- 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]