lean4-htt/tests/lean/run/grind_order_3.lean
Leonardo de Moura 3ce5097c3c
feat: process grind core equalities in grind order (#10604)
This PR implements the method `processNewEq` in `grind order`. It is
responsible for processing equalities propagated by the `grind` E-graph.
2025-09-28 04:19:35 +00:00

58 lines
2.2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open Lean Grind
example [LE α] [LT α] [Std.LawfulOrderLT α] [Std.IsLinearPreorder α]
(a b c d : α) : a ≤ b → ¬ (c ≤ b) → ¬ (d ≤ c) → d < a → False := by
grind -linarith (splits := 0)
example [LE α] [Std.IsLinearPreorder α]
(a b c d : α) : a ≤ b → ¬ (c ≤ b) → ¬ (d ≤ c) → ¬ (a ≤ d) → False := by
grind -linarith (splits := 0)
example [LE α] [LT α] [Std.LawfulOrderLT α] [Std.IsLinearPreorder α] [CommRing α] [OrderedRing α]
(a b c d : α) : a - b ≤ 5 → ¬ (c ≤ b) → ¬ (d ≤ c + 2) → d ≤ a - 8 → False := by
grind -linarith (splits := 0)
example [LE α] [LT α] [Std.LawfulOrderLT α] [Std.IsLinearPreorder α] [CommRing α] [OrderedRing α]
(a b c d : α) : a - b ≤ 5 → ¬ (c < b) → ¬ (d ≤ c + 2) → d ≤ a - 8 → False := by
grind -linarith (splits := 0)
example (p : Prop) (a b c : Int) : (p ↔ b ≤ a) → (p ↔ c ≤ b) → ¬ p → c ≤ a + 1 → False := by
grind -linarith -cutsat (splits := 0)
/--
error: `grind` failed
case grind
α : Type u_1
inst : LE α
inst_1 : Std.IsPreorder α
a b c : α
h : a ≤ b
h_1 : b ≤ c
h_2 : c ≤ a
h_3 : ¬a = c
⊢ False
-/
#guard_msgs in
example [LE α] [Std.IsPreorder α]
(a b c : α) : a ≤ b → b ≤ c → c ≤ a → a = c := by
grind -linarith -verbose
example [LE α] [Std.IsPartialOrder α]
(a b c : α) : a ≤ b → b ≤ c → c ≤ a → a = c := by
grind -linarith -verbose
example [LE α] [Std.IsLinearPreorder α]
(a b c d e : α) : a ≤ b → b = c → d = c → d ≤ e → a ≤ e := by
grind -linarith (splits := 0)
example [LE α] [Std.IsLinearPreorder α]
(a b c d e : α) : a ≥ b → d = c → c = b → d ≥ e → a ≥ e := by
grind -linarith (splits := 0)
example [LE α] [LT α] [Std.LawfulOrderLT α] [Std.IsPreorder α] [CommRing α] [OrderedRing α]
(a b c d e : α) : a ≥ b → d = c → c = b → d ≥ e → a ≥ e := by
grind -linarith (splits := 0)
example [LE α] [LT α] [Std.LawfulOrderLT α] [Std.IsPreorder α] [CommRing α] [OrderedRing α]
(a b c d e : α) : a + 2 ≥ b → d = c → c = b → d + 1 ≥ e → a + 3 ≥ e := by
grind -linarith (splits := 0)