549 |
549 |
550 apply (simp only: wf_java_mdecl_def) |
550 apply (simp only: wf_java_mdecl_def) |
551 apply (subgoal_tac "(\<forall>y\<in>set pns. y \<notin> set (map fst lvars))") |
551 apply (subgoal_tac "(\<forall>y\<in>set pns. y \<notin> set (map fst lvars))") |
552 apply (simp add: init_vars_def locvars_xstate_def locvars_locals_def galldefs unique_def split_def map_of_map_as_map_upd del: map_map) |
552 apply (simp add: init_vars_def locvars_xstate_def locvars_locals_def galldefs unique_def split_def map_of_map_as_map_upd del: map_map) |
553 apply (intro strip) |
553 apply (intro strip) |
554 apply (simp (no_asm_simp) only: append_Cons [THEN sym]) |
554 apply (simp (no_asm_simp) only: append_Cons [symmetric]) |
555 apply (rule progression_lvar_init_aux) |
555 apply (rule progression_lvar_init_aux) |
556 apply (auto simp: unique_def map_of_in_set disjoint_varnames_def) |
556 apply (auto simp: unique_def map_of_in_set disjoint_varnames_def) |
557 done |
557 done |
558 |
558 |
559 |
559 |
646 \<Longrightarrow> G,gh s'\<turnstile>v::\<preceq>T" |
646 \<Longrightarrow> G,gh s'\<turnstile>v::\<preceq>T" |
647 apply (simp add: gh_def) |
647 apply (simp add: gh_def) |
648 apply (rule_tac x3="fst s" and s3="snd s"and x'3="fst s'" |
648 apply (rule_tac x3="fst s" and s3="snd s"and x'3="fst s'" |
649 in eval_type_sound [THEN conjunct2 [THEN conjunct1 [THEN mp]], simplified]) |
649 in eval_type_sound [THEN conjunct2 [THEN conjunct1 [THEN mp]], simplified]) |
650 apply assumption+ |
650 apply assumption+ |
651 apply (simp (no_asm_use) add: surjective_pairing [THEN sym]) |
651 apply (simp (no_asm_use) add: surjective_pairing [symmetric]) |
652 apply (simp only: surjective_pairing [THEN sym]) |
652 apply (simp only: surjective_pairing [symmetric]) |
653 apply (auto simp add: gs_def gx_def) |
653 apply (auto simp add: gs_def gx_def) |
654 done |
654 done |
655 |
655 |
656 lemma evals_preserves_conf: |
656 lemma evals_preserves_conf: |
657 "\<lbrakk> G\<turnstile> s -es[\<succ>]vs-> s'; G,gh s \<turnstile> t ::\<preceq> T; E \<turnstile>es[::]Ts; |
657 "\<lbrakk> G\<turnstile> s -es[\<succ>]vs-> s'; G,gh s \<turnstile> t ::\<preceq> T; E \<turnstile>es[::]Ts; |
660 apply (subgoal_tac "gh s\<le>| gh s'") |
660 apply (subgoal_tac "gh s\<le>| gh s'") |
661 apply (frule conf_hext, assumption, assumption) |
661 apply (frule conf_hext, assumption, assumption) |
662 apply (frule eval_evals_exec_type_sound [THEN conjunct2 [THEN conjunct1 [THEN mp]]]) |
662 apply (frule eval_evals_exec_type_sound [THEN conjunct2 [THEN conjunct1 [THEN mp]]]) |
663 apply (subgoal_tac "G \<turnstile> (gx s, (gh s, gl s)) -es[\<succ>]vs-> (gx s', (gh s', gl s'))") |
663 apply (subgoal_tac "G \<turnstile> (gx s, (gh s, gl s)) -es[\<succ>]vs-> (gx s', (gh s', gl s'))") |
664 apply assumption |
664 apply assumption |
665 apply (simp add: gx_def gh_def gl_def surjective_pairing [THEN sym]) |
665 apply (simp add: gx_def gh_def gl_def surjective_pairing [symmetric]) |
666 apply (case_tac E) |
666 apply (case_tac E) |
667 apply (simp add: gx_def gs_def gh_def gl_def surjective_pairing [THEN sym]) |
667 apply (simp add: gx_def gs_def gh_def gl_def surjective_pairing [symmetric]) |
668 done |
668 done |
669 |
669 |
670 lemma eval_of_class: "\<lbrakk> G \<turnstile> s -e\<succ>a'-> s'; E \<turnstile> e :: Class C; |
670 lemma eval_of_class: "\<lbrakk> G \<turnstile> s -e\<succ>a'-> s'; E \<turnstile> e :: Class C; |
671 wf_java_prog G; s::\<preceq>E; gx s'=None; a' \<noteq> Null; G=prg E\<rbrakk> |
671 wf_java_prog G; s::\<preceq>E; gx s'=None; a' \<noteq> Null; G=prg E\<rbrakk> |
672 \<Longrightarrow> (\<exists> lc. a' = Addr lc)" |
672 \<Longrightarrow> (\<exists> lc. a' = Addr lc)" |
1060 (* establish (x, h, l)::\<preceq>(env_of_jmb G CL S) *) |
1060 (* establish (x, h, l)::\<preceq>(env_of_jmb G CL S) *) |
1061 apply (frule_tac xs=s1 and xs'="(x, h, l)" in state_ok_evals) |
1061 apply (frule_tac xs=s1 and xs'="(x, h, l)" in state_ok_evals) |
1062 apply (simp (no_asm_simp) only: env_of_jmb_fst, assumption, simp only: env_of_jmb_fst) |
1062 apply (simp (no_asm_simp) only: env_of_jmb_fst, assumption, simp only: env_of_jmb_fst) |
1063 |
1063 |
1064 (* establish \<exists> lc. a' = Addr lc *) |
1064 (* establish \<exists> lc. a' = Addr lc *) |
1065 apply (frule (5) eval_of_class, rule env_of_jmb_fst [THEN sym]) |
1065 apply (frule (5) eval_of_class, rule env_of_jmb_fst [symmetric]) |
1066 apply (subgoal_tac "G,h \<turnstile> a' ::\<preceq> Class C") |
1066 apply (subgoal_tac "G,h \<turnstile> a' ::\<preceq> Class C") |
1067 apply (subgoal_tac "is_class G dynT") |
1067 apply (subgoal_tac "is_class G dynT") |
1068 |
1068 |
1069 (* establish method (G, dynT) (mn, pTs) = Some(md, rT, pns, lvars, blk, res) *) |
1069 (* establish method (G, dynT) (mn, pTs) = Some(md, rT, pns, lvars, blk, res) *) |
1070 apply (drule method_defined, assumption+) |
1070 apply (drule method_defined, assumption+) |
1095 apply (simp only: fst_conv snd_conv) |
1095 apply (simp only: fst_conv snd_conv) |
1096 |
1096 |
1097 (* establish length pns = length pTs *) |
1097 (* establish length pns = length pTs *) |
1098 apply (frule method_preserves_length, assumption, assumption) |
1098 apply (frule method_preserves_length, assumption, assumption) |
1099 (* establish length pvs = length ps *) |
1099 (* establish length pvs = length ps *) |
1100 apply (frule evals_preserves_length [THEN sym]) |
1100 apply (frule evals_preserves_length [symmetric]) |
1101 |
1101 |
1102 (** start evaluating subexpressions **) |
1102 (** start evaluating subexpressions **) |
1103 apply (simp (no_asm_use) only: compExpr.simps compExprs.simps) |
1103 apply (simp (no_asm_use) only: compExpr.simps compExprs.simps) |
1104 |
1104 |
1105 (* evaluate e *) |
1105 (* evaluate e *) |
1177 apply (frule_tac E="env_of_jmb G CL S" in evals_type_sound) |
1177 apply (frule_tac E="env_of_jmb G CL S" in evals_type_sound) |
1178 apply assumption+ |
1178 apply assumption+ |
1179 apply (simp only: env_of_jmb_fst) |
1179 apply (simp only: env_of_jmb_fst) |
1180 apply (simp add: conforms_def xconf_def gs_def) |
1180 apply (simp add: conforms_def xconf_def gs_def) |
1181 apply simp |
1181 apply simp |
1182 apply (simp (no_asm_use) only: gx_def gs_def surjective_pairing [THEN sym]) |
1182 apply (simp (no_asm_use) only: gx_def gs_def surjective_pairing [symmetric]) |
1183 apply (simp (no_asm_use) only: ty_exprs_list_all2) apply simp |
1183 apply (simp (no_asm_use) only: ty_exprs_list_all2) apply simp |
1184 apply simp |
1184 apply simp |
1185 apply (simp (no_asm_use) only: gx_def gs_def surjective_pairing [THEN sym]) |
1185 apply (simp (no_asm_use) only: gx_def gs_def surjective_pairing [symmetric]) |
1186 (* list_all2 (\<lambda>T T'. G \<turnstile> T \<preceq> T') pTsa pTs *) |
1186 (* list_all2 (\<lambda>T T'. G \<turnstile> T \<preceq> T') pTsa pTs *) |
1187 apply (rule max_spec_widen, simp only: env_of_jmb_fst) |
1187 apply (rule max_spec_widen, simp only: env_of_jmb_fst) |
1188 |
1188 |
1189 |
1189 |
1190 (* show method (G, md) (mn, pTs) = Some (md, rT, pns, lvars, blk, res) *) |
1190 (* show method (G, md) (mn, pTs) = Some (md, rT, pns, lvars, blk, res) *) |