author | Christian Urban <urbanc@in.tum.de> |
Sun, 15 Aug 2010 14:00:28 +0800 | |
changeset 2400 | c6d30d5f5ba1 |
parent 2398 | 1e6160690546 |
child 2401 | 7645e18e8b19 |
permissions | -rw-r--r-- |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
1 |
theory SingleLet |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
2 |
imports "../NewParser" |
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
5 |
atom_decl name |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
|
2400
c6d30d5f5ba1
defined qperms and qsizes
Christian Urban <urbanc@in.tum.de>
parents:
2398
diff
changeset
|
7 |
declare [[STEPS = 20]] |
2294
72ad4e766acf
properly exported bn_descr
Christian Urban <urbanc@in.tum.de>
parents:
2293
diff
changeset
|
8 |
|
2336
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
9 |
nominal_datatype trm = |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
10 |
Var "name" |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
11 |
| App "trm" "trm" |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
12 |
| Lam x::"name" t::"trm" bind_set x in t |
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
13 |
| Let a::"assg" t::"trm" bind_set "bn a" in t |
2311
4da5c5c29009
work on transitivity proof
Christian Urban <urbanc@in.tum.de>
parents:
2308
diff
changeset
|
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
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
17 |
and assg = |
2320
d835a2771608
prove that alpha implies alpha_bn (needed for rsp proofs)
Christian Urban <urbanc@in.tum.de>
parents:
2318
diff
changeset
|
18 |
As "name" x::"name" t::"trm" bind x in t |
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
19 |
binder |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
20 |
bn::"assg \<Rightarrow> atom set" |
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
21 |
where |
2320
d835a2771608
prove that alpha implies alpha_bn (needed for rsp proofs)
Christian Urban <urbanc@in.tum.de>
parents:
2318
diff
changeset
|
22 |
"bn (As x y t) = {atom x}" |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
23 |
|
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
24 |
(* can lift *) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
25 |
thm distinct |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
26 |
thm trm_raw_assg_raw.inducts |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
27 |
thm fv_defs |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
28 |
thm perm_simps |
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
29 |
thm perm_laws |
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
30 |
thm trm_raw_assg_raw.size(9 - 16) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
31 |
|
2398 | 32 |
(* cannot lift yet *) |
33 |
thm eq_iff |
|
34 |
thm eq_iff_simps |
|
2361 | 35 |
|
2398 | 36 |
ML {* |
37 |
val thms_d = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms distinct} |
|
38 |
*} |
|
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
39 |
|
2398 | 40 |
ML {* |
41 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.inducts} |
|
42 |
*} |
|
43 |
||
44 |
ML {* |
|
45 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms fv_defs} |
|
46 |
*} |
|
47 |
||
48 |
ML {* |
|
49 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.size(9 - 16)} |
|
50 |
*} |
|
51 |
||
52 |
ML {* |
|
53 |
val thms_p = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_simps} |
|
54 |
*} |
|
55 |
||
56 |
ML {* |
|
57 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_laws} |
|
58 |
*} |
|
59 |
||
60 |
||
61 |
||
62 |
||
63 |
||
64 |
section {* NOT *} |
|
65 |
||
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
66 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
67 |
ML {* |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
68 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff[unfolded alphas prod_fv.simps prod_rel.simps prod_alpha_def]} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
69 |
*} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
70 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
71 |
ML {* |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
72 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff[unfolding alphas]} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
73 |
*} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
74 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
75 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
76 |
(* |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
77 |
instance trm :: size .. |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
78 |
instance assg :: size .. |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
79 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
80 |
lemma "(size (Var x)) = 0" |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
81 |
apply(descending) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
82 |
apply(rule trm_raw_assg_raw.size(9 - 16)) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
83 |
apply(simp) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
84 |
*) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
85 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
86 |
ML {* |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
87 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff[unfolding alphas]} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
88 |
*} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
89 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
90 |
section {* NOT *} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
91 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
92 |
ML {* |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
93 |
val thms_p = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_simps(1)} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
94 |
*} |
2361 | 95 |
|
96 |
instance trm :: pt sorry |
|
97 |
instance assg :: pt sorry |
|
98 |
||
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
99 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
100 |
|
2361 | 101 |
|
102 |
||
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
103 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
104 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
105 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
106 |
|
2361 | 107 |
|
2365 | 108 |
thm eq_iff[no_vars] |
109 |
||
110 |
ML {* |
|
111 |
val q1 = lift_thm [@{typ trm}, @{typ assg}] @{context} @{thm "eq_iff"(1)} |
|
112 |
*} |
|
113 |
||
2361 | 114 |
local_setup {* Local_Theory.note ((@{binding d1}, []), thms_d) #> snd *} |
115 |
local_setup {* Local_Theory.note ((@{binding i1}, []), thms_i) #> snd *} |
|
116 |
local_setup {* Local_Theory.note ((@{binding f1}, []), thms_f) #> snd *} |
|
2365 | 117 |
local_setup {* Local_Theory.note ((@{binding q1}, []), [q1]) #> snd *} |
118 |
||
2361 | 119 |
|
120 |
thm perm_defs |
|
121 |
thm perm_simps |
|
122 |
||
123 |
lemma supp_fv: |
|
124 |
"supp t = fv_trm t" |
|
125 |
"supp b = fv_bn b" |
|
126 |
apply(induct t and b rule: i1) |
|
127 |
apply(simp_all add: f1) |
|
128 |
apply(simp_all add: supp_def) |
|
2365 | 129 |
apply(simp_all add: b1) |
130 |
sorry |
|
131 |
||
132 |
consts perm_bn_trm :: "perm \<Rightarrow> trm \<Rightarrow> trm" |
|
133 |
consts perm_bn_assg :: "perm \<Rightarrow> assg \<Rightarrow> assg" |
|
134 |
||
135 |
lemma y: |
|
136 |
"perm_bn_trm p (Var x) = (Var x)" |
|
137 |
"perm_bn_trm p (App t1 t2) = (App t1 t2)" |
|
138 |
"perm_bn_trm p (" |
|
139 |
||
140 |
||
2361 | 141 |
|
142 |
ML {* |
|
143 |
map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff} |
|
144 |
*} |
|
145 |
||
146 |
||
147 |
||
2359 | 148 |
|
149 |
||
150 |
lemma "Var x \<noteq> App y1 y2" |
|
151 |
apply(descending) |
|
152 |
apply(simp add: trm_raw.distinct) |
|
153 |
||
154 |
||
155 |
||
156 |
ML {* |
|
157 |
map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw.distinct(1)} |
|
158 |
*} |
|
159 |
||
160 |
||
161 |
||
2338 | 162 |
|
2336
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
163 |
typ trm |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
164 |
typ assg |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
165 |
|
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
166 |
thm trm_assg.fv |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
167 |
thm trm_assg.supp |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
168 |
thm trm_assg.eq_iff |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
169 |
thm trm_assg.bn |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
170 |
thm trm_assg.perm |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
171 |
thm trm_assg.induct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
172 |
thm trm_assg.inducts |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
173 |
thm trm_assg.distinct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
174 |
ML {* Sign.of_sort @{theory} (@{typ trm}, @{sort fs}) *} |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
175 |
|
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>
parents:
2146
diff
changeset
|
176 |
(* TEMPORARY |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
177 |
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>
parents:
2146
diff
changeset
|
178 |
*) |
2064
2725853f43b9
solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents:
2028
diff
changeset
|
179 |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
180 |
end |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
181 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
182 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
183 |