author | oheimb |
Tue, 09 Jan 2001 13:54:44 +0100 | |
changeset 10828 | b207d6d1bedc |
parent 10613 | 78b1d6c3ee9c |
child 10925 | 5ffe7ed8899a |
permissions | -rw-r--r-- |
8011 | 1 |
(* Title: HOL/MicroJava/J/JTypeSafe.ML |
2 |
ID: $Id$ |
|
3 |
Author: David von Oheimb |
|
4 |
Copyright 1999 Technische Universitaet Muenchen |
|
5 |
||
6 |
Type safety proof |
|
7 |
*) |
|
8 |
||
9240 | 9 |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
10 |
|
8011 | 11 |
Addsimps [split_beta]; |
12 |
||
10042 | 13 |
Goal "[|h a = None; (h, l)::\\<preceq>(G, lT); wf_prog wf_mb G; is_class G C|] ==> \ |
14 |
\ (h(a\\<mapsto>(C,(init_vars (fields (G,C))))), l)::\\<preceq>(G, lT)"; |
|
8011 | 15 |
by( etac conforms_upd_obj 1); |
16 |
by( rewtac oconf_def); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
17 |
by( auto_tac (claset() addSDs [fields_is_type], simpset())); |
8011 | 18 |
qed "NewC_conforms"; |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
19 |
|
8011 | 20 |
Goalw [cast_ok_def] |
10042 | 21 |
"[| wf_prog wf_mb G; G,h\\<turnstile>v::\\<preceq>Class C; G\\<turnstile>C\\<preceq>? D; cast_ok G D h v|] \ |
22 |
\ ==> G,h\\<turnstile>v::\\<preceq>Class D"; |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
23 |
by( case_tac "v = Null" 1); |
8011 | 24 |
by( Asm_full_simp_tac 1); |
25 |
by( dtac widen_RefT 1); |
|
26 |
by( Clarify_tac 1); |
|
9348 | 27 |
by( datac non_npD 1 1); |
28 |
by( auto_tac (claset() addSIs [conf_AddrI], simpset() addsimps [obj_ty_def])); |
|
8011 | 29 |
qed "Cast_conf"; |
30 |
||
10042 | 31 |
Goal "[| wf_prog wf_mb G; field (G,C) fn = Some (fd, ft); (h,l)::\\<preceq>(G,lT); \ |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
32 |
\ x' = None --> G,h\\<turnstile>a'::\\<preceq> Class C; np a' x' = None |] ==> \ |
10042 | 33 |
\ G,h\\<turnstile>the (snd (the (h (the_Addr a'))) (fn, fd))::\\<preceq>ft"; |
8011 | 34 |
by( dtac np_NoneD 1); |
35 |
by( etac conjE 1); |
|
36 |
by( mp_tac 1); |
|
37 |
by( dtac non_np_objD 1); |
|
38 |
by Auto_tac; |
|
39 |
by( dtac (conforms_heapD RS hconfD) 1); |
|
40 |
by( atac 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
41 |
by( datac widen_cfs_fields 2 1); |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
42 |
by( datac oconf_objD 1 1); |
8011 | 43 |
by Auto_tac; |
8082 | 44 |
qed "FAcc_type_sound"; |
8011 | 45 |
|
46 |
Goal |
|
10042 | 47 |
"[| wf_prog wf_mb G; a = the_Addr a'; (c, fs) = the (h a); \ |
48 |
\ (G, lT)\\<turnstile>v::T'; G\\<turnstile>T'\\<preceq>ft; \ |
|
49 |
\ (G, lT)\\<turnstile>aa::Class C; \ |
|
8034
6fc37b5c5e98
Various little changes like cmethd -> method and cfield -> field.
nipkow
parents:
8011
diff
changeset
|
50 |
\ field (G,C) fn = Some (fd, ft); h''\\<le>|h'; \ |
10042 | 51 |
\ x' = None --> G,h'\\<turnstile>a'::\\<preceq> Class C; h'\\<le>|h; \ |
52 |
\ (h, l)::\\<preceq>(G, lT); G,h\\<turnstile>x::\\<preceq>T'; np a' x' = None|] ==> \ |
|
8011 | 53 |
\ h''\\<le>|h(a\\<mapsto>(c,(fs((fn,fd)\\<mapsto>x)))) \\<and> \ |
10042 | 54 |
\ (h(a\\<mapsto>(c,(fs((fn,fd)\\<mapsto>x)))), l)::\\<preceq>(G, lT) \\<and> \ |
55 |
\ G,h(a\\<mapsto>(c,(fs((fn,fd)\\<mapsto>x))))\\<turnstile>x::\\<preceq>T'"; |
|
8011 | 56 |
by( dtac np_NoneD 1); |
57 |
by( etac conjE 1); |
|
58 |
by( Asm_full_simp_tac 1); |
|
59 |
by( dtac non_np_objD 1); |
|
60 |
by( atac 1); |
|
61 |
by( SELECT_GOAL Auto_tac 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
62 |
by( Clarify_tac 1); |
8011 | 63 |
by( Full_simp_tac 1); |
64 |
by( EVERY [forward_tac [hext_objD] 1, atac 1]); |
|
65 |
by( etac exE 1); |
|
66 |
by( Asm_full_simp_tac 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
67 |
by( Clarify_tac 1); |
8011 | 68 |
by( rtac conjI 1); |
69 |
by( fast_tac (HOL_cs addEs [hext_trans, hext_upd_obj]) 1); |
|
70 |
by( rtac conjI 1); |
|
71 |
by( fast_tac (HOL_cs addEs [conf_upd_obj RS iffD2]) 2); |
|
72 |
||
73 |
by( rtac conforms_upd_obj 1); |
|
74 |
by Auto_tac; |
|
75 |
by( rtac hextI 2); |
|
76 |
by( Force_tac 2); |
|
77 |
by( rtac oconf_hext 1); |
|
78 |
by( etac hext_upd_obj 2); |
|
79 |
by( dtac widen_cfs_fields 1); |
|
80 |
by( atac 1); |
|
81 |
by( atac 1); |
|
82 |
by( rtac (oconf_obj RS iffD2) 1); |
|
83 |
by( Simp_tac 1); |
|
84 |
by( strip_tac 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
85 |
by( case_tac "(aaa, b) = (fn, fd)" 1); |
8011 | 86 |
by( Asm_full_simp_tac 1); |
87 |
by( fast_tac (HOL_cs addIs [conf_widen]) 1); |
|
88 |
by( fast_tac (HOL_cs addDs [conforms_heapD RS hconfD, oconf_objD]) 1); |
|
8082 | 89 |
qed "FAss_type_sound"; |
8011 | 90 |
|
10042 | 91 |
Goalw [wf_mhead_def] "[| wf_prog wf_mb G; list_all2 (conf G h) pvs pTs; \ |
8011 | 92 |
\ list_all2 (\\<lambda>T T'. G\\<turnstile>T\\<preceq>T') pTs pTs'; wf_mhead G (mn,pTs') rT; \ |
93 |
\ length pTs' = length pns; nodups pns; \ |
|
94 |
\ Ball (set lvars) (split (\\<lambda>vn. is_type G)) \ |
|
10042 | 95 |
\ |] ==> G,h\\<turnstile>init_vars lvars(pns[\\<mapsto>]pvs)[::\\<preceq>]map_of lvars(pns[\\<mapsto>]pTs')"; |
8011 | 96 |
by( Clarsimp_tac 1); |
97 |
by( rtac lconf_ext_list 1); |
|
98 |
by( rtac (Ball_set_table RS lconf_init_vars) 1); |
|
99 |
by( Force_tac 1); |
|
100 |
by( atac 1); |
|
101 |
by( atac 1); |
|
102 |
by( (etac conf_list_gext_widen THEN_ALL_NEW atac) 1); |
|
103 |
qed "Call_lemma2"; |
|
104 |
||
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
105 |
Goal "G\\<turnstile>C\\<preceq>C D \\<Longrightarrow> is_class G D \\<longrightarrow> is_class G C"; |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
106 |
by (etac rtrancl_induct 1); |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
107 |
by (dtac subcls1D 2); |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
108 |
by Auto_tac; |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
109 |
qed_spec_mp "subcls_is_class2"; |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
110 |
|
8011 | 111 |
Goalw [wf_java_prog_def] |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
112 |
"[| wf_java_prog G; a' \\<noteq> Null; (h, l)::\\<preceq>(G, lT); class G C = Some y; \ |
8085 | 113 |
\ max_spec G C (mn,pTsa) = {((mda,rTa),pTs')}; xc\\<le>|xh; xh\\<le>|h; \ |
8011 | 114 |
\ list_all2 (conf G h) pvs pTsa;\ |
115 |
\ (md, rT, pns, lvars, blk, res) = \ |
|
8034
6fc37b5c5e98
Various little changes like cmethd -> method and cfield -> field.
nipkow
parents:
8011
diff
changeset
|
116 |
\ the (method (G,fst (the (h (the_Addr a')))) (mn, pTs'));\ |
10042 | 117 |
\ \\<forall>lT. (h, init_vars lvars(pns[\\<mapsto>]pvs)(This\\<mapsto>a'))::\\<preceq>(G, lT) --> \ |
118 |
\ (G, lT)\\<turnstile>blk\\<surd> --> h\\<le>|xi \\<and> (xi, xl)::\\<preceq>(G, lT); \ |
|
119 |
\ \\<forall>lT. (xi, xl)::\\<preceq>(G, lT) --> (\\<forall>T. (G, lT)\\<turnstile>res::T --> \ |
|
120 |
\ xi\\<le>|h' \\<and> (h', xj)::\\<preceq>(G, lT) \\<and> (x' = None --> G,h'\\<turnstile>v::\\<preceq>T)); \ |
|
121 |
\ G,xh\\<turnstile>a'::\\<preceq> Class C |] ==> \ |
|
122 |
\ xc\\<le>|h' \\<and> (h', l)::\\<preceq>(G, lT) \\<and> (x' = None --> G,h'\\<turnstile>v::\\<preceq>rTa)"; |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
123 |
by( dtac max_spec2mheads 1); |
8105
2dda3e88d23f
simplified definition of appl_methds, removing m_head
oheimb
parents:
8085
diff
changeset
|
124 |
by( Clarify_tac 1); |
2dda3e88d23f
simplified definition of appl_methds, removing m_head
oheimb
parents:
8085
diff
changeset
|
125 |
by( datac non_np_objD' 2 1); |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
126 |
by( Clarsimp_tac 1); |
8011 | 127 |
by( Clarsimp_tac 1); |
128 |
by( EVERY'[forward_tac [hext_objD], atac] 1); |
|
129 |
by( Clarsimp_tac 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
130 |
by( datac Call_lemma 3 1); |
8082 | 131 |
by( clarsimp_tac (claset(),simpset() addsimps [wf_java_mdecl_def])1); |
8034
6fc37b5c5e98
Various little changes like cmethd -> method and cfield -> field.
nipkow
parents:
8011
diff
changeset
|
132 |
by( thin_tac "method ?sig ?x = ?y" 1); |
8011 | 133 |
by( EVERY'[dtac spec, etac impE] 1); |
134 |
by( mp_tac 2); |
|
135 |
by( rtac conformsI 1); |
|
136 |
by( etac conforms_heapD 1); |
|
137 |
by( rtac lconf_ext 1); |
|
138 |
by( force_tac (claset() addSEs [Call_lemma2],simpset()) 1); |
|
139 |
by( EVERY'[etac conf_hext, etac conf_obj_AddrI, atac] 1); |
|
140 |
by( thin_tac "?E\\<turnstile>?blk\\<surd>" 1); |
|
141 |
by( etac conjE 1); |
|
142 |
by( EVERY'[dtac spec, mp_tac] 1); |
|
10042 | 143 |
(*by( thin_tac "?E::\\<preceq>(G, pT')" 1);*) |
8011 | 144 |
by( EVERY'[dtac spec, mp_tac] 1); |
10042 | 145 |
by( thin_tac "?E\\<turnstile>res::?rT" 1); |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
146 |
by( Clarify_tac 1); |
8011 | 147 |
by( rtac conjI 1); |
148 |
by( fast_tac (HOL_cs addIs [hext_trans]) 1); |
|
149 |
by( rtac conjI 1); |
|
150 |
by( rtac impI 2); |
|
151 |
by( mp_tac 2); |
|
152 |
by( forward_tac [conf_widen] 2); |
|
153 |
by( atac 4); |
|
154 |
by( atac 2); |
|
155 |
by( fast_tac (HOL_cs addSEs [widen_trans]) 2); |
|
156 |
by( etac conforms_hext 1); |
|
157 |
by( etac hext_trans 1); |
|
158 |
by( atac 1); |
|
159 |
by( etac conforms_heapD 1); |
|
160 |
qed "Call_type_sound"; |
|
161 |
||
162 |
||
163 |
||
164 |
Unify.search_bound := 40; |
|
165 |
Unify.trace_bound := 40; |
|
166 |
Delsplits[split_if]; |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
167 |
Delsimps[fun_upd_apply]; |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
168 |
Addsimps[fun_upd_same]; |
9240 | 169 |
val forward_hyp_tac = ALLGOALS (TRY o (EVERY' [dtac spec, mp_tac, |
170 |
(mp_tac ORELSE' (dtac spec THEN' mp_tac)), REPEAT o (etac conjE)])); |
|
8011 | 171 |
Goal |
10042 | 172 |
"wf_java_prog G ==> \ |
173 |
\ (G\\<turnstile>(x,(h,l)) -e \\<succ>v -> (x', (h',l')) --> \ |
|
174 |
\ (\\<forall>lT. (h ,l )::\\<preceq>(G,lT) --> (\\<forall>T . (G,lT)\\<turnstile>e :: T --> \ |
|
175 |
\ h\\<le>|h' \\<and> (h',l')::\\<preceq>(G,lT) \\<and> (x'=None --> G,h'\\<turnstile>v ::\\<preceq> T )))) \\<and> \ |
|
176 |
\ (G\\<turnstile>(x,(h,l)) -es[\\<succ>]vs-> (x', (h',l')) --> \ |
|
177 |
\ (\\<forall>lT. (h ,l )::\\<preceq>(G,lT) --> (\\<forall>Ts. (G,lT)\\<turnstile>es[::]Ts --> \ |
|
178 |
\ h\\<le>|h' \\<and> (h',l')::\\<preceq>(G,lT) \\<and> (x'=None --> list_all2 (\\<lambda>v T. G,h'\\<turnstile>v::\\<preceq>T) vs Ts)))) \\<and> \ |
|
179 |
\ (G\\<turnstile>(x,(h,l)) -c -> (x', (h',l')) --> \ |
|
180 |
\ (\\<forall>lT. (h ,l )::\\<preceq>(G,lT) --> (G,lT)\\<turnstile>c \\<surd> --> \ |
|
181 |
\ h\\<le>|h' \\<and> (h',l')::\\<preceq>(G,lT)))"; |
|
8011 | 182 |
by( rtac eval_evals_exec.induct 1); |
183 |
by( rewtac c_hupd_def); |
|
184 |
||
185 |
(* several simplifications, XcptE, XcptEs, XcptS, Skip *) |
|
186 |
by( ALLGOALS Asm_full_simp_tac); |
|
187 |
by( ALLGOALS strip_tac); |
|
188 |
by( ALLGOALS (eresolve_tac ty_expr_ty_exprs_wt_stmt.elims |
|
189 |
THEN_ALL_NEW Full_simp_tac)); |
|
190 |
by( ALLGOALS (EVERY' [REPEAT o (etac conjE), REPEAT o hyp_subst_tac])); |
|
191 |
by( rewtac wf_java_prog_def); |
|
192 |
||
193 |
(* Level 7 *) |
|
194 |
||
9240 | 195 |
(* 14 NewC *) |
8011 | 196 |
by( dtac new_AddrD 1); |
197 |
by( etac disjE 1); |
|
198 |
by( Asm_simp_tac 2); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
199 |
by( Clarsimp_tac 1); |
8011 | 200 |
by( rtac conjI 1); |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
201 |
by( force_tac (claset() addSEs [NewC_conforms],simpset()) 1); |
8011 | 202 |
by( rtac conf_obj_AddrI 1); |
8185 | 203 |
by( rtac rtrancl_refl 2); |
8011 | 204 |
by( Simp_tac 1); |
205 |
||
206 |
(* for Cast *) |
|
207 |
by( defer_tac 1); |
|
208 |
||
9240 | 209 |
(* 13 Lit *) |
8011 | 210 |
by( etac conf_litval 1); |
211 |
||
9240 | 212 |
(* 12 BinOp *) |
213 |
by forward_hyp_tac; |
|
214 |
by forward_hyp_tac; |
|
215 |
by( EVERY'[rtac conjI, eatac hext_trans 1] 1); |
|
216 |
by( etac conjI 1); |
|
217 |
by( Clarsimp_tac 1); |
|
218 |
by( dtac eval_no_xcpt 1); |
|
219 |
by( asm_full_simp_tac (simpset() addsplits [binop.split]) 1); |
|
220 |
||
8185 | 221 |
(* 11 LAcc *) |
8011 | 222 |
by( fast_tac (claset() addEs [conforms_localD RS lconfD]) 1); |
223 |
||
8185 | 224 |
(* 10 Nil *) |
8011 | 225 |
by( Simp_tac 5); |
226 |
||
227 |
(* for FAss *) |
|
228 |
by( EVERY'[eresolve_tac ty_expr_ty_exprs_wt_stmt.elims THEN_ALL_NEW Full_simp_tac, |
|
229 |
REPEAT o (etac conjE), hyp_subst_tac] 3); |
|
230 |
||
231 |
(* for if *) |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
232 |
by( (case_tac "the_Bool v" THEN_ALL_NEW Asm_full_simp_tac) 8); |
8011 | 233 |
|
234 |
by forward_hyp_tac; |
|
235 |
||
236 |
(* 10+1 if *) |
|
237 |
by( fast_tac (HOL_cs addIs [hext_trans]) 8); |
|
238 |
by( fast_tac (HOL_cs addIs [hext_trans]) 8); |
|
239 |
||
240 |
(* 9 Expr *) |
|
241 |
by( Fast_tac 6); |
|
242 |
||
243 |
by( ALLGOALS Asm_full_simp_tac); |
|
244 |
||
245 |
(* 8 Cast *) |
|
246 |
by( EVERY'[rtac impI, dtac raise_if_NoneD, Clarsimp_tac, |
|
247 |
fast_tac (claset() addEs [Cast_conf])] 8); |
|
248 |
||
249 |
(* 7 LAss *) |
|
9385 | 250 |
by( asm_simp_tac (simpset() addsplits [split_if]) 1); |
8011 | 251 |
by( EVERY'[eresolve_tac ty_expr_ty_exprs_wt_stmt.elims THEN_ALL_NEW Full_simp_tac] 1); |
252 |
by( blast_tac (claset() addIs [conforms_upd_local, conf_widen]) 1); |
|
253 |
||
254 |
(* 6 FAcc *) |
|
255 |
by( fast_tac (claset() addSEs [FAcc_type_sound]) 1); |
|
256 |
||
257 |
(* 5 While *) |
|
10828
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10613
diff
changeset
|
258 |
by(thin_tac "?a \\<longrightarrow> ?b" 5); |
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10613
diff
changeset
|
259 |
by(datac ty_expr_ty_exprs_wt_stmt.Loop 1 5); |
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10613
diff
changeset
|
260 |
by(force_tac (claset() addEs [hext_trans], simpset()addsplits[split_if_asm]) 5); |
8011 | 261 |
|
262 |
by forward_hyp_tac; |
|
263 |
||
264 |
(* 4 Cons *) |
|
265 |
by( fast_tac (claset() addDs [evals_no_xcpt] addIs [conf_hext,hext_trans]) 3); |
|
266 |
||
267 |
(* 3 ;; *) |
|
268 |
by( fast_tac (claset() addIs [hext_trans]) 3); |
|
269 |
||
270 |
(* 2 FAss *) |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
271 |
by( case_tac "x2 = None" 1); |
8011 | 272 |
by( Asm_simp_tac 2); |
273 |
by( fast_tac (claset() addIs [hext_trans]) 2); |
|
274 |
by( Asm_full_simp_tac 1); |
|
275 |
by( dtac eval_no_xcpt 1); |
|
276 |
by( SELECT_GOAL (etac FAss_type_sound 1 THEN rtac refl 1 THEN ALLGOALS atac) 1); |
|
277 |
||
278 |
by prune_params_tac; |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
279 |
(* Level 50 *) |
8011 | 280 |
|
281 |
(* 1 Call *) |
|
8442
96023903c2df
case_tac now subsumes both boolean and datatype cases;
wenzelm
parents:
8423
diff
changeset
|
282 |
by( case_tac "x" 1); |
8011 | 283 |
by( Clarsimp_tac 2); |
284 |
by( dtac exec_xcpt 2); |
|
285 |
by( Asm_full_simp_tac 2); |
|
286 |
by( dtac eval_xcpt 2); |
|
287 |
by( Asm_full_simp_tac 2); |
|
288 |
by( fast_tac (HOL_cs addEs [hext_trans]) 2); |
|
289 |
by( Clarify_tac 1); |
|
290 |
by( dtac evals_no_xcpt 1); |
|
291 |
by( Asm_full_simp_tac 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
292 |
by( case_tac "a' = Null" 1); |
8011 | 293 |
by( Asm_full_simp_tac 1); |
294 |
by( dtac exec_xcpt 1); |
|
295 |
by( Asm_full_simp_tac 1); |
|
296 |
by( dtac eval_xcpt 1); |
|
297 |
by( Asm_full_simp_tac 1); |
|
298 |
by( fast_tac (HOL_cs addEs [hext_trans]) 1); |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
299 |
by( datac ty_expr_is_type 1 1); |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
300 |
by(Clarsimp_tac 1); |
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
301 |
by( (rtac (rewrite_rule [wf_java_prog_def] Call_type_sound) |
9348 | 302 |
THEN_ALL_NEW Asm_simp_tac) 1); |
8011 | 303 |
qed "eval_evals_exec_type_sound"; |
304 |
||
10042 | 305 |
Goal "!!E s s'. \ |
306 |
\ [| G=prg E; wf_java_prog G; G\\<turnstile>(x,s) -e\\<succ>v -> (x',s'); s::\\<preceq>E; E\\<turnstile>e::T |] \ |
|
307 |
\ ==> s'::\\<preceq>E \\<and> (x'=None --> G,heap s'\\<turnstile>v::\\<preceq>T)"; |
|
8011 | 308 |
by( split_all_tac 1); |
309 |
bd (eval_evals_exec_type_sound RS conjunct1 RS mp RS spec RS mp) 1; |
|
310 |
by Auto_tac; |
|
311 |
qed "eval_type_sound"; |
|
312 |
||
10042 | 313 |
Goal "!!E s s'. \ |
314 |
\ [| G=prg E; wf_java_prog G; G\\<turnstile>(x,s) -s0-> (x',s'); s::\\<preceq>E; E\\<turnstile>s0\\<surd> |] \ |
|
315 |
\ ==> s'::\\<preceq>E"; |
|
8011 | 316 |
by( split_all_tac 1); |
317 |
bd (eval_evals_exec_type_sound RS conjunct2 RS conjunct2 RS mp RS spec RS mp) 1; |
|
318 |
by Auto_tac; |
|
319 |
qed "exec_type_sound"; |
|
320 |
||
10042 | 321 |
Goal "[|G=prg E; wf_java_prog G; G\\<turnstile>(x,s) -e\\<succ>a'-> Norm s'; a' \\<noteq> Null;\ |
322 |
\ s::\\<preceq>E; E\\<turnstile>e::Class C; method (G,C) sig \\<noteq> None|] ==> \ |
|
8034
6fc37b5c5e98
Various little changes like cmethd -> method and cfield -> field.
nipkow
parents:
8011
diff
changeset
|
323 |
\ method (G,fst (the (heap s' (the_Addr a')))) sig \\<noteq> None"; |
8105
2dda3e88d23f
simplified definition of appl_methds, removing m_head
oheimb
parents:
8085
diff
changeset
|
324 |
by( datac eval_type_sound 4 1); |
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
325 |
by(Clarsimp_tac 1); |
8011 | 326 |
by(rewtac wf_java_prog_def); |
327 |
by( forward_tac [widen_methd] 1); |
|
328 |
by( atac 1); |
|
329 |
by( Fast_tac 2); |
|
330 |
by( dtac non_npD 1); |
|
331 |
by Auto_tac; |
|
332 |
qed "all_methods_understood"; |
|
333 |
||
334 |
Delsimps [split_beta]; |
|
10613
78b1d6c3ee9c
improved superclass entry for classes and definition status of is_class, class
oheimb
parents:
10042
diff
changeset
|
335 |
Addsimps[fun_upd_apply]; |
8011 | 336 |