0
|
1 |
structure Nat2 =
|
|
2 |
struct
|
|
3 |
|
|
4 |
local
|
|
5 |
val parse_ast_translation = []
|
|
6 |
val parse_preproc = None
|
|
7 |
val parse_postproc = None
|
|
8 |
val parse_translation = []
|
|
9 |
val print_translation = []
|
|
10 |
val print_preproc = None
|
|
11 |
val print_postproc = None
|
|
12 |
val print_ast_translation = []
|
|
13 |
in
|
|
14 |
|
|
15 |
(**** begin of user section ****)
|
|
16 |
|
|
17 |
(**** end of user section ****)
|
|
18 |
|
|
19 |
val thy = extend_theory (FOL.thy)
|
|
20 |
"Nat2"
|
|
21 |
([],
|
|
22 |
[],
|
|
23 |
[(["nat"], 0)],
|
|
24 |
[(["nat"], ([], "term"))],
|
|
25 |
[(["succ", "pred"], "nat => nat")],
|
|
26 |
Some (NewSext {
|
|
27 |
mixfix =
|
|
28 |
[Delimfix("0", "nat", "0"),
|
|
29 |
Infixr("+", "[nat,nat] => nat", 90),
|
|
30 |
Infixr("<", "[nat,nat] => o", 70),
|
|
31 |
Infixr("<=", "[nat,nat] => o", 70)],
|
|
32 |
xrules =
|
|
33 |
[],
|
|
34 |
parse_ast_translation = parse_ast_translation,
|
|
35 |
parse_preproc = parse_preproc,
|
|
36 |
parse_postproc = parse_postproc,
|
|
37 |
parse_translation = parse_translation,
|
|
38 |
print_translation = print_translation,
|
|
39 |
print_preproc = print_preproc,
|
|
40 |
print_postproc = print_postproc,
|
|
41 |
print_ast_translation = print_ast_translation}))
|
|
42 |
[("pred_0", "pred(0) = 0"),
|
|
43 |
("pred_succ", "pred(succ(m)) = m"),
|
|
44 |
("plus_0", "0+n = n"),
|
|
45 |
("plus_succ", "succ(m)+n = succ(m+n)"),
|
|
46 |
("nat_distinct1", "~ 0=succ(n)"),
|
|
47 |
("nat_distinct2", "~ succ(m)=0"),
|
|
48 |
("succ_inject", "succ(m)=succ(n) <-> m=n"),
|
|
49 |
("leq_0", "0 <= n"),
|
|
50 |
("leq_succ_succ", "succ(m)<=succ(n) <-> m<=n"),
|
|
51 |
("leq_succ_0", "~ succ(m) <= 0"),
|
|
52 |
("lt_0_succ", "0 < succ(n)"),
|
|
53 |
("lt_succ_succ", "succ(m)<succ(n) <-> m<n"),
|
|
54 |
("lt_0", "~ m < 0"),
|
|
55 |
("nat_ind", "[| P(0); ALL n. P(n)-->P(succ(n)) |] ==> All(P)")]
|
|
56 |
|
|
57 |
val ax = get_axiom thy
|
|
58 |
|
|
59 |
val pred_0 = ax "pred_0"
|
|
60 |
val pred_succ = ax "pred_succ"
|
|
61 |
val plus_0 = ax "plus_0"
|
|
62 |
val plus_succ = ax "plus_succ"
|
|
63 |
val nat_distinct1 = ax "nat_distinct1"
|
|
64 |
val nat_distinct2 = ax "nat_distinct2"
|
|
65 |
val succ_inject = ax "succ_inject"
|
|
66 |
val leq_0 = ax "leq_0"
|
|
67 |
val leq_succ_succ = ax "leq_succ_succ"
|
|
68 |
val leq_succ_0 = ax "leq_succ_0"
|
|
69 |
val lt_0_succ = ax "lt_0_succ"
|
|
70 |
val lt_succ_succ = ax "lt_succ_succ"
|
|
71 |
val lt_0 = ax "lt_0"
|
|
72 |
val nat_ind = ax "nat_ind"
|
|
73 |
|
|
74 |
|
|
75 |
end
|
|
76 |
end
|