21147
|
1 |
structure ROOT =
|
|
2 |
struct
|
|
3 |
|
|
4 |
structure HOL =
|
|
5 |
struct
|
|
6 |
|
|
7 |
datatype boola = True | False;
|
|
8 |
|
|
9 |
fun nota False = True
|
|
10 |
| nota True = False;
|
|
11 |
|
|
12 |
fun op_conj y True = y
|
|
13 |
| op_conj x False = False
|
21172
|
14 |
| op_conj True y = y
|
|
15 |
| op_conj False x = False;
|
21147
|
16 |
|
|
17 |
end; (*struct HOL*)
|
|
18 |
|
21189
|
19 |
structure Nat =
|
21147
|
20 |
struct
|
|
21 |
|
21189
|
22 |
datatype nat = Zero_nat | Suc of nat;
|
21147
|
23 |
|
21189
|
24 |
fun less_nat Zero_nat (Suc n) = HOL.True
|
21172
|
25 |
| less_nat n Zero_nat = HOL.False
|
21189
|
26 |
| less_nat (Suc m) (Suc n) = less_nat m n;
|
21147
|
27 |
|
|
28 |
fun less_eq_nat m n = HOL.nota (less_nat n m);
|
|
29 |
|
21189
|
30 |
end; (*struct Nat*)
|
21147
|
31 |
|
|
32 |
structure Codegen =
|
|
33 |
struct
|
|
34 |
|
|
35 |
fun in_interval (k, l) n =
|
21189
|
36 |
HOL.op_conj (Nat.less_eq_nat k n) (Nat.less_eq_nat n l);
|
21147
|
37 |
|
|
38 |
end; (*struct Codegen*)
|
|
39 |
|
|
40 |
end; (*struct ROOT*)
|