src/HOL/MicroJava/J/Eval.thy
changeset 77645 7edbb16bc60f
parent 67443 3abf6a722518
child 80914 d97fdabd9e2b
equal deleted inserted replaced
77644:48b4e0cd94cd 77645:7edbb16bc60f
    81 
    81 
    82   \<comment> \<open>cf. 15.11.4.1, 15.11.4.2, 15.11.4.4, 15.11.4.5, 14.15\<close>
    82   \<comment> \<open>cf. 15.11.4.1, 15.11.4.2, 15.11.4.4, 15.11.4.5, 14.15\<close>
    83 | Call: "[| G\<turnstile>Norm s0 -e\<succ>a'-> s1; a = the_Addr a';
    83 | Call: "[| G\<turnstile>Norm s0 -e\<succ>a'-> s1; a = the_Addr a';
    84             G\<turnstile>s1 -ps[\<succ>]pvs-> (x,(h,l)); dynT = fst (the (h a));
    84             G\<turnstile>s1 -ps[\<succ>]pvs-> (x,(h,l)); dynT = fst (the (h a));
    85             (md,rT,pns,lvars,blk,res) = the (method (G,dynT) (mn,pTs));
    85             (md,rT,pns,lvars,blk,res) = the (method (G,dynT) (mn,pTs));
    86             G\<turnstile>(np a' x,(h,(init_vars lvars)(pns[\<mapsto>]pvs)(This\<mapsto>a'))) -blk-> s3;
    86             G\<turnstile>(np a' x,(h,(init_vars lvars)(pns[\<mapsto>]pvs, This\<mapsto>a'))) -blk-> s3;
    87             G\<turnstile> s3 -res\<succ>v -> (x4,s4) |] ==>
    87             G\<turnstile> s3 -res\<succ>v -> (x4,s4) |] ==>
    88          G\<turnstile>Norm s0 -{C}e..mn({pTs}ps)\<succ>v-> (x4,(heap s4,l))"
    88          G\<turnstile>Norm s0 -{C}e..mn({pTs}ps)\<succ>v-> (x4,(heap s4,l))"
    89 
    89 
    90 
    90 
    91   \<comment> \<open>evaluation of expression lists\<close>
    91   \<comment> \<open>evaluation of expression lists\<close>
   133 
   133 
   134 
   134 
   135 lemmas eval_evals_exec_induct = eval_evals_exec.induct [split_format (complete)]
   135 lemmas eval_evals_exec_induct = eval_evals_exec.induct [split_format (complete)]
   136 
   136 
   137 lemma NewCI: "[|new_Addr (heap s) = (a,x);  
   137 lemma NewCI: "[|new_Addr (heap s) = (a,x);  
   138        s' = c_hupd (heap s(a\<mapsto>(C,init_vars (fields (G,C))))) (x,s)|] ==>  
   138        s' = c_hupd ((heap s)(a\<mapsto>(C,init_vars (fields (G,C))))) (x,s)|] ==>  
   139        G\<turnstile>Norm s -NewC C\<succ>Addr a-> s'"
   139        G\<turnstile>Norm s -NewC C\<succ>Addr a-> s'"
   140 apply simp
   140 apply simp
   141 apply (rule eval_evals_exec.NewC)
   141 apply (rule eval_evals_exec.NewC)
   142 apply auto
   142 apply auto
   143 done
   143 done
   195 
   195 
   196 lemma eval_Call_code:
   196 lemma eval_Call_code:
   197   "[| G\<turnstile>Norm s0 -e\<succ>a'-> s1; a = the_Addr a';
   197   "[| G\<turnstile>Norm s0 -e\<succ>a'-> s1; a = the_Addr a';
   198       G\<turnstile>s1 -ps[\<succ>]pvs-> (x,(h,l)); dynT = fst (the (h a));
   198       G\<turnstile>s1 -ps[\<succ>]pvs-> (x,(h,l)); dynT = fst (the (h a));
   199       (md,rT,pns,lvars,blk,res) = the (method (G,dynT) (mn,pTs));
   199       (md,rT,pns,lvars,blk,res) = the (method (G,dynT) (mn,pTs));
   200       G\<turnstile>(np a' x,(h,(init_vars lvars)(pns[\<mapsto>]pvs)(This\<mapsto>a'))) -blk-> s3;
   200       G\<turnstile>(np a' x,(h,(init_vars lvars)(pns[\<mapsto>]pvs, This\<mapsto>a'))) -blk-> s3;
   201       G\<turnstile> s3 -res\<succ>v -> (x4,(h4, l4)) |] ==>
   201       G\<turnstile> s3 -res\<succ>v -> (x4,(h4, l4)) |] ==>
   202    G\<turnstile>Norm s0 -{C}e..mn({pTs}ps)\<succ>v-> (x4,(h4,l))"
   202    G\<turnstile>Norm s0 -{C}e..mn({pTs}ps)\<succ>v-> (x4,(h4,l))"
   203 using Call[of G s0 e a' s1 a ps pvs x h l dynT md rT pns lvars blk res mn pTs s3 v x4 "(h4, l4)" C]
   203 using Call[of G s0 e a' s1 a ps pvs x h l dynT md rT pns lvars blk res mn pTs s3 v x4 "(h4, l4)" C]
   204 by simp
   204 by simp
   205 
   205