2083
|
1 |
theory Modules
|
2042
|
2 |
imports "../NewParser"
|
1599
|
3 |
begin
|
|
4 |
|
2083
|
5 |
(* example from Leroy'96 about modules;
|
|
6 |
see OTT example by Owens *)
|
1599
|
7 |
|
|
8 |
atom_decl name
|
|
9 |
|
|
10 |
nominal_datatype mexp =
|
|
11 |
Acc "path"
|
|
12 |
| Stru "body"
|
2042
|
13 |
| Funct x::"name" "sexp" m::"mexp" bind_set x in m
|
1599
|
14 |
| FApp "mexp" "path"
|
|
15 |
| Ascr "mexp" "sexp"
|
|
16 |
and body =
|
|
17 |
Empty
|
2042
|
18 |
| Seq c::defn d::"body" bind_set "cbinders c" in d
|
1599
|
19 |
and defn =
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
20 |
Type "name" "ty"
|
1599
|
21 |
| Dty "name"
|
|
22 |
| DStru "name" "mexp"
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
23 |
| Val "name" "trm"
|
1599
|
24 |
and sexp =
|
|
25 |
Sig sbody
|
|
26 |
| SFunc "name" "sexp" "sexp"
|
|
27 |
and sbody =
|
|
28 |
SEmpty
|
2042
|
29 |
| SSeq C::spec D::sbody bind_set "Cbinders C" in D
|
1599
|
30 |
and spec =
|
|
31 |
Type1 "name"
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
32 |
| Type2 "name" "ty"
|
1599
|
33 |
| SStru "name" "sexp"
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
34 |
| SVal "name" "ty"
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
35 |
and ty =
|
1599
|
36 |
Tyref1 "name"
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
37 |
| Tyref2 "path" "ty"
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
38 |
| Fun "ty" "ty"
|
1599
|
39 |
and path =
|
|
40 |
Sref1 "name"
|
|
41 |
| Sref2 "path" "name"
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
42 |
and trm =
|
1599
|
43 |
Tref1 "name"
|
|
44 |
| Tref2 "path" "name"
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
45 |
| Lam' v::"name" "ty" M::"trm" bind_set v in M
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
46 |
| App' "trm" "trm"
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
47 |
| Let' "body" "trm"
|
1599
|
48 |
binder
|
|
49 |
cbinders :: "defn \<Rightarrow> atom set"
|
|
50 |
and Cbinders :: "spec \<Rightarrow> atom set"
|
|
51 |
where
|
|
52 |
"cbinders (Type t T) = {atom t}"
|
|
53 |
| "cbinders (Dty t) = {atom t}"
|
|
54 |
| "cbinders (DStru x s) = {atom x}"
|
|
55 |
| "cbinders (Val v M) = {atom v}"
|
|
56 |
| "Cbinders (Type1 t) = {atom t}"
|
|
57 |
| "Cbinders (Type2 t T) = {atom t}"
|
|
58 |
| "Cbinders (SStru x S) = {atom x}"
|
|
59 |
| "Cbinders (SVal v T) = {atom v}"
|
|
60 |
|
2082
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
61 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.fv
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
62 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.eq_iff
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
63 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.bn
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
64 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.perm
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
65 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.induct
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
66 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.inducts
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
67 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.distinct
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
68 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.supp(1-3,5-7,9-10)
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
69 |
thm mexp_body_defn_sexp_sbody_spec_ty_path_trm.fv[simplified mexp_body_defn_sexp_sbody_spec_ty_path_trm.supp(1-3,5-7,9-10)]
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
70 |
|
0854af516f14
cleaned up a bit the examples; added equivariance to all examples
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
71 |
|
1599
|
72 |
|
|
73 |
end
|
|
74 |
|
|
75 |
|
|
76 |
|