lean4-htt/tests
Leonardo de Moura 681724a8cf
feat: generate instantiate only [...] at finish? (#10841)
This PR improves the `grind` tactic generated by the `instantiate`
action in tracing mode. It also updates the syntax for the `instantiate`
tactic, making it similar to `simp`. For example:

* `instantiate only [thm1, thm2]` instantiates only theorems `thm1` and
`thm2`.
* `instantiate [thm1, thm2]` instantiates theorems marked with the
`@[grind]` attribute **and** theorems `thm1` and `thm2`.

The action produces `instantiate only [...]` tactics. Example:

```lean
/--
info: Try this:
  [apply] ⏎
    instantiate only [= Array.getElem_set]
    instantiate only [= Array.getElem_set]
-/
#guard_msgs in
example (as bs cs : Array α) (v₁ v₂ : α)
        (i₁ i₂ j : Nat)
        (h₁ : i₁ < as.size)
        (h₂ : bs = as.set i₁ v₁)
        (h₃ : i₂ < bs.size)
        (h₄ : cs = bs.set i₂ v₂)
        (h₅ : i₁ ≠ j ∧ i₂ ≠ j)
        (h₆ : j < cs.size)
        (h₇ : j < as.size) :
    cs[j] = as[j] := by
  grind => finish?
```

Recall that `finish?` replays generated tactics before suggesting them.

The `instantiate` action inspects the generated proof term to decide
which theorems to include as parameters in the `instantiate only [...]`
tactic. However, in some cases, a theorem contributes only by adding a
term to the state. In such cases, the generated tactic cannot be fully
replayed, and the action uses
`instantiate approx [<thms instantiated>]` to indicate which parts of
the tactic script are approximate. The `approx` is just a hint for
users.
2025-10-19 23:35:27 +00:00
..
bench refactor: use Shrink stub in the iterator framework (#10725) 2025-10-14 10:22:14 +00:00
compiler refactor: discipline around arithmetic of String.Pos.Raw (#10713) 2025-10-09 07:47:45 +00:00
elabissues
ir
lake fix: lake: local cache w/ --old (#10741) 2025-10-11 02:20:31 +00:00
lean feat: generate instantiate only [...] at finish? (#10841) 2025-10-19 23:35:27 +00:00
pkg feat: hint about inaccessible private declaration on dot notation failure (#10803) 2025-10-17 09:31:56 +00:00
playground
plugin
simpperf
.gitignore
common.sh
lakefile.toml fix: detect private references in inferred type of public def (#10762) 2025-10-15 12:51:54 +00:00
lean-toolchain