63 method (G,C) sig = Some (C,rT,maxl,ins); |
63 method (G,C) sig = Some (C,rT,maxl,ins); |
64 ins!pc = Bipush i; |
64 ins!pc = Bipush i; |
65 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
65 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
66 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs); |
66 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs); |
67 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
67 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
68 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>"; |
68 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
69 apply (clarsimp simp add: defs1 approx_val_def sup_PTS_eq map_eq_Cons) |
69 apply (clarsimp simp add: defs1 approx_val_def sup_PTS_eq map_eq_Cons) |
70 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup) |
70 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup) |
71 . |
71 done |
72 |
72 |
73 lemma NT_subtype_conv: |
73 lemma NT_subtype_conv: |
74 "G \<turnstile> NT \<preceq> T = (T=NT \<or> (\<exists>C. T = Class C))" |
74 "G \<turnstile> NT \<preceq> T = (T=NT \<or> (\<exists>C. T = Class C))" |
75 proof - |
75 proof - |
76 have "\<And>T T'. G \<turnstile> T' \<preceq> T \<Longrightarrow> T' = NT \<longrightarrow> (T=NT | (\<exists>C. T = Class C))" |
76 have "\<And>T T'. G \<turnstile> T' \<preceq> T \<Longrightarrow> T' = NT \<longrightarrow> (T=NT | (\<exists>C. T = Class C))" |
77 apply (erule widen.induct) |
77 apply (erule widen.induct) |
78 apply auto |
78 apply auto |
79 apply (case_tac R) |
79 apply (case_tac R) |
80 apply auto |
80 apply auto |
81 . |
81 done |
82 note l = this |
82 note l = this |
83 |
83 |
84 show ?thesis |
84 show ?thesis |
85 by (force intro: null dest: l) |
85 by (force intro: null dest: l) |
86 qed |
86 qed |
90 method (G,C) sig = Some (C,rT,maxl,ins); |
90 method (G,C) sig = Some (C,rT,maxl,ins); |
91 ins!pc = Aconst_null; |
91 ins!pc = Aconst_null; |
92 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
92 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
93 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs); |
93 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs); |
94 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
94 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
95 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>"; |
95 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
96 apply (clarsimp simp add: defs1 map_eq_Cons) |
96 apply (clarsimp simp add: defs1 map_eq_Cons) |
97 apply (rule conjI) |
97 apply (rule conjI) |
98 apply (force simp add: approx_val_Null NT_subtype_conv) |
98 apply (force simp add: approx_val_Null NT_subtype_conv) |
99 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup) |
99 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup) |
100 . |
100 done |
101 |
101 |
102 |
102 |
103 lemma Cast_conf2: |
103 lemma Cast_conf2: |
104 "\<lbrakk>wf_prog ok G; G,h\<turnstile>v\<Colon>\<preceq>RefT rt; cast_ok G C h v; G\<turnstile>Class C\<preceq>T; is_class G C\<rbrakk> |
104 "\<lbrakk>wf_prog ok G; G,h\<turnstile>v\<Colon>\<preceq>RefT rt; cast_ok G C h v; G\<turnstile>Class C\<preceq>T; is_class G C\<rbrakk> |
105 \<Longrightarrow> G,h\<turnstile>v\<Colon>\<preceq>T" |
105 \<Longrightarrow> G,h\<turnstile>v\<Colon>\<preceq>T" |
121 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
121 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
122 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
122 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
123 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
123 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
124 apply (clarsimp simp add: defs1 map_eq_Cons raise_xcpt_def approx_val_def) |
124 apply (clarsimp simp add: defs1 map_eq_Cons raise_xcpt_def approx_val_def) |
125 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup Cast_conf2) |
125 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup Cast_conf2) |
126 . |
126 done |
127 |
127 |
128 |
128 |
129 lemma Getfield_correct: |
129 lemma Getfield_correct: |
130 "\<lbrakk> wf_prog wt G; |
130 "\<lbrakk> wf_prog wt G; |
131 method (G,C) sig = Some (C,rT,maxl,ins); |
131 method (G,C) sig = Some (C,rT,maxl,ins); |
132 ins!pc = Getfield F D; |
132 ins!pc = Getfield F D; |
133 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
133 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
134 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
134 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
135 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
135 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
136 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>"; |
136 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
137 apply (clarsimp simp add: defs1 raise_xcpt_def map_eq_Cons approx_val_def split: option.split) |
137 apply (clarsimp simp add: defs1 raise_xcpt_def map_eq_Cons approx_val_def split: option.split) |
138 apply (frule conf_widen) |
138 apply (frule conf_widen) |
139 apply assumption+ |
139 apply assumption+ |
140 apply (drule conf_RefTD) |
140 apply (drule conf_RefTD) |
141 apply (clarsimp simp add: defs1 approx_val_def) |
141 apply (clarsimp simp add: defs1 approx_val_def) |
142 apply (rule conjI) |
142 apply (rule conjI) |
143 apply (drule widen_cfs_fields) |
143 apply (drule widen_cfs_fields) |
144 apply assumption+ |
144 apply assumption+ |
145 apply (force intro: conf_widen simp add: hconf_def oconf_def lconf_def) |
145 apply (force intro: conf_widen simp add: hconf_def oconf_def lconf_def) |
146 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup) |
146 apply (blast intro: approx_stk_imp_approx_stk_sup approx_loc_imp_approx_loc_sup) |
147 . |
147 done |
148 |
148 |
149 lemma Putfield_correct: |
149 lemma Putfield_correct: |
150 "\<lbrakk> wf_prog wt G; |
150 "\<lbrakk> wf_prog wt G; |
151 method (G,C) sig = Some (C,rT,maxl,ins); |
151 method (G,C) sig = Some (C,rT,maxl,ins); |
152 ins!pc = Putfield F D; |
152 ins!pc = Putfield F D; |
153 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
153 wt_instr (ins!pc) G rT (phi C sig) (length ins) pc; |
154 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
154 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
155 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
155 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
156 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>"; |
156 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
157 apply (clarsimp simp add: defs1 raise_xcpt_def split: option.split List.split) |
157 apply (clarsimp simp add: defs1 raise_xcpt_def split: option.split List.split) |
158 apply (clarsimp simp add: approx_val_def) |
158 apply (clarsimp simp add: approx_val_def) |
159 apply (frule conf_widen) |
159 apply (frule conf_widen) |
160 prefer 2 |
160 prefer 2 |
161 apply assumption |
161 apply assumption |
162 apply assumption |
162 apply assumption |
163 apply (drule conf_RefTD) |
163 apply (drule conf_RefTD) |
164 apply clarsimp |
164 apply clarsimp |
165 apply (blast intro: sup_heap_update_value approx_stk_imp_approx_stk_sup_heap approx_stk_imp_approx_stk_sup |
165 apply (blast intro: sup_heap_update_value approx_stk_imp_approx_stk_sup_heap |
166 approx_loc_imp_approx_loc_sup_heap approx_loc_imp_approx_loc_sup |
166 approx_stk_imp_approx_stk_sup |
167 hconf_imp_hconf_field_update |
167 approx_loc_imp_approx_loc_sup_heap approx_loc_imp_approx_loc_sup |
168 correct_frames_imp_correct_frames_field_update conf_widen dest: widen_cfs_fields) |
168 hconf_imp_hconf_field_update |
169 . |
169 correct_frames_imp_correct_frames_field_update conf_widen dest: widen_cfs_fields) |
|
170 done |
170 |
171 |
171 lemma collapse_paired_All: |
172 lemma collapse_paired_All: |
172 "(\<forall>x y. P(x,y)) = (\<forall>z. P z)" |
173 "(\<forall>x y. P(x,y)) = (\<forall>z. P z)" |
173 by fast |
174 by fast |
174 |
175 |
440 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
441 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
441 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
442 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
442 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
443 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
443 apply (clarsimp simp add: neq_Nil_conv defs1 split: split_if_asm) |
444 apply (clarsimp simp add: neq_Nil_conv defs1 split: split_if_asm) |
444 apply (frule wt_jvm_prog_impl_wt_instr) |
445 apply (frule wt_jvm_prog_impl_wt_instr) |
445 apply (tactic "EVERY1[atac, etac Suc_lessD]") |
446 apply (assumption, erule Suc_lessD) |
446 apply (unfold wt_jvm_prog_def) |
447 apply (unfold wt_jvm_prog_def) |
447 apply (tactic {* fast_tac (claset() |
448 apply (fastsimp |
448 addDs [thm "subcls_widen_methd"] |
449 dest: subcls_widen_methd |
449 addEs [rotate_prems 1 widen_trans] |
450 elim: widen_trans [COMP swap_prems_rl] |
450 addIs [conf_widen] |
451 intro: conf_widen |
451 addss (simpset() addsimps [thm "approx_val_def",thm "append_eq_conv_conj", map_eq_Cons]@thms "defs1")) 1 *}) |
452 simp: approx_val_def append_eq_conv_conj map_eq_Cons defs1) |
452 . |
453 done |
453 |
454 |
454 lemmas [simp] = map_append |
455 lemmas [simp] = map_append |
455 |
456 |
456 lemma Goto_correct: |
457 lemma Goto_correct: |
457 "\<lbrakk> wf_prog wt G; |
458 "\<lbrakk> wf_prog wt G; |
461 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
462 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
462 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
463 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
463 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
464 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
464 apply (clarsimp simp add: defs1) |
465 apply (clarsimp simp add: defs1) |
465 apply (fast intro: approx_loc_imp_approx_loc_sup approx_stk_imp_approx_stk_sup) |
466 apply (fast intro: approx_loc_imp_approx_loc_sup approx_stk_imp_approx_stk_sup) |
466 . |
467 done |
467 |
468 |
468 |
469 |
469 lemma Ifcmpeq_correct: |
470 lemma Ifcmpeq_correct: |
470 "\<lbrakk> wf_prog wt G; |
471 "\<lbrakk> wf_prog wt G; |
471 method (G,C) sig = Some (C,rT,maxl,ins); |
472 method (G,C) sig = Some (C,rT,maxl,ins); |
474 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
475 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
475 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
476 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
476 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
477 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
477 apply (clarsimp simp add: defs1) |
478 apply (clarsimp simp add: defs1) |
478 apply (fast intro: approx_loc_imp_approx_loc_sup approx_stk_imp_approx_stk_sup) |
479 apply (fast intro: approx_loc_imp_approx_loc_sup approx_stk_imp_approx_stk_sup) |
479 . |
480 done |
480 |
481 |
481 lemma Pop_correct: |
482 lemma Pop_correct: |
482 "\<lbrakk> wf_prog wt G; |
483 "\<lbrakk> wf_prog wt G; |
483 method (G,C) sig = Some (C,rT,maxl,ins); |
484 method (G,C) sig = Some (C,rT,maxl,ins); |
484 ins ! pc = Pop; |
485 ins ! pc = Pop; |
486 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
487 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
487 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
488 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
488 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
489 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
489 apply (clarsimp simp add: defs1) |
490 apply (clarsimp simp add: defs1) |
490 apply (fast intro: approx_loc_imp_approx_loc_sup approx_stk_imp_approx_stk_sup) |
491 apply (fast intro: approx_loc_imp_approx_loc_sup approx_stk_imp_approx_stk_sup) |
491 . |
492 done |
492 |
493 |
493 lemma Dup_correct: |
494 lemma Dup_correct: |
494 "\<lbrakk> wf_prog wt G; |
495 "\<lbrakk> wf_prog wt G; |
495 method (G,C) sig = Some (C,rT,maxl,ins); |
496 method (G,C) sig = Some (C,rT,maxl,ins); |
496 ins ! pc = Dup; |
497 ins ! pc = Dup; |
499 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
500 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
500 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
501 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
501 apply (clarsimp simp add: defs1 map_eq_Cons) |
502 apply (clarsimp simp add: defs1 map_eq_Cons) |
502 apply (force intro: approx_stk_imp_approx_stk_sup approx_val_imp_approx_val_sup approx_loc_imp_approx_loc_sup |
503 apply (force intro: approx_stk_imp_approx_stk_sup approx_val_imp_approx_val_sup approx_loc_imp_approx_loc_sup |
503 simp add: defs1 map_eq_Cons) |
504 simp add: defs1 map_eq_Cons) |
504 . |
505 done |
505 |
506 |
506 lemma Dup_x1_correct: |
507 lemma Dup_x1_correct: |
507 "\<lbrakk> wf_prog wt G; |
508 "\<lbrakk> wf_prog wt G; |
508 method (G,C) sig = Some (C,rT,maxl,ins); |
509 method (G,C) sig = Some (C,rT,maxl,ins); |
509 ins ! pc = Dup_x1; |
510 ins ! pc = Dup_x1; |
512 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
513 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
513 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
514 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
514 apply (clarsimp simp add: defs1 map_eq_Cons) |
515 apply (clarsimp simp add: defs1 map_eq_Cons) |
515 apply (force intro: approx_stk_imp_approx_stk_sup approx_val_imp_approx_val_sup approx_loc_imp_approx_loc_sup |
516 apply (force intro: approx_stk_imp_approx_stk_sup approx_val_imp_approx_val_sup approx_loc_imp_approx_loc_sup |
516 simp add: defs1 map_eq_Cons) |
517 simp add: defs1 map_eq_Cons) |
517 . |
518 done |
518 |
519 |
519 lemma Dup_x2_correct: |
520 lemma Dup_x2_correct: |
520 "\<lbrakk> wf_prog wt G; |
521 "\<lbrakk> wf_prog wt G; |
521 method (G,C) sig = Some (C,rT,maxl,ins); |
522 method (G,C) sig = Some (C,rT,maxl,ins); |
522 ins ! pc = Dup_x2; |
523 ins ! pc = Dup_x2; |
550 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
551 Some state' = exec (G, None, hp, (stk,loc,C,sig,pc)#frs) ; |
551 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
552 G,phi \<turnstile>JVM (None, hp, (stk,loc,C,sig,pc)#frs)\<surd> \<rbrakk> |
552 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
553 \<Longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
553 apply (clarsimp simp add: defs1 map_eq_Cons approx_val_def conf_def) |
554 apply (clarsimp simp add: defs1 map_eq_Cons approx_val_def conf_def) |
554 apply (blast intro: approx_stk_imp_approx_stk_sup approx_val_imp_approx_val_sup approx_loc_imp_approx_loc_sup) |
555 apply (blast intro: approx_stk_imp_approx_stk_sup approx_val_imp_approx_val_sup approx_loc_imp_approx_loc_sup) |
555 . |
556 done |
556 |
557 |
557 |
558 |
558 (** instr correct **) |
559 (** instr correct **) |
559 |
560 |
560 lemma instr_correct: |
561 lemma instr_correct: |
586 by (auto simp add: correct_state_def Let_def) |
587 by (auto simp add: correct_state_def Let_def) |
587 |
588 |
588 |
589 |
589 lemma BV_correct_1 [rulify]: |
590 lemma BV_correct_1 [rulify]: |
590 "\<And>state. \<lbrakk> wt_jvm_prog G phi; G,phi \<turnstile>JVM state\<surd>\<rbrakk> |
591 "\<And>state. \<lbrakk> wt_jvm_prog G phi; G,phi \<turnstile>JVM state\<surd>\<rbrakk> |
591 \<Longrightarrow> exec (G,state) = Some state' \<longrightarrow> G,phi \<turnstile>JVM state'\<surd>"; |
592 \<Longrightarrow> exec (G,state) = Some state' \<longrightarrow> G,phi \<turnstile>JVM state'\<surd>" |
592 apply (tactic "split_all_tac 1") |
593 apply (simp only: split_tupled_all) |
593 apply (rename_tac xp hp frs) |
594 apply (rename_tac xp hp frs) |
594 apply (case_tac xp) |
595 apply (case_tac xp) |
595 apply (case_tac frs) |
596 apply (case_tac frs) |
596 apply simp |
597 apply simp |
597 apply (tactic "split_all_tac 1") |
598 apply (simp only: split_tupled_all) |
598 apply (tactic "hyp_subst_tac 1") |
599 apply hypsubst |
599 apply (frule correct_state_impl_Some_method) |
600 apply (frule correct_state_impl_Some_method) |
600 apply (force intro: instr_correct) |
601 apply (force intro: instr_correct) |
601 apply (case_tac frs) |
602 apply (case_tac frs) |
602 apply simp+ |
603 apply simp_all |
603 . |
604 done |
604 |
605 |
605 |
606 |
606 lemma L0: |
607 lemma L0: |
607 "\<lbrakk> xp=None; frs\<noteq>[] \<rbrakk> \<Longrightarrow> (\<exists>state'. exec (G,xp,hp,frs) = Some state')" |
608 "\<lbrakk> xp=None; frs\<noteq>[] \<rbrakk> \<Longrightarrow> (\<exists>state'. exec (G,xp,hp,frs) = Some state')" |
608 by (clarsimp simp add: neq_Nil_conv simp del: split_paired_Ex) |
609 by (clarsimp simp add: neq_Nil_conv simp del: split_paired_Ex) |
611 "\<lbrakk>wt_jvm_prog G phi; G,phi \<turnstile>JVM (xp,hp,frs)\<surd>; xp=None; frs\<noteq>[]\<rbrakk> |
612 "\<lbrakk>wt_jvm_prog G phi; G,phi \<turnstile>JVM (xp,hp,frs)\<surd>; xp=None; frs\<noteq>[]\<rbrakk> |
612 \<Longrightarrow> \<exists>state'. exec(G,xp,hp,frs) = Some state' \<and> G,phi \<turnstile>JVM state'\<surd>" |
613 \<Longrightarrow> \<exists>state'. exec(G,xp,hp,frs) = Some state' \<and> G,phi \<turnstile>JVM state'\<surd>" |
613 apply (drule L0) |
614 apply (drule L0) |
614 apply assumption |
615 apply assumption |
615 apply (fast intro: BV_correct_1) |
616 apply (fast intro: BV_correct_1) |
616 . |
617 done |
617 |
618 |
618 |
619 |
619 theorem BV_correct [rulify]: |
620 theorem BV_correct [rulify]: |
620 "\<lbrakk> wt_jvm_prog G phi; G \<turnstile> s -jvm\<rightarrow> t \<rbrakk> \<Longrightarrow> G,phi \<turnstile>JVM s\<surd> \<longrightarrow> G,phi \<turnstile>JVM t\<surd>" |
621 "\<lbrakk> wt_jvm_prog G phi; G \<turnstile> s -jvm\<rightarrow> t \<rbrakk> \<Longrightarrow> G,phi \<turnstile>JVM s\<surd> \<longrightarrow> G,phi \<turnstile>JVM t\<surd>" |
621 apply (unfold exec_all_def) |
622 apply (unfold exec_all_def) |
622 apply (erule rtrancl_induct) |
623 apply (erule rtrancl_induct) |
623 apply simp |
624 apply simp |
624 apply (auto intro: BV_correct_1) |
625 apply (auto intro: BV_correct_1) |
625 . |
626 done |
626 |
627 |
627 |
628 |
628 theorem BV_correct_initial: |
629 theorem BV_correct_initial: |
629 "\<lbrakk> wt_jvm_prog G phi; G \<turnstile> s0 -jvm\<rightarrow> (None,hp,(stk,loc,C,sig,pc)#frs); G,phi \<turnstile>JVM s0 \<surd>\<rbrakk> |
630 "\<lbrakk> wt_jvm_prog G phi; G \<turnstile> s0 -jvm\<rightarrow> (None,hp,(stk,loc,C,sig,pc)#frs); G,phi \<turnstile>JVM s0 \<surd>\<rbrakk> |
630 \<Longrightarrow> approx_stk G hp stk (fst (the (((phi C) sig) ! pc))) \<and> approx_loc G hp loc (snd (the (((phi C) sig) ! pc)))" |
631 \<Longrightarrow> approx_stk G hp stk (fst (the (((phi C) sig) ! pc))) \<and> approx_loc G hp loc (snd (the (((phi C) sig) ! pc)))" |
631 apply (drule BV_correct) |
632 apply (drule BV_correct) |
632 apply assumption+ |
633 apply assumption+ |
633 apply (simp add: correct_state_def correct_frame_def split_def split: option.splits) |
634 apply (simp add: correct_state_def correct_frame_def split_def split: option.splits) |
634 . |
635 done |
635 |
636 |
636 end |
637 end |