author | Christian Urban <urbanc@in.tum.de> |
Wed, 11 Aug 2010 19:53:57 +0800 | |
changeset 2395 | 79e493880801 |
parent 2393 | d9a0cf26a88c |
child 2397 | c670a849af65 |
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 |
|
2388 | 7 |
declare [[STEPS = 17]] |
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 |
|
2395 | 24 |
|
25 |
||
2389
0f24c961b5f6
introduced a general alpha_prove method
Christian Urban <urbanc@in.tum.de>
parents:
2388
diff
changeset
|
26 |
thm alpha_sym_thms |
0f24c961b5f6
introduced a general alpha_prove method
Christian Urban <urbanc@in.tum.de>
parents:
2388
diff
changeset
|
27 |
thm alpha_trans_thms |
2388 | 28 |
thm size_eqvt |
2392
9294d7cec5e2
proved rsp-helper lemmas of size functions
Christian Urban <urbanc@in.tum.de>
parents:
2389
diff
changeset
|
29 |
thm size_simps |
9294d7cec5e2
proved rsp-helper lemmas of size functions
Christian Urban <urbanc@in.tum.de>
parents:
2389
diff
changeset
|
30 |
thm size_rsp |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
31 |
thm alpha_bn_imps |
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
32 |
thm distinct |
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
33 |
thm eq_iff |
2387
082d9fd28f89
helper lemmas for rsp-lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2386
diff
changeset
|
34 |
thm eq_iff_simps |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
35 |
thm fv_defs |
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
36 |
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
|
37 |
thm perm_laws |
2388 | 38 |
thm funs_rsp |
2395 | 39 |
thm constrs_rsp |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
40 |
|
2395 | 41 |
declare constrs_rsp[quot_respect] |
42 |
(* declare funs_rsp[quot_respect] *) |
|
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
43 |
|
2359 | 44 |
typ trm |
45 |
typ assg |
|
2338 | 46 |
term Var |
47 |
term App |
|
48 |
term Baz |
|
2339
1e0b3992189c
more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents:
2338
diff
changeset
|
49 |
term bn |
1e0b3992189c
more quotient-definitions
Christian Urban <urbanc@in.tum.de>
parents:
2338
diff
changeset
|
50 |
term fv_trm |
2384
841b7e34e70a
fixed order of fold_union to make alpha and fv agree
Christian Urban <urbanc@in.tum.de>
parents:
2382
diff
changeset
|
51 |
term alpha_bn |
2338 | 52 |
|
2361 | 53 |
lemma [quot_respect]: |
54 |
"(op = ===> alpha_trm_raw ===> alpha_trm_raw) permute permute" |
|
2393
d9a0cf26a88c
added a function that transforms the helper-rsp lemmas into real rsp lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2392
diff
changeset
|
55 |
apply(simp) |
2361 | 56 |
sorry |
57 |
||
58 |
ML {* |
|
59 |
val thms_d = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms distinct} |
|
60 |
*} |
|
61 |
||
62 |
ML {* |
|
63 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.inducts} |
|
64 |
*} |
|
65 |
||
66 |
ML {* |
|
67 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms fv_defs} |
|
68 |
*} |
|
69 |
||
70 |
thm perm_defs[no_vars] |
|
71 |
||
72 |
instance trm :: pt sorry |
|
73 |
instance assg :: pt sorry |
|
74 |
||
2365 | 75 |
lemma b1: |
2361 | 76 |
"p \<bullet> Var name = Var (p \<bullet> name)" |
77 |
"p \<bullet> App trm1 trm2 = App (p \<bullet> trm1) (p \<bullet> trm2)" |
|
78 |
"p \<bullet> Lam name trm = Lam (p \<bullet> name) (p \<bullet> trm)" |
|
79 |
"p \<bullet> Let assg trm = Let (p \<bullet> assg) (p \<bullet> trm)" |
|
80 |
"p \<bullet> Foo name1 name2 trm1 trm2 trm3 = |
|
81 |
Foo (p \<bullet> name1) (p \<bullet> name2) (p \<bullet> trm1) (p \<bullet> trm2) (p \<bullet> trm3)" |
|
82 |
"p \<bullet> Bar name1 name2 trm = Bar (p \<bullet> name1) (p \<bullet> name2) (p \<bullet> trm)" |
|
83 |
"p \<bullet> Baz name trm1 trm2 = Baz (p \<bullet> name) (p \<bullet> trm1) (p \<bullet> trm2)" |
|
84 |
"p \<bullet> As name1 name2 trm = As (p \<bullet> name1) (p \<bullet> name2) (p \<bullet> trm)" |
|
85 |
sorry |
|
86 |
||
87 |
||
88 |
(* |
|
89 |
ML {* |
|
90 |
val thms_p = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_defs} |
|
91 |
*} |
|
92 |
*) |
|
93 |
||
2365 | 94 |
thm eq_iff[no_vars] |
95 |
||
96 |
ML {* |
|
97 |
val q1 = lift_thm [@{typ trm}, @{typ assg}] @{context} @{thm "eq_iff"(1)} |
|
98 |
*} |
|
99 |
||
2361 | 100 |
local_setup {* Local_Theory.note ((@{binding d1}, []), thms_d) #> snd *} |
101 |
local_setup {* Local_Theory.note ((@{binding i1}, []), thms_i) #> snd *} |
|
102 |
local_setup {* Local_Theory.note ((@{binding f1}, []), thms_f) #> snd *} |
|
2365 | 103 |
local_setup {* Local_Theory.note ((@{binding q1}, []), [q1]) #> snd *} |
104 |
||
2361 | 105 |
|
106 |
thm perm_defs |
|
107 |
thm perm_simps |
|
108 |
||
109 |
lemma supp_fv: |
|
110 |
"supp t = fv_trm t" |
|
111 |
"supp b = fv_bn b" |
|
112 |
apply(induct t and b rule: i1) |
|
113 |
apply(simp_all add: f1) |
|
114 |
apply(simp_all add: supp_def) |
|
2365 | 115 |
apply(simp_all add: b1) |
116 |
sorry |
|
117 |
||
118 |
consts perm_bn_trm :: "perm \<Rightarrow> trm \<Rightarrow> trm" |
|
119 |
consts perm_bn_assg :: "perm \<Rightarrow> assg \<Rightarrow> assg" |
|
120 |
||
121 |
lemma y: |
|
122 |
"perm_bn_trm p (Var x) = (Var x)" |
|
123 |
"perm_bn_trm p (App t1 t2) = (App t1 t2)" |
|
124 |
"perm_bn_trm p (" |
|
125 |
||
126 |
||
2361 | 127 |
|
128 |
ML {* |
|
129 |
map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff} |
|
130 |
*} |
|
131 |
||
132 |
||
133 |
||
2359 | 134 |
|
135 |
||
136 |
lemma "Var x \<noteq> App y1 y2" |
|
137 |
apply(descending) |
|
138 |
apply(simp add: trm_raw.distinct) |
|
139 |
||
140 |
||
141 |
||
142 |
ML {* |
|
143 |
map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw.distinct(1)} |
|
144 |
*} |
|
145 |
||
146 |
||
147 |
||
2338 | 148 |
|
2336
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
149 |
typ trm |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
150 |
typ assg |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
151 |
|
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
152 |
thm trm_assg.fv |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
153 |
thm trm_assg.supp |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
154 |
thm trm_assg.eq_iff |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
155 |
thm trm_assg.bn |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
156 |
thm trm_assg.perm |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
157 |
thm trm_assg.induct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
158 |
thm trm_assg.inducts |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
159 |
thm trm_assg.distinct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
160 |
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
|
161 |
|
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
|
162 |
(* TEMPORARY |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
163 |
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
|
164 |
*) |
2064
2725853f43b9
solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents:
2028
diff
changeset
|
165 |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
166 |
end |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
167 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
168 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
169 |