src/HOL/Bali/AxSound.thy
changeset 21765 89275a3ed7be
parent 18249 4398f0f12579
child 23350 50c5b0912a0c
equal deleted inserted replaced
21764:720b0add5206 21765:89275a3ed7be
   373       by simp
   373       by simp
   374   }
   374   }
   375   thus ?case
   375   thus ?case
   376     by (unfold ax_valids2_def) blast
   376     by (unfold ax_valids2_def) blast
   377 next
   377 next
   378   case (asm A ts)
   378   case (asm ts A)
   379   have "ts \<subseteq> A" .
   379   have "ts \<subseteq> A" .
   380   then show "G,A|\<Turnstile>\<Colon>ts"
   380   then show "G,A|\<Turnstile>\<Colon>ts"
   381     by (auto simp add: ax_valids2_def triple_valid2_def)
   381     by (auto simp add: ax_valids2_def triple_valid2_def)
   382 next
   382 next
   383   case (weaken A ts ts')
   383   case (weaken A ts' ts)
   384   have "G,A|\<Turnstile>\<Colon>ts'" .
   384   have "G,A|\<Turnstile>\<Colon>ts'" .
   385   moreover have "ts \<subseteq> ts'" .
   385   moreover have "ts \<subseteq> ts'" .
   386   ultimately show "G,A|\<Turnstile>\<Colon>ts"
   386   ultimately show "G,A|\<Turnstile>\<Colon>ts"
   387     by (unfold ax_valids2_def triple_valid2_def) blast
   387     by (unfold ax_valids2_def triple_valid2_def) blast
   388 next
   388 next
   389   case (conseq A P Q t)
   389   case (conseq P A t Q)
   390   have con: "\<forall>Y s Z. P Y s Z \<longrightarrow> 
   390   have con: "\<forall>Y s Z. P Y s Z \<longrightarrow> 
   391               (\<exists>P' Q'.
   391               (\<exists>P' Q'.
   392                   (G,A\<turnstile>{P'} t\<succ> {Q'} \<and> G,A|\<Turnstile>\<Colon>{ {P'} t\<succ> {Q'} }) \<and>
   392                   (G,A\<turnstile>{P'} t\<succ> {Q'} \<and> G,A|\<Turnstile>\<Colon>{ {P'} t\<succ> {Q'} }) \<and>
   393                   (\<forall>Y' s'. (\<forall>Y Z'. P' Y s Z' \<longrightarrow> Q' Y' s' Z') \<longrightarrow> Q Y' s' Z))".
   393                   (\<forall>Y' s'. (\<forall>Y Z'. P' Y s Z' \<longrightarrow> Q' Y' s' Z') \<longrightarrow> Q Y' s' Z))".
   394   show "G,A|\<Turnstile>\<Colon>{ {P} t\<succ> {Q} }"
   394   show "G,A|\<Turnstile>\<Colon>{ {P} t\<succ> {Q} }"
   429       qed
   429       qed
   430       ultimately show ?thesis ..
   430       ultimately show ?thesis ..
   431     qed
   431     qed
   432   qed
   432   qed
   433 next
   433 next
   434   case (hazard A P Q t)
   434   case (hazard A P t Q)
   435   show "G,A|\<Turnstile>\<Colon>{ {P \<and>. Not \<circ> type_ok G t} t\<succ> {Q} }"
   435   show "G,A|\<Turnstile>\<Colon>{ {P \<and>. Not \<circ> type_ok G t} t\<succ> {Q} }"
   436     by (simp add: ax_valids2_def triple_valid2_def2 type_ok_def) fast
   436     by (simp add: ax_valids2_def triple_valid2_def2 type_ok_def) fast
   437 next
   437 next
   438   case (Abrupt A P t)
   438   case (Abrupt A P t)
   439   show "G,A|\<Turnstile>\<Colon>{ {P\<leftarrow>arbitrary3 t \<and>. Not \<circ> normal} t\<succ> {P} }"
   439   show "G,A|\<Turnstile>\<Colon>{ {P\<leftarrow>arbitrary3 t \<and>. Not \<circ> normal} t\<succ> {P} }"
   472       show "s1\<Colon>\<preceq>(G, L)"
   472       show "s1\<Colon>\<preceq>(G, L)"
   473 	by (rule evaln_type_sound [elim_format]) simp
   473 	by (rule evaln_type_sound [elim_format]) simp
   474     qed
   474     qed
   475   qed
   475   qed
   476 next
   476 next
   477   case (FVar A statDeclC P Q R accC e fn stat)
   477   case (FVar A P statDeclC Q e stat fn R accC)
   478   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .Init statDeclC. {Q} }" .
   478   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .Init statDeclC. {Q} }" .
   479   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Q} e-\<succ> {\<lambda>Val:a:. fvar statDeclC stat fn a ..; R} }" .
   479   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Q} e-\<succ> {\<lambda>Val:a:. fvar statDeclC stat fn a ..; R} }" .
   480   show "G,A|\<Turnstile>\<Colon>{ {Normal P} {accC,statDeclC,stat}e..fn=\<succ> {R} }"
   480   show "G,A|\<Turnstile>\<Colon>{ {Normal P} {accC,statDeclC,stat}e..fn=\<succ> {R} }"
   481   proof (rule valid_var_NormalI)
   481   proof (rule valid_var_NormalI)
   482     fix n s0 L accC' T V vf s3 Y Z
   482     fix n s0 L accC' T V vf s3 Y Z
   567 	by (rule evaln_type_sound [elim_format]) simp
   567 	by (rule evaln_type_sound [elim_format]) simp
   568       ultimately show ?thesis using Q by simp
   568       ultimately show ?thesis using Q by simp
   569     qed
   569     qed
   570   qed
   570   qed
   571 next
   571 next
   572   case (AVar A P Q R e1 e2)
   572   case (AVar A P e1 Q e2 R)
   573   have valid_e1: "G,A|\<Turnstile>\<Colon>{ {Normal P} e1-\<succ> {Q} }" .
   573   have valid_e1: "G,A|\<Turnstile>\<Colon>{ {Normal P} e1-\<succ> {Q} }" .
   574   have valid_e2: "\<And> a. G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In1 a} e2-\<succ> {\<lambda>Val:i:. avar G i a ..; R} }"
   574   have valid_e2: "\<And> a. G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In1 a} e2-\<succ> {\<lambda>Val:i:. avar G i a ..; R} }"
   575     using AVar.hyps by simp
   575     using AVar.hyps by simp
   576   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e1.[e2]=\<succ> {R} }"
   576   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e1.[e2]=\<succ> {R} }"
   577   proof (rule valid_var_NormalI)
   577   proof (rule valid_var_NormalI)
   631 	by (rule evaln_type_sound [elim_format]) simp
   631 	by (rule evaln_type_sound [elim_format]) simp
   632       ultimately show ?thesis ..
   632       ultimately show ?thesis ..
   633     qed
   633     qed
   634   qed
   634   qed
   635 next
   635 next
   636   case (NewC A C P Q)
   636   case (NewC A P C Q)
   637   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .Init C. {Alloc G (CInst C) Q} }".
   637   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .Init C. {Alloc G (CInst C) Q} }".
   638   show "G,A|\<Turnstile>\<Colon>{ {Normal P} NewC C-\<succ> {Q} }"
   638   show "G,A|\<Turnstile>\<Colon>{ {Normal P} NewC C-\<succ> {Q} }"
   639   proof (rule valid_expr_NormalI)
   639   proof (rule valid_expr_NormalI)
   640     fix n s0 L accC T E v s2 Y Z
   640     fix n s0 L accC T E v s2 Y Z
   641     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
   641     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
   671 	by (rule evaln_type_sound [elim_format]) simp
   671 	by (rule evaln_type_sound [elim_format]) simp
   672       ultimately show ?thesis ..
   672       ultimately show ?thesis ..
   673     qed
   673     qed
   674   qed
   674   qed
   675 next
   675 next
   676   case (NewA A P Q R T e)
   676   case (NewA A P T Q e R)
   677   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .init_comp_ty T. {Q} }" .
   677   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .init_comp_ty T. {Q} }" .
   678   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Q} e-\<succ> {\<lambda>Val:i:. abupd (check_neg i) .; 
   678   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Q} e-\<succ> {\<lambda>Val:i:. abupd (check_neg i) .; 
   679                                             Alloc G (Arr T (the_Intg i)) R}}" .
   679                                             Alloc G (Arr T (the_Intg i)) R}}" .
   680   show "G,A|\<Turnstile>\<Colon>{ {Normal P} New T[e]-\<succ> {R} }"
   680   show "G,A|\<Turnstile>\<Colon>{ {Normal P} New T[e]-\<succ> {R} }"
   681   proof (rule valid_expr_NormalI)
   681   proof (rule valid_expr_NormalI)
   744 	by (rule evaln_type_sound [elim_format]) simp
   744 	by (rule evaln_type_sound [elim_format]) simp
   745       ultimately show ?thesis ..
   745       ultimately show ?thesis ..
   746     qed
   746     qed
   747   qed
   747   qed
   748 next
   748 next
   749   case (Cast A P Q T e)
   749   case (Cast A P e T Q)
   750   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> 
   750   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> 
   751                  {\<lambda>Val:v:. \<lambda>s.. abupd (raise_if (\<not> G,s\<turnstile>v fits T) ClassCast) .;
   751                  {\<lambda>Val:v:. \<lambda>s.. abupd (raise_if (\<not> G,s\<turnstile>v fits T) ClassCast) .;
   752                   Q\<leftarrow>In1 v} }" .
   752                   Q\<leftarrow>In1 v} }" .
   753   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Cast T e-\<succ> {Q} }"
   753   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Cast T e-\<succ> {Q} }"
   754   proof (rule valid_expr_NormalI)
   754   proof (rule valid_expr_NormalI)
   784 	by (rule evaln_type_sound [elim_format]) simp
   784 	by (rule evaln_type_sound [elim_format]) simp
   785       ultimately show ?thesis ..
   785       ultimately show ?thesis ..
   786     qed
   786     qed
   787   qed
   787   qed
   788 next
   788 next
   789   case (Inst A P Q T e)
   789   case (Inst A P e Q T)
   790   assume valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ>
   790   assume valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ>
   791                {\<lambda>Val:v:. \<lambda>s.. Q\<leftarrow>In1 (Bool (v \<noteq> Null \<and> G,s\<turnstile>v fits RefT T))} }"
   791                {\<lambda>Val:v:. \<lambda>s.. Q\<leftarrow>In1 (Bool (v \<noteq> Null \<and> G,s\<turnstile>v fits RefT T))} }"
   792   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e InstOf T-\<succ> {Q} }"
   792   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e InstOf T-\<succ> {Q} }"
   793   proof (rule valid_expr_NormalI)
   793   proof (rule valid_expr_NormalI)
   794     fix n s0 L accC instT E v s1 Y Z
   794     fix n s0 L accC instT E v s1 Y Z
   839 	using normal_s0 by (auto elim: evaln_elim_cases)
   839 	using normal_s0 by (auto elim: evaln_elim_cases)
   840       with P conf_s0 show ?thesis by simp
   840       with P conf_s0 show ?thesis by simp
   841     qed
   841     qed
   842   qed
   842   qed
   843 next
   843 next
   844   case (UnOp A P Q e unop)
   844   case (UnOp A P e Q unop)
   845   assume valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P}e-\<succ>{\<lambda>Val:v:. Q\<leftarrow>In1 (eval_unop unop v)} }"
   845   assume valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P}e-\<succ>{\<lambda>Val:v:. Q\<leftarrow>In1 (eval_unop unop v)} }"
   846   show "G,A|\<Turnstile>\<Colon>{ {Normal P} UnOp unop e-\<succ> {Q} }"
   846   show "G,A|\<Turnstile>\<Colon>{ {Normal P} UnOp unop e-\<succ> {Q} }"
   847   proof (rule valid_expr_NormalI)
   847   proof (rule valid_expr_NormalI)
   848     fix n s0 L accC T E v s1 Y Z
   848     fix n s0 L accC T E v s1 Y Z
   849     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
   849     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
   876 	by (rule evaln_type_sound [elim_format]) simp
   876 	by (rule evaln_type_sound [elim_format]) simp
   877       ultimately show ?thesis ..
   877       ultimately show ?thesis ..
   878     qed
   878     qed
   879   qed
   879   qed
   880 next
   880 next
   881   case (BinOp A P Q R binop e1 e2)
   881   case (BinOp A P e1 Q binop e2 R)
   882   assume valid_e1: "G,A|\<Turnstile>\<Colon>{ {Normal P} e1-\<succ> {Q} }" 
   882   assume valid_e1: "G,A|\<Turnstile>\<Colon>{ {Normal P} e1-\<succ> {Q} }" 
   883   have valid_e2: "\<And> v1.  G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In1 v1}
   883   have valid_e2: "\<And> v1.  G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In1 v1}
   884               (if need_second_arg binop v1 then In1l e2 else In1r Skip)\<succ>
   884               (if need_second_arg binop v1 then In1l e2 else In1r Skip)\<succ>
   885               {\<lambda>Val:v2:. R\<leftarrow>In1 (eval_binop binop v1 v2)} }"
   885               {\<lambda>Val:v2:. R\<leftarrow>In1 (eval_binop binop v1 v2)} }"
   886     using BinOp.hyps by simp
   886     using BinOp.hyps by simp
   975 	using normal_s0 by (auto elim: evaln_elim_cases)
   975 	using normal_s0 by (auto elim: evaln_elim_cases)
   976       with P conf_s0 show ?thesis by simp
   976       with P conf_s0 show ?thesis by simp
   977     qed
   977     qed
   978   qed
   978   qed
   979 next
   979 next
   980   case (Acc A P Q var)
   980   case (Acc A P var Q)
   981   have valid_var: "G,A|\<Turnstile>\<Colon>{ {Normal P} var=\<succ> {\<lambda>Var:(v, f):. Q\<leftarrow>In1 v} }" .
   981   have valid_var: "G,A|\<Turnstile>\<Colon>{ {Normal P} var=\<succ> {\<lambda>Var:(v, f):. Q\<leftarrow>In1 v} }" .
   982   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Acc var-\<succ> {Q} }"
   982   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Acc var-\<succ> {Q} }"
   983   proof (rule valid_expr_NormalI)
   983   proof (rule valid_expr_NormalI)
   984     fix n s0 L accC T E v s1 Y Z
   984     fix n s0 L accC T E v s1 Y Z
   985     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
   985     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  1011 	by (rule evaln_type_sound [elim_format]) simp
  1011 	by (rule evaln_type_sound [elim_format]) simp
  1012       ultimately show ?thesis ..
  1012       ultimately show ?thesis ..
  1013     qed
  1013     qed
  1014   qed
  1014   qed
  1015 next
  1015 next
  1016   case (Ass A P Q R e var)
  1016   case (Ass A P var Q e R)
  1017   have valid_var: "G,A|\<Turnstile>\<Colon>{ {Normal P} var=\<succ> {Q} }" .
  1017   have valid_var: "G,A|\<Turnstile>\<Colon>{ {Normal P} var=\<succ> {Q} }" .
  1018   have valid_e: "\<And> vf. 
  1018   have valid_e: "\<And> vf. 
  1019                   G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In2 vf} e-\<succ> {\<lambda>Val:v:. assign (snd vf) v .; R} }"
  1019                   G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In2 vf} e-\<succ> {\<lambda>Val:v:. assign (snd vf) v .; R} }"
  1020     using Ass.hyps by simp
  1020     using Ass.hyps by simp
  1021   show "G,A|\<Turnstile>\<Colon>{ {Normal P} var:=e-\<succ> {R} }"
  1021   show "G,A|\<Turnstile>\<Colon>{ {Normal P} var:=e-\<succ> {R} }"
  1123 	by (rule evaln_type_sound [elim_format]) simp
  1123 	by (rule evaln_type_sound [elim_format]) simp
  1124       ultimately show ?thesis ..
  1124       ultimately show ?thesis ..
  1125     qed
  1125     qed
  1126   qed
  1126   qed
  1127 next
  1127 next
  1128   case (Cond A P P' Q e0 e1 e2)
  1128   case (Cond A P e0 P' e1 e2 Q)
  1129   have valid_e0: "G,A|\<Turnstile>\<Colon>{ {Normal P} e0-\<succ> {P'} }" .
  1129   have valid_e0: "G,A|\<Turnstile>\<Colon>{ {Normal P} e0-\<succ> {P'} }" .
  1130   have valid_then_else:"\<And> b.  G,A|\<Turnstile>\<Colon>{ {P'\<leftarrow>=b} (if b then e1 else e2)-\<succ> {Q} }"
  1130   have valid_then_else:"\<And> b.  G,A|\<Turnstile>\<Colon>{ {P'\<leftarrow>=b} (if b then e1 else e2)-\<succ> {Q} }"
  1131     using Cond.hyps by simp
  1131     using Cond.hyps by simp
  1132   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e0 ? e1 : e2-\<succ> {Q} }"
  1132   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e0 ? e1 : e2-\<succ> {Q} }"
  1133   proof (rule valid_expr_NormalI)
  1133   proof (rule valid_expr_NormalI)
  1213 	by (rule evaln_type_sound [elim_format]) simp
  1213 	by (rule evaln_type_sound [elim_format]) simp
  1214       ultimately show ?thesis ..
  1214       ultimately show ?thesis ..
  1215     qed
  1215     qed
  1216   qed
  1216   qed
  1217 next
  1217 next
  1218   case (Call A P Q R S accC' args e mn mode pTs' statT)
  1218   case (Call A P e Q args R mode statT mn pTs' S accC')
  1219   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {Q} }" .
  1219   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {Q} }" .
  1220   have valid_args: "\<And> a. G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In1 a} args\<doteq>\<succ> {R a} }"
  1220   have valid_args: "\<And> a. G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>In1 a} args\<doteq>\<succ> {R a} }"
  1221     using Call.hyps by simp
  1221     using Call.hyps by simp
  1222   have valid_methd: "\<And> a vs invC declC l.
  1222   have valid_methd: "\<And> a vs invC declC l.
  1223         G,A|\<Turnstile>\<Colon>{ {R a\<leftarrow>In3 vs \<and>.
  1223         G,A|\<Turnstile>\<Colon>{ {R a\<leftarrow>In3 vs \<and>.
  1602   case (Methd A P Q ms)
  1602   case (Methd A P Q ms)
  1603   have valid_body: "G,A \<union> {{P} Methd-\<succ> {Q} | ms}|\<Turnstile>\<Colon>{{P} body G-\<succ> {Q} | ms}".
  1603   have valid_body: "G,A \<union> {{P} Methd-\<succ> {Q} | ms}|\<Turnstile>\<Colon>{{P} body G-\<succ> {Q} | ms}".
  1604   show "G,A|\<Turnstile>\<Colon>{{P} Methd-\<succ> {Q} | ms}"
  1604   show "G,A|\<Turnstile>\<Colon>{{P} Methd-\<succ> {Q} | ms}"
  1605     by (rule Methd_sound)
  1605     by (rule Methd_sound)
  1606 next
  1606 next
  1607   case (Body A D P Q R c)
  1607   case (Body A P D Q c R)
  1608   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .Init D. {Q} }".
  1608   have valid_init: "G,A|\<Turnstile>\<Colon>{ {Normal P} .Init D. {Q} }".
  1609   have valid_c: "G,A|\<Turnstile>\<Colon>{ {Q} .c. 
  1609   have valid_c: "G,A|\<Turnstile>\<Colon>{ {Q} .c. 
  1610               {\<lambda>s.. abupd (absorb Ret) .; R\<leftarrow>In1 (the (locals s Result))} }".
  1610               {\<lambda>s.. abupd (absorb Ret) .; R\<leftarrow>In1 (the (locals s Result))} }".
  1611   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Body D c-\<succ> {R} }"
  1611   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Body D c-\<succ> {R} }"
  1612   proof (rule valid_expr_NormalI)
  1612   proof (rule valid_expr_NormalI)
  1695       with P conf_s0 show ?thesis
  1695       with P conf_s0 show ?thesis
  1696 	by simp
  1696 	by simp
  1697     qed
  1697     qed
  1698   qed
  1698   qed
  1699 next
  1699 next
  1700   case (Cons A P Q R e es)
  1700   case (Cons A P e Q es R)
  1701   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {Q} }".
  1701   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {Q} }".
  1702   have valid_es: "\<And> v. G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>\<lfloor>v\<rfloor>\<^sub>e} es\<doteq>\<succ> {\<lambda>Vals:vs:. R\<leftarrow>\<lfloor>(v # vs)\<rfloor>\<^sub>l} }"
  1702   have valid_es: "\<And> v. G,A|\<Turnstile>\<Colon>{ {Q\<leftarrow>\<lfloor>v\<rfloor>\<^sub>e} es\<doteq>\<succ> {\<lambda>Vals:vs:. R\<leftarrow>\<lfloor>(v # vs)\<rfloor>\<^sub>l} }"
  1703     using Cons.hyps by simp
  1703     using Cons.hyps by simp
  1704   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e # es\<doteq>\<succ> {R} }"
  1704   show "G,A|\<Turnstile>\<Colon>{ {Normal P} e # es\<doteq>\<succ> {R} }"
  1705   proof (rule valid_expr_list_NormalI)
  1705   proof (rule valid_expr_list_NormalI)
  1777       with P conf_s0 show ?thesis
  1777       with P conf_s0 show ?thesis
  1778 	by simp
  1778 	by simp
  1779     qed
  1779     qed
  1780   qed
  1780   qed
  1781 next
  1781 next
  1782   case (Expr A P Q e)
  1782   case (Expr A P e Q)
  1783   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {Q\<leftarrow>\<diamondsuit>} }".
  1783   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {Q\<leftarrow>\<diamondsuit>} }".
  1784   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .Expr e. {Q} }"
  1784   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .Expr e. {Q} }"
  1785   proof (rule valid_stmt_NormalI)
  1785   proof (rule valid_stmt_NormalI)
  1786     fix n s0 L accC C s1 Y Z
  1786     fix n s0 L accC C s1 Y Z
  1787     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  1787     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  1807 	by (rule validE)
  1807 	by (rule validE)
  1808       thus ?thesis by simp
  1808       thus ?thesis by simp
  1809     qed
  1809     qed
  1810   qed
  1810   qed
  1811 next
  1811 next
  1812   case (Lab A P Q c l)
  1812   case (Lab A P c l Q)
  1813   have valid_c: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c. {abupd (absorb l) .; Q} }".
  1813   have valid_c: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c. {abupd (absorb l) .; Q} }".
  1814   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .l\<bullet> c. {Q} }"
  1814   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .l\<bullet> c. {Q} }"
  1815   proof (rule valid_stmt_NormalI)
  1815   proof (rule valid_stmt_NormalI)
  1816     fix n s0 L accC C s2 Y Z
  1816     fix n s0 L accC C s2 Y Z
  1817     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  1817     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  1844 	by (rule evaln_type_sound [elim_format]) simp
  1844 	by (rule evaln_type_sound [elim_format]) simp
  1845       ultimately show ?thesis ..
  1845       ultimately show ?thesis ..
  1846     qed
  1846     qed
  1847   qed
  1847   qed
  1848 next
  1848 next
  1849   case (Comp A P Q R c1 c2)
  1849   case (Comp A P c1 Q c2 R)
  1850   have valid_c1: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1. {Q} }" .
  1850   have valid_c1: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1. {Q} }" .
  1851   have valid_c2: "G,A|\<Turnstile>\<Colon>{ {Q} .c2. {R} }" .
  1851   have valid_c2: "G,A|\<Turnstile>\<Colon>{ {Q} .c2. {R} }" .
  1852   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1;; c2. {R} }"
  1852   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1;; c2. {R} }"
  1853   proof (rule valid_stmt_NormalI)
  1853   proof (rule valid_stmt_NormalI)
  1854     fix n s0 L accC C s2 Y Z
  1854     fix n s0 L accC C s2 Y Z
  1903 	by (rule evaln_type_sound [elim_format]) simp
  1903 	by (rule evaln_type_sound [elim_format]) simp
  1904       ultimately show ?thesis ..
  1904       ultimately show ?thesis ..
  1905     qed
  1905     qed
  1906   qed
  1906   qed
  1907 next
  1907 next
  1908   case (If A P P' Q c1 c2 e)
  1908   case (If A P e P' c1 c2 Q)
  1909   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {P'} }" .
  1909   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {P'} }" .
  1910   have valid_then_else: "\<And> b. G,A|\<Turnstile>\<Colon>{ {P'\<leftarrow>=b} .(if b then c1 else c2). {Q} }" 
  1910   have valid_then_else: "\<And> b. G,A|\<Turnstile>\<Colon>{ {P'\<leftarrow>=b} .(if b then c1 else c2). {Q} }" 
  1911     using If.hyps by simp
  1911     using If.hyps by simp
  1912   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .If(e) c1 Else c2. {Q} }"
  1912   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .If(e) c1 Else c2. {Q} }"
  1913   proof (rule valid_stmt_NormalI)
  1913   proof (rule valid_stmt_NormalI)
  1980 	by (rule evaln_type_sound [elim_format]) simp
  1980 	by (rule evaln_type_sound [elim_format]) simp
  1981       ultimately show ?thesis ..
  1981       ultimately show ?thesis ..
  1982     qed
  1982     qed
  1983   qed
  1983   qed
  1984 next
  1984 next
  1985   case (Loop A P P' c e l)
  1985   case (Loop A P e P' c l)
  1986   have valid_e: "G,A|\<Turnstile>\<Colon>{ {P} e-\<succ> {P'} }".
  1986   have valid_e: "G,A|\<Turnstile>\<Colon>{ {P} e-\<succ> {P'} }".
  1987   have valid_c: "G,A|\<Turnstile>\<Colon>{ {Normal (P'\<leftarrow>=True)} 
  1987   have valid_c: "G,A|\<Turnstile>\<Colon>{ {Normal (P'\<leftarrow>=True)} 
  1988                          .c. 
  1988                          .c. 
  1989                          {abupd (absorb (Cont l)) .; P} }" .
  1989                          {abupd (absorb (Cont l)) .; P} }" .
  1990   show "G,A|\<Turnstile>\<Colon>{ {P} .l\<bullet> While(e) c. {P'\<leftarrow>=False\<down>=\<diamondsuit>} }"
  1990   show "G,A|\<Turnstile>\<Colon>{ {P} .l\<bullet> While(e) c. {P'\<leftarrow>=False\<down>=\<diamondsuit>} }"
  2018                  normal s \<Longrightarrow> \<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>t\<Colon>T; 
  2018                  normal s \<Longrightarrow> \<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>t\<Colon>T; 
  2019                  normal s \<Longrightarrow> \<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>dom (locals (store s))\<guillemotright>t\<guillemotright>E
  2019                  normal s \<Longrightarrow> \<lparr>prg=G,cls=accC,lcl=L\<rparr>\<turnstile>dom (locals (store s))\<guillemotright>t\<guillemotright>E
  2020                 \<rbrakk>\<Longrightarrow> (P'\<leftarrow>=False\<down>=\<diamondsuit>) v s' Z"
  2020                 \<rbrakk>\<Longrightarrow> (P'\<leftarrow>=False\<down>=\<diamondsuit>) v s' Z"
  2021 	  (is "PROP ?Hyp n t s v s'")
  2021 	  (is "PROP ?Hyp n t s v s'")
  2022 	proof (induct)
  2022 	proof (induct)
  2023 	  case (Loop b c' e' l' n' s0' s1' s2' s3' Y' T E)
  2023 	  case (Loop s0' e' n' b s1' c' s2' l' s3' Y' T E)
  2024 	  have while: "(\<langle>l'\<bullet> While(e') c'\<rangle>\<^sub>s::term) = \<langle>l\<bullet> While(e) c\<rangle>\<^sub>s" .
  2024 	  have while: "(\<langle>l'\<bullet> While(e') c'\<rangle>\<^sub>s::term) = \<langle>l\<bullet> While(e) c\<rangle>\<^sub>s" .
  2025           hence eqs: "l'=l" "e'=e" "c'=c" by simp_all
  2025           hence eqs: "l'=l" "e'=e" "c'=c" by simp_all
  2026 	  have valid_A: "\<forall>t\<in>A. G\<Turnstile>n'\<Colon>t". 
  2026 	  have valid_A: "\<forall>t\<in>A. G\<Turnstile>n'\<Colon>t". 
  2027 	  have P: "P Y' (Norm s0') Z".
  2027 	  have P: "P Y' (Norm s0') Z".
  2028 	  have conf_s0': "Norm s0'\<Colon>\<preceq>(G, L)" .
  2028 	  have conf_s0': "Norm s0'\<Colon>\<preceq>(G, L)" .
  2171 	      with P' False show ?thesis
  2171 	      with P' False show ?thesis
  2172 		by auto
  2172 		by auto
  2173 	    qed
  2173 	    qed
  2174 	  qed
  2174 	  qed
  2175 	next
  2175 	next
  2176 	  case (Abrupt n' s t' abr Y' T E)
  2176 	  case (Abrupt abr s t' n' Y' T E)
  2177 	  have t': "t' = \<langle>l\<bullet> While(e) c\<rangle>\<^sub>s".
  2177 	  have t': "t' = \<langle>l\<bullet> While(e) c\<rangle>\<^sub>s".
  2178 	  have conf: "(Some abr, s)\<Colon>\<preceq>(G, L)".
  2178 	  have conf: "(Some abr, s)\<Colon>\<preceq>(G, L)".
  2179 	  have P: "P Y' (Some abr, s) Z".
  2179 	  have P: "P Y' (Some abr, s) Z".
  2180 	  have valid_A: "\<forall>t\<in>A. G\<Turnstile>n'\<Colon>t". 
  2180 	  have valid_A: "\<forall>t\<in>A. G\<Turnstile>n'\<Colon>t". 
  2181 	  show "(P'\<leftarrow>=False\<down>=\<diamondsuit>) (arbitrary3 t') (Some abr, s) Z"
  2181 	  show "(P'\<leftarrow>=False\<down>=\<diamondsuit>) (arbitrary3 t') (Some abr, s) Z"
  2210       qed
  2210       qed
  2211       ultimately show ?thesis ..
  2211       ultimately show ?thesis ..
  2212     qed
  2212     qed
  2213   qed
  2213   qed
  2214 next
  2214 next
  2215   case (Jmp A P j)
  2215   case (Jmp A j P)
  2216   show "G,A|\<Turnstile>\<Colon>{ {Normal (abupd (\<lambda>a. Some (Jump j)) .; P\<leftarrow>\<diamondsuit>)} .Jmp j. {P} }"
  2216   show "G,A|\<Turnstile>\<Colon>{ {Normal (abupd (\<lambda>a. Some (Jump j)) .; P\<leftarrow>\<diamondsuit>)} .Jmp j. {P} }"
  2217   proof (rule valid_stmt_NormalI)
  2217   proof (rule valid_stmt_NormalI)
  2218     fix n s0 L accC C s1 Y Z
  2218     fix n s0 L accC C s1 Y Z
  2219     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  2219     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  2220     assume conf_s0:  "s0\<Colon>\<preceq>(G,L)"  
  2220     assume conf_s0:  "s0\<Colon>\<preceq>(G,L)"  
  2237 	by (rule evaln_type_sound [elim_format]) simp
  2237 	by (rule evaln_type_sound [elim_format]) simp
  2238       ultimately show ?thesis ..
  2238       ultimately show ?thesis ..
  2239     qed
  2239     qed
  2240   qed
  2240   qed
  2241 next
  2241 next
  2242   case (Throw A P Q e)
  2242   case (Throw A P e Q)
  2243   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {\<lambda>Val:a:. abupd (throw a) .; Q\<leftarrow>\<diamondsuit>} }".
  2243   have valid_e: "G,A|\<Turnstile>\<Colon>{ {Normal P} e-\<succ> {\<lambda>Val:a:. abupd (throw a) .; Q\<leftarrow>\<diamondsuit>} }".
  2244   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .Throw e. {Q} }"
  2244   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .Throw e. {Q} }"
  2245   proof (rule valid_stmt_NormalI)
  2245   proof (rule valid_stmt_NormalI)
  2246     fix n s0 L accC C s2 Y Z
  2246     fix n s0 L accC C s2 Y Z
  2247     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  2247     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  2275 	by (rule evaln_type_sound [elim_format]) simp
  2275 	by (rule evaln_type_sound [elim_format]) simp
  2276       ultimately show ?thesis ..
  2276       ultimately show ?thesis ..
  2277     qed
  2277     qed
  2278   qed
  2278   qed
  2279 next
  2279 next
  2280   case (Try A C P Q R c1 c2 vn)
  2280   case (Try A P c1 Q C vn c2 R)
  2281   have valid_c1: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1. {SXAlloc G Q} }".
  2281   have valid_c1: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1. {SXAlloc G Q} }".
  2282   have valid_c2: "G,A|\<Turnstile>\<Colon>{ {Q \<and>. (\<lambda>s. G,s\<turnstile>catch C) ;. new_xcpt_var vn} 
  2282   have valid_c2: "G,A|\<Turnstile>\<Colon>{ {Q \<and>. (\<lambda>s. G,s\<turnstile>catch C) ;. new_xcpt_var vn} 
  2283                            .c2. 
  2283                            .c2. 
  2284                           {R} }".
  2284                           {R} }".
  2285   have Q_R: "(Q \<and>. (\<lambda>s. \<not> G,s\<turnstile>catch C)) \<Rightarrow> R" .
  2285   have Q_R: "(Q \<and>. (\<lambda>s. \<not> G,s\<turnstile>catch C)) \<Rightarrow> R" .
  2407 	by (rule evaln_type_sound [elim_format]) simp
  2407 	by (rule evaln_type_sound [elim_format]) simp
  2408       ultimately show ?thesis ..
  2408       ultimately show ?thesis ..
  2409     qed
  2409     qed
  2410   qed
  2410   qed
  2411 next
  2411 next
  2412   case (Fin A P Q R c1 c2)
  2412   case (Fin A P c1 Q  c2 R)
  2413   have valid_c1: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1. {Q} }".
  2413   have valid_c1: "G,A|\<Turnstile>\<Colon>{ {Normal P} .c1. {Q} }".
  2414   have valid_c2: "\<And> abr. G,A|\<Turnstile>\<Colon>{ {Q \<and>. (\<lambda>s. abr = fst s) ;. abupd (\<lambda>x. None)} 
  2414   have valid_c2: "\<And> abr. G,A|\<Turnstile>\<Colon>{ {Q \<and>. (\<lambda>s. abr = fst s) ;. abupd (\<lambda>x. None)} 
  2415                                   .c2.
  2415                                   .c2.
  2416                                   {abupd (abrupt_if (abr \<noteq> None) abr) .; R} }"
  2416                                   {abupd (abrupt_if (abr \<noteq> None) abr) .; R} }"
  2417     using Fin.hyps by simp
  2417     using Fin.hyps by simp
  2481 	by (rule evaln_type_sound [elim_format]) simp
  2481 	by (rule evaln_type_sound [elim_format]) simp
  2482       ultimately show ?thesis ..
  2482       ultimately show ?thesis ..
  2483     qed
  2483     qed
  2484   qed
  2484   qed
  2485 next
  2485 next
  2486   case (Done A C P)
  2486   case (Done A P C)
  2487   show "G,A|\<Turnstile>\<Colon>{ {Normal (P\<leftarrow>\<diamondsuit> \<and>. initd C)} .Init C. {P} }" 
  2487   show "G,A|\<Turnstile>\<Colon>{ {Normal (P\<leftarrow>\<diamondsuit> \<and>. initd C)} .Init C. {P} }" 
  2488   proof (rule valid_stmt_NormalI)
  2488   proof (rule valid_stmt_NormalI)
  2489     fix n s0 L accC E s3 Y Z
  2489     fix n s0 L accC E s3 Y Z
  2490     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  2490     assume valid_A: "\<forall>t\<in>A. G\<Turnstile>n\<Colon>t"
  2491     assume conf_s0:  "s0\<Colon>\<preceq>(G,L)"  
  2491     assume conf_s0:  "s0\<Colon>\<preceq>(G,L)"  
  2504       with P conf_s0 show ?thesis
  2504       with P conf_s0 show ?thesis
  2505 	by simp
  2505 	by simp
  2506     qed
  2506     qed
  2507   qed
  2507   qed
  2508 next
  2508 next
  2509   case (Init A C P Q R c)
  2509   case (Init C c A P Q R)
  2510   have c: "the (class G C) = c".
  2510   have c: "the (class G C) = c".
  2511   have valid_super: 
  2511   have valid_super: 
  2512         "G,A|\<Turnstile>\<Colon>{ {Normal (P \<and>. Not \<circ> initd C ;. supd (init_class_obj G C))}
  2512         "G,A|\<Turnstile>\<Colon>{ {Normal (P \<and>. Not \<circ> initd C ;. supd (init_class_obj G C))}
  2513                  .(if C = Object then Skip else Init (super c)). 
  2513                  .(if C = Object then Skip else Init (super c)). 
  2514                  {Q} }".
  2514                  {Q} }".
  2616 	by (rule evaln_type_sound [elim_format]) simp
  2616 	by (rule evaln_type_sound [elim_format]) simp
  2617       ultimately show ?thesis ..
  2617       ultimately show ?thesis ..
  2618     qed
  2618     qed
  2619   qed
  2619   qed
  2620 next
  2620 next
  2621   case (InsInitV A P Q c v)
  2621   case (InsInitV A P c v Q)
  2622   show "G,A|\<Turnstile>\<Colon>{ {Normal P} InsInitV c v=\<succ> {Q} }"
  2622   show "G,A|\<Turnstile>\<Colon>{ {Normal P} InsInitV c v=\<succ> {Q} }"
  2623   proof (rule valid_var_NormalI)
  2623   proof (rule valid_var_NormalI)
  2624     fix s0 vf n s1 L Z
  2624     fix s0 vf n s1 L Z
  2625     assume "normal s0"
  2625     assume "normal s0"
  2626     moreover
  2626     moreover
  2628     ultimately have "False" 
  2628     ultimately have "False" 
  2629       by (cases s0) (simp add: evaln_InsInitV) 
  2629       by (cases s0) (simp add: evaln_InsInitV) 
  2630     thus "Q \<lfloor>vf\<rfloor>\<^sub>v s1 Z \<and> s1\<Colon>\<preceq>(G, L)"..
  2630     thus "Q \<lfloor>vf\<rfloor>\<^sub>v s1 Z \<and> s1\<Colon>\<preceq>(G, L)"..
  2631   qed
  2631   qed
  2632 next
  2632 next
  2633   case (InsInitE A P Q c e)
  2633   case (InsInitE A P c e Q)
  2634   show "G,A|\<Turnstile>\<Colon>{ {Normal P} InsInitE c e-\<succ> {Q} }"
  2634   show "G,A|\<Turnstile>\<Colon>{ {Normal P} InsInitE c e-\<succ> {Q} }"
  2635   proof (rule valid_expr_NormalI)
  2635   proof (rule valid_expr_NormalI)
  2636     fix s0 v n s1 L Z
  2636     fix s0 v n s1 L Z
  2637     assume "normal s0"
  2637     assume "normal s0"
  2638     moreover
  2638     moreover
  2640     ultimately have "False" 
  2640     ultimately have "False" 
  2641       by (cases s0) (simp add: evaln_InsInitE) 
  2641       by (cases s0) (simp add: evaln_InsInitE) 
  2642     thus "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z \<and> s1\<Colon>\<preceq>(G, L)"..
  2642     thus "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z \<and> s1\<Colon>\<preceq>(G, L)"..
  2643   qed
  2643   qed
  2644 next
  2644 next
  2645   case (Callee A P Q e l)
  2645   case (Callee A P l e Q)
  2646   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Callee l e-\<succ> {Q} }"
  2646   show "G,A|\<Turnstile>\<Colon>{ {Normal P} Callee l e-\<succ> {Q} }"
  2647   proof (rule valid_expr_NormalI)
  2647   proof (rule valid_expr_NormalI)
  2648     fix s0 v n s1 L Z
  2648     fix s0 v n s1 L Z
  2649     assume "normal s0"
  2649     assume "normal s0"
  2650     moreover
  2650     moreover
  2652     ultimately have "False" 
  2652     ultimately have "False" 
  2653       by (cases s0) (simp add: evaln_Callee) 
  2653       by (cases s0) (simp add: evaln_Callee) 
  2654     thus "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z \<and> s1\<Colon>\<preceq>(G, L)"..
  2654     thus "Q \<lfloor>v\<rfloor>\<^sub>e s1 Z \<and> s1\<Colon>\<preceq>(G, L)"..
  2655   qed
  2655   qed
  2656 next
  2656 next
  2657   case (FinA A P Q a c)
  2657   case (FinA A P a c Q)
  2658   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .FinA a c. {Q} }"
  2658   show "G,A|\<Turnstile>\<Colon>{ {Normal P} .FinA a c. {Q} }"
  2659   proof (rule valid_stmt_NormalI)
  2659   proof (rule valid_stmt_NormalI)
  2660     fix s0 v n s1 L Z
  2660     fix s0 v n s1 L Z
  2661     assume "normal s0"
  2661     assume "normal s0"
  2662     moreover
  2662     moreover