author | Christian Urban <urbanc@in.tum.de> |
Wed, 08 Dec 2010 12:37:25 +0000 | |
changeset 2600 | ca6b4bc7a871 |
parent 2599 | d6fe94028a5d |
child 2602 | bcf558c445a4 |
permissions | -rw-r--r-- |
2573 | 1 |
theory Foo2 |
2 |
imports "../Nominal2" |
|
3 |
begin |
|
4 |
||
5 |
(* |
|
6 |
Contrived example that has more than one |
|
7 |
binding clause |
|
8 |
*) |
|
9 |
||
10 |
atom_decl name |
|
11 |
||
12 |
nominal_datatype foo: trm = |
|
13 |
Var "name" |
|
14 |
| App "trm" "trm" |
|
15 |
| Lam x::"name" t::"trm" bind x in t |
|
16 |
| Let1 a1::"assg" t1::"trm" a2::"assg" t2::"trm" bind "bn a1" in t1, bind "bn a2" in t2 |
|
17 |
| Let2 x::"name" y::"name" t1::"trm" t2::"trm" bind x y in t1, bind y in t2 |
|
18 |
and assg = |
|
19 |
As_Nil |
|
20 |
| As "name" x::"name" t::"trm" "assg" |
|
21 |
binder |
|
22 |
bn::"assg \<Rightarrow> atom list" |
|
23 |
where |
|
24 |
"bn (As x y t a) = [atom x] @ bn a" |
|
25 |
| "bn (As_Nil) = []" |
|
26 |
||
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
27 |
thm foo.bn_defs |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
28 |
thm foo.permute_bn |
2593
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2592
diff
changeset
|
29 |
thm foo.perm_bn_alpha |
2573 | 30 |
thm foo.perm_bn_simps |
2593
25dcb2b1329e
ordered raw_bn_info to agree with the order of the raw_bn_functions; started alpha_bn proof
Christian Urban <urbanc@in.tum.de>
parents:
2592
diff
changeset
|
31 |
thm foo.bn_finite |
2573 | 32 |
|
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
33 |
|
2573 | 34 |
thm foo.distinct |
35 |
thm foo.induct |
|
36 |
thm foo.inducts |
|
37 |
thm foo.exhaust |
|
38 |
thm foo.fv_defs |
|
39 |
thm foo.bn_defs |
|
40 |
thm foo.perm_simps |
|
2575
b1d38940040a
single rename in let2
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2573
diff
changeset
|
41 |
thm foo.eq_iff(5) |
2573 | 42 |
thm foo.fv_bn_eqvt |
43 |
thm foo.size_eqvt |
|
44 |
thm foo.supports |
|
45 |
thm foo.fsupp |
|
46 |
thm foo.supp |
|
47 |
thm foo.fresh |
|
48 |
||
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
49 |
|
2586
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2585
diff
changeset
|
50 |
|
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
51 |
|
2590
98dc38c250bb
added abs_rename_res lemma
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
52 |
|
2586
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2585
diff
changeset
|
53 |
|
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
54 |
(* |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
55 |
thm at_set_avoiding1[THEN exE] |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
56 |
|
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
57 |
|
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
58 |
lemma Let1_rename: |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
59 |
fixes c::"'a::fs" |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
60 |
shows "\<exists>name' trm'. {atom name'} \<sharp>* c \<and> Lam name trm = Lam name' trm'" |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
61 |
apply(simp only: foo.eq_iff) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
62 |
apply(rule at_set_avoiding1[where c="(c, atom name, trm)" and xs="set [atom name]", THEN exE]) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
63 |
apply(simp) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
64 |
apply(simp add: finite_supp) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
65 |
apply(perm_simp) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
66 |
apply(rule Abs_rename_list[THEN exE]) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
67 |
apply(simp only: set_eqvt) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
68 |
apply |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
69 |
sorry |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
70 |
*) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
71 |
|
2600
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
72 |
thm foo.exhaust |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
73 |
|
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
74 |
ML {* |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
75 |
fun strip_prems_concl trm = |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
76 |
(Logic.strip_imp_prems trm, Logic.strip_imp_concl trm) |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
77 |
*} |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
78 |
|
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
79 |
|
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
80 |
ML {* |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
81 |
@{thms foo.exhaust} |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
82 |
|> map prop_of |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
83 |
|> map strip_prems_concl |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
84 |
|> map fst |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
85 |
|> map (map (Syntax.string_of_term @{context})) |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
86 |
|> map cat_lines |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
87 |
|> cat_lines |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
88 |
|> writeln |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
89 |
*} |
ca6b4bc7a871
kept the nested structure of constructors (belonging to one datatype)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
90 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
91 |
lemma test6: |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
92 |
fixes c::"'a::fs" |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
93 |
assumes "\<exists>name. y = Var name \<Longrightarrow> P" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
94 |
and "\<exists>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P" |
2592
98236fbd8aa6
updated to Isabelle 2nd December
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
95 |
and "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
96 |
and "\<exists>a1 trm1 a2 trm2. ((set (bn a1)) \<union> (set (bn a2))) \<sharp>* c \<and> y = Let1 a1 trm1 a2 trm2 \<Longrightarrow> P" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
97 |
and "\<exists>x1 x2 trm1 trm2. {atom x1, atom x2} \<sharp>* c \<and> y = Let2 x1 x2 trm1 trm2 \<Longrightarrow> P" |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
98 |
shows "P" |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
99 |
apply(rule_tac y="y" in foo.exhaust(1)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
100 |
apply(rule assms(1)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
101 |
apply(rule exI)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
102 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
103 |
apply(rule assms(2)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
104 |
apply(rule exI)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
105 |
apply(assumption) |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
106 |
(* lam case *) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
107 |
(* |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
108 |
apply(rule Let1_rename) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
109 |
apply(rule assms(3)) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
110 |
apply(assumption) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
111 |
apply(simp) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
112 |
*) |
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
113 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
114 |
apply(subgoal_tac "\<exists>p. (p \<bullet> {atom name}) \<sharp>* (c, [atom name], trm)") |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
115 |
apply(erule exE) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
116 |
apply(insert Abs_rename_list)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
117 |
apply(drule_tac x="p" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
118 |
apply(drule_tac x="[atom name]" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
119 |
apply(drule_tac x="trm" in meta_spec) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
120 |
apply(simp only: fresh_star_Pair set.simps) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
121 |
apply(drule meta_mp) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
122 |
apply(simp) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
123 |
apply(erule exE) |
2592
98236fbd8aa6
updated to Isabelle 2nd December
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
124 |
apply(rule assms(3)) |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
125 |
apply(perm_simp) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
126 |
apply(erule conjE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
127 |
apply(assumption) |
2592
98236fbd8aa6
updated to Isabelle 2nd December
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
128 |
apply(clarify) |
98236fbd8aa6
updated to Isabelle 2nd December
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
129 |
apply(simp (no_asm) add: foo.eq_iff) |
98236fbd8aa6
updated to Isabelle 2nd December
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
130 |
apply(perm_simp) |
98236fbd8aa6
updated to Isabelle 2nd December
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
131 |
apply(assumption) |
2589
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
132 |
apply(rule at_set_avoiding1) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
133 |
apply(simp) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
134 |
apply(simp add: finite_supp) |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
135 |
(* let1 case *) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
136 |
apply(subgoal_tac "\<exists>p. (p \<bullet> ((set (bn assg1)) \<union> (set (bn assg2)))) \<sharp>* (c, bn assg1, bn assg2, trm1, trm2)") |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
137 |
apply(erule exE) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
138 |
apply(rule assms(4)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
139 |
apply(simp only: foo.eq_iff) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
140 |
apply(insert Abs_rename_list)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
141 |
apply(drule_tac x="p" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
142 |
apply(drule_tac x="bn assg1" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
143 |
apply(drule_tac x="trm1" in meta_spec) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
144 |
apply(insert Abs_rename_list)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
145 |
apply(drule_tac x="p" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
146 |
apply(drule_tac x="bn assg2" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
147 |
apply(drule_tac x="trm2" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
148 |
apply(drule meta_mp) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
149 |
apply(simp only: union_eqvt fresh_star_Pair set.simps fresh_star_Un, simp) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
150 |
apply(drule meta_mp) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
151 |
apply(simp only: union_eqvt fresh_star_Pair set.simps fresh_star_Un, simp) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
152 |
apply(erule exE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
153 |
apply(rule exI)+ |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
154 |
apply(perm_simp add: foo.permute_bn) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
155 |
apply(rule conjI) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
156 |
apply(simp add: fresh_star_Pair fresh_star_Un) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
157 |
apply(erule conjE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
158 |
apply(rule conjI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
159 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
160 |
apply(rotate_tac 4) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
161 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
162 |
apply(rule conjI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
163 |
apply(assumption) |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
164 |
apply(rule conjI) |
2594
515e5496171c
automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2593
diff
changeset
|
165 |
apply(rule foo.perm_bn_alpha) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
166 |
apply(rule conjI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
167 |
apply(assumption) |
2594
515e5496171c
automated alpha_perm_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2593
diff
changeset
|
168 |
apply(rule foo.perm_bn_alpha) |
2589
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
169 |
apply(rule at_set_avoiding1) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
170 |
apply(simp) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
171 |
apply(simp add: finite_supp) |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
172 |
(* let2 case *) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
173 |
apply(subgoal_tac "\<exists>p. (p \<bullet> ({atom name1} \<union> {atom name2})) \<sharp>* (c, atom name1, atom name2, trm1, trm2)") |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
174 |
apply(erule exE) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
175 |
apply(rule assms(5)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
176 |
apply(simp only:) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
177 |
apply(simp only: foo.eq_iff) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
178 |
apply(insert Abs_rename_list)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
179 |
apply(drule_tac x="p" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
180 |
apply(drule_tac x="[atom name1] @ [atom name2]" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
181 |
apply(drule_tac x="trm1" in meta_spec) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
182 |
apply(insert Abs_rename_list)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
183 |
apply(drule_tac x="p" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
184 |
apply(drule_tac x="[atom name2]" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
185 |
apply(drule_tac x="trm2" in meta_spec) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
186 |
apply(drule meta_mp) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
187 |
apply(simp only: union_eqvt fresh_star_Pair fresh_star_list fresh_star_Un, simp) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
188 |
apply(auto)[1] |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
189 |
apply(perm_simp) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
190 |
apply(auto simp add: fresh_star_def)[1] |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
191 |
apply(perm_simp) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
192 |
apply(auto simp add: fresh_star_def)[1] |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
193 |
apply(perm_simp) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
194 |
apply(auto simp add: fresh_star_def)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
195 |
apply(drule meta_mp) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
196 |
apply(perm_simp) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
197 |
apply(auto simp add: fresh_star_def fresh_Pair fresh_Nil fresh_Cons)[1] |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
198 |
apply(erule exE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
199 |
apply(rule exI)+ |
2598
b136721eedb2
automated permute_bn theorems
Christian Urban <urbanc@in.tum.de>
parents:
2594
diff
changeset
|
200 |
apply(perm_simp add: foo.permute_bn) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
201 |
apply(rule conjI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
202 |
prefer 2 |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
203 |
apply(rule conjI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
204 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
205 |
apply(assumption) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2590
diff
changeset
|
206 |
apply(simp add: fresh_star_Pair) |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
207 |
apply(simp add: fresh_star_def) |
2589
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
208 |
apply(rule at_set_avoiding1) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
209 |
apply(simp) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
210 |
apply(simp add: finite_supp) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
211 |
done |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
212 |
|
2585
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
213 |
lemma test5: |
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
214 |
fixes c::"'a::fs" |
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
215 |
assumes "\<And>name. y = Var name \<Longrightarrow> P" |
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
216 |
and "\<And>trm1 trm2. y = App trm1 trm2 \<Longrightarrow> P" |
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
217 |
and "\<And>name trm. \<lbrakk>{atom name} \<sharp>* c; y = Lam name trm\<rbrakk> \<Longrightarrow> P" |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
218 |
and "\<And>a1 trm1 a2 trm2. \<lbrakk>((set (bn a1)) \<union> (set (bn a2))) \<sharp>* c; y = Let1 a1 trm1 a2 trm2\<rbrakk> \<Longrightarrow> P" |
2585
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
219 |
and "\<And>x1 x2 trm1 trm2. \<lbrakk>{atom x1, atom x2} \<sharp>* c; y = Let2 x1 x2 trm1 trm2\<rbrakk> \<Longrightarrow> P" |
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
220 |
shows "P" |
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
221 |
apply(rule_tac y="y" in test6) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
222 |
apply(erule exE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
223 |
apply(rule assms(1)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
224 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
225 |
apply(erule exE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
226 |
apply(rule assms(2)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
227 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
228 |
apply(rule assms(3)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
229 |
apply(auto)[2] |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
230 |
apply(erule exE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
231 |
apply(rule assms(4)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
232 |
apply(auto)[2] |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
233 |
apply(erule exE)+ |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
234 |
apply(rule assms(5)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
235 |
apply(auto)[2] |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
236 |
done |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
237 |
|
2585
385add25dedf
slightly simplified the Foo2 tests and hint at a general lemma
Christian Urban <urbanc@in.tum.de>
parents:
2584
diff
changeset
|
238 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
239 |
lemma strong_induct: |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
240 |
fixes c :: "'a :: fs" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
241 |
and assg :: assg and trm :: trm |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
242 |
assumes a0: "\<And>name c. P1 c (Var name)" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
243 |
and a1: "\<And>trm1 trm2 c. \<lbrakk>\<And>d. P1 d trm1; \<And>d. P1 d trm2\<rbrakk> \<Longrightarrow> P1 c (App trm1 trm2)" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
244 |
and a2: "\<And>name trm c. (\<And>d. P1 d trm) \<Longrightarrow> P1 c (Lam name trm)" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
245 |
and a3: "\<And>a1 t1 a2 t2 c. |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
246 |
\<lbrakk>((set (bn a1)) \<union> (set (bn a2))) \<sharp>* c; \<And>d. P2 c a1; \<And>d. P1 d t1; \<And>d. P2 d a2; \<And>d. P1 d t2\<rbrakk> |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
247 |
\<Longrightarrow> P1 c (Let1 a1 t1 a2 t2)" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
248 |
and a4: "\<And>n1 n2 t1 t2 c. |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
249 |
\<lbrakk>{atom n1, atom n2} \<sharp>* c; \<And>d. P1 d t1; \<And>d. P1 d t2\<rbrakk> \<Longrightarrow> P1 c (Let2 n1 n2 t1 t2)" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
250 |
and a5: "\<And>c. P2 c As_Nil" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
251 |
and a6: "\<And>name1 name2 trm assg c. \<lbrakk>\<And>d. P1 d trm; \<And>d. P2 d assg\<rbrakk> \<Longrightarrow> P2 c (As name1 name2 trm assg)" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
252 |
shows "P1 c trm" "P2 c assg" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
253 |
using assms |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
254 |
apply(induction_schema) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
255 |
apply(rule_tac y="trm" and c="c" in test5) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
256 |
apply(simp_all)[5] |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
257 |
apply(rule_tac y="assg" in foo.exhaust(2)) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
258 |
apply(simp_all)[2] |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
259 |
apply(relation "measure (sum_case (size o snd) (size o snd))") |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
260 |
apply(simp_all add: foo.size) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
261 |
done |
2584
1eac050a36f4
completely different method fro deriving the exhaust lemma
Christian Urban <urbanc@in.tum.de>
parents:
2579
diff
changeset
|
262 |
|
2573 | 263 |
end |
264 |
||
265 |
||
266 |