author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Fri, 14 May 2010 10:28:42 +0200 | |
changeset 2132 | d74e08799b63 |
parent 2130 | 5111dadd1162 |
child 2133 | 16834a4ca1bb |
permissions | -rw-r--r-- |
2130
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory SingleLetFoo |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
imports "../NewParser" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
5 |
|
2132
d74e08799b63
SingleLetFoo with everything.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2130
diff
changeset
|
6 |
declare [[STEPS = 5]] |
2130
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
7 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
8 |
atom_decl name |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
10 |
nominal_datatype trm = |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
Var "name" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
12 |
| App "trm" "trm" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
| Lam x::"name" t::"trm" bind_set x in t |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
| Let a::"assg" t::"trm" bind_set "bn a" in t |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
| Foo1 a1::"assg" a2::"assg" t::"trm" bind_set "bn a1" "bn a2" in t |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
16 |
| Foo2 x::name a::"assg" t::"trm" bind_set x "bn a" in t |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
17 |
and assg = |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
18 |
As "name" "trm" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
19 |
binder |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
20 |
bn::"assg \<Rightarrow> atom set" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
21 |
where |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
22 |
"bn (As x t) = {atom x}" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
23 |
|
2132
d74e08799b63
SingleLetFoo with everything.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2130
diff
changeset
|
24 |
thm trm_assg.distinct |
d74e08799b63
SingleLetFoo with everything.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2130
diff
changeset
|
25 |
thm trm_assg.eq_iff |
d74e08799b63
SingleLetFoo with everything.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2130
diff
changeset
|
26 |
thm trm_assg.supp |
d74e08799b63
SingleLetFoo with everything.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2130
diff
changeset
|
27 |
thm trm_assg.perm |
d74e08799b63
SingleLetFoo with everything.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2130
diff
changeset
|
28 |
|
2130
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
29 |
thm permute_trm_raw_permute_assg_raw.simps |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
30 |
thm fv_trm_raw.simps fv_assg_raw.simps fv_bn_raw.simps[no_vars] |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
31 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
32 |
(* there is something wrong with the free variables *) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
33 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
34 |
text {* |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
35 |
thm alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros[no_vars] |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
36 |
*} |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
37 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
38 |
inductive |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
39 |
alpha_trm_raw and alpha_assg_raw and alpha_bn_raw |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
40 |
where |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
41 |
"name = namea \<Longrightarrow> alpha_trm_raw (Var_raw name) (Var_raw namea)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
42 |
| "\<lbrakk>alpha_trm_raw trm_raw1 trm_raw1a; alpha_trm_raw trm_raw2 trm_raw2a\<rbrakk> |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
43 |
\<Longrightarrow> alpha_trm_raw (App_raw trm_raw1 trm_raw2) (App_raw trm_raw1a trm_raw2a)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
44 |
| "\<exists>p. ({atom name}, trm_raw) \<approx>gen alpha_trm_raw fv_trm_raw p ({atom namea}, trm_rawa) \<Longrightarrow> |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
45 |
alpha_trm_raw (Lam_raw name trm_raw) (Lam_raw namea trm_rawa)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
46 |
| "\<lbrakk>\<exists>p. (bn_raw assg_raw, trm_raw) \<approx>gen alpha_trm_raw fv_trm_raw p (bn_raw assg_rawa, trm_rawa); |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
47 |
alpha_bn_raw assg_raw assg_rawa\<rbrakk> |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
48 |
\<Longrightarrow> alpha_trm_raw (Let_raw assg_raw trm_raw) (Let_raw assg_rawa trm_rawa)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
49 |
| "\<lbrakk>\<exists>p. (bn_raw assg_raw1 \<union> bn_raw ass_raw2, trm_raw) \<approx>gen alpha_trm_raw fv_trm_raw p |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
50 |
(bn_raw assg_raw1a \<union> bn_raw ass_raw2a, trm_rawa); |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
51 |
alpha_bn_raw assg_raw1 assg_raw1a; alpha_bn_raw assg_raw2 assg_raw2a\<rbrakk> |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
52 |
\<Longrightarrow> alpha_trm_raw (Foo1_raw assg_raw1 assg_raw2 trm_raw) (Foo1_raw assg_raw1a assg_raw2a trm_rawa)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
53 |
| "\<lbrakk>\<exists>p. ({atom name} \<union> bn_raw assg_raw, trm_raw) \<approx>gen alpha_trm_raw fv_trm_raw p |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
54 |
({atom namea} \<union> bn_raw assg_rawa, trm_rawa); |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
55 |
alpha_bn_raw assg_raw assg_rawa\<rbrakk> |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
56 |
\<Longrightarrow> alpha_trm_raw (Foo2_raw name assg_raw trm_raw) (Foo2_raw namea assg_rawa trm_rawa)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
57 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
58 |
| "\<lbrakk>name = namea; alpha_trm_raw trm_raw trm_rawa\<rbrakk> |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
59 |
\<Longrightarrow> alpha_assg_raw (As_raw name trm_raw) (As_raw namea trm_rawa)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
60 |
| "alpha_trm_raw trm_raw trm_rawa \<Longrightarrow> alpha_bn_raw (As_raw name trm_raw) (As_raw namea trm_rawa)" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
61 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
62 |
lemmas all = alpha_trm_raw_alpha_assg_raw_alpha_bn_raw.intros |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
63 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
64 |
lemma test: "p \<bullet> bn_raw \<equiv> bn_raw" sorry |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
65 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
66 |
lemma |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
67 |
assumes "distinct [x,y, z, u]" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
68 |
shows "alpha_trm_raw (Foo2_raw z (As_raw x (Var_raw z)) (Var_raw z)) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
69 |
(Foo2_raw u (As_raw y (Var_raw z)) (Var_raw u))" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
70 |
using assms |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
71 |
apply(rule_tac all) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
72 |
apply(rule_tac x="(z \<leftrightarrow> u) + (x \<leftrightarrow> y)" in exI) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
73 |
apply(simp only: alphas) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
74 |
apply(rule conjI) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
75 |
apply(simp) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
76 |
apply(simp add: supp_at_base fresh_star_def) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
77 |
apply(rule conjI) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
78 |
apply(simp add: supp_at_base fresh_star_def) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
79 |
apply(rule conjI) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
80 |
apply(simp) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
81 |
apply(rule all) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
82 |
apply(simp) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
83 |
unfolding flip_def |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
84 |
apply(perm_simp add: test) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
85 |
unfolding flip_def[symmetric] |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
86 |
apply(simp) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
87 |
apply(subst flip_at_base_simps(3)) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
88 |
apply(auto)[2] |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
89 |
apply(simp) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
90 |
apply(rule all) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
91 |
apply(rule all) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
92 |
apply(simp) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
93 |
done |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
94 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
95 |
lemma |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
96 |
assumes "distinct [x,y,z,u]" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
97 |
shows "fv_trm_raw (Foo2_raw z (As_raw x (Var_raw z)) (Var_raw z)) = {atom z}" |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
98 |
using assms |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
99 |
apply(simp add: supp_at_base) |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
100 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
101 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
102 |
end |
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
103 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
104 |
|
5111dadd1162
added a more instructive example - has some problems with fv though
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
105 |