lean4-htt/tests/elab/grind_const_pattern.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

82 lines
1.3 KiB
Text

module
reset_grind_attrs%
attribute [grind] List.map_append
def a := 10
example : a = 5 + 5 := by
grind [a]
/--
error: `grind` failed
case grind
h : ¬a = 10
⊢ False
[grind] Goal diagnostics
[facts] Asserted facts
[prop] ¬a = 10
[eqc] False propositions
[prop] a = 10
[cutsat] Assignment satisfying linear constraints
[assign] a := 1
-/
#guard_msgs (error) in
example : a = 5 + 5 := by
grind
section
attribute [local grind] a
example : a = 5 + 5 := by
grind
end
def f (x : Nat) := x + 1
theorem fa : f a = 11 := rfl
example : f a = 10 + 1 := by
grind [fa]
/--
error: `grind` failed
case grind
h : ¬f a = 11
⊢ False
[grind] Goal diagnostics
[facts] Asserted facts
[prop] ¬f a = 11
[eqc] False propositions
[prop] f a = 11
[cutsat] Assignment satisfying linear constraints
[assign] a := 2
[assign] f a := 1
-/
#guard_msgs (error) in
example : f a = 10 + 1 := by
grind
attribute [grind] fa
example : f a = 10 + 1 := by
grind
/--
error: `grind` failed
case grind
x : Nat
h : ¬f x = 11
⊢ False
[grind] Goal diagnostics
[facts] Asserted facts
[prop] ¬f x = 11
[eqc] False propositions
[prop] f x = 11
[cutsat] Assignment satisfying linear constraints
[assign] x := 1
[assign] f x := 2
-/
#guard_msgs (error) in
example : f x = 10 + 1 := by
grind