File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/Lean/Meta/Tactic/Grind/Arith/Cutsat Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,25 @@ private def getAssignmentExt? (e : Expr) : GoalM (Option Rat) := do
4646private def hasTheoryVar (e : Expr) : GoalM Bool := do
4747 cutsatExt.hasTermAtRoot e
4848
49+ /-
50+ **Note** : cutsat is a procedure for linear integer arithmetic. Thus, morally a
51+ nonlinear multiplication, division, and modulo are **not** interpreted by cutsat.
52+ Thus, we enable model-theory combination for them. This is necessary for examples
53+ such as:
54+ ```
55+ example {a b : Nat} (ha : 1 ≤ a) : (a - 1 + 1) * b = a * b := by grind
56+ ```
57+ Note that we currently use a restrictive/cheaper version of mbtc. We only case-split
58+ on `a = b`, if they have the same assignment **and** occur as the `i`-th argument of
59+ the same function symbol. The latter reduces the number of case-splits we have to
60+ perform, but misses the following variant of the problem above.
61+ ```
62+ example {a b : Nat} (ha : 1 ≤ a) : (a - 1 + 1) * b = b * a := by grind
63+ ```
64+ If this becomes an issue in practice, we can add a flag for enabling the more
65+ expensive version of `mbtc`.
66+ -/
67+
4968private def isNonlinearTerm (e : Expr) : GoalM Bool :=
5069 match_expr e with
5170 | HMul.hMul _ _ _ _ a b => return (← getIntValue? a <|> getIntValue? b).isNone
You can’t perform that action at this time.
0 commit comments