src/HOL/Bali/DefiniteAssignmentCorrect.thy
changeset 44890 22f665a2e91c
parent 35069 09154b995ed8
child 50710 32007a8db6bb
equal deleted inserted replaced
44889:340df9f3491f 44890:22f665a2e91c
    63   qed
    63   qed
    64 next
    64 next
    65   case False
    65   case False
    66   with eval obtain s0' abr where "G\<turnstile>(Some abr,s0') \<midarrow>Body D c-\<succ>v\<rightarrow>s1"
    66   with eval obtain s0' abr where "G\<turnstile>(Some abr,s0') \<midarrow>Body D c-\<succ>v\<rightarrow>s1"
    67                                  "s0 = (Some abr, s0')"
    67                                  "s0 = (Some abr, s0')"
    68     by (cases s0) fastsimp
    68     by (cases s0) fastforce
    69   with this jump
    69   with this jump
    70   show ?thesis
    70   show ?thesis
    71     by (cases) (simp)
    71     by (cases) (simp)
    72 qed
    72 qed
    73 
    73 
    87     by (rule Body_no_jump)
    87     by (rule Body_no_jump)
    88 next
    88 next
    89   case False
    89   case False
    90   with eval obtain s0' abr where "G\<turnstile>(Some abr,s0') \<midarrow>Methd D sig-\<succ>v\<rightarrow>s1"
    90   with eval obtain s0' abr where "G\<turnstile>(Some abr,s0') \<midarrow>Methd D sig-\<succ>v\<rightarrow>s1"
    91                                  "s0 = (Some abr, s0')"
    91                                  "s0 = (Some abr, s0')"
    92     by (cases s0) fastsimp
    92     by (cases s0) fastforce
    93   with this jump
    93   with this jump
    94   show ?thesis
    94   show ?thesis
    95     by (cases) (simp)
    95     by (cases) (simp)
    96 qed
    96 qed
    97 
    97 
  1100     by simp
  1100     by simp
  1101   ultimately show ?thesis
  1101   ultimately show ?thesis
  1102     apply (rule jumpNestingOk_evalE)
  1102     apply (rule jumpNestingOk_evalE)
  1103     apply assumption
  1103     apply assumption
  1104     apply simp
  1104     apply simp
  1105     apply fastsimp
  1105     apply fastforce
  1106     done
  1106     done
  1107 qed
  1107 qed
  1108 
  1108 
  1109 lemmas jumpNestingOk_eval_no_jumpE 
  1109 lemmas jumpNestingOk_eval_no_jumpE 
  1110        = jumpNestingOk_eval_no_jump [THEN conjE,rule_format]
  1110        = jumpNestingOk_eval_no_jump [THEN conjE,rule_format]
  2787       from nrm_c2' nrm_c2 A
  2787       from nrm_c2' nrm_c2 A
  2788       have "?NormalAssigned s2 A" 
  2788       have "?NormalAssigned s2 A" 
  2789         by blast
  2789         by blast
  2790       moreover from brk_c2' brk_c2 A
  2790       moreover from brk_c2' brk_c2 A
  2791       have "?BreakAssigned s1 s2 A" 
  2791       have "?BreakAssigned s1 s2 A" 
  2792         by fastsimp
  2792         by fastforce
  2793       with True 
  2793       with True 
  2794       have "?BreakAssigned (Norm s0) s2 A" by simp
  2794       have "?BreakAssigned (Norm s0) s2 A" by simp
  2795       moreover from res_c2 True
  2795       moreover from res_c2 True
  2796       have "?ResAssigned (Norm s0) s2"
  2796       have "?ResAssigned (Norm s0) s2"
  2797         by simp
  2797         by simp
  2872         from nrm_c1' nrm_c1 A
  2872         from nrm_c1' nrm_c1 A
  2873         have "?NormalAssigned s2 A" 
  2873         have "?NormalAssigned s2 A" 
  2874           by blast
  2874           by blast
  2875         moreover from brk_c1' brk_c1 A
  2875         moreover from brk_c1' brk_c1 A
  2876         have "?BreakAssigned s1 s2 A" 
  2876         have "?BreakAssigned s1 s2 A" 
  2877           by fastsimp
  2877           by fastforce
  2878         with normal_s1
  2878         with normal_s1
  2879         have "?BreakAssigned (Norm s0) s2 A" by simp
  2879         have "?BreakAssigned (Norm s0) s2 A" by simp
  2880         moreover from res_c1 normal_s1 have "?ResAssigned (Norm s0) s2"
  2880         moreover from res_c1 normal_s1 have "?ResAssigned (Norm s0) s2"
  2881           by simp
  2881           by simp
  2882         ultimately show ?thesis by (intro conjI)
  2882         ultimately show ?thesis by (intro conjI)
  2902         from nrm_c2' nrm_c2 A
  2902         from nrm_c2' nrm_c2 A
  2903         have "?NormalAssigned s2 A" 
  2903         have "?NormalAssigned s2 A" 
  2904           by blast
  2904           by blast
  2905         moreover from brk_c2' brk_c2 A
  2905         moreover from brk_c2' brk_c2 A
  2906         have "?BreakAssigned s1 s2 A" 
  2906         have "?BreakAssigned s1 s2 A" 
  2907           by fastsimp
  2907           by fastforce
  2908         with normal_s1
  2908         with normal_s1
  2909         have "?BreakAssigned (Norm s0) s2 A" by simp
  2909         have "?BreakAssigned (Norm s0) s2 A" by simp
  2910         moreover from res_c2 normal_s1 have "?ResAssigned (Norm s0) s2"
  2910         moreover from res_c2 normal_s1 have "?ResAssigned (Norm s0) s2"
  2911           by simp
  2911           by simp
  2912         ultimately show ?thesis by (intro conjI)
  2912         ultimately show ?thesis by (intro conjI)
  3023           moreover 
  3023           moreover 
  3024           have "?BreakAssigned (Norm s0) s3 A" 
  3024           have "?BreakAssigned (Norm s0) s3 A" 
  3025           proof -
  3025           proof -
  3026             from brk_A_A' brk_A' 
  3026             from brk_A_A' brk_A' 
  3027             have "?BreakAssigned (abupd (absorb (Cont l)) s2) s3 A" 
  3027             have "?BreakAssigned (abupd (absorb (Cont l)) s2) s3 A" 
  3028               by fastsimp
  3028               by fastforce
  3029             moreover
  3029             moreover
  3030             from True have "normal (abupd (absorb (Cont l)) s2)"
  3030             from True have "normal (abupd (absorb (Cont l)) s2)"
  3031               by (cases s2) auto
  3031               by (cases s2) auto
  3032             ultimately show ?thesis
  3032             ultimately show ?thesis
  3033               by simp
  3033               by simp
  3044           with eval_while 
  3044           with eval_while 
  3045           have eq_s3_s2: "s3=s2"
  3045           have eq_s3_s2: "s3=s2"
  3046             by auto
  3046             by auto
  3047           with nrm_C_C' nrm_C' A
  3047           with nrm_C_C' nrm_C' A
  3048           have "?NormalAssigned s3 A"
  3048           have "?NormalAssigned s3 A"
  3049             by fastsimp
  3049             by fastforce
  3050           moreover
  3050           moreover
  3051           from eq_s3_s2 brk_C_C' brk_C' normal_s1 A
  3051           from eq_s3_s2 brk_C_C' brk_C' normal_s1 A
  3052           have "?BreakAssigned (Norm s0) s3 A"
  3052           have "?BreakAssigned (Norm s0) s3 A"
  3053             by fastsimp
  3053             by fastforce
  3054           moreover 
  3054           moreover 
  3055           from eq_s3_s2 res_s2 normal_s1 have "?ResAssigned (Norm s0) s3"
  3055           from eq_s3_s2 res_s2 normal_s1 have "?ResAssigned (Norm s0) s3"
  3056             by simp
  3056             by simp
  3057           ultimately show ?thesis by (intro conjI)
  3057           ultimately show ?thesis by (intro conjI)
  3058         qed
  3058         qed
  3273           have "?BreakAssigned (Norm s0) s3 A"
  3273           have "?BreakAssigned (Norm s0) s3 A"
  3274           proof -
  3274           proof -
  3275             from brkAss_C2 have "?BreakAssigned (Norm s0) s3 C2'"
  3275             from brkAss_C2 have "?BreakAssigned (Norm s0) s3 C2'"
  3276               by (cases s2) (auto simp add: new_xcpt_var_def)
  3276               by (cases s2) (auto simp add: new_xcpt_var_def)
  3277             with brk_C2' A show ?thesis 
  3277             with brk_C2' A show ?thesis 
  3278               by fastsimp
  3278               by fastforce
  3279           qed
  3279           qed
  3280           moreover
  3280           moreover
  3281           from resAss_s3 have "?ResAssigned (Norm s0) s3"
  3281           from resAss_s3 have "?ResAssigned (Norm s0) s3"
  3282             by (cases s2) ( simp add: new_xcpt_var_def)
  3282             by (cases s2) ( simp add: new_xcpt_var_def)
  3283           ultimately show ?thesis by (intro conjI)
  3283           ultimately show ?thesis by (intro conjI)
  3351         by simp
  3351         by simp
  3352       from nrmAss_C2' nrm_C2' have "?NormalAssigned s2 C2"
  3352       from nrmAss_C2' nrm_C2' have "?NormalAssigned s2 C2"
  3353         by blast
  3353         by blast
  3354       moreover
  3354       moreover
  3355       from brkAss_C2' brk_C2' have "?BreakAssigned (Norm s1) s2 C2"
  3355       from brkAss_C2' brk_C2' have "?BreakAssigned (Norm s1) s2 C2"
  3356         by fastsimp
  3356         by fastforce
  3357       ultimately
  3357       ultimately
  3358       show ?thesis
  3358       show ?thesis
  3359         using that resAss_s2' by simp
  3359         using that resAss_s2' by simp
  3360     qed
  3360     qed
  3361     note s3 = `s3 = (if \<exists>err. x1 = Some (Error err) then (x1, s1)
  3361     note s3 = `s3 = (if \<exists>err. x1 = Some (Error err) then (x1, s1)
  3377           from normal_s3 s3
  3377           from normal_s3 s3
  3378           have "normal (x1,s1)"
  3378           have "normal (x1,s1)"
  3379             by (cases s2) (simp add: abrupt_if_def)
  3379             by (cases s2) (simp add: abrupt_if_def)
  3380           with normal_s3 nrmAss_C1 s3 s1_s2
  3380           with normal_s3 nrmAss_C1 s3 s1_s2
  3381           show ?thesis
  3381           show ?thesis
  3382             by fastsimp
  3382             by fastforce
  3383         qed
  3383         qed
  3384         moreover 
  3384         moreover 
  3385         have "nrm C2 \<subseteq> dom (locals (snd s3))"
  3385         have "nrm C2 \<subseteq> dom (locals (snd s3))"
  3386         proof -
  3386         proof -
  3387           from normal_s3 s3
  3387           from normal_s3 s3
  3388           have "normal s2"
  3388           have "normal s2"
  3389             by (cases s2) (simp add: abrupt_if_def)
  3389             by (cases s2) (simp add: abrupt_if_def)
  3390           with normal_s3 nrmAss_C2 s3 s1_s2
  3390           with normal_s3 nrmAss_C2 s3 s1_s2
  3391           show ?thesis
  3391           show ?thesis
  3392             by fastsimp
  3392             by fastforce
  3393         qed
  3393         qed
  3394         ultimately have "nrm C1 \<union> nrm C2 \<subseteq> \<dots>"
  3394         ultimately have "nrm C1 \<union> nrm C2 \<subseteq> \<dots>"
  3395           by (rule Un_least)
  3395           by (rule Un_least)
  3396         with nrm_A show ?thesis
  3396         with nrm_A show ?thesis
  3397           by simp
  3397           by simp