src/HOL/Bali/State.thy
changeset 63648 f9f3006a5579
parent 62390 842917225d56
child 67399 eab6ce8368fa
equal deleted inserted replaced
63647:437bd400d808 63648:f9f3006a5579
    95 by (simp add: obj_ty_def)
    95 by (simp add: obj_ty_def)
    96 
    96 
    97 lemma obj_ty_widenD: 
    97 lemma obj_ty_widenD: 
    98  "G\<turnstile>obj_ty obj\<preceq>RefT t \<Longrightarrow> (\<exists>C. tag obj = CInst C) \<or> (\<exists>T k. tag obj = Arr T k)"
    98  "G\<turnstile>obj_ty obj\<preceq>RefT t \<Longrightarrow> (\<exists>C. tag obj = CInst C) \<or> (\<exists>T k. tag obj = Arr T k)"
    99 apply (unfold obj_ty_def)
    99 apply (unfold obj_ty_def)
   100 apply (auto split add: obj_tag.split_asm)
   100 apply (auto split: obj_tag.split_asm)
   101 done
   101 done
   102 
   102 
   103 definition
   103 definition
   104   obj_class :: "obj \<Rightarrow> qtname" where
   104   obj_class :: "obj \<Rightarrow> qtname" where
   105   "obj_class obj = (case tag obj of 
   105   "obj_class obj = (case tag obj of 
   205                  | Arr t k \<Rightarrow> (\<exists> i. n = Inr i  \<and> i in_bounds k \<and> t = T))  
   205                  | Arr t k \<Rightarrow> (\<exists> i. n = Inr i  \<and> i in_bounds k \<and> t = T))  
   206      | Inr C \<Rightarrow> (\<exists>nt. n = Inl nt \<and> 
   206      | Inr C \<Rightarrow> (\<exists>nt. n = Inl nt \<and> 
   207                  fields_table G C (\<lambda>fn f. declclassf fn = C \<and> static f) nt 
   207                  fields_table G C (\<lambda>fn f. declclassf fn = C \<and> static f) nt 
   208                   = Some T))"
   208                   = Some T))"
   209 apply (unfold var_tys_def arr_comps_def)
   209 apply (unfold var_tys_def arr_comps_def)
   210 apply (force split add: sum.split_asm sum.split obj_tag.split)
   210 apply (force split: sum.split_asm sum.split obj_tag.split)
   211 done
   211 done
   212 
   212 
   213 
   213 
   214 subsubsection "stores"
   214 subsubsection "stores"
   215 
   215 
   702 apply (simp (no_asm))
   702 apply (simp (no_asm))
   703 done
   703 done
   704 
   704 
   705 lemma inited_gupdate [simp]: "inited C (g(r\<mapsto>obj)) = (inited C g \<or> r = Stat C)"
   705 lemma inited_gupdate [simp]: "inited C (g(r\<mapsto>obj)) = (inited C g \<or> r = Stat C)"
   706 apply (unfold inited_def)
   706 apply (unfold inited_def)
   707 apply (auto split add: st.split)
   707 apply (auto split: st.split)
   708 done
   708 done
   709 
   709 
   710 lemma inited_init_class_obj [intro!]: "inited C (globs (init_class_obj G C s))"
   710 lemma inited_init_class_obj [intro!]: "inited C (globs (init_class_obj G C s))"
   711 apply (unfold inited_def)
   711 apply (unfold inited_def)
   712 apply (simp (no_asm))
   712 apply (simp (no_asm))