lean4-htt/tests/lean/run/grind_9427.lean
Leonardo de Moura 6a0b0c8273
fix: grind lia distracted by nonlinearity (#11678)
This PR fixes a bug in `registerNonlinearOccsAt` used to implement
`grind lia`. This issue was originally reported at:
https://leanprover.zulipchat.com/#narrow/channel/113489-new-members/topic/Weirdness.20with.20cutsat/near/562099515

Example that was failing:
```lean
example {a : Nat} (ha : 1 ≤ a) (H : a ^ 2 = 2 ^ a)
    : a = 1 ∨ a = 2 ∨ 3 ≤ a := by
  grind
```
2025-12-14 23:18:12 +00:00

39 lines
980 B
Text

module
example {n} (x y : BitVec n) : x * y = y * x := by
grind
example {n} (x y z w : BitVec n) : w = z → x * y - z*w = 0 → z*z = y * x := by
grind
example (x y : BitVec 64) : x * y = y * x := by
grind
example (x y : BitVec 128) : x * y = y * x := by
grind
example (x y : BitVec 128) : x * y = y * x + 2^64 * 2^64 * x := by
grind
example (x y : BitVec 256) : x * y = y * x := by
grind
example (x y : BitVec 1024) : x * y = y * x := by
grind
example (x y : BitVec 1024) : x * y = y * x := by
grind -lia
example (x y : BitVec 100000) : x * y = y * x := by
grind -lia
example (x y z : BitVec 100000) : x * y - z*z = 0 → z*z = y * x := by
grind -lia
/--
trace: [grind.issues] exponent 1024 exceeds threshold for exponentiation `(exp := 16)`
[grind.issues] exponent 1024 exceeds threshold for exponentiation `(exp := 16)`
-/
#guard_msgs in
set_option trace.grind.issues true in
example (x y : BitVec 1024) : x * y = y * x := by
grind (exp := 16)