lean4-htt/tests/elab/grind_mvar.lean
Leonardo de Moura db491ddd35
refactor: move issue tracker from grind to SymM (#13125)
This PR moves the issue tracking infrastructure from `GrindM` to `SymM`.
Issues can occur in different places within a `sym =>` block (e.g.,
during
arithmetic normalization, simplification), not just during `grind`
invocations. Moving them to `SymM` makes them available to all modules
operating within the symbolic computation framework.

- `Sym.reportIssue`: adds an issue to the `SymM` state
- `Sym.getIssues`: retrieves accumulated issues
- `Sym.withNewIssueContext`: saves/restores the issue list around a
  computation, used at grind entry points to isolate per-invocation
  issues while preserving them in the outer context
- `GrindM.State.issues` removed; `Grind.reportIssue` delegates to
`Sym.reportIssue`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:27:27 +00:00

11 lines
441 B
Text

module
open List
reset_grind_attrs%
attribute [grind →] Array.eq_empty_of_append_eq_empty eq_nil_of_length_eq_zero
attribute [grind] Vector.getElem?_append getElem?_dropLast
#guard_msgs (trace) in -- should not report any issues
set_option trace.sym.issues true
theorem dropLast_concat : dropLast (l₁ ++ [b]) = l₁ := by
fail_if_success grind
grind -ext only [List.dropLast_append_cons, List.dropLast_singleton, List.append_nil]