author | Christian Urban <urbanc@in.tum.de> |
Sun, 29 Aug 2010 12:14:40 +0800 | |
changeset 2452 | 39f8d405d7a2 |
parent 2451 | d2e929f51fa9 |
child 2454 | 9ffee4eb1ae1 |
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 |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
7 |
declare [[STEPS = 100]] |
2294
72ad4e766acf
properly exported bn_descr
Christian Urban <urbanc@in.tum.de>
parents:
2293
diff
changeset
|
8 |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
9 |
nominal_datatype single_let: 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" |
2424
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2410
diff
changeset
|
12 |
| Lam x::"name" t::"trm" bind x in t |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2410
diff
changeset
|
13 |
| Let a::"assg" t::"trm" bind (set) "bn a" in t |
621ebd8b13c4
changed parser so that the binding mode is indicated as "bind (list)", "bind (set)" or "bind (res)"; if only "bind" is given, then bind (list) is assumed as default
Christian Urban <urbanc@in.tum.de>
parents:
2410
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 |
|
2448 | 24 |
thm Ball_def Bex_def mem_def |
25 |
||
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
26 |
thm single_let.distinct |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
27 |
thm single_let.induct |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
28 |
thm single_let.exhaust |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
29 |
thm single_let.fv_defs |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
30 |
thm single_let.bn_defs |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
31 |
thm single_let.perm_simps |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
32 |
thm single_let.eq_iff |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
33 |
thm single_let.fv_bn_eqvt |
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
34 |
thm single_let.size_eqvt |
2448 | 35 |
thm single_let.supports |
2450
217ef3e4282e
added proofs for fsupp properties
Christian Urban <urbanc@in.tum.de>
parents:
2449
diff
changeset
|
36 |
thm single_let.fsupp |
2430
a746d49b0240
updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents:
2428
diff
changeset
|
37 |
|
2450
217ef3e4282e
added proofs for fsupp properties
Christian Urban <urbanc@in.tum.de>
parents:
2449
diff
changeset
|
38 |
|
2448 | 39 |
|
40 |
||
41 |
||
42 |
lemma test: |
|
43 |
"(\<exists>p. (bs, x) \<approx>lst (op=) f p (cs, y)) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>lst (op=) supp p (cs, y))" |
|
2452 | 44 |
sorry |
2448 | 45 |
|
46 |
lemma Abs_eq_iff: |
|
47 |
shows "Abs bs x = Abs cs y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>gen (op =) supp p (cs, y))" |
|
48 |
and "Abs_res bs x = Abs_res cs y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>res (op =) supp p (cs, y))" |
|
49 |
and "Abs_lst bsl x = Abs_lst csl y \<longleftrightarrow> (\<exists>p. (bsl, x) \<approx>lst (op =) supp p (csl, y))" |
|
50 |
by (lifting alphas_abs) |
|
51 |
||
2361 | 52 |
lemma supp_fv: |
2448 | 53 |
"supp t = fv_trm t \<and> supp b = fv_bn b" |
54 |
apply(rule single_let.induct) |
|
55 |
apply(simp_all only: single_let.fv_defs)[2] |
|
56 |
apply(simp_all only: supp_def)[2] |
|
57 |
apply(simp_all only: single_let.perm_simps)[2] |
|
58 |
apply(simp_all only: single_let.eq_iff)[2] |
|
59 |
apply(simp_all only: de_Morgan_conj)[2] |
|
60 |
apply(simp_all only: Collect_disj_eq)[2] |
|
61 |
apply(simp_all only: finite_Un)[2] |
|
62 |
apply(simp_all only: de_Morgan_conj)[2] |
|
63 |
apply(simp_all only: Collect_disj_eq)[2] |
|
64 |
apply(subgoal_tac "supp (Lam name trm) = supp (Abs_lst [atom name] trm)") |
|
65 |
apply(simp only: single_let.fv_defs) |
|
66 |
apply(simp only: supp_abs) |
|
2452 | 67 |
apply(simp) |
2448 | 68 |
apply(simp (no_asm) only: supp_def) |
69 |
apply(simp only: single_let.perm_simps) |
|
70 |
apply(simp only: single_let.eq_iff) |
|
2452 | 71 |
apply(simp only: permute_abs atom_eqvt permute_list.simps) |
72 |
apply(simp only: Abs_eq_iff) |
|
2448 | 73 |
apply(subst test) |
2452 | 74 |
apply(rule refl) |
2365 | 75 |
sorry |
2452 | 76 |
|
2448 | 77 |
(* |
2365 | 78 |
consts perm_bn_trm :: "perm \<Rightarrow> trm \<Rightarrow> trm" |
79 |
consts perm_bn_assg :: "perm \<Rightarrow> assg \<Rightarrow> assg" |
|
80 |
||
81 |
lemma y: |
|
82 |
"perm_bn_trm p (Var x) = (Var x)" |
|
83 |
"perm_bn_trm p (App t1 t2) = (App t1 t2)" |
|
84 |
"perm_bn_trm p (" |
|
85 |
||
86 |
||
2361 | 87 |
|
2336
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
88 |
typ trm |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
89 |
typ assg |
f2d545b77b31
added definition of the quotient types
Christian Urban <urbanc@in.tum.de>
parents:
2330
diff
changeset
|
90 |
|
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
91 |
thm trm_assg.fv |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
92 |
thm trm_assg.supp |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
93 |
thm trm_assg.eq_iff |
1911
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
94 |
thm trm_assg.bn |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
95 |
thm trm_assg.perm |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
96 |
thm trm_assg.induct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
97 |
thm trm_assg.inducts |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
98 |
thm trm_assg.distinct |
60b5c61d3de2
renamed Ex1.thy to SingleLet.thy
Christian Urban <urbanc@in.tum.de>
parents:
1773
diff
changeset
|
99 |
ML {* Sign.of_sort @{theory} (@{typ trm}, @{sort fs}) *} |
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
100 |
*) |
2024
d974059827ad
Equivariance fails for single let?
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1911
diff
changeset
|
101 |
|
2436
3885dc2669f9
cleaned up (almost completely) the examples
Christian Urban <urbanc@in.tum.de>
parents:
2434
diff
changeset
|
102 |
|
2064
2725853f43b9
solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents:
2028
diff
changeset
|
103 |
|
1596
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
104 |
end |
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
105 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
106 |
|
c69d9fb16785
Move Ex1 and Ex2 out of Test
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
107 |