author | wenzelm |
Tue, 30 May 2000 16:08:38 +0200 | |
changeset 9000 | c20d58286a51 |
parent 8442 | 96023903c2df |
permissions | -rw-r--r-- |
8388 | 1 |
Goal "\\<forall> n. length (option_filter_n l P n) = length l"; |
2 |
by (induct_tac "l" 1); |
|
3 |
by Auto_tac; |
|
4 |
qed_spec_mp "length_option_filter_n"; |
|
5 |
||
6 |
Goalw[is_approx_def] "\\<forall> n. is_approx (option_filter_n a P n) a"; |
|
7 |
by (induct_tac "a" 1); |
|
8 |
by (Clarsimp_tac 1); |
|
9 |
by (Clarsimp_tac 1); |
|
8423 | 10 |
by (case_tac "P n" 1); |
8388 | 11 |
by (Clarsimp_tac 1); |
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
12 |
by (case_tac "na" 1); |
8388 | 13 |
by (Clarsimp_tac 1); |
14 |
by (clarsimp_tac (claset(), simpset() addsimps [length_option_filter_n]) 1); |
|
15 |
by (Force_tac 1); |
|
16 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
17 |
by (case_tac "na" 1); |
8388 | 18 |
by (Clarsimp_tac 1); |
19 |
by (force_tac (claset(), simpset() addsimps [length_option_filter_n]) 1); |
|
20 |
qed_spec_mp "is_approx_option_filter_n"; |
|
21 |
||
22 |
Goalw[option_filter_def] "is_approx (option_filter l P) l"; |
|
23 |
by (simp_tac (simpset() addsimps [is_approx_option_filter_n]) 1); |
|
24 |
qed "is_approx_option_filter"; |
|
25 |
||
26 |
||
27 |
Goal "\\<forall>n n'. n < length l \\<longrightarrow> P (n+n') \\<longrightarrow> option_filter_n l P n' ! n = Some (l!n)"; |
|
28 |
by (induct_tac "l" 1); |
|
29 |
by (Simp_tac 1); |
|
30 |
by (Clarify_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
31 |
by (case_tac "n" 1); |
8388 | 32 |
by (Clarsimp_tac 1); |
33 |
by (Clarsimp_tac 1); |
|
34 |
qed_spec_mp "option_filter_n_Some"; |
|
35 |
||
36 |
Goalw [option_filter_def] |
|
37 |
"\\<lbrakk>n < length l; P n\\<rbrakk> \\<Longrightarrow> option_filter l P ! n = Some (l!n)"; |
|
38 |
br option_filter_n_Some 1; |
|
39 |
ba 1; |
|
40 |
by (Asm_simp_tac 1); |
|
41 |
qed "option_filter_Some"; |
|
42 |
||
43 |
Goal "\\<lbrakk>length ins < length phi; pc < length ins\\<rbrakk> \\<Longrightarrow> \ |
|
44 |
\ contains_dead ins (option_filter phi (mdot ins)) phi pc"; |
|
45 |
by (asm_full_simp_tac (simpset() addsimps [contains_dead_def]) 1); |
|
46 |
br conjI 1; |
|
47 |
br conjI 2; |
|
48 |
by (ALLGOALS (Clarsimp_tac |
|
49 |
THEN' (rtac option_filter_Some) |
|
50 |
THEN' Asm_simp_tac |
|
51 |
THEN' (clarsimp_tac (claset(), simpset() addsimps [mdot_def,maybe_dead_def])))); |
|
52 |
qed "option_filter_contains_dead"; |
|
53 |
||
54 |
Goal "\\<lbrakk>length ins < length phi; pc < length ins\\<rbrakk> \\<Longrightarrow> \ |
|
55 |
\ contains_targets ins (option_filter phi (mdot ins)) phi pc"; |
|
56 |
by (asm_full_simp_tac (simpset() addsimps [contains_targets_def]) 1); |
|
57 |
by (Clarsimp_tac 1); |
|
58 |
br conjI 1; |
|
59 |
by (ALLGOALS (Clarsimp_tac |
|
60 |
THEN' (rtac option_filter_Some) |
|
61 |
THEN' Asm_simp_tac |
|
62 |
THEN' (asm_full_simp_tac (simpset() addsimps [mdot_def,is_target_def])) |
|
63 |
THEN' Force_tac)); |
|
64 |
qed "option_filter_contains_targets"; |
|
65 |
||
66 |
Goalw[fits_def, make_cert_def] "length ins < length phi \\<Longrightarrow> fits ins (make_cert ins phi) phi"; |
|
67 |
by (Clarsimp_tac 1); |
|
68 |
br conjI 1; |
|
69 |
br is_approx_option_filter 1; |
|
70 |
by (Clarsimp_tac 1); |
|
71 |
br conjI 1; |
|
72 |
br option_filter_contains_dead 1; |
|
73 |
ba 1; |
|
74 |
ba 1; |
|
75 |
br option_filter_contains_targets 1; |
|
76 |
ba 1; |
|
77 |
ba 1; |
|
78 |
qed "fits_make_cert"; |
|
79 |
||
80 |
||
81 |
Goal "\\<exists>a'. a = rev a'"; |
|
82 |
by (induct_tac "a" 1); |
|
83 |
by (Simp_tac 1); |
|
84 |
by (Clarsimp_tac 1); |
|
85 |
by (res_inst_tac [("x","a'@[a]")] exI 1); |
|
86 |
by (Simp_tac 1); |
|
87 |
qed "rev_surj"; |
|
88 |
||
89 |
Goal "\\<forall>n. n \\<le> length x \\<longrightarrow> (\\<exists>a b. x = a@b \\<and> length a = n)"; |
|
90 |
by (induct_tac "x" 1); |
|
91 |
by (Simp_tac 1); |
|
92 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
93 |
by (case_tac "n" 1); |
8388 | 94 |
by (Clarsimp_tac 1); |
95 |
by (Clarsimp_tac 1); |
|
96 |
by (smp_tac 1 1); |
|
97 |
by (Clarsimp_tac 1); |
|
98 |
by (res_inst_tac [("x","a#aa")] exI 1); |
|
99 |
by (Simp_tac 1); |
|
100 |
qed_spec_mp "append_length_n"; |
|
101 |
||
102 |
Goal "\\<lbrakk>n < length x\\<rbrakk> \\<Longrightarrow> \\<exists>a b c. x = (rev a) @ b # c \\<and> length a = n"; |
|
103 |
by (subgoal_tac "n \\<le> length x" 1); |
|
104 |
by (Asm_full_simp_tac 2); |
|
105 |
by (forward_tac [append_length_n] 1); |
|
106 |
by (Clarsimp_tac 1); |
|
107 |
by (cut_inst_tac [("xs","b")] neq_Nil_conv 1); |
|
108 |
by (Clarsimp_tac 1); |
|
109 |
by (cut_inst_tac [("a","a")] rev_surj 1); |
|
110 |
by (Clarsimp_tac 1); |
|
111 |
by (res_inst_tac [("x","a'")] exI 1); |
|
112 |
by (Clarsimp_tac 1); |
|
113 |
qed "rev_append_cons"; |
|
114 |
||
115 |
||
116 |
Goal "G \\<turnstile> b \\<preceq> NT \\<Longrightarrow> b = NT"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
117 |
by (case_tac "b" 1); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
118 |
by (case_tac "ref_ty" 2); |
8388 | 119 |
by Auto_tac; |
120 |
qed "widen_NT"; |
|
121 |
||
122 |
Goal "G \\<turnstile> b \\<preceq> Class C \\<Longrightarrow> \\<exists>r. b = RefT r"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
123 |
by (case_tac "b" 1); |
8388 | 124 |
by Auto_tac; |
125 |
qed "widen_Class"; |
|
126 |
||
127 |
||
128 |
Goal "\\<forall>b. length a = length b \\<longrightarrow> (\\<forall>x\\<in>set (zip a b). x \\<in> widen G) = (G \\<turnstile> (map Some a) <=l (map Some b))"; |
|
129 |
by (induct_tac "a" 1); |
|
130 |
by (Clarsimp_tac 1); |
|
131 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
132 |
by (case_tac "b" 1); |
8388 | 133 |
by (Clarsimp_tac 1); |
134 |
by (Clarsimp_tac 1); |
|
135 |
qed_spec_mp "all_widen_is_sup_loc"; |
|
136 |
||
137 |
Goal "\\<lbrakk>fits ins cert phi; i = ins!pc; i = MI meth_inv; pc < length ins; \ |
|
138 |
\ wf_prog wf_mb G; \ |
|
139 |
\ G \\<turnstile> (x, y) <=s s1; wtl_inst i G rT s1 s1' cert mpc pc\\<rbrakk> \ |
|
140 |
\ \\<Longrightarrow> \\<exists>s2'. wtl_inst i G rT (x, y) s2' cert mpc pc \\<and> \ |
|
141 |
\ ((G \\<turnstile> s2' <=s s1') \\<or> (\\<exists> s. cert ! (Suc pc) = Some s \\<and> (G \\<turnstile> s2' <=s s)))"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
142 |
by (case_tac "meth_inv" 1); |
8388 | 143 |
by (Clarsimp_tac 1); |
144 |
by (cut_inst_tac [("x","x"),("n","length apTs")] rev_append_cons 1); |
|
145 |
by (asm_full_simp_tac (simpset() addsimps [sup_state_length_fst]) 1); |
|
146 |
by (Clarify_tac 1); |
|
147 |
by (subgoal_tac "length (rev aa) = length (rev apTs)" 1); |
|
148 |
by (Asm_full_simp_tac 2); |
|
149 |
by (dres_inst_tac [("G","G"),("x","ba#c"),("i","y"),("j","ya"),("y","X#ST'")] sup_state_append_fst 1); |
|
150 |
back(); |
|
151 |
back(); |
|
152 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_rev_fst,sup_state_Cons1]) 1); |
|
8423 | 153 |
by (case_tac "X = NT" 1); |
8388 | 154 |
by (Clarsimp_tac 1); |
155 |
by (res_inst_tac [("x","a")] exI 1); |
|
156 |
by (res_inst_tac [("x","b")] exI 1); |
|
157 |
by (Asm_full_simp_tac 1); |
|
158 |
by (res_inst_tac [("x","aa")] exI 1); |
|
159 |
by (asm_full_simp_tac (simpset() addsimps [widen_NT]) 1); |
|
160 |
by (Asm_full_simp_tac 1); |
|
161 |
by (strip_tac1 1); |
|
162 |
by (forward_tac [widen_Class] 1); |
|
163 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
164 |
by (case_tac "r" 1); |
8388 | 165 |
by (Clarsimp_tac 1); |
166 |
by (res_inst_tac [("x","a")] exI 1); |
|
167 |
by (res_inst_tac [("x","b")] exI 1); |
|
168 |
by (Clarsimp_tac 1); |
|
169 |
by (res_inst_tac [("x","aa")] exI 1); |
|
170 |
by (clarsimp_tac (claset(), simpset() addsimps [fits_def]) 1); |
|
171 |
by (Clarsimp_tac 1); |
|
172 |
bd subcls_widen_methd 1; |
|
173 |
ba 1; |
|
174 |
ba 1; |
|
175 |
by (Clarify_tac 1); |
|
176 |
by (res_inst_tac [("x","rT'#c")] exI 1); |
|
177 |
by (res_inst_tac [("x","y")] exI 1); |
|
178 |
by (Asm_full_simp_tac 1); |
|
179 |
by (subgoal_tac "\\<exists>a b. cert ! Suc pc = Some (a, b) \\<and> G \\<turnstile> (rT' # c, y) <=s (a, b)" 1); |
|
180 |
by (Clarsimp_tac 1); |
|
181 |
by (res_inst_tac [("x","aa")] exI 1); |
|
182 |
by (Asm_full_simp_tac 1); |
|
183 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_def, all_widen_is_sup_loc]) 1); |
|
184 |
br sup_loc_trans 1; |
|
185 |
ba 1; |
|
186 |
ba 1; |
|
187 |
by (Clarsimp_tac 1); |
|
188 |
by (subgoal_tac "G \\<turnstile> (rT' # c, y) <=s (rT # ST', ya)" 1); |
|
189 |
br sup_state_trans 1; |
|
190 |
ba 1; |
|
191 |
ba 1; |
|
192 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); |
|
193 |
qed "method_inv_pseudo_mono"; |
|
194 |
||
195 |
||
196 |
||
197 |
Goalw[sup_loc_def] "\\<forall> y n. (G \\<turnstile> b <=l y) \\<longrightarrow> n < length y \\<longrightarrow> y!n = Some t \\<longrightarrow> (\\<exists>t. b!n = Some t \\<and> (G \\<turnstile> (b!n) <=o (y!n)))"; |
|
198 |
by (induct_tac "b" 1); |
|
199 |
by (Simp_tac 1); |
|
200 |
by (clarsimp_tac (claset(), simpset() addsimps [list_all2_Cons1]) 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
201 |
by (case_tac "n" 1); |
8388 | 202 |
by (asm_full_simp_tac (simpset() addsimps [sup_ty_opt_some]) 1); |
203 |
by (smp_tac 1 1); |
|
204 |
by (Asm_full_simp_tac 1); |
|
205 |
qed_spec_mp "sup_loc_some"; |
|
206 |
||
207 |
||
208 |
Goalw[sup_state_def] |
|
209 |
"\\<lbrakk>G \\<turnstile> (a, b) <=s (x, y); n < length y; y!n = Some t\\<rbrakk>\ |
|
210 |
\ \\<Longrightarrow> \\<exists>ts. b!n = Some ts \\<and> G \\<turnstile> (ts#a, b) <=s (t#x, y)"; |
|
211 |
by (Clarsimp_tac 1); |
|
212 |
by (datac sup_loc_some 2 1); |
|
213 |
by (Clarsimp_tac 1); |
|
214 |
qed "mono_load"; |
|
215 |
||
216 |
||
217 |
Goalw[sup_state_def] |
|
218 |
"\\<lbrakk>G \\<turnstile> (a, b) <=s (ts # ST', y); n < length y\\<rbrakk> \\<Longrightarrow> \ |
|
219 |
\ \\<exists> t a'. a = t#a' \\<and> G \\<turnstile> (a', b[n := Some t]) <=s (ST', y[n := Some ts])"; |
|
220 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_loc_Cons2]) 1); |
|
221 |
by (forward_tac [map_hd_tl] 1); |
|
222 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_loc_update]) 1); |
|
223 |
qed "mono_store"; |
|
224 |
||
225 |
Goal "(G \\<turnstile> xb \\<preceq> PrimT p) = (xb = PrimT p)"; |
|
226 |
by Safe_tac; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
227 |
by (case_tac "xb" 1); |
8388 | 228 |
by Auto_tac; |
229 |
bd widen_RefT 1; |
|
230 |
by Auto_tac; |
|
231 |
qed "PrimT_PrimT"; |
|
232 |
||
233 |
Goal "\\<lbrakk>wtl_inst i G rT s1 s1' cert mpc pc; \ |
|
234 |
\ fits ins cert phi; pc < length ins; wf_prog wf_mb G; \ |
|
235 |
\ G \\<turnstile> s2 <=s s1; i = ins!pc\\<rbrakk> \\<Longrightarrow> \ |
|
236 |
\ \\<exists> s2'. wtl_inst (ins!pc) G rT s2 s2' cert mpc pc \\<and> \ |
|
237 |
\ (G \\<turnstile> s2' <=s s1' \\<or> (\\<exists>s. cert!(Suc pc) = Some s \\<and> G \\<turnstile> s2' <=s s))"; |
|
238 |
by (cut_inst_tac [("z","s2")] surj_pair 1); |
|
239 |
by (Clarify_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
240 |
by (case_tac "ins!pc" 1); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
241 |
by (case_tac "load_and_store" 1); |
8388 | 242 |
by (Clarsimp_tac 1); |
243 |
by (datac mono_load 2 1); |
|
244 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_length_snd]) 1); |
|
245 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_length_snd]) 1); |
|
246 |
by (datac mono_store 1 1); |
|
247 |
by (Clarsimp_tac 1); |
|
248 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); |
|
249 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
250 |
by (case_tac "create_object" 1); |
8388 | 251 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons1]) 1); |
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
252 |
by (case_tac "manipulate_object" 1); |
8388 | 253 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
254 |
be widen_trans 1; |
|
255 |
ba 1; |
|
256 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
257 |
br conjI 1; |
|
258 |
be widen_trans 1; |
|
259 |
ba 1; |
|
260 |
be widen_trans 1; |
|
261 |
ba 1; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
262 |
by (case_tac "check_object" 1); |
8388 | 263 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
264 |
be widen_RefT2 1; |
|
265 |
br method_inv_pseudo_mono 1; |
|
266 |
ba 1; |
|
267 |
by (Asm_full_simp_tac 1); |
|
268 |
ba 1; |
|
269 |
ba 1; |
|
270 |
ba 1; |
|
271 |
ba 1; |
|
272 |
ba 1; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
273 |
by (case_tac "meth_ret" 1); |
8388 | 274 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
275 |
br conjI 1; |
|
276 |
be widen_trans 1; |
|
277 |
ba 1; |
|
278 |
by (cut_inst_tac [("z","s1'")] surj_pair 1); |
|
279 |
by (strip_tac1 1); |
|
280 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
281 |
by (case_tac "op_stack" 1); |
8388 | 282 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
283 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
284 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
285 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
286 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
287 |
by (case_tac "branch" 1); |
8388 | 288 |
by (Clarsimp_tac 1); |
289 |
bd sup_state_trans 1; |
|
290 |
ba 1; |
|
291 |
by (Clarsimp_tac 1); |
|
292 |
by (cut_inst_tac [("z","s1'")] surj_pair 1); |
|
293 |
by (Clarify_tac 1); |
|
294 |
by (Clarsimp_tac 1); |
|
295 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
296 |
br conjI 1; |
|
297 |
br sup_state_trans 2; |
|
298 |
ba 2; |
|
299 |
ba 2; |
|
300 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
301 |
by (case_tac "xa" 1); |
8388 | 302 |
by (clarsimp_tac (claset(), simpset() addsimps [PrimT_PrimT]) 1); |
303 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
304 |
by (case_tac "xb" 1); |
8388 | 305 |
by Auto_tac; |
306 |
bd widen_RefT 1; |
|
307 |
by Auto_tac; |
|
308 |
qed "wtl_inst_pseudo_mono"; |
|
309 |
||
310 |
||
311 |
Goal "\\<lbrakk>wtl_inst i G rT s1 s1' cert (Suc pc) pc; G \\<turnstile> s2 <=s s1\\<rbrakk> \\<Longrightarrow> \ |
|
312 |
\ \\<exists>s2'. wtl_inst i G rT s2 s2' cert (Suc pc) pc \\<and> (G \\<turnstile> s2' <=s s1')"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
313 |
by (case_tac "i" 1); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
314 |
by (case_tac "branch" 8); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
315 |
by (case_tac "op_stack" 7); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
316 |
by (case_tac "meth_ret" 6); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
317 |
by (case_tac "meth_inv" 5); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
318 |
by (case_tac "check_object" 4); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
319 |
by (case_tac "manipulate_object" 3); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
320 |
by (case_tac "create_object" 2); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
321 |
by (case_tac "load_and_store" 1); |
8388 | 322 |
by (TRYALL Asm_full_simp_tac); |
323 |
by (pair_tac "s1'" 1); |
|
324 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
325 |
br widen_trans 1; |
|
326 |
ba 1; |
|
327 |
ba 1; |
|
328 |
by (pair_tac "s1'" 1); |
|
329 |
by (clarsimp_tac (claset(), simpset() addsimps [sup_state_Cons2]) 1); |
|
330 |
br sup_state_trans 1; |
|
331 |
ba 1; |
|
332 |
ba 1; |
|
333 |
qed "wtl_inst_last_mono"; |
|
334 |
||
335 |
Goalw [wtl_inst_option_def] |
|
336 |
"\\<lbrakk>wtl_inst_option i G rT s1 s1' cert mpc pc; Suc pc = mpc; G \\<turnstile> s2 <=s s1\\<rbrakk> \\<Longrightarrow> \ |
|
337 |
\ \\<exists>s2'. wtl_inst_option i G rT s2 s2' cert mpc pc \\<and> (G \\<turnstile> s2' <=s s1')"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
338 |
by (case_tac "cert!pc" 1); |
8388 | 339 |
by (Clarsimp_tac 1); |
340 |
bd wtl_inst_last_mono 1; |
|
341 |
ba 1; |
|
342 |
by (Asm_full_simp_tac 1); |
|
343 |
by (Clarsimp_tac 1); |
|
344 |
bd sup_state_trans 1; |
|
345 |
ba 1; |
|
346 |
by (Asm_full_simp_tac 1); |
|
347 |
by (dres_inst_tac [("s2.0","(a,b)")] wtl_inst_last_mono 1); |
|
348 |
by (Simp_tac 1); |
|
349 |
by (Asm_full_simp_tac 1); |
|
350 |
qed "wtl_option_last_mono"; |
|
351 |
||
352 |
Goalw [wt_instr_def] |
|
353 |
"\\<lbrakk>wt_instr (ins!pc) G rT phi max_pc pc; fits ins cert phi;\ |
|
354 |
\ pc < length ins; length ins = max_pc\\<rbrakk> \\<Longrightarrow> \ |
|
355 |
\ \\<exists> s. wtl_inst (ins!pc) G rT (phi!pc) s cert max_pc pc \\<and> G \\<turnstile> s <=s phi ! Suc pc"; |
|
356 |
by (cut_inst_tac [("z","phi!pc")] surj_pair 1); |
|
357 |
by (strip_tac1 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
358 |
by (case_tac "ins!pc" 1); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
359 |
by (case_tac "op_stack" 7); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
360 |
by (case_tac "check_object" 4); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
361 |
by (case_tac "manipulate_object" 3); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
362 |
by (case_tac "create_object" 2); |
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
363 |
by (case_tac "load_and_store" 1); |
8388 | 364 |
by (TRYALL (Asm_full_simp_tac THEN_MAYBE' Force_tac)); |
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
365 |
by (case_tac "meth_inv" 1); |
8388 | 366 |
by (cut_inst_tac [("z","phi!(Suc pc)")] surj_pair 1); |
367 |
by (strip_tac1 1); |
|
368 |
by (Clarsimp_tac 1); |
|
8423 | 369 |
by (case_tac "X = NT" 1); |
8388 | 370 |
by (clarsimp_tac (claset(),simpset() addsimps [fits_def, contains_dead_def]) 1); |
371 |
by (smp_tac 1 1); |
|
372 |
by (Clarsimp_tac 1); |
|
373 |
by (Force_tac 1); |
|
374 |
by (Asm_full_simp_tac 1); |
|
375 |
by (strip_tac1 1); |
|
376 |
by (res_inst_tac [("x","rT#ST'")] exI 1); |
|
377 |
by (res_inst_tac [("x","y")] exI 1); |
|
378 |
by (Asm_full_simp_tac 1); |
|
379 |
by (res_inst_tac [("x","apTs")] exI 1); |
|
380 |
by (clarsimp_tac (claset(),simpset() addsimps [fits_def, contains_dead_def]) 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
381 |
by (case_tac "meth_ret" 1); |
8388 | 382 |
by (asm_full_simp_tac (simpset() addsimps [fits_def, contains_dead_def]) 1); |
383 |
by (cut_inst_tac [("z","phi!Suc pc")] surj_pair 1); |
|
384 |
by (strip_tac1 1); |
|
385 |
by (Clarsimp_tac 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
386 |
by (case_tac "branch" 1); |
8388 | 387 |
by (asm_full_simp_tac (simpset() addsimps [fits_def, contains_dead_def, contains_targets_def]) 1); |
388 |
by (cut_inst_tac [("z","phi!Suc pc")] surj_pair 1); |
|
389 |
by (Force_tac 1); |
|
390 |
by (asm_full_simp_tac (simpset() addsimps [fits_def, contains_targets_def]) 1); |
|
391 |
by (Force_tac 1); |
|
392 |
qed "wt_instr_imp_wtl_inst"; |
|
393 |
||
394 |
Goalw [wtl_inst_option_def] |
|
395 |
"\\<lbrakk>fits ins cert phi; pc < length ins; wt_instr (ins!pc) G rT phi max_pc pc; \ |
|
396 |
\ max_pc = length ins\\<rbrakk> \\<Longrightarrow> \ |
|
397 |
\ \\<exists> s. wtl_inst_option (ins!pc) G rT (phi!pc) s cert max_pc pc \\<and> G \\<turnstile> s <=s phi ! Suc pc"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
398 |
by (case_tac "cert!pc" 1); |
8388 | 399 |
by (Clarsimp_tac 1); |
400 |
bd wt_instr_imp_wtl_inst 1; |
|
401 |
ba 1; |
|
402 |
ba 1; |
|
403 |
br refl 1; |
|
404 |
by (Clarsimp_tac 1); |
|
405 |
by (Clarsimp_tac 1); |
|
406 |
by (forward_tac [wt_instr_imp_wtl_inst] 1); |
|
407 |
ba 1; |
|
408 |
ba 1; |
|
409 |
by (Clarsimp_tac 1); |
|
410 |
by (clarsimp_tac (claset(), simpset() addsimps [fits_def, is_approx_def]) 1); |
|
411 |
by (eres_inst_tac [("x","pc")] allE 1); |
|
412 |
by (Clarsimp_tac 1); |
|
413 |
by Auto_tac; |
|
414 |
qed "wt_inst_imp_wtl_option"; |
|
415 |
||
416 |
Goal "\\<lbrakk>wtl_inst_list ins G rT s0 s' cert max_pc pc; \ |
|
417 |
\ ins \\<noteq> []; G \\<turnstile> s <=s s0; \ |
|
418 |
\ s \\<noteq> s0 \\<longrightarrow> cert ! pc = Some s0\\<rbrakk> \\<Longrightarrow> \ |
|
419 |
\ wtl_inst_list ins G rT s s' cert max_pc pc"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
420 |
by (case_tac "ins" 1); |
8388 | 421 |
by (Clarify_tac 1); |
422 |
by (Clarify_tac 1); |
|
423 |
by (Asm_full_simp_tac 1); |
|
424 |
by (Clarify_tac 1); |
|
8423 | 425 |
by (case_tac "list = []" 1); |
8388 | 426 |
by (Asm_full_simp_tac 1); |
8423 | 427 |
by (case_tac "s = s0" 1); |
8388 | 428 |
by (Force_tac 1); |
429 |
by (force_tac (claset(), simpset() addsimps [wtl_inst_option_def]) 1); |
|
430 |
by (force_tac (claset(), simpset() addsimps [wtl_inst_option_def]) 1); |
|
431 |
qed "wtl_inst_list_s"; |
|
432 |
||
433 |
||
434 |
Goal "\\<lbrakk>wtl_inst_list ins G rT s0 s' cert max_pc pc; \ |
|
435 |
\ ins \\<noteq> []; G \\<turnstile> s <=s s0; cert ! pc = Some s0\\<rbrakk> \\<Longrightarrow> \ |
|
436 |
\ wtl_inst_list ins G rT s s' cert max_pc pc"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
437 |
by (case_tac "ins" 1); |
8388 | 438 |
by (Clarify_tac 1); |
439 |
by (force_tac (claset(), simpset() addsimps [wtl_inst_option_def]) 1); |
|
440 |
qed "wtl_inst_list_cert"; |
|
441 |
||
442 |
||
443 |
Goalw [wtl_inst_option_def] |
|
444 |
"\\<lbrakk>wtl_inst_option i G rT s1 s1' cert mpc pc; \ |
|
445 |
\ fits ins cert phi; pc < length ins; wf_prog wf_mb G; \ |
|
446 |
\ G \\<turnstile> s2 <=s s1; i = ins!pc\\<rbrakk> \\<Longrightarrow> \ |
|
447 |
\ \\<exists> s2'. wtl_inst_option (ins!pc) G rT s2 s2' cert mpc pc \\<and> \ |
|
448 |
\ (G \\<turnstile> s2' <=s s1' \\<or> (\\<exists>s. cert!(Suc pc) = Some s \\<and> G \\<turnstile> s2' <=s s))"; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
449 |
by (case_tac "cert!pc" 1); |
8388 | 450 |
by (Asm_full_simp_tac 1); |
451 |
by (datac wtl_inst_pseudo_mono 4 1); |
|
452 |
by (Clarsimp_tac 1); |
|
453 |
by (Clarsimp_tac 1); |
|
454 |
by (Clarsimp_tac 1); |
|
455 |
br conjI 1; |
|
456 |
br sup_state_trans 1; |
|
457 |
ba 1; |
|
458 |
ba 1; |
|
459 |
by (thin_tac "G \\<turnstile> s1 <=s (a, b)" 1); |
|
460 |
by (thin_tac "G \\<turnstile> s2 <=s s1" 1); |
|
461 |
by (subgoal_tac "G \\<turnstile> (a,b) <=s (a,b)" 1); |
|
462 |
by (datac wtl_inst_pseudo_mono 4 1); |
|
463 |
by (Asm_full_simp_tac 1); |
|
464 |
by (Asm_full_simp_tac 1); |
|
465 |
by (Simp_tac 1); |
|
466 |
qed "wtl_option_pseudo_mono"; |
|
467 |
||
468 |
Goal "((l @ a # list) ! length l) = a"; |
|
469 |
by (induct_tac "l" 1); |
|
470 |
by Auto_tac; |
|
471 |
qed "append_cons_length_nth"; |
|
472 |
||
473 |
Goal "\\<forall> pc. (\\<forall>pc'. pc' < length ins \\<longrightarrow> wt_instr (ins ! pc') G rT phi (pc+length ins) (pc+pc')) \\<longrightarrow> \ |
|
474 |
\ wf_prog wf_mb G \\<longrightarrow> \ |
|
475 |
\ fits all_ins cert phi \\<longrightarrow> (\\<exists> l. pc = length l \\<and> l@ins=all_ins) \\<longrightarrow> pc < length all_ins \\<longrightarrow>\ |
|
476 |
\ (\\<forall> s. (G \\<turnstile> s <=s (phi!pc)) \\<longrightarrow> \ |
|
477 |
\ (\\<exists>s'. wtl_inst_list ins G rT s s' cert (pc+length ins) pc))"; |
|
478 |
by (induct_tac "ins" 1); |
|
479 |
by (Simp_tac 1); |
|
480 |
by (Clarify_tac 1); |
|
481 |
by (eres_inst_tac [("x","Suc (length l)")] allE 1); |
|
482 |
be impE 1; |
|
483 |
by (Clarsimp_tac 1); |
|
484 |
by (eres_inst_tac [("x","Suc pc'")] allE 1); |
|
485 |
by (Asm_full_simp_tac 1); |
|
486 |
by (Clarify_tac 1); |
|
487 |
be impE 1; |
|
488 |
by (Asm_full_simp_tac 1); |
|
489 |
by (eres_inst_tac [("x","0")] allE 1); |
|
490 |
by (Asm_full_simp_tac 1); |
|
491 |
by (forw_inst_tac [("G","G"),("rT","rT"),("pc","length l"), |
|
492 |
("max_pc","Suc (length l + length list)")] wt_inst_imp_wtl_option 1); |
|
493 |
by (Simp_tac 1); |
|
494 |
by (asm_full_simp_tac (simpset() addsimps [nth_append]) 1); |
|
495 |
by (Simp_tac 1); |
|
496 |
by (asm_full_simp_tac (simpset() addsimps [nth_append]) 1); |
|
497 |
by (Clarify_tac 1); |
|
8423 | 498 |
by (case_tac "list = []" 1); |
8388 | 499 |
by (Clarsimp_tac 1); |
500 |
bd wtl_option_last_mono 1; |
|
501 |
br refl 1; |
|
502 |
ba 1; |
|
503 |
by (Clarsimp_tac 1); |
|
504 |
by (dres_inst_tac [("a","(ac,bb)")] sup_state_trans 1); |
|
505 |
ba 1; |
|
506 |
by (Force_tac 1); |
|
507 |
by (Clarsimp_tac 1); |
|
508 |
bd wtl_option_pseudo_mono 1; |
|
509 |
ba 1; |
|
510 |
by (Simp_tac 1); |
|
511 |
ba 1; |
|
512 |
ba 1; |
|
513 |
by (simp_tac (simpset() addsimps [append_cons_length_nth]) 1); |
|
514 |
by (clarsimp_tac (claset(), simpset() addsimps [append_cons_length_nth]) 1); |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
515 |
by (case_tac "cert ! Suc (length l)" 1); |
8388 | 516 |
by (Clarsimp_tac 1); |
517 |
by (dres_inst_tac [("a","(ac,bb)")] sup_state_trans 1); |
|
518 |
ba 1; |
|
519 |
by (Force_tac 1); |
|
520 |
by (Clarsimp_tac 1); |
|
521 |
by (subgoal_tac "G \\<turnstile> (ac, bb) <=s phi ! Suc (length l)" 1); |
|
522 |
by (thin_tac "G \\<turnstile> (ab, ba) <=s phi ! Suc (length l)" 1); |
|
523 |
by (smp_tac 2 1); |
|
524 |
by (Force_tac 1); |
|
525 |
be disjE 1; |
|
526 |
br sup_state_trans 1; |
|
527 |
ba 1; |
|
528 |
ba 1; |
|
529 |
by (clarsimp_tac (claset(), simpset() addsimps [fits_def, is_approx_def]) 1); |
|
530 |
by (eres_inst_tac [("x","Suc (length l)")] allE 1); |
|
531 |
be impE 1; |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
532 |
by (case_tac "length list" 1); |
8388 | 533 |
by (Clarsimp_tac 1); |
534 |
by (Clarsimp_tac 1); |
|
535 |
by (Clarsimp_tac 1); |
|
536 |
qed_spec_mp "wt_imp_wtl_inst_list"; |
|
537 |
||
538 |
||
539 |
||
540 |
Goalw[wt_method_def, wtl_method_def] |
|
541 |
"\\<lbrakk>wt_method G C pTs rT mxl ins phi; fits ins cert phi; wf_prog wf_mb G\\<rbrakk> \\<Longrightarrow> wtl_method G C pTs rT mxl ins cert"; |
|
542 |
by (Clarsimp_tac 1); |
|
543 |
by (cut_inst_tac [("pc","0")] wt_imp_wtl_inst_list 1); |
|
544 |
by (Force_tac 1); |
|
545 |
ba 1; |
|
546 |
ba 1; |
|
547 |
by (Simp_tac 1); |
|
548 |
by (Simp_tac 1); |
|
549 |
by (clarsimp_tac (claset(), simpset() addsimps [wt_start_def]) 1); |
|
550 |
ba 1; |
|
551 |
by (Asm_full_simp_tac 1); |
|
552 |
qed "fits_imp_wtl_method_complete"; |
|
553 |
||
554 |
Goal "\\<lbrakk>wt_method G C pTs rT mxl ins phi; wf_prog wf_mb G\\<rbrakk> \\<Longrightarrow> wtl_method G C pTs rT mxl ins (make_cert ins phi)"; |
|
555 |
by (subgoal_tac "fits ins (make_cert ins phi) phi" 1); |
|
556 |
br fits_make_cert 2; |
|
557 |
by (asm_full_simp_tac (simpset() addsimps [wt_method_def]) 2); |
|
558 |
br fits_imp_wtl_method_complete 1; |
|
559 |
ba 1; |
|
560 |
ba 1; |
|
561 |
ba 1; |
|
562 |
qed "wtl_method_complete"; |
|
563 |
||
564 |
Goalw[wt_jvm_prog_def, wfprg_def] "\\<lbrakk>wt_jvm_prog G Phi\\<rbrakk> \\<Longrightarrow> wfprg G"; |
|
565 |
by Auto_tac; |
|
566 |
qed "wt_imp_wfprg"; |
|
567 |
||
568 |
Goal "(a,b,c,d)\\<in>set l \\<longrightarrow> unique l \\<longrightarrow> (a',b',c',d') \\<in> set l \\<longrightarrow> a = a' \\<longrightarrow> b=b' \\<and> c=c' \\<and> d=d'"; |
|
569 |
by (induct_tac "l" 1); |
|
570 |
by Auto_tac; |
|
571 |
qed_spec_mp "unique_set"; |
|
572 |
||
573 |
Goal "(a,b,c,d)\\<in>set l \\<longrightarrow> unique l \\<longrightarrow> (\\<epsilon> (a',b',c',d'). (a',b',c',d') \\<in> set l \\<and> a'=a) = (a,b,c,d)"; |
|
574 |
by (auto_tac (claset(), simpset() addsimps [unique_set])); |
|
575 |
qed_spec_mp "unique_epsilon"; |
|
576 |
||
577 |
Goal "\\<lbrakk>wt_jvm_prog G Phi\\<rbrakk> \\<Longrightarrow> wtl_jvm_prog G (make_Cert G Phi)"; |
|
578 |
by (forward_tac [wt_imp_wfprg] 1); |
|
579 |
by (asm_full_simp_tac (simpset() addsimps [wt_jvm_prog_def, |
|
580 |
wtl_jvm_prog_def, wf_prog_def, wf_cdecl_def, wf_mdecl_def]) 1); |
|
581 |
by Auto_tac; |
|
582 |
bd bspec 1; |
|
583 |
ba 1; |
|
584 |
by (Clarsimp_tac 1); |
|
585 |
bd bspec 1; |
|
586 |
back(); |
|
587 |
ba 1; |
|
588 |
by (clarsimp_tac (claset(), simpset() addsimps [make_Cert_def, wfprg_def]) 1); |
|
589 |
bd wtl_method_complete 1; |
|
590 |
ba 1; |
|
591 |
by (asm_full_simp_tac (simpset() addsimps [unique_epsilon]) 1); |
|
592 |
qed "wtl_complete"; |
|
593 |
||
594 |
||
595 |
||
596 |
||
597 |