- cst : ℤ → omega.int.exprterm
- exp : ℤ → expr → omega.int.exprterm
- add : omega.int.exprterm → omega.int.exprterm → omega.int.exprterm
The shadow syntax for arithmetic terms. All constants are reified to cst
(e.g., -5 is reified to cst -5) and all other atomic terms are reified to
exp (e.g., -5 * (gcd 14 -7) is reified to exp -5 \(gcd 14 -7)).
expaccepts a coefficient of typeint` as its first argument because
multiplication by constant is allowed by the omega test.
- cst : ℤ → omega.int.preterm
- var : ℤ → ℕ → omega.int.preterm
- add : omega.int.preterm → omega.int.preterm → omega.int.preterm
Similar to exprterm, except that all exprs are now replaced with
de Brujin indices of type nat. This is akin to generalizing over
the terms represented by the said exprs.
@[simp]
Preterm evaluation
Equations
- omega.int.preterm.val v (t1+*t2) = omega.int.preterm.val v t1 + omega.int.preterm.val v t2
- omega.int.preterm.val v (i ** n) = ite (i = 1) (v n) (ite (i = -1) (-v n) ((v n) * i))
- omega.int.preterm.val v (&i) = i
Fresh de Brujin index not used by any variable in argument
Equations
- (t1+*t2).fresh_index = max t1.fresh_index t2.fresh_index
- (i ** n).fresh_index = n + 1
- (&_x).fresh_index = 0
@[simp]
@[simp]
Return a term (which is in canonical form by definition) that is equivalent to the input preterm
Equations
- omega.int.canonize (t1+*t2) = (omega.int.canonize t1).add (omega.int.canonize t2)
- omega.int.canonize (i ** n) = (0, list.nil {n ↦ i})
- omega.int.canonize (&i) = (i, list.nil ℤ)
@[simp]