1911
|
1 |
theory SingleLet
|
2024
|
2 |
imports "../NewParser"
|
1596
|
3 |
begin
|
|
4 |
|
|
5 |
atom_decl name
|
|
6 |
|
2400
|
7 |
declare [[STEPS = 20]]
|
2294
|
8 |
|
2336
|
9 |
nominal_datatype trm =
|
1911
|
10 |
Var "name"
|
|
11 |
| App "trm" "trm"
|
2024
|
12 |
| Lam x::"name" t::"trm" bind_set x in t
|
|
13 |
| Let a::"assg" t::"trm" bind_set "bn a" in t
|
2311
|
14 |
| Foo x::"name" y::"name" t::"trm" t1::"trm" t2::"trm" bind_set x in y t t1 t2
|
2296
|
15 |
| Bar x::"name" y::"name" t::"trm" bind y x in t x y
|
2316
|
16 |
| Baz x::"name" t1::"trm" t2::"trm" bind x in t1, bind x in t2
|
1911
|
17 |
and assg =
|
2320
|
18 |
As "name" x::"name" t::"trm" bind x in t
|
1596
|
19 |
binder
|
1911
|
20 |
bn::"assg \<Rightarrow> atom set"
|
1596
|
21 |
where
|
2320
|
22 |
"bn (As x y t) = {atom x}"
|
1911
|
23 |
|
2409
|
24 |
ML {* Function.prove_termination *}
|
|
25 |
|
|
26 |
text {* can lift *}
|
2401
7645e18e8b19
modified the code for class instantiations (with help from Florian)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
27 |
|
2397
|
28 |
thm distinct
|
|
29 |
thm trm_raw_assg_raw.inducts
|
2407
|
30 |
thm trm_raw.exhaust
|
|
31 |
thm assg_raw.exhaust
|
2397
|
32 |
thm fv_defs
|
2384
|
33 |
thm perm_simps
|
|
34 |
thm perm_laws
|
2397
|
35 |
thm trm_raw_assg_raw.size(9 - 16)
|
2398
|
36 |
thm eq_iff
|
|
37 |
thm eq_iff_simps
|
2406
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
38 |
thm bn_defs
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
39 |
thm fv_eqvt
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
40 |
thm bn_eqvt
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
41 |
thm size_eqvt
|
2405
|
42 |
|
2406
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
43 |
|
2398
|
44 |
ML {*
|
|
45 |
val thms_d = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms distinct}
|
|
46 |
*}
|
2397
|
47 |
|
2398
|
48 |
ML {*
|
|
49 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.inducts}
|
|
50 |
*}
|
|
51 |
|
2407
|
52 |
ML {*
|
|
53 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw.exhaust}
|
|
54 |
*}
|
|
55 |
|
|
56 |
ML {*
|
|
57 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms assg_raw.exhaust}
|
|
58 |
*}
|
|
59 |
|
2398
|
60 |
ML {*
|
|
61 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms fv_defs}
|
|
62 |
*}
|
|
63 |
|
|
64 |
ML {*
|
|
65 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.size(9 - 16)}
|
|
66 |
*}
|
|
67 |
|
|
68 |
ML {*
|
|
69 |
val thms_p = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_simps}
|
|
70 |
*}
|
|
71 |
|
|
72 |
ML {*
|
|
73 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_laws}
|
|
74 |
*}
|
|
75 |
|
2402
|
76 |
ML {*
|
2403
a92d2c915004
cezary made the eq_iff lemmas to lift (still needs some infrastructure in quotient)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
77 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context})
|
a92d2c915004
cezary made the eq_iff lemmas to lift (still needs some infrastructure in quotient)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
78 |
@{thms eq_iff[unfolded alphas permute_prod.simps prod_fv.simps prod_alpha_def prod_rel.simps
|
a92d2c915004
cezary made the eq_iff lemmas to lift (still needs some infrastructure in quotient)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
79 |
prod.cases]}
|
2402
|
80 |
*}
|
2397
|
81 |
|
2405
|
82 |
ML {*
|
|
83 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context})
|
|
84 |
@{thms eq_iff_simps[unfolded alphas permute_prod.simps prod_fv.simps prod_alpha_def prod_rel.simps
|
|
85 |
prod.cases]}
|
|
86 |
*}
|
2397
|
87 |
|
2405
|
88 |
ML {*
|
|
89 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms bn_defs}
|
|
90 |
*}
|
2361
|
91 |
|
2406
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
92 |
ML {*
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
93 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms bn_eqvt}
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
94 |
*}
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
95 |
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
96 |
ML {*
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
97 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms fv_eqvt}
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
98 |
*}
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
99 |
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
100 |
ML {*
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
101 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms size_eqvt}
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
102 |
*}
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
103 |
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
104 |
|
428d9cb9a243
can also lift the various eqvt lemmas for bn, fv, fv_bn and size
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
105 |
|
2361
|
106 |
|
|
107 |
lemma supp_fv:
|
|
108 |
"supp t = fv_trm t"
|
|
109 |
"supp b = fv_bn b"
|
|
110 |
apply(induct t and b rule: i1)
|
|
111 |
apply(simp_all add: f1)
|
|
112 |
apply(simp_all add: supp_def)
|
2365
|
113 |
apply(simp_all add: b1)
|
|
114 |
sorry
|
|
115 |
|
|
116 |
consts perm_bn_trm :: "perm \<Rightarrow> trm \<Rightarrow> trm"
|
|
117 |
consts perm_bn_assg :: "perm \<Rightarrow> assg \<Rightarrow> assg"
|
|
118 |
|
|
119 |
lemma y:
|
|
120 |
"perm_bn_trm p (Var x) = (Var x)"
|
|
121 |
"perm_bn_trm p (App t1 t2) = (App t1 t2)"
|
|
122 |
"perm_bn_trm p ("
|
|
123 |
|
|
124 |
|
2361
|
125 |
|
2336
|
126 |
typ trm
|
|
127 |
typ assg
|
|
128 |
|
1911
|
129 |
thm trm_assg.fv
|
|
130 |
thm trm_assg.supp
|
2024
|
131 |
thm trm_assg.eq_iff
|
1911
|
132 |
thm trm_assg.bn
|
|
133 |
thm trm_assg.perm
|
|
134 |
thm trm_assg.induct
|
|
135 |
thm trm_assg.inducts
|
|
136 |
thm trm_assg.distinct
|
|
137 |
ML {* Sign.of_sort @{theory} (@{typ trm}, @{sort fs}) *}
|
2024
|
138 |
|
2288
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
139 |
(* TEMPORARY
|
2024
|
140 |
thm trm_assg.fv[simplified trm_assg.supp(1-2)]
|
2288
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
141 |
*)
|
2064
2725853f43b9
solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
142 |
|
1596
|
143 |
end
|
|
144 |
|
|
145 |
|
|
146 |
|