leanprover-community / leanprover-community/lean
primed tactics from mathlib
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 433
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
Here's a list of "primed" tactics in mathlib which fix bugs or add features to tactics in the core library. I'm not sure which of these should replace their counterparts, if someone else can review this that'd be great. (Feel free to edit this list directly!)
I can try to tackle the ones from tactic.core and tactic.interactive which don't require modifying C++.
Primed tactics in mathlib's tactic.core:
-
/of_tactic'has_coe'replacesof_tacticandhas_coeininit.lean.parser.of_tacticis implemented in C++ here.of_tactic'was removed in the 3.7.1c update since it was no longer necessary after the fix in #147. -
eval_expr'replaceseval_exprininit.meta.tactic; C++ implementation here. -
has_attribute'returns aboolwhereashas_attributeininit.meta.tacticreturns anat; C++ implementation here. -
simp_bottom_up'"a variant" ofsimplify_bottom_up. -
triv': "Unliketriv, it only unfolds reducible definitions, so it sometimes fails faster."
- [ ] iterate', compare iterate in init.meta.tactic.
- [ ] target' is a wrapper around target (C++ implementation here) that instantiates mvars and calls whnf.
-
resolve_name'wrapsresolve_name(C++ implementation here) so that it succeeds on a list of empty goals.
Primed tactics in mathlib's tactic.interactive:
-
congr'behaves likecongrbut takes an optional argument specifying the depth of recursive applications. -
guard_hyp'fixesguard_hypby instantiating meta variables.
- [ ] guard_expr_eq' uses is_def_eq, whereas guard_expr_eq uses alpha_eqv.
- [ ] guard_target' uses guard_expr_eq', whereas guard_target uses guard_expr_eq.
-
change'"mimics the behavior ofchange, except in the case ofchange x with y at l. In this case, it will correctly replace occurences ofxwithyat all possible hypotheses inl. As long asxandyare defeq, it should never fail."
Other primed tactics in mathlib:
-
apply'/symmetry'/reflexivity'/transitivity'/ ... fixes the "apply bug" inapplyand related tactics (also ininit.meta.interactive). See alsoapply_fun. -
clear'works likeclear(C++ implementation here) except that the hypotheses can be cleared in any order. See alsoclear_dependentin the same file.
Any others?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the primed implementations in mathlib's src/tactic/core.lean, src/tactic/interactive.lean, src/tactic/apply.lean, and src/tactic/clear.lean with their counterparts under Lean's library/init/meta files and the linked C++ implementations. Done requires an agreed, reviewed scope for which tactics should replace their core counterparts, including any required changes to the core implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100