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
|
|
14 |
| op_conj True ya = ya
|
|
15 |
| op_conj False xa = False;
|
|
16 |
|
|
17 |
end; (*struct HOL*)
|
|
18 |
|
|
19 |
structure IntDef =
|
|
20 |
struct
|
|
21 |
|
|
22 |
datatype nat = Zero_nat | Succ_nat of nat;
|
|
23 |
|
|
24 |
fun less_nat Zero_nat (Succ_nat n) = HOL.True
|
|
25 |
| less_nat na Zero_nat = HOL.False
|
|
26 |
| less_nat (Succ_nat m) (Succ_nat nb) = less_nat m nb;
|
|
27 |
|
|
28 |
fun less_eq_nat m n = HOL.nota (less_nat n m);
|
|
29 |
|
|
30 |
end; (*struct IntDef*)
|
|
31 |
|
|
32 |
structure Codegen =
|
|
33 |
struct
|
|
34 |
|
|
35 |
fun in_interval (k, l) n =
|
|
36 |
HOL.op_conj (IntDef.less_eq_nat k n) (IntDef.less_eq_nat n l);
|
|
37 |
|
|
38 |
end; (*struct Codegen*)
|
|
39 |
|
|
40 |
end; (*struct ROOT*)
|