You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some constants in Lean are defined by attributes such as @[to_addictive] (see Mathematics in Lean) or @[reassoc]. For example, hom_inv_id_assoc in mathlib is defined as a result of this line. Such definitions are difficult to locate because their names cannot be anticipated.
Therefore, you shouldn't rely on names to locate the definition of a premise. Instead, you should use its path and position. For example, below is how we locate premises in ReProver:
"""Return a premise at position ``pos`` in file ``path``.
Return None if no such premise can be found.
"""
forpinself.get_premises(path):
assertp.path==path
ifp.start<=pos<=p.end:
returnp
returnNone
Even with this technique, there is still a small percentage (~%1) of premises whose definitions cannot be located. That's why you may see Cannot locate premise ... in the log when training the retriever.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Some constants in Lean are defined by attributes such as
@[to_addictive]
(see Mathematics in Lean) or@[reassoc]
. For example,hom_inv_id_assoc
in mathlib is defined as a result of this line. Such definitions are difficult to locate because their names cannot be anticipated.Therefore, you shouldn't rely on names to locate the definition of a premise. Instead, you should use its path and position. For example, below is how we locate premises in ReProver:
ReProver/common.py
Lines 253 to 262 in b89e258
Even with this technique, there is still a small percentage (~%1) of premises whose definitions cannot be located. That's why you may see
Cannot locate premise ...
in the log when training the retriever.Related issues: #44
Beta Was this translation helpful? Give feedback.
All reactions