Skip to content

Commit 3536de5

Browse files
committed
doc:
1 parent 5c42acd commit 3536de5

File tree

1 file changed

+19
-0
lines changed
  • src/Lean/Meta/Tactic/Grind/Arith/Cutsat

1 file changed

+19
-0
lines changed

src/Lean/Meta/Tactic/Grind/Arith/Cutsat/MBTC.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,25 @@ private def getAssignmentExt? (e : Expr) : GoalM (Option Rat) := do
4646
private 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+
4968
private def isNonlinearTerm (e : Expr) : GoalM Bool :=
5069
match_expr e with
5170
| HMul.hMul _ _ _ _ a b => return (← getIntValue? a <|> getIntValue? b).isNone

0 commit comments

Comments
 (0)