lean4-htt/src/Lean
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
..
Compiler refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
Data refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
DocString refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
Elab feat: finish? tactic for grind interactive mode (#10837) 2025-10-19 03:52:32 +00:00
ErrorExplanations feat: overhaul meta system (#10362) 2025-09-17 21:04:29 +00:00
Language chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Linter chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Meta feat: finish? tactic for grind interactive mode (#10837) 2025-10-19 03:52:32 +00:00
Parser refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
ParserCompiler chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
PremiseSelection chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
PrettyPrinter refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
Server refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
Util chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Widget chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
AddDecl.lean refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
Attributes.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
AuxRecursor.lean
BuiltinDocAttr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Class.lean
Compiler.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
CoreM.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Data.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Declaration.lean
DeclarationRange.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
DefEqAttrib.lean
DocString.lean
Elab.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
EnvExtension.lean feat: shake import minimizer aware of the module system and arbitrary elaboration dependencies (#10575) 2025-09-28 16:00:00 +00:00
Environment.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ErrorExplanation.lean refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
ErrorExplanations.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Exception.lean feat: hint about inaccessible private declaration on dot notation failure (#10803) 2025-10-17 09:31:56 +00:00
Expr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ExtraModUses.lean feat: shake import minimizer aware of the module system and arbitrary elaboration dependencies (#10575) 2025-09-28 16:00:00 +00:00
HeadIndex.lean
Hygiene.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ImportingFlag.lean chore: miscellaneous documentation typos (#10009) 2025-08-20 21:39:03 +00:00
InternalExceptionId.lean chore: reorganize Init imports around strings (#10289) 2025-09-07 17:09:14 +00:00
KeyedDeclsAttribute.lean fix: some ExtraModUses (#10620) 2025-10-03 15:50:40 +00:00
LabelAttribute.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Level.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Linter.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
LoadDynlib.lean fix: do not allow access to private primitives in public scope (#9890) 2025-08-14 15:34:54 +00:00
LocalContext.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Log.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Message.lean refactor: rename String.split to String.splitToList (#10822) 2025-10-18 12:12:54 +00:00
Meta.lean feat: @[method_specs] to generate specification theorems from class instances (#10302) 2025-09-15 11:17:06 +00:00
MetavarContext.lean fix: remove superfluous Monad instances from some spec lemmas (#10564) (#10618) 2025-09-29 15:02:43 +00:00
Modifiers.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
MonadEnv.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Namespace.lean
Parser.lean feat: hexnum parser (#10716) 2025-10-08 21:12:03 +00:00
ParserCompiler.lean chore: even more module system fixes and refinements from Mathlib porting (#10726) 2025-10-15 14:59:09 +00:00
PremiseSelection.lean feat: basic premise selection algorithm based on MePo (#7844) 2025-09-23 06:40:22 +00:00
PrettyPrinter.lean
PrivateName.lean
ProjFns.lean
ReducibilityAttrs.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Replay.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ReservedNameAction.lean
ResolveName.lean feat: backward.privateInPublic option (#10807) 2025-10-16 20:51:45 +00:00
Runtime.lean
ScopedEnvExtension.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Server.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Setup.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Shell.lean refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
Structure.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
SubExpr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Syntax.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ToExpr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ToLevel.lean
Util.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Widget.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00