lean4-htt/tests/lean/run/grind_split_issue.lean
Leonardo de Moura 06d6dbff5d
feat: model-based theory combination in grind (#7641)
This PR implements basic model-based theory combination in `grind`.
`grind` can now solve examples such as
```lean
example (f : Int → Int) (x : Int)
    : 0 ≤ x → x ≠ 0 → x ≤ 1 → f x = 2 → f 1 = 2 := by
  grind
```
2025-03-23 04:06:09 +00:00

37 lines
800 B
Text

set_option grind.warning false
variable (d : Nat) in
inductive X : Nat → Prop
| f {s : Nat} : X s
| g {s : Nat} : X d → X s
/--
error: `grind` failed
case grind.1
c : Nat
q : X c 0
s : Nat
h : 0 = s
h_1 : HEq ⋯ ⋯
⊢ False
[grind] Goal diagnostics
[facts] Asserted facts
[prop] X c 0
[prop] 0 = s
[prop] HEq ⋯ ⋯
[eqc] True propositions
[prop] X c 0
[prop] X c s
[eqc] Equivalence classes
[eqc] {s, 0}
[cases] Case analyses
[cases] [1/2]: X c 0
[grind] Issues
[issue] #1 other goal(s) were not fully processed due to previous failures, threshold: `(failures := 1)`
-/
#guard_msgs (error) in
example {c : Nat} (q : X c 0) : False := by
grind -mbtc [cases X]
example {c : Nat} (q : X c 0) : False := by
fail_if_success grind [cases X]
sorry