File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
src/Lean/Meta/Tactic/Grind/Arith/Cutsat Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ def processNewDiseqImpl (a b : Expr) : GoalM Unit := do
290290
291291/-- Different kinds of terms internalized by this module. -/
292292private inductive SupportedTermKind where
293- | add | mul | num | div | mod | sub | pow | natAbs | toNat
293+ | add | mul | num | div | mod | sub | pow | natAbs | toNat | natCast
294294 deriving BEq
295295
296296private def getKindAndType? (e : Expr) : Option (SupportedTermKind × Expr) :=
@@ -307,6 +307,7 @@ private def getKindAndType? (e : Expr) : Option (SupportedTermKind × Expr) :=
307307 some (.num, α)
308308 | Int.natAbs _ => some (.natAbs, Nat.mkType)
309309 | Int.toNat _ => some (.toNat, Nat.mkType)
310+ | NatCast.natCast α _ _ => some (.natCast, α)
310311 | _ => none
311312
312313private def isForbiddenParent (parent? : Option Expr) (k : SupportedTermKind) : Bool := Id.run do
@@ -315,7 +316,7 @@ private def isForbiddenParent (parent? : Option Expr) (k : SupportedTermKind) :
315316 -- TODO: document `NatCast.natCast` case.
316317 -- Remark: we added it to prevent natCast_sub from being expanded twice.
317318 if declName == ``NatCast.natCast then return true
318- if k matches .div | .mod | .sub | .pow | .natAbs | .toNat then return false
319+ if k matches .div | .mod | .sub | .pow | .natAbs | .toNat | .natCast then return false
319320 if declName == ``HAdd.hAdd || declName == ``LE.le || declName == ``Dvd.dvd then return true
320321 match k with
321322 | .add => return false
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ example (a b : Int) : a + b = Int.ofNat 2 → a - 2 = -b := by
2727 grind
2828
2929/--
30- trace: [ grind.cutsat.assert ] -1*「↑a * ↑b」 ≤ 0
30+ trace: [ grind.cutsat.assert ] -1*↑a ≤ 0
31+ [ grind.cutsat.assert ] -1*↑b ≤ 0
32+ [ grind.cutsat.assert ] -1*「↑a * ↑b」 ≤ 0
3133[ grind.cutsat.assert ] -1*↑c ≤ 0
3234[ grind.cutsat.assert ] -1*↑c + 「↑a * ↑b」 + 1 ≤ 0
3335[ grind.cutsat.assert ] -1*↑0 = 0
Original file line number Diff line number Diff line change 1+ example (n : Int) (n0 : ¬0 ≤ n) (a : Nat) : n ≠ (a : Int) := by
2+ grind
You can’t perform that action at this time.
0 commit comments