equal
deleted
inserted
replaced
457 assume eval: "G\<turnstile>s0 \<midarrow>LVar vn=\<succ>vf\<midarrow>n\<rightarrow> s1" |
457 assume eval: "G\<turnstile>s0 \<midarrow>LVar vn=\<succ>vf\<midarrow>n\<rightarrow> s1" |
458 assume P: "(Normal (\<lambda>s.. P\<leftarrow>In2 (lvar vn s))) Y s0 Z" |
458 assume P: "(Normal (\<lambda>s.. P\<leftarrow>In2 (lvar vn s))) Y s0 Z" |
459 show "P (In2 vf) s1 Z \<and> s1\<Colon>\<preceq>(G, L)" |
459 show "P (In2 vf) s1 Z \<and> s1\<Colon>\<preceq>(G, L)" |
460 proof |
460 proof |
461 from eval normal_s0 obtain "s1=s0" "vf=lvar vn (store s0)" |
461 from eval normal_s0 obtain "s1=s0" "vf=lvar vn (store s0)" |
462 by (fastsimp elim: evaln_elim_cases) |
462 by (fastforce elim: evaln_elim_cases) |
463 with P show "P (In2 vf) s1 Z" |
463 with P show "P (In2 vf) s1 Z" |
464 by simp |
464 by simp |
465 next |
465 next |
466 from eval wt da conf_s0 wf |
466 from eval wt da conf_s0 wf |
467 show "s1\<Colon>\<preceq>(G, L)" |
467 show "s1\<Colon>\<preceq>(G, L)" |
498 from eval obtain a s1 s2 s2' where |
498 from eval obtain a s1 s2 s2' where |
499 eval_init: "G\<turnstile>s0 \<midarrow>Init statDeclC\<midarrow>n\<rightarrow> s1" and |
499 eval_init: "G\<turnstile>s0 \<midarrow>Init statDeclC\<midarrow>n\<rightarrow> s1" and |
500 eval_e: "G\<turnstile>s1 \<midarrow>e-\<succ>a\<midarrow>n\<rightarrow> s2" and |
500 eval_e: "G\<turnstile>s1 \<midarrow>e-\<succ>a\<midarrow>n\<rightarrow> s2" and |
501 fvar: "(vf,s2')=fvar statDeclC stat fn a s2" and |
501 fvar: "(vf,s2')=fvar statDeclC stat fn a s2" and |
502 s3: "s3 = check_field_access G accC statDeclC fn stat a s2'" |
502 s3: "s3 = check_field_access G accC statDeclC fn stat a s2'" |
503 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
503 using normal_s0 by (fastforce elim: evaln_elim_cases) |
504 have wt_init: "\<lparr>prg=G, cls=accC, lcl=L\<rparr>\<turnstile>(Init statDeclC)\<Colon>\<surd>" |
504 have wt_init: "\<lparr>prg=G, cls=accC, lcl=L\<rparr>\<turnstile>(Init statDeclC)\<Colon>\<surd>" |
505 proof - |
505 proof - |
506 from wf wt_e |
506 from wf wt_e |
507 have iscls_statC: "is_class G statC" |
507 have iscls_statC: "is_class G statC" |
508 by (auto dest: ty_expr_is_type type_is_class) |
508 by (auto dest: ty_expr_is_type type_is_class) |
591 by (rule da_elim_cases) simp |
591 by (rule da_elim_cases) simp |
592 from eval obtain s1 a i s2 where |
592 from eval obtain s1 a i s2 where |
593 eval_e1: "G\<turnstile>s0 \<midarrow>e1-\<succ>a\<midarrow>n\<rightarrow> s1" and |
593 eval_e1: "G\<turnstile>s0 \<midarrow>e1-\<succ>a\<midarrow>n\<rightarrow> s1" and |
594 eval_e2: "G\<turnstile>s1 \<midarrow>e2-\<succ>i\<midarrow>n\<rightarrow> s2" and |
594 eval_e2: "G\<turnstile>s1 \<midarrow>e2-\<succ>i\<midarrow>n\<rightarrow> s2" and |
595 avar: "avar G i a s2 =(vf, s2')" |
595 avar: "avar G i a s2 =(vf, s2')" |
596 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
596 using normal_s0 by (fastforce elim: evaln_elim_cases) |
597 from valid_e1 P valid_A conf_s0 eval_e1 wt_e1 da_e1 |
597 from valid_e1 P valid_A conf_s0 eval_e1 wt_e1 da_e1 |
598 obtain Q: "Q \<lfloor>a\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G, L)" |
598 obtain Q: "Q \<lfloor>a\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G, L)" |
599 by (rule validE) |
599 by (rule validE) |
600 from Q have Q': "\<And> v. (Q\<leftarrow>In1 a) v s1 Z" |
600 from Q have Q': "\<And> v. (Q\<leftarrow>In1 a) v s1 Z" |
601 by simp |
601 by simp |
652 by (auto intro: da_Init [simplified] assigned.select_convs) |
652 by (auto intro: da_Init [simplified] assigned.select_convs) |
653 from eval obtain s1 a where |
653 from eval obtain s1 a where |
654 eval_init: "G\<turnstile>s0 \<midarrow>Init C\<midarrow>n\<rightarrow> s1" and |
654 eval_init: "G\<turnstile>s0 \<midarrow>Init C\<midarrow>n\<rightarrow> s1" and |
655 alloc: "G\<turnstile>s1 \<midarrow>halloc CInst C\<succ>a\<rightarrow> s2" and |
655 alloc: "G\<turnstile>s1 \<midarrow>halloc CInst C\<succ>a\<rightarrow> s2" and |
656 v: "v=Addr a" |
656 v: "v=Addr a" |
657 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
657 using normal_s0 by (fastforce elim: evaln_elim_cases) |
658 from valid_init P valid_A conf_s0 eval_init wt_init da_init |
658 from valid_init P valid_A conf_s0 eval_init wt_init da_init |
659 obtain "(Alloc G (CInst C) Q) \<diamondsuit> s1 Z" |
659 obtain "(Alloc G (CInst C) Q) \<diamondsuit> s1 Z" |
660 by (rule validE) |
660 by (rule validE) |
661 with alloc v have "Q \<lfloor>v\<rfloor>\<^sub>e s2 Z" |
661 with alloc v have "Q \<lfloor>v\<rfloor>\<^sub>e s2 Z" |
662 by simp |
662 by simp |
694 from eval obtain s1 i s2 a where |
694 from eval obtain s1 i s2 a where |
695 eval_init: "G\<turnstile>s0 \<midarrow>init_comp_ty T\<midarrow>n\<rightarrow> s1" and |
695 eval_init: "G\<turnstile>s0 \<midarrow>init_comp_ty T\<midarrow>n\<rightarrow> s1" and |
696 eval_e: "G\<turnstile>s1 \<midarrow>e-\<succ>i\<midarrow>n\<rightarrow> s2" and |
696 eval_e: "G\<turnstile>s1 \<midarrow>e-\<succ>i\<midarrow>n\<rightarrow> s2" and |
697 alloc: "G\<turnstile>abupd (check_neg i) s2 \<midarrow>halloc Arr T (the_Intg i)\<succ>a\<rightarrow> s3" and |
697 alloc: "G\<turnstile>abupd (check_neg i) s2 \<midarrow>halloc Arr T (the_Intg i)\<succ>a\<rightarrow> s3" and |
698 v: "v=Addr a" |
698 v: "v=Addr a" |
699 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
699 using normal_s0 by (fastforce elim: evaln_elim_cases) |
700 obtain I where |
700 obtain I where |
701 da_init: |
701 da_init: |
702 "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>dom (locals (store s0)) \<guillemotright>\<langle>init_comp_ty T\<rangle>\<^sub>s\<guillemotright> I" |
702 "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>dom (locals (store s0)) \<guillemotright>\<langle>init_comp_ty T\<rangle>\<^sub>s\<guillemotright> I" |
703 proof (cases "\<exists>C. T = Class C") |
703 proof (cases "\<exists>C. T = Class C") |
704 case True |
704 case True |
764 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> E" |
764 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> E" |
765 by cases simp |
765 by cases simp |
766 from eval obtain s1 where |
766 from eval obtain s1 where |
767 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>v\<midarrow>n\<rightarrow> s1" and |
767 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>v\<midarrow>n\<rightarrow> s1" and |
768 s2: "s2 = abupd (raise_if (\<not> G,snd s1\<turnstile>v fits T) ClassCast) s1" |
768 s2: "s2 = abupd (raise_if (\<not> G,snd s1\<turnstile>v fits T) ClassCast) s1" |
769 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
769 using normal_s0 by (fastforce elim: evaln_elim_cases) |
770 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
770 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
771 have "(\<lambda>Val:v:. \<lambda>s.. abupd (raise_if (\<not> G,s\<turnstile>v fits T) ClassCast) .; |
771 have "(\<lambda>Val:v:. \<lambda>s.. abupd (raise_if (\<not> G,s\<turnstile>v fits T) ClassCast) .; |
772 Q\<leftarrow>In1 v) \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
772 Q\<leftarrow>In1 v) \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
773 by (rule validE) |
773 by (rule validE) |
774 with s2 have "Q \<lfloor>v\<rfloor>\<^sub>e s2 Z" |
774 with s2 have "Q \<lfloor>v\<rfloor>\<^sub>e s2 Z" |
803 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> E" |
803 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> E" |
804 by cases simp |
804 by cases simp |
805 from eval obtain a where |
805 from eval obtain a where |
806 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>a\<midarrow>n\<rightarrow> s1" and |
806 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>a\<midarrow>n\<rightarrow> s1" and |
807 v: "v = Bool (a \<noteq> Null \<and> G,store s1\<turnstile>a fits RefT T)" |
807 v: "v = Bool (a \<noteq> Null \<and> G,store s1\<turnstile>a fits RefT T)" |
808 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
808 using normal_s0 by (fastforce elim: evaln_elim_cases) |
809 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
809 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
810 have "(\<lambda>Val:v:. \<lambda>s.. Q\<leftarrow>In1 (Bool (v \<noteq> Null \<and> G,s\<turnstile>v fits RefT T))) |
810 have "(\<lambda>Val:v:. \<lambda>s.. Q\<leftarrow>In1 (Bool (v \<noteq> Null \<and> G,s\<turnstile>v fits RefT T))) |
811 \<lfloor>a\<rfloor>\<^sub>e s1 Z" |
811 \<lfloor>a\<rfloor>\<^sub>e s1 Z" |
812 by (rule validE) |
812 by (rule validE) |
813 with v have "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
813 with v have "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
857 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> E" |
857 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> E" |
858 by cases simp |
858 by cases simp |
859 from eval obtain ve where |
859 from eval obtain ve where |
860 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>ve\<midarrow>n\<rightarrow> s1" and |
860 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>ve\<midarrow>n\<rightarrow> s1" and |
861 v: "v = eval_unop unop ve" |
861 v: "v = eval_unop unop ve" |
862 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
862 using normal_s0 by (fastforce elim: evaln_elim_cases) |
863 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
863 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
864 have "(\<lambda>Val:v:. Q\<leftarrow>In1 (eval_unop unop v)) \<lfloor>ve\<rfloor>\<^sub>e s1 Z" |
864 have "(\<lambda>Val:v:. Q\<leftarrow>In1 (eval_unop unop v)) \<lfloor>ve\<rfloor>\<^sub>e s1 Z" |
865 by (rule validE) |
865 by (rule validE) |
866 with v have "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
866 with v have "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
867 by simp |
867 by simp |
910 from eval obtain v1 s1 v2 where |
910 from eval obtain v1 s1 v2 where |
911 eval_e1: "G\<turnstile>s0 \<midarrow>e1-\<succ>v1\<midarrow>n\<rightarrow> s1" and |
911 eval_e1: "G\<turnstile>s0 \<midarrow>e1-\<succ>v1\<midarrow>n\<rightarrow> s1" and |
912 eval_e2: "G\<turnstile>s1 \<midarrow>(if need_second_arg binop v1 then \<langle>e2\<rangle>\<^sub>e else \<langle>Skip\<rangle>\<^sub>s) |
912 eval_e2: "G\<turnstile>s1 \<midarrow>(if need_second_arg binop v1 then \<langle>e2\<rangle>\<^sub>e else \<langle>Skip\<rangle>\<^sub>s) |
913 \<succ>\<midarrow>n\<rightarrow> (\<lfloor>v2\<rfloor>\<^sub>e, s2)" and |
913 \<succ>\<midarrow>n\<rightarrow> (\<lfloor>v2\<rfloor>\<^sub>e, s2)" and |
914 v: "v=eval_binop binop v1 v2" |
914 v: "v=eval_binop binop v1 v2" |
915 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
915 using normal_s0 by (fastforce elim: evaln_elim_cases) |
916 from valid_e1 P valid_A conf_s0 eval_e1 wt_e1 da_e1 |
916 from valid_e1 P valid_A conf_s0 eval_e1 wt_e1 da_e1 |
917 obtain Q: "Q \<lfloor>v1\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G,L)" |
917 obtain Q: "Q \<lfloor>v1\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G,L)" |
918 by (rule validE) |
918 by (rule validE) |
919 from Q have Q': "\<And> v. (Q\<leftarrow>In1 v1) v s1 Z" |
919 from Q have Q': "\<And> v. (Q\<leftarrow>In1 v1) v s1 Z" |
920 by simp |
920 by simp |
992 from da obtain V where |
992 from da obtain V where |
993 da_var: "\<lparr>prg=G,cls=accC,lcl=L\<rparr> \<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>var\<rangle>\<^sub>v\<guillemotright> V" |
993 da_var: "\<lparr>prg=G,cls=accC,lcl=L\<rparr> \<turnstile> dom (locals (store s0)) \<guillemotright>\<langle>var\<rangle>\<^sub>v\<guillemotright> V" |
994 by (cases "\<exists> n. var=LVar n") (insert da.LVar,auto elim!: da_elim_cases) |
994 by (cases "\<exists> n. var=LVar n") (insert da.LVar,auto elim!: da_elim_cases) |
995 from eval obtain w upd where |
995 from eval obtain w upd where |
996 eval_var: "G\<turnstile>s0 \<midarrow>var=\<succ>(v, upd)\<midarrow>n\<rightarrow> s1" |
996 eval_var: "G\<turnstile>s0 \<midarrow>var=\<succ>(v, upd)\<midarrow>n\<rightarrow> s1" |
997 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
997 using normal_s0 by (fastforce elim: evaln_elim_cases) |
998 from valid_var P valid_A conf_s0 eval_var wt_var da_var |
998 from valid_var P valid_A conf_s0 eval_var wt_var da_var |
999 have "(\<lambda>Var:(v, f):. Q\<leftarrow>In1 v) \<lfloor>(v, upd)\<rfloor>\<^sub>v s1 Z" |
999 have "(\<lambda>Var:(v, f):. Q\<leftarrow>In1 v) \<lfloor>(v, upd)\<rfloor>\<^sub>v s1 Z" |
1000 by (rule validE) |
1000 by (rule validE) |
1001 then have "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
1001 then have "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z" |
1002 by simp |
1002 by simp |
1149 \<turnstile>(dom (locals (store s0)) \<union> assigns_if False e0)\<guillemotright>\<langle>e2\<rangle>\<^sub>e\<guillemotright> E2" |
1149 \<turnstile>(dom (locals (store s0)) \<union> assigns_if False e0)\<guillemotright>\<langle>e2\<rangle>\<^sub>e\<guillemotright> E2" |
1150 by cases simp+ |
1150 by cases simp+ |
1151 from eval obtain b s1 where |
1151 from eval obtain b s1 where |
1152 eval_e0: "G\<turnstile>s0 \<midarrow>e0-\<succ>b\<midarrow>n\<rightarrow> s1" and |
1152 eval_e0: "G\<turnstile>s0 \<midarrow>e0-\<succ>b\<midarrow>n\<rightarrow> s1" and |
1153 eval_then_else: "G\<turnstile>s1 \<midarrow>(if the_Bool b then e1 else e2)-\<succ>v\<midarrow>n\<rightarrow> s2" |
1153 eval_then_else: "G\<turnstile>s1 \<midarrow>(if the_Bool b then e1 else e2)-\<succ>v\<midarrow>n\<rightarrow> s2" |
1154 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1154 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1155 from valid_e0 P valid_A conf_s0 eval_e0 wt_e0 da_e0 |
1155 from valid_e0 P valid_A conf_s0 eval_e0 wt_e0 da_e0 |
1156 obtain "P' \<lfloor>b\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G,L)" |
1156 obtain "P' \<lfloor>b\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G,L)" |
1157 by (rule validE) |
1157 by (rule validE) |
1158 hence P': "\<And> v. (P'\<leftarrow>=(the_Bool b)) v s1 Z" |
1158 hence P': "\<And> v. (P'\<leftarrow>=(the_Bool b)) v s1 Z" |
1159 by (cases "normal s1") auto |
1159 by (cases "normal s1") auto |
1244 statM: "max_spec G accC statT \<lparr>name=mn,parTs=pTs\<rparr> |
1244 statM: "max_spec G accC statT \<lparr>name=mn,parTs=pTs\<rparr> |
1245 = {((statDeclT,statM),pTs')}" and |
1245 = {((statDeclT,statM),pTs')}" and |
1246 mode: "mode = invmode statM e" and |
1246 mode: "mode = invmode statM e" and |
1247 T: "T =(resTy statM)" and |
1247 T: "T =(resTy statM)" and |
1248 eq_accC_accC': "accC=accC'" |
1248 eq_accC_accC': "accC=accC'" |
1249 by cases fastsimp+ |
1249 by cases fastforce+ |
1250 from da obtain C where |
1250 from da obtain C where |
1251 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> (dom (locals (store s0)))\<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> C" and |
1251 da_e: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> (dom (locals (store s0)))\<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright> C" and |
1252 da_args: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> nrm C \<guillemotright>\<langle>args\<rangle>\<^sub>l\<guillemotright> E" |
1252 da_args: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> nrm C \<guillemotright>\<langle>args\<rangle>\<^sub>l\<guillemotright> E" |
1253 by cases simp |
1253 by cases simp |
1254 from eval eq_accC_accC' obtain a s1 vs s2 s3 s3' s4 invDeclC where |
1254 from eval eq_accC_accC' obtain a s1 vs s2 s3 s3' s4 invDeclC where |
1633 v: "v = the (locals (store s2) Result)" and |
1633 v: "v = the (locals (store s2) Result)" and |
1634 s3: "s3 =(if \<exists>l. abrupt s2 = Some (Jump (Break l)) \<or> |
1634 s3: "s3 =(if \<exists>l. abrupt s2 = Some (Jump (Break l)) \<or> |
1635 abrupt s2 = Some (Jump (Cont l)) |
1635 abrupt s2 = Some (Jump (Cont l)) |
1636 then abupd (\<lambda>x. Some (Error CrossMethodJump)) s2 else s2)"and |
1636 then abupd (\<lambda>x. Some (Error CrossMethodJump)) s2 else s2)"and |
1637 s4: "s4 = abupd (absorb Ret) s3" |
1637 s4: "s4 = abupd (absorb Ret) s3" |
1638 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1638 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1639 obtain C' where |
1639 obtain C' where |
1640 da_c': "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> (dom (locals (store s1)))\<guillemotright>\<langle>c\<rangle>\<^sub>s\<guillemotright> C'" |
1640 da_c': "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile> (dom (locals (store s1)))\<guillemotright>\<langle>c\<rangle>\<^sub>s\<guillemotright> C'" |
1641 proof - |
1641 proof - |
1642 from eval_init |
1642 from eval_init |
1643 have "(dom (locals (store s0))) \<subseteq> (dom (locals (store s1)))" |
1643 have "(dom (locals (store s0))) \<subseteq> (dom (locals (store s1)))" |
1718 by cases simp |
1718 by cases simp |
1719 from eval obtain s1 ve vs where |
1719 from eval obtain s1 ve vs where |
1720 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>ve\<midarrow>n\<rightarrow> s1" and |
1720 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>ve\<midarrow>n\<rightarrow> s1" and |
1721 eval_es: "G\<turnstile>s1 \<midarrow>es\<doteq>\<succ>vs\<midarrow>n\<rightarrow> s2" and |
1721 eval_es: "G\<turnstile>s1 \<midarrow>es\<doteq>\<succ>vs\<midarrow>n\<rightarrow> s2" and |
1722 v: "v=ve#vs" |
1722 v: "v=ve#vs" |
1723 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1723 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1724 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
1724 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
1725 obtain Q: "Q \<lfloor>ve\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G,L)" |
1725 obtain Q: "Q \<lfloor>ve\<rfloor>\<^sub>e s1 Z" and conf_s1: "s1\<Colon>\<preceq>(G,L)" |
1726 by (rule validE) |
1726 by (rule validE) |
1727 from Q have Q': "\<And> v. (Q\<leftarrow>\<lfloor>ve\<rfloor>\<^sub>e) v s1 Z" |
1727 from Q have Q': "\<And> v. (Q\<leftarrow>\<lfloor>ve\<rfloor>\<^sub>e) v s1 Z" |
1728 by simp |
1728 by simp |
1766 assume eval: "G\<turnstile>s0 \<midarrow>Skip\<midarrow>n\<rightarrow> s1" |
1766 assume eval: "G\<turnstile>s0 \<midarrow>Skip\<midarrow>n\<rightarrow> s1" |
1767 assume P: "(Normal (P\<leftarrow>\<diamondsuit>)) Y s0 Z" |
1767 assume P: "(Normal (P\<leftarrow>\<diamondsuit>)) Y s0 Z" |
1768 show "P \<diamondsuit> s1 Z \<and> s1\<Colon>\<preceq>(G, L)" |
1768 show "P \<diamondsuit> s1 Z \<and> s1\<Colon>\<preceq>(G, L)" |
1769 proof - |
1769 proof - |
1770 from eval obtain "s1=s0" |
1770 from eval obtain "s1=s0" |
1771 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1771 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1772 with P conf_s0 show ?thesis |
1772 with P conf_s0 show ?thesis |
1773 by simp |
1773 by simp |
1774 qed |
1774 qed |
1775 qed |
1775 qed |
1776 next |
1776 next |
1794 from da obtain E where |
1794 from da obtain E where |
1795 da_e: "\<lparr>prg=G,cls=accC, lcl=L\<rparr>\<turnstile>dom (locals (store s0))\<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright>E" |
1795 da_e: "\<lparr>prg=G,cls=accC, lcl=L\<rparr>\<turnstile>dom (locals (store s0))\<guillemotright>\<langle>e\<rangle>\<^sub>e\<guillemotright>E" |
1796 by cases simp |
1796 by cases simp |
1797 from eval obtain v where |
1797 from eval obtain v where |
1798 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>v\<midarrow>n\<rightarrow> s1" |
1798 eval_e: "G\<turnstile>s0 \<midarrow>e-\<succ>v\<midarrow>n\<rightarrow> s1" |
1799 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1799 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1800 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
1800 from valid_e P valid_A conf_s0 eval_e wt_e da_e |
1801 obtain Q: "(Q\<leftarrow>\<diamondsuit>) \<lfloor>v\<rfloor>\<^sub>e s1 Z" and "s1\<Colon>\<preceq>(G,L)" |
1801 obtain Q: "(Q\<leftarrow>\<diamondsuit>) \<lfloor>v\<rfloor>\<^sub>e s1 Z" and "s1\<Colon>\<preceq>(G,L)" |
1802 by (rule validE) |
1802 by (rule validE) |
1803 thus ?thesis by simp |
1803 thus ?thesis by simp |
1804 qed |
1804 qed |
1825 da_c: "\<lparr>prg=G,cls=accC, lcl=L\<rparr>\<turnstile>dom (locals (store s0))\<guillemotright>\<langle>c\<rangle>\<^sub>s\<guillemotright>E" |
1825 da_c: "\<lparr>prg=G,cls=accC, lcl=L\<rparr>\<turnstile>dom (locals (store s0))\<guillemotright>\<langle>c\<rangle>\<^sub>s\<guillemotright>E" |
1826 by cases simp |
1826 by cases simp |
1827 from eval obtain s1 where |
1827 from eval obtain s1 where |
1828 eval_c: "G\<turnstile>s0 \<midarrow>c\<midarrow>n\<rightarrow> s1" and |
1828 eval_c: "G\<turnstile>s0 \<midarrow>c\<midarrow>n\<rightarrow> s1" and |
1829 s2: "s2 = abupd (absorb l) s1" |
1829 s2: "s2 = abupd (absorb l) s1" |
1830 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1830 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1831 from valid_c P valid_A conf_s0 eval_c wt_c da_c |
1831 from valid_c P valid_A conf_s0 eval_c wt_c da_c |
1832 obtain Q: "(abupd (absorb l) .; Q) \<diamondsuit> s1 Z" |
1832 obtain Q: "(abupd (absorb l) .; Q) \<diamondsuit> s1 Z" |
1833 by (rule validE) |
1833 by (rule validE) |
1834 with s2 have "Q \<diamondsuit> s2 Z" |
1834 with s2 have "Q \<diamondsuit> s2 Z" |
1835 by simp |
1835 by simp |
1857 show "R \<diamondsuit> s2 Z \<and> s2\<Colon>\<preceq>(G,L)" |
1857 show "R \<diamondsuit> s2 Z \<and> s2\<Colon>\<preceq>(G,L)" |
1858 proof - |
1858 proof - |
1859 from eval obtain s1 where |
1859 from eval obtain s1 where |
1860 eval_c1: "G\<turnstile>s0 \<midarrow>c1 \<midarrow>n\<rightarrow> s1" and |
1860 eval_c1: "G\<turnstile>s0 \<midarrow>c1 \<midarrow>n\<rightarrow> s1" and |
1861 eval_c2: "G\<turnstile>s1 \<midarrow>c2 \<midarrow>n\<rightarrow> s2" |
1861 eval_c2: "G\<turnstile>s1 \<midarrow>c2 \<midarrow>n\<rightarrow> s2" |
1862 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
1862 using normal_s0 by (fastforce elim: evaln_elim_cases) |
1863 from wt obtain |
1863 from wt obtain |
1864 wt_c1: "\<lparr>prg = G, cls = accC, lcl = L\<rparr>\<turnstile>c1\<Colon>\<surd>" and |
1864 wt_c1: "\<lparr>prg = G, cls = accC, lcl = L\<rparr>\<turnstile>c1\<Colon>\<surd>" and |
1865 wt_c2: "\<lparr>prg = G, cls = accC, lcl = L\<rparr>\<turnstile>c2\<Colon>\<surd>" |
1865 wt_c2: "\<lparr>prg = G, cls = accC, lcl = L\<rparr>\<turnstile>c2\<Colon>\<surd>" |
1866 by cases simp |
1866 by cases simp |
1867 from da obtain C1 C2 where |
1867 from da obtain C1 C2 where |
2295 eval_c1: "G\<turnstile>s0 \<midarrow>c1\<midarrow>n\<rightarrow> s1" and |
2295 eval_c1: "G\<turnstile>s0 \<midarrow>c1\<midarrow>n\<rightarrow> s1" and |
2296 sxalloc: "G\<turnstile>s1 \<midarrow>sxalloc\<rightarrow> s2" and |
2296 sxalloc: "G\<turnstile>s1 \<midarrow>sxalloc\<rightarrow> s2" and |
2297 s3: "if G,s2\<turnstile>catch C |
2297 s3: "if G,s2\<turnstile>catch C |
2298 then G\<turnstile>new_xcpt_var vn s2 \<midarrow>c2\<midarrow>n\<rightarrow> s3 |
2298 then G\<turnstile>new_xcpt_var vn s2 \<midarrow>c2\<midarrow>n\<rightarrow> s3 |
2299 else s3 = s2" |
2299 else s3 = s2" |
2300 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
2300 using normal_s0 by (fastforce elim: evaln_elim_cases) |
2301 from wt obtain |
2301 from wt obtain |
2302 wt_c1: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>c1\<Colon>\<surd>" and |
2302 wt_c1: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>c1\<Colon>\<surd>" and |
2303 wt_c2: "\<lparr>prg=G,cls=accC,lcl=L(VName vn\<mapsto>Class C)\<rparr>\<turnstile>c2\<Colon>\<surd>" |
2303 wt_c2: "\<lparr>prg=G,cls=accC,lcl=L(VName vn\<mapsto>Class C)\<rparr>\<turnstile>c2\<Colon>\<surd>" |
2304 by cases simp |
2304 by cases simp |
2305 from da obtain C1 C2 where |
2305 from da obtain C1 C2 where |
2427 eval_c1: "G\<turnstile>s0 \<midarrow>c1\<midarrow>n\<rightarrow> (abr1, s1)" and |
2427 eval_c1: "G\<turnstile>s0 \<midarrow>c1\<midarrow>n\<rightarrow> (abr1, s1)" and |
2428 eval_c2: "G\<turnstile>Norm s1 \<midarrow>c2\<midarrow>n\<rightarrow> s2" and |
2428 eval_c2: "G\<turnstile>Norm s1 \<midarrow>c2\<midarrow>n\<rightarrow> s2" and |
2429 s3: "s3 = (if \<exists>err. abr1 = Some (Error err) |
2429 s3: "s3 = (if \<exists>err. abr1 = Some (Error err) |
2430 then (abr1, s1) |
2430 then (abr1, s1) |
2431 else abupd (abrupt_if (abr1 \<noteq> None) abr1) s2)" |
2431 else abupd (abrupt_if (abr1 \<noteq> None) abr1) s2)" |
2432 using normal_s0 by (fastsimp elim: evaln_elim_cases) |
2432 using normal_s0 by (fastforce elim: evaln_elim_cases) |
2433 from wt obtain |
2433 from wt obtain |
2434 wt_c1: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>c1\<Colon>\<surd>" and |
2434 wt_c1: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>c1\<Colon>\<surd>" and |
2435 wt_c2: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>c2\<Colon>\<surd>" |
2435 wt_c2: "\<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>c2\<Colon>\<surd>" |
2436 by cases simp |
2436 by cases simp |
2437 from da obtain C1 C2 where |
2437 from da obtain C1 C2 where |