equal
deleted
inserted
replaced
7 |
7 |
8 signature NUMERAL = |
8 signature NUMERAL = |
9 sig |
9 sig |
10 val mk_cnumeral: int -> cterm |
10 val mk_cnumeral: int -> cterm |
11 val mk_cnumber: ctyp -> int -> cterm |
11 val mk_cnumber: ctyp -> int -> cterm |
|
12 val add_code: string -> bool -> bool -> string -> theory -> theory |
12 end; |
13 end; |
13 |
14 |
14 structure Numeral: NUMERAL = |
15 structure Numeral: NUMERAL = |
15 struct |
16 struct |
16 |
17 |
49 | mk_cnumber T 1 = instT T oneT one |
50 | mk_cnumber T 1 = instT T oneT one |
50 | mk_cnumber T i = Thm.capply (instT T numberT number_of) (mk_cnumeral i); |
51 | mk_cnumber T i = Thm.capply (instT T numberT number_of) (mk_cnumeral i); |
51 |
52 |
52 end; |
53 end; |
53 |
54 |
|
55 |
|
56 (* code generator *) |
|
57 |
|
58 fun add_code number_of negative unbounded target = |
|
59 CodeTarget.add_pretty_numeral target unbounded negative number_of |
|
60 @{const_name Int.B0} @{const_name Int.B1} |
|
61 @{const_name Int.Pls} @{const_name Int.Min} |
|
62 @{const_name Int.Bit}; |
|
63 |
54 end; |
64 end; |