lean4-htt/src/Lean/Meta
Leonardo de Moura 206eb73cd9
feat: finish? tactic for grind interactive mode (#10837)
This PR implements the `finish?` tactic for the `grind` interactive
mode. When it successfully closes the goal, it produces a code action
that allows the user to close the goal using explicit grind tactic
steps, i.e., without any search. It also makes explicit which solvers
have been used.

This is just the first version, we will add many "bells and whistles"
later. For example, `instantiate` steps will clearly show which theorems
have been instantiated.

Example:

```lean
/--
info: Try this:
  [apply] ⏎
    cases #b0f4
    next => cases #50fc
    next => cases #50fc <;> lia
-/
#guard_msgs in
example (p : Nat → Prop) (x y z w : Int) :
    (x = 1 ∨ x = 2) →
    (w = 1 ∨ w = 4) →
    (y = 1 ∨ (∃ x : Nat, y = 3 - x ∧ p x)) →
    (z = 1 ∨ z = 0) → x + y ≤ 6 := by
  grind => finish?
```

The anchors in the generated script are based on stable hash codes.
Moreover, users can hover over them to see the exact term used in the
case split. `grind?` will also be implemented using the new framework.
2025-10-19 03:52:32 +00:00
..
ArgsPacker refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Constructions chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Match fix: more pedantic checking of inaccessible patterns (#10796) 2025-10-17 17:02:54 +00:00
Tactic feat: finish? tactic for grind interactive mode (#10837) 2025-10-19 03:52:32 +00:00
AbstractMVars.lean fix: instantiate mvars in types of mvars in abstractMVars (#10612) 2025-09-29 16:33:10 +00:00
AbstractNestedProofs.lean chore: more module system fixes and improvements from Mathlib porting (#10655) 2025-10-08 11:30:09 +00:00
ACLt.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
AppBuilder.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ArgsPacker.lean feat: Add List.zipWithM and Array.zipWithM (#9528) 2025-07-28 08:39:52 +00:00
Basic.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
BinderNameHint.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Canonicalizer.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Check.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
CheckTactic.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Closure.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Coe.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
CoeAttr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
CollectFVars.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
CollectMVars.lean feat: split out Expr.getMVarDependencies from MVarId.getMVarDependencies (#9785) 2025-08-08 00:28:30 +00:00
CompletionName.lean refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
CongrTheorems.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Constructions.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
CtorRecognizer.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
DecLevel.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Diagnostics.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
DiscrTree.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
DiscrTreeTypes.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Eqns.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Eval.lean fix: #guard should work with the module system (#10535) 2025-09-24 07:38:10 +00:00
ExprDefEq.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ExprLens.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ExprTraverse.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ForEachExpr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
FunInfo.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
GeneralizeTelescope.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
GeneralizeVars.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
GetUnfoldableConst.lean feat: list definitions in defeq problems that could not be unfolded for lack of @[expose] (#10158) 2025-09-23 16:13:39 +00:00
GlobalInstances.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Hint.lean refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
IndPredBelow.lean fix: complete overhaul of structural recursion on inductives predicates (#9995) 2025-09-01 08:17:58 +00:00
Inductive.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
InferType.lean chore: miscellaneous documentation typos (#10009) 2025-08-20 21:39:03 +00:00
Injective.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Instances.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
IntInstTesters.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Iterator.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
KAbstract.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
KExprMap.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
LazyDiscrTree.lean fix: check that compiler does not infer inconsistent types between modules (#10418) 2025-09-19 12:36:47 +00:00
LetToHave.lean chore: fix spelling errors (#10042) 2025-08-22 07:23:12 +00:00
LevelDefEq.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
LitValues.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Match.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
MatchUtil.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
MethodSpecs.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
MkIffOfInductiveProp.lean feat: add coinductive command to specify coinductive predicates (#10333) 2025-10-07 18:04:51 +00:00
NatInstTesters.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
NatTable.lean chore: fix spelling errors (#10042) 2025-08-22 07:23:12 +00:00
Offset.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Order.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
PPGoal.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
PProdN.lean fix: complete overhaul of structural recursion on inductives predicates (#9995) 2025-09-01 08:17:58 +00:00
RecursorInfo.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Reduce.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ReduceEval.lean feat: upstream ReduceEval instances from quote4 (#10563) 2025-09-26 04:02:55 +00:00
SameCtorUtils.lean refactor: introduce SameCtorUtils (#10316) 2025-09-10 14:32:58 +00:00
SizeOf.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Sorry.lean feat: pretty print sorry in "declaration uses 'sorry'" (#10034) 2025-09-08 12:14:42 +00:00
Structure.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
SynthInstance.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Tactic.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Transform.lean fix: unfold more auxillary theorems in termination checking (#10733) 2025-10-10 11:09:28 +00:00
TransparencyMode.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
TryThis.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
UnificationHint.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
WHNF.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00