- 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 type
int` 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.add t2) = omega.int.preterm.val v t1 + omega.int.preterm.val v t2
- omega.int.preterm.val v (omega.int.preterm.var i n) = ite (i = 1) (v n) (ite (i = -1) (-v n) (v n * i))
- omega.int.preterm.val v (omega.int.preterm.cst i) = i
Fresh de Brujin index not used by any variable in argument
Equations
- (t1.add t2).fresh_index = max t1.fresh_index t2.fresh_index
- (omega.int.preterm.var i n).fresh_index = n + 1
- (omega.int.preterm.cst _x).fresh_index = 0
@[simp]
Equations
- t.add_one = t.add (omega.int.preterm.cst 1)
@[simp]
Return a term (which is in canonical form by definition) that is equivalent to the input preterm
Equations
- omega.int.canonize (t1.add t2) = (omega.int.canonize t1).add (omega.int.canonize t2)
- omega.int.canonize (omega.int.preterm.var i n) = (0, list.func.set i list.nil n)
- omega.int.canonize (omega.int.preterm.cst i) = (i, list.nil ℤ)
@[simp]