author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Tue, 02 Mar 2010 14:51:40 +0100 | |
changeset 1304 | dc65319809cc |
parent 1302 | d3101a5b9c4d |
child 1309 | b395b902cf0d |
child 1312 | b0eae8c93314 |
permissions | -rw-r--r-- |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory Test |
1261
853abc14c5c6
added IsaMakefile...but so far included only a test for the parser
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
2 |
imports "Parser" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
|
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
5 |
text {* example 1 *} |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
6 |
|
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
7 |
nominal_datatype lam = |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
8 |
VAR "name" |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
| APP "lam" "lam" |
1287
8557af71724e
slight simplification of the raw-decl generation
Christian Urban <urbanc@in.tum.de>
parents:
1285
diff
changeset
|
10 |
| LET bp::"bp" t::"lam" bind "bi bp" in t |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
and bp = |
1287
8557af71724e
slight simplification of the raw-decl generation
Christian Urban <urbanc@in.tum.de>
parents:
1285
diff
changeset
|
12 |
BP "name" "lam" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
binder |
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1290
diff
changeset
|
14 |
bi::"bp \<Rightarrow> atom set" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
where |
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1290
diff
changeset
|
16 |
"bi (BP x t) = {atom x}" |
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
17 |
|
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
18 |
typ lam_raw |
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
19 |
term VAR_raw |
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
parents:
1272
diff
changeset
|
20 |
term APP_raw |
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
parents:
1272
diff
changeset
|
21 |
term LET_raw |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
22 |
term Test.BP_raw |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
23 |
thm bi_raw.simps |
1295
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1290
diff
changeset
|
24 |
thm permute_lam_raw_permute_bp_raw.simps |
0ecc775e5fce
Link calls to Raw permutations, FV definition and alpha_definition into the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1290
diff
changeset
|
25 |
thm alpha_lam_raw_alpha_bp_raw.intros |
1297
0ab16694c3c1
Add a check of fv_functions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1295
diff
changeset
|
26 |
thm fv_lam_raw_fv_bp_raw.simps |
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
27 |
|
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
28 |
|
961
0f88e04eb486
Variable takes a 'name'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
954
diff
changeset
|
29 |
print_theorems |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
30 |
|
1261
853abc14c5c6
added IsaMakefile...but so far included only a test for the parser
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
31 |
text {* example 2 *} |
853abc14c5c6
added IsaMakefile...but so far included only a test for the parser
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
32 |
|
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
33 |
nominal_datatype trm' = |
961
0f88e04eb486
Variable takes a 'name'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
954
diff
changeset
|
34 |
Var "name" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
35 |
| App "trm'" "trm'" |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
36 |
| Lam x::"name" t::"trm'" bind x in t |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
37 |
| Let p::"pat'" "trm'" t::"trm'" bind "f p" in t |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
38 |
and pat' = |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
39 |
PN |
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
40 |
| PS "name" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
41 |
| PD "name" "name" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
42 |
binder |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
43 |
f::"pat' \<Rightarrow> atom set" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
44 |
where |
978
b44592adf235
Improper interface for datatype and function packages and proper interface lateron.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
973
diff
changeset
|
45 |
"f PN = {}" |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
46 |
| "f (PS x) = {atom x}" |
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
47 |
| "f (PD x y) = {atom x, atom y}" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
48 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
49 |
thm f_raw.simps |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
50 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
51 |
nominal_datatype trm0 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
52 |
Var0 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
53 |
| App0 "trm0" "trm0" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
54 |
| Lam0 x::"name" t::"trm0" bind x in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
55 |
| Let0 p::"pat0" "trm0" t::"trm0" bind "f0 p" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
56 |
and pat0 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
57 |
PN0 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
58 |
| PS0 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
59 |
| PD0 "pat0" "pat0" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
60 |
binder |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
61 |
f0::"pat0 \<Rightarrow> atom set" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
62 |
where |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
63 |
"f0 PN0 = {}" |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
64 |
| "f0 (PS0 x) = {atom x}" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
65 |
| "f0 (PD0 p1 p2) = (f0 p1) \<union> (f0 p2)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
66 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
67 |
thm f0_raw.simps |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
68 |
|
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
69 |
text {* example type schemes *} |
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
70 |
|
1304
dc65319809cc
Change type schemes to name set.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1302
diff
changeset
|
71 |
(* does not work yet |
1302
d3101a5b9c4d
Length fix for nested recursions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1299
diff
changeset
|
72 |
nominal_datatype t = |
d3101a5b9c4d
Length fix for nested recursions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1299
diff
changeset
|
73 |
Var "name" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
74 |
| Fun "t" "t" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
75 |
|
1302
d3101a5b9c4d
Length fix for nested recursions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1299
diff
changeset
|
76 |
nominal_datatype tyS = |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
77 |
All xs::"name list" ty::"t_raw" bind xs in ty |
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
78 |
*) |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
79 |
|
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
80 |
nominal_datatype t = |
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
81 |
Var "name" |
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
82 |
| Fun "t" "t" |
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
83 |
and tyS = |
1304
dc65319809cc
Change type schemes to name set.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1302
diff
changeset
|
84 |
All xs::"name set" ty::"t" bind xs in ty |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
85 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
86 |
(* example 1 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
87 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
88 |
nominal_datatype trm1 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
89 |
Vr1 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
90 |
| Ap1 "trm1" "trm1" |
1290
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
91 |
| Lm1 x::"name" t::"trm1" bind x in t |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
92 |
| Lt1 p::"bp1" "trm1" t::"trm1" bind "bv1 p" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
93 |
and bp1 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
94 |
BUnit1 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
95 |
| BV1 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
96 |
| BP1 "bp1" "bp1" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
97 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
98 |
bv1 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
99 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
100 |
"bv1 (BUnit1) = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
101 |
| "bv1 (BV1 x) = {atom x}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
102 |
| "bv1 (BP1 bp1 bp2) = (bv1 bp1) \<union> (bv1 bp2)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
103 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
104 |
thm bv1_raw.simps |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
105 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
106 |
(* example 2 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
107 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
108 |
nominal_datatype trm2 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
109 |
Vr2 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
110 |
| Ap2 "trm2" "trm2" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
111 |
| Lm2 x::"name" t::"trm2" bind x in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
112 |
| Lt2 r::"rassign" t::"trm2" bind "bv2 r" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
113 |
and rassign = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
114 |
As "name" "trm2" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
115 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
116 |
bv2 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
117 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
118 |
"bv2 (As x t) = {atom x}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
119 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
120 |
(* example 3 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
121 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
122 |
nominal_datatype trm3 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
123 |
Vr3 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
124 |
| Ap3 "trm3" "trm3" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
125 |
| Lm3 x::"name" t::"trm3" bind x in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
126 |
| Lt3 r::"rassigns3" t::"trm3" bind "bv3 r" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
127 |
and rassigns3 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
128 |
ANil |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
129 |
| ACons "name" "trm3" "rassigns3" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
130 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
131 |
bv3 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
132 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
133 |
"bv3 ANil = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
134 |
| "bv3 (ACons x t as) = {atom x} \<union> (bv3 as)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
135 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
136 |
(* example 4 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
137 |
|
1302
d3101a5b9c4d
Length fix for nested recursions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1299
diff
changeset
|
138 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
139 |
nominal_datatype trm4 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
140 |
Vr4 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
141 |
| Ap4 "trm4" "trm4 list" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
142 |
| Lm4 x::"name" t::"trm4" bind x in t |
1302
d3101a5b9c4d
Length fix for nested recursions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1299
diff
changeset
|
143 |
|
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
144 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
145 |
(* example 5 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
146 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
147 |
nominal_datatype trm5 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
148 |
Vr5 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
149 |
| Ap5 "trm5" "trm5" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
150 |
| Lt5 l::"lts" t::"trm5" bind "bv5 l" in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
151 |
and lts = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
152 |
Lnil |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
153 |
| Lcons "name" "trm5" "lts" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
154 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
155 |
bv5 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
156 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
157 |
"bv5 Lnil = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
158 |
| "bv5 (Lcons n t ltl) = {atom n} \<union> (bv5 ltl)" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
159 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
160 |
(* example 6 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
161 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
162 |
nominal_datatype trm6 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
163 |
Vr6 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
164 |
| Lm6 x::"name" t::"trm6" bind x in t |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
165 |
| Lt6 left::"trm6" right::"trm6" bind "bv6 left" in right |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
166 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
167 |
bv6 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
168 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
169 |
"bv6 (Vr6 n) = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
170 |
| "bv6 (Lm6 n t) = {atom n} \<union> bv6 t" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
171 |
| "bv6 (Lt6 l r) = bv6 l \<union> bv6 r" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
172 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
173 |
(* example 7 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
174 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
175 |
nominal_datatype trm7 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
176 |
Vr7 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
177 |
| Lm7 l::"name" r::"trm7" bind l in r |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
178 |
| Lt7 l::"trm7" r::"trm7" bind "bv7 l" in r |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
179 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
180 |
bv7 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
181 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
182 |
"bv7 (Vr7 n) = {atom n}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
183 |
| "bv7 (Lm7 n t) = bv7 t - {atom n}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
184 |
| "bv7 (Lt7 l r) = bv7 l \<union> bv7 r" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
185 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
186 |
(* example 8 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
187 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
188 |
nominal_datatype foo8 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
189 |
Foo0 "name" |
1283
6a133abb7633
generated the "binding list" from the input; at the moment it is only printed out as tracing; does not yet include the "bind itself binders"
Christian Urban <urbanc@in.tum.de>
parents:
1272
diff
changeset
|
190 |
| Foo1 b::"bar8" f::"foo8" bind "bv8 b" in f --"check fo error if this is called foo" |
1251
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
191 |
and bar8 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
192 |
Bar0 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
193 |
| Bar1 "name" s::"name" b::"bar8" bind s in b |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
194 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
195 |
bv8 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
196 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
197 |
"bv8 (Bar0 x) = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
198 |
| "bv8 (Bar1 v x b) = {atom v}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
199 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
200 |
(* example 9 from Terms.thy *) |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
201 |
|
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
202 |
nominal_datatype lam9 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
203 |
Var9 "name" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
204 |
| Lam9 n::"name" l::"lam9" bind n in l |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
205 |
and bla9 = |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
206 |
Bla9 f::"lam9" s::"lam9" bind "bv9 f" in s |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
207 |
binder |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
208 |
bv9 |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
209 |
where |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
210 |
"bv9 (Var9 x) = {}" |
11b8798dea5d
parsing and definition of raw datatype and bv-function work (not very beautiful)
Christian Urban <urbanc@in.tum.de>
parents:
1232
diff
changeset
|
211 |
| "bv9 (Lam9 x b) = {atom x}" |
954
c009d2535896
very rough example file for how nominal2 specification can be parsed
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
212 |
|
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
213 |
(* example from my PHD *) |
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
214 |
|
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
215 |
atom_decl coname |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
216 |
|
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
217 |
nominal_datatype phd = |
1290
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
218 |
Ax "name" "coname" |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
219 |
| Cut n::"coname" t1::"phd" c::"coname" t2::"phd" bind n in t1, bind c in t2 |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
220 |
| AndR c1::"coname" t1::"phd" c2::"coname" t2::"phd" "coname" bind c1 in t1, bind c2 in t2 |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
221 |
| AndL1 n::"name" t::"phd" "name" bind n in t |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
222 |
| AndL2 n::"name" t::"phd" "name" bind n in t |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
223 |
| ImpL c::"coname" t1::"phd" n::"name" t2::"phd" "name" bind c in t1, bind n in t2 |
a7e7ffb7f362
modified for new binding format - hope it is the intended one
Christian Urban <urbanc@in.tum.de>
parents:
1287
diff
changeset
|
224 |
| ImpR c::"coname" n::"name" t::"phd" "coname" bind n in 1, bind c in t |
1285
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
225 |
|
e3ac56d3b7af
added example from my phd
Christian Urban <urbanc@in.tum.de>
parents:
1284
diff
changeset
|
226 |
(* example form Leroy 96 about modules; OTT *) |
1284 | 227 |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
228 |
nominal_datatype mexp = |
1296 | 229 |
Acc "path" |
230 |
| Stru "body" |
|
231 |
| Funct x::"name" "sexp" m::"mexp" bind x in m |
|
232 |
| FApp "mexp" "path" |
|
233 |
| Ascr "mexp" "sexp" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
234 |
and body = |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
235 |
Empty |
1296 | 236 |
| Seq c::defn d::"body" bind "cbinders c" in d |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
237 |
and defn = |
1296 | 238 |
Type "name" "tyty" |
239 |
| Dty "name" |
|
240 |
| DStru "name" "mexp" |
|
241 |
| Val "name" "trmtrm" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
242 |
and sexp = |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
243 |
Sig sbody |
1296 | 244 |
| SFunc "name" "sexp" "sexp" |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
245 |
and sbody = |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
246 |
SEmpty |
1296 | 247 |
| SSeq C::spec D::sbody bind "Cbinders C" in D |
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
248 |
and spec = |
1296 | 249 |
Type1 "name" |
250 |
| Type2 "name" "tyty" |
|
251 |
| SStru "name" "sexp" |
|
252 |
| SVal "name" "tyty" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
253 |
and tyty = |
1296 | 254 |
Tyref1 "name" |
255 |
| Tyref2 "path" "tyty" |
|
256 |
| Fun "tyty" "tyty" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
257 |
and path = |
1296 | 258 |
Sref1 "name" |
259 |
| Sref2 "path" "name" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
260 |
and trmtrm = |
1296 | 261 |
Tref1 "name" |
262 |
| Tref2 "path" "name" |
|
263 |
| Lam v::"name" "tyty" M::"trmtrm" bind v in M |
|
264 |
| App "trmtrm" "trmtrm" |
|
265 |
| Let "body" "trmtrm" |
|
1272
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
266 |
binder |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
267 |
cbinders :: "defn \<Rightarrow> atom set" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
268 |
and Cbinders :: "spec \<Rightarrow> atom set" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
269 |
where |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
270 |
"cbinders (Type t T) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
271 |
| "cbinders (Dty t) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
272 |
| "cbinders (DStru x s) = {atom x}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
273 |
| "cbinders (Val v M) = {atom v}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
274 |
| "Cbinders (Type1 t) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
275 |
| "Cbinders (Type2 t T) = {atom t}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
276 |
| "Cbinders (SStru x S) = {atom x}" |
6d140b2c751f
added ott-example about Leroy96
Christian Urban <urbanc@in.tum.de>
parents:
1265
diff
changeset
|
277 |
| "Cbinders (SVal v T) = {atom v}" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
278 |
|
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
279 |
(* core haskell *) |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
280 |
|
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
281 |
atom_decl var |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
282 |
atom_decl tvar |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
283 |
atom_decl co |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
284 |
|
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
285 |
datatype sort = |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
286 |
TY tvar |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
287 |
| CO co |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
288 |
|
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
289 |
nominal_datatype kind = |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
290 |
KStar |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
291 |
| KFun kind kind |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
292 |
| KEq kind kind |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
293 |
|
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
294 |
(* there are types, coercion types and regular types *) |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
295 |
(* |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
296 |
nominal_datatype ty = |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
297 |
TVar tvar |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
298 |
| TFun string "ty list" |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
299 |
| TAll tvar kind_raw ty --"some binding" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
300 |
| TSym ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
301 |
| TCir ty ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
302 |
| TApp ty ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
303 |
| TLeft ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
304 |
| TRight ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
305 |
| TEq ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
306 |
| TRightc ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
307 |
| TLeftc ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
308 |
| TCoe ty ty |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
309 |
*) |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
310 |
typedecl ty --"hack since ty is not yet defined" |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
311 |
|
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
312 |
abbreviation |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
313 |
"atoms A \<equiv> atom ` A" |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
314 |
|
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
315 |
(* does not work yet |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
316 |
nominal_datatype trm = |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
317 |
Var var |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
318 |
| LAM tv::tvar kind_raw t::trm bind tv in t |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
319 |
| APP trm ty |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
320 |
| Lam v::var ty t::trm bind v in t |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
321 |
| App trm trm |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
322 |
| Let x::var ty trm t::trm bind x in t |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
323 |
| Case trm "assoc list" |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
324 |
| Cast trm ty --"ty is supposed to be a coercion type only" |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
325 |
and assoc = |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
326 |
A p::pat t::trm bind "bv p" in t |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
327 |
and pat = |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
328 |
K string "(tvar \<times> kind_raw) list" "(var \<times> ty) list" |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
329 |
binder |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
330 |
bv :: "pat \<Rightarrow> atom set" |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
331 |
where |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
332 |
"bv (K s ts vs) = (atoms (set (map fst ts))) \<union> (atoms (set (map fst vs)))" |
1299
cbcd4997dac5
most tests work - the ones that do not I commented out
Christian Urban <urbanc@in.tum.de>
parents:
1298
diff
changeset
|
333 |
*) |
1265
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
334 |
|
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
335 |
thm bv_raw.simps |
fc8f5897b00a
first attempt to make sense out of the core-haskell definition
Christian Urban <urbanc@in.tum.de>
parents:
1261
diff
changeset
|
336 |
|
961
0f88e04eb486
Variable takes a 'name'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
954
diff
changeset
|
337 |
end |
1223
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
parents:
1194
diff
changeset
|
338 |
|
160343d86a6f
"raw"-ified the term-constructors and types given in the specification
Christian Urban <urbanc@in.tum.de>
parents:
1194
diff
changeset
|
339 |
|
1228
c179ad9d2446
declarartion of the raw datatype already works; raw binding functions throw an exception about mutual recursive types
Christian Urban <urbanc@in.tum.de>
parents:
1223
diff
changeset
|
340 |