37 \item all triples in a derivation are of the same type (due to weak |
37 \item all triples in a derivation are of the same type (due to weak |
38 polymorphism) |
38 polymorphism) |
39 \end{itemize} |
39 \end{itemize} |
40 *} |
40 *} |
41 |
41 |
42 |
|
43 |
|
44 types res = vals (* result entry *) |
42 types res = vals (* result entry *) |
45 syntax |
43 syntax |
46 Val :: "val \<Rightarrow> res" |
44 Val :: "val \<Rightarrow> res" |
47 Var :: "var \<Rightarrow> res" |
45 Var :: "var \<Rightarrow> res" |
48 Vals :: "val list \<Rightarrow> res" |
46 Vals :: "val list \<Rightarrow> res" |
512 (* variables *) |
510 (* variables *) |
513 LVar: " G,A\<turnstile>{Normal (\<lambda>s.. P\<leftarrow>Var (lvar vn s))} LVar vn=\<succ> {P}" |
511 LVar: " G,A\<turnstile>{Normal (\<lambda>s.. P\<leftarrow>Var (lvar vn s))} LVar vn=\<succ> {P}" |
514 |
512 |
515 FVar: "\<lbrakk>G,A\<turnstile>{Normal P} .Init C. {Q}; |
513 FVar: "\<lbrakk>G,A\<turnstile>{Normal P} .Init C. {Q}; |
516 G,A\<turnstile>{Q} e-\<succ> {\<lambda>Val:a:. fvar C stat fn a ..; R}\<rbrakk> \<Longrightarrow> |
514 G,A\<turnstile>{Q} e-\<succ> {\<lambda>Val:a:. fvar C stat fn a ..; R}\<rbrakk> \<Longrightarrow> |
517 G,A\<turnstile>{Normal P} {C,stat}e..fn=\<succ> {R}" |
515 G,A\<turnstile>{Normal P} {accC,C,stat}e..fn=\<succ> {R}" |
518 |
516 |
519 AVar: "\<lbrakk>G,A\<turnstile>{Normal P} e1-\<succ> {Q}; |
517 AVar: "\<lbrakk>G,A\<turnstile>{Normal P} e1-\<succ> {Q}; |
520 \<forall>a. G,A\<turnstile>{Q\<leftarrow>Val a} e2-\<succ> {\<lambda>Val:i:. avar G i a ..; R}\<rbrakk> \<Longrightarrow> |
518 \<forall>a. G,A\<turnstile>{Q\<leftarrow>Val a} e2-\<succ> {\<lambda>Val:i:. avar G i a ..; R}\<rbrakk> \<Longrightarrow> |
521 G,A\<turnstile>{Normal P} e1.[e2]=\<succ> {R}" |
519 G,A\<turnstile>{Normal P} e1.[e2]=\<succ> {R}" |
522 (* expressions *) |
520 (* expressions *) |
558 invC = invocation_class mode (store s) a statT \<and> |
556 invC = invocation_class mode (store s) a statT \<and> |
559 l = locals (store s)) ;. |
557 l = locals (store s)) ;. |
560 init_lvars G declC \<lparr>name=mn,parTs=pTs\<rparr> mode a vs) \<and>. |
558 init_lvars G declC \<lparr>name=mn,parTs=pTs\<rparr> mode a vs) \<and>. |
561 (\<lambda>s. normal s \<longrightarrow> G\<turnstile>mode\<rightarrow>invC\<preceq>statT)} |
559 (\<lambda>s. normal s \<longrightarrow> G\<turnstile>mode\<rightarrow>invC\<preceq>statT)} |
562 Methd declC \<lparr>name=mn,parTs=pTs\<rparr>-\<succ> {set_lvars l .; S}\<rbrakk> \<Longrightarrow> |
560 Methd declC \<lparr>name=mn,parTs=pTs\<rparr>-\<succ> {set_lvars l .; S}\<rbrakk> \<Longrightarrow> |
563 G,A\<turnstile>{Normal P} {statT,mode}e\<cdot>mn({pTs}args)-\<succ> {S}" |
561 G,A\<turnstile>{Normal P} {accC,statT,mode}e\<cdot>mn({pTs}args)-\<succ> {S}" |
564 |
562 |
565 Methd:"\<lbrakk>G,A\<union> {{P} Methd-\<succ> {Q} | ms} |\<turnstile> {{P} body G-\<succ> {Q} | ms}\<rbrakk> \<Longrightarrow> |
563 Methd:"\<lbrakk>G,A\<union> {{P} Methd-\<succ> {Q} | ms} |\<turnstile> {{P} body G-\<succ> {Q} | ms}\<rbrakk> \<Longrightarrow> |
566 G,A|\<turnstile>{{P} Methd-\<succ> {Q} | ms}" |
564 G,A|\<turnstile>{{P} Methd-\<succ> {Q} | ms}" |
567 |
565 |
568 Body: "\<lbrakk>G,A\<turnstile>{Normal P} .Init D. {Q}; |
566 Body: "\<lbrakk>G,A\<turnstile>{Normal P} .Init D. {Q}; |
1042 \<forall>a. G,A\<turnstile>{Q\<leftarrow>Val a} args\<doteq>\<succ> |
1040 \<forall>a. G,A\<turnstile>{Q\<leftarrow>Val a} args\<doteq>\<succ> |
1043 {R a \<and>. (\<lambda>s. C = obj_class (the (heap (store s) (the_Addr a))) \<and> |
1041 {R a \<and>. (\<lambda>s. C = obj_class (the (heap (store s) (the_Addr a))) \<and> |
1044 C = invocation_declclass |
1042 C = invocation_declclass |
1045 G IntVir (store s) a statT \<lparr>name=mn,parTs=pTs\<rparr> )}; |
1043 G IntVir (store s) a statT \<lparr>name=mn,parTs=pTs\<rparr> )}; |
1046 G,(A::'a triple set)\<turnstile>{Normal P} e-\<succ> {Q::'a assn}\<rbrakk> |
1044 G,(A::'a triple set)\<turnstile>{Normal P} e-\<succ> {Q::'a assn}\<rbrakk> |
1047 \<Longrightarrow> G,A\<turnstile>{Normal P} {statT,IntVir}e\<cdot>mn({pTs}args)-\<succ> {S}" |
1045 \<Longrightarrow> G,A\<turnstile>{Normal P} {accC,statT,IntVir}e\<cdot>mn({pTs}args)-\<succ> {S}" |
1048 apply (erule ax_derivs.Call) |
1046 apply (erule ax_derivs.Call) |
1049 apply safe |
1047 apply safe |
1050 apply (erule spec) |
1048 apply (erule spec) |
1051 apply (rule ax_escape, clarsimp) |
1049 apply (rule ax_escape, clarsimp) |
1052 apply (drule spec, drule spec, drule spec,erule conseq12) |
1050 apply (drule spec, drule spec, drule spec,erule conseq12) |
1060 Methd C \<lparr>name=mn,parTs=pTs\<rparr>-\<succ> {set_lvars l .; S}; |
1058 Methd C \<lparr>name=mn,parTs=pTs\<rparr>-\<succ> {set_lvars l .; S}; |
1061 G,A\<turnstile>{Normal P} e-\<succ> {Q}; |
1059 G,A\<turnstile>{Normal P} e-\<succ> {Q}; |
1062 \<forall> a. G,(A::'a triple set)\<turnstile>{Q\<leftarrow>Val a} args\<doteq>\<succ> {(R::val \<Rightarrow> 'a assn) a |
1060 \<forall> a. G,(A::'a triple set)\<turnstile>{Q\<leftarrow>Val a} args\<doteq>\<succ> {(R::val \<Rightarrow> 'a assn) a |
1063 \<and>. (\<lambda> s. C=invocation_declclass |
1061 \<and>. (\<lambda> s. C=invocation_declclass |
1064 G Static (store s) a statT \<lparr>name=mn,parTs=pTs\<rparr>)} |
1062 G Static (store s) a statT \<lparr>name=mn,parTs=pTs\<rparr>)} |
1065 \<rbrakk> \<Longrightarrow> G,A\<turnstile>{Normal P} {statT,Static}e\<cdot>mn({pTs}args)-\<succ> {S}" |
1063 \<rbrakk> \<Longrightarrow> G,A\<turnstile>{Normal P} {accC,statT,Static}e\<cdot>mn({pTs}args)-\<succ> {S}" |
1066 apply (erule ax_derivs.Call) |
1064 apply (erule ax_derivs.Call) |
1067 apply safe |
1065 apply safe |
1068 apply (erule spec) |
1066 apply (erule spec) |
1069 apply (rule ax_escape, clarsimp) |
1067 apply (rule ax_escape, clarsimp) |
1070 apply (erule_tac V = "?P \<longrightarrow> ?Q" in thin_rl) |
1068 apply (erule_tac V = "?P \<longrightarrow> ?Q" in thin_rl) |