author | Christian Urban <urbanc@in.tum.de> |
Mon, 16 Aug 2010 17:59:09 +0800 | |
changeset 2402 | 80db544a37ea |
parent 2401 | 7645e18e8b19 |
child 2403 | a92d2c915004 |
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 *) |
2401
7645e18e8b19
modified the code for class instantiations (with help from Florian)
Christian Urban <urbanc@in.tum.de>
parents:
2400
diff
changeset
|
25 |
|
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
26 |
thm distinct |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
27 |
thm trm_raw_assg_raw.inducts |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
28 |
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
|
29 |
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
|
30 |
thm perm_laws |
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
31 |
thm trm_raw_assg_raw.size(9 - 16) |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
32 |
|
2398 | 33 |
(* cannot lift yet *) |
34 |
thm eq_iff |
|
35 |
thm eq_iff_simps |
|
2361 | 36 |
|
2398 | 37 |
ML {* |
38 |
val thms_d = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms distinct} |
|
39 |
*} |
|
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
40 |
|
2398 | 41 |
ML {* |
42 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.inducts} |
|
43 |
*} |
|
44 |
||
45 |
ML {* |
|
46 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms fv_defs} |
|
47 |
*} |
|
48 |
||
49 |
ML {* |
|
50 |
val thms_i = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms trm_raw_assg_raw.size(9 - 16)} |
|
51 |
*} |
|
52 |
||
53 |
ML {* |
|
54 |
val thms_p = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_simps} |
|
55 |
*} |
|
56 |
||
57 |
ML {* |
|
58 |
val thms_f = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms perm_laws} |
|
59 |
*} |
|
60 |
||
61 |
||
62 |
section {* NOT *} |
|
63 |
||
2402 | 64 |
lemma [quot_respect]: |
65 |
"(alpha_assg_raw ===> alpha_assg_raw ===> op =) alpha_bn_raw alpha_bn_raw" |
|
66 |
"(op = ===> (alpha_trm_raw ===> op =) ===> prod_rel op = alpha_trm_raw ===> op =) prod_fv prod_fv" |
|
67 |
"((prod_rel op = alpha_trm_raw ===> prod_rel op = alpha_trm_raw ===> op =) ===> |
|
68 |
(alpha_trm_raw ===> alpha_trm_raw ===> op =) ===> |
|
69 |
prod_rel (prod_rel op = alpha_trm_raw) alpha_trm_raw ===> |
|
70 |
prod_rel (prod_rel op = alpha_trm_raw) alpha_trm_raw ===> op =) |
|
71 |
prod_alpha prod_alpha" |
|
72 |
"(op = ===> |
|
73 |
(alpha_trm_raw ===> alpha_trm_raw ===> op =) ===> |
|
74 |
prod_rel op = alpha_trm_raw ===> prod_rel op = alpha_trm_raw ===> op =) |
|
75 |
prod_alpha prod_alpha" |
|
76 |
"((prod_rel (prod_rel op = alpha_trm_raw) alpha_trm_raw ===> |
|
77 |
prod_rel (prod_rel op = alpha_trm_raw) alpha_trm_raw ===> op =) ===> |
|
78 |
(alpha_trm_raw ===> alpha_trm_raw ===> op =) ===> |
|
79 |
prod_rel (prod_rel (prod_rel op = alpha_trm_raw) alpha_trm_raw) alpha_trm_raw ===> |
|
80 |
prod_rel (prod_rel (prod_rel op = alpha_trm_raw) alpha_trm_raw) alpha_trm_raw ===> |
|
81 |
op =) |
|
82 |
prod_alpha prod_alpha" |
|
83 |
sorry |
|
84 |
||
85 |
thm eq_iff(5) |
|
86 |
thm eq_iff(5)[unfolded alphas permute_prod.simps] |
|
87 |
ML {* |
|
88 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) |
|
89 |
@{thms eq_iff(5)[unfolded alphas permute_prod.simps]} |
|
90 |
*} |
|
2397
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_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
|
94 |
*} |
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
95 |
|
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
96 |
ML {* |
2402 | 97 |
val thms_e = map (lift_thm [@{typ trm}, @{typ assg}] @{context}) @{thms eq_iff[unfolded alphas]} |
2397
c670a849af65
more experiments with lifting
Christian Urban <urbanc@in.tum.de>
parents:
2395
diff
changeset
|
98 |
*} |
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 |
thm perm_defs |
|
103 |
thm perm_simps |
|
104 |
||
105 |
lemma supp_fv: |
|
106 |
"supp t = fv_trm t" |
|
107 |
"supp b = fv_bn b" |
|
108 |
apply(induct t and b rule: i1) |
|
109 |
apply(simp_all add: f1) |
|
110 |
apply(simp_all add: supp_def) |
|
2365 | 111 |
apply(simp_all add: b1) |
112 |
sorry |
|
113 |
||
114 |
consts perm_bn_trm :: "perm \<Rightarrow> trm \<Rightarrow> trm" |
|
115 |
consts perm_bn_assg :: "perm \<Rightarrow> assg \<Rightarrow> assg" |
|
116 |
||
117 |
lemma y: |
|
118 |
"perm_bn_trm p (Var x) = (Var x)" |
|
119 |
"perm_bn_trm p (App t1 t2) = (App t1 t2)" |
|
120 |
"perm_bn_trm p (" |
|
121 |
||
122 |
||
2361 | 123 |
|
2336
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
124 |
typ trm |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
125 |
typ assg |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
126 |
|
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
127 |
thm trm_assg.fv |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
128 |
thm trm_assg.supp |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
129 |
thm trm_assg.eq_iff |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
130 |
thm trm_assg.bn |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
131 |
thm trm_assg.perm |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
132 |
thm trm_assg.induct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
133 |
thm trm_assg.inducts |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
134 |
thm trm_assg.distinct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
135 |
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
|
136 |
|
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
|
137 |
(* TEMPORARY |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
138 |
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
|
139 |
*) |
2064
2725853f43b9
solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents:
2028
diff
changeset
|
140 |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
141 |
end |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
142 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
143 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
144 |