11 fun i_of_term vs t = |
11 fun i_of_term vs t = |
12 case t of |
12 case t of |
13 Free(xn,xT) => (case AList.lookup (op =) vs t of |
13 Free(xn,xT) => (case AList.lookup (op =) vs t of |
14 NONE => error "Variable not found in the list!!" |
14 NONE => error "Variable not found in the list!!" |
15 | SOME n => Var n) |
15 | SOME n => Var n) |
16 | Const("0",iT) => Cst 0 |
16 | Const("HOL.zero",iT) => Cst 0 |
17 | Const("1",iT) => Cst 1 |
17 | Const("HOL.one",iT) => Cst 1 |
18 | Bound i => Var (nat (IntInf.fromInt i)) |
18 | Bound i => Var (nat (IntInf.fromInt i)) |
19 | Const("HOL.uminus",_)$t' => Neg (i_of_term vs t') |
19 | Const("HOL.uminus",_)$t' => Neg (i_of_term vs t') |
20 | Const ("HOL.plus",_)$t1$t2 => Add (i_of_term vs t1,i_of_term vs t2) |
20 | Const ("HOL.plus",_)$t1$t2 => Add (i_of_term vs t1,i_of_term vs t2) |
21 | Const ("HOL.minus",_)$t1$t2 => Sub (i_of_term vs t1,i_of_term vs t2) |
21 | Const ("HOL.minus",_)$t1$t2 => Sub (i_of_term vs t1,i_of_term vs t2) |
22 | Const ("HOL.times",_)$t1$t2 => Mult (i_of_term vs t1,i_of_term vs t2) |
22 | Const ("HOL.times",_)$t1$t2 => Mult (i_of_term vs t1,i_of_term vs t2) |