lean4-htt/tests/lean/run/grind_cutsat_div_mod.lean
Leonardo de Moura 798da80459
fix: grind push new fact (#7532)
This PR fixes the procedure for putting new facts into the `grind`
"to-do" list. It ensures the new facts are preprocessed. This PR also
removes some of the clutter in the `Nat.sub` support.
2025-03-17 19:14:08 +00:00

31 lines
781 B
Text

set_option grind.warning false
example (x y : Int) : x / 2 + y = 3 → x = 5 → y = 1 := by
grind
example (x y : Int) : x / -2 + y = 3 → x = 5 → y = 5 := by
grind
example (x y : Int) : x % -2 + y = 3 → x = 5 → y = 2 := by
grind
example (x y : Int) : x % 2 + y = 3 → x = 5 → y = 2 := by
grind
/--
info: [grind.cutsat.model] x := 5
[grind.cutsat.model] y := 2
[grind.cutsat.model] 「x / 2」 := 2
[grind.cutsat.model] 「x % 2」 := 1
-/
#guard_msgs (info) in
set_option trace.grind.cutsat.model true in
example (x y : Int) : x % 2 + y = 3 → x ≤ 5 → x > 4 → y = 1 := by
fail_if_success grind
sorry
example (x y : Int) : x = y / 2 → y % 2 = 0 → y - 2*x = 0 := by
grind
example (x : Int) : x ≥ 0 → (x + 4) / 2 ≤ x + 2 := by
grind