Skip to content

Commit

Permalink
feat: omega supports Nat.succ (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em authored Dec 21, 2023
1 parent 5bf9172 commit 7a51fa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Std/Tactic/Omega/Frontend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ partial def asLinearComboImpl (e : Expr) : OmegaM (LinearCombo × OmegaM Expr ×
mkAtomLinearCombo e
| _ => mkAtomLinearCombo e
| (``Nat.cast, #[_, _, n]) => match n.getAppFnArgs with
| (``Nat.succ, #[n]) => rewrite e (.app (.const ``Int.ofNat_succ []) n)
| (``HAdd.hAdd, #[_, _, _, _, a, b]) => rewrite e (mkApp2 (.const ``Int.ofNat_add []) a b)
| (``HMul.hMul, #[_, _, _, _, a, b]) => rewrite e (mkApp2 (.const ``Int.ofNat_mul []) a b)
| (``HDiv.hDiv, #[_, _, _, _, a, b]) => rewrite e (mkApp2 (.const ``Int.ofNat_ediv []) a b)
Expand Down
2 changes: 2 additions & 0 deletions test/omega/test.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ example {x : Int} : x / 0 = 0 := by omega

example {x : Int} : x / 2 + x / (-2) = 0 := by omega

example {x y z : Nat} (_ : a ≤ c) (_ : b ≤ c) : a < Nat.succ c := by omega

example (_ : 7 < 3) : False := by omega
example (_ : 0 < 0) : False := by omega

Expand Down

0 comments on commit 7a51fa8

Please sign in to comment.