- 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.
Instances for omega.int.preterm
- omega.int.preterm.has_sizeof_inst
- omega.int.preterm.has_reflect
- omega.int.preterm.inhabited
@[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 = linear_order.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]