src/HOL/MicroJava/BV/JType.thy
changeset 10797 028d22926a41
parent 10630 f89c3fc4fde1
child 10812 ead84e90bfeb
equal deleted inserted replaced
10796:c0bcea781b3a 10797:028d22926a41
   149 apply simp 
   149 apply simp 
   150 apply (blast intro: rtrancl_into_trancl2)
   150 apply (blast intro: rtrancl_into_trancl2)
   151 done 
   151 done 
   152 
   152 
   153 lemma closed_err_types:
   153 lemma closed_err_types:
   154   "[| wf_prog wf_mb G; univalent (subcls1 G); acyclic (subcls1 G) |] 
   154   "[| wf_prog wf_mb G; single_valued (subcls1 G); acyclic (subcls1 G) |] 
   155   ==> closed (err (types G)) (lift2 (sup G))"
   155   ==> closed (err (types G)) (lift2 (sup G))"
   156   apply (unfold closed_def plussub_def lift2_def sup_def)
   156   apply (unfold closed_def plussub_def lift2_def sup_def)
   157   apply (auto split: err.split)
   157   apply (auto split: err.split)
   158   apply (drule is_tyI, assumption)
   158   apply (drule is_tyI, assumption)
   159   apply (auto simp add: is_ty_def is_type_conv simp del: is_type.simps 
   159   apply (auto simp add: is_ty_def is_type_conv simp del: is_type.simps 
   161   apply (blast dest!: is_lub_some_lub is_lubD is_ubD intro!: is_ubI)
   161   apply (blast dest!: is_lub_some_lub is_lubD is_ubD intro!: is_ubI)
   162   done
   162   done
   163 
   163 
   164 
   164 
   165 lemma err_semilat_JType_esl_lemma:
   165 lemma err_semilat_JType_esl_lemma:
   166   "[| wf_prog wf_mb G; univalent (subcls1 G); acyclic (subcls1 G) |] 
   166   "[| wf_prog wf_mb G; single_valued (subcls1 G); acyclic (subcls1 G) |] 
   167   ==> err_semilat (esl G)"
   167   ==> err_semilat (esl G)"
   168 proof -
   168 proof -
   169   assume wf_prog:   "wf_prog wf_mb G"
   169   assume wf_prog:   "wf_prog wf_mb G"
   170   assume univalent: "univalent (subcls1 G)" 
   170   assume single_valued: "single_valued (subcls1 G)" 
   171   assume acyclic:   "acyclic (subcls1 G)"
   171   assume acyclic:   "acyclic (subcls1 G)"
   172   
   172   
   173   hence "order (subtype G)"
   173   hence "order (subtype G)"
   174     by (rule order_widen)
   174     by (rule order_widen)
   175   moreover
   175   moreover
   176   from wf_prog univalent acyclic
   176   from wf_prog single_valued acyclic
   177   have "closed (err (types G)) (lift2 (sup G))"
   177   have "closed (err (types G)) (lift2 (sup G))"
   178     by (rule closed_err_types)
   178     by (rule closed_err_types)
   179   moreover
   179   moreover
   180   
   180   
   181   { fix c1 c2
   181   { fix c1 c2
   183     with wf_prog 
   183     with wf_prog 
   184     obtain 
   184     obtain 
   185       "G \<turnstile> c1 \<preceq>C Object"
   185       "G \<turnstile> c1 \<preceq>C Object"
   186       "G \<turnstile> c2 \<preceq>C Object"
   186       "G \<turnstile> c2 \<preceq>C Object"
   187       by (blast intro: subcls_C_Object)
   187       by (blast intro: subcls_C_Object)
   188     with wf_prog univalent
   188     with wf_prog single_valued
   189     obtain u where
   189     obtain u where
   190       "is_lub ((subcls1 G)^* ) c1 c2 u"
   190       "is_lub ((subcls1 G)^* ) c1 c2 u"
   191       by (blast dest: univalent_has_lubs)
   191       by (blast dest: single_valued_has_lubs)
   192     with acyclic
   192     with acyclic
   193     have "G \<turnstile> c1 \<preceq>C some_lub ((subcls1 G)^* ) c1 c2"
   193     have "G \<turnstile> c1 \<preceq>C some_lub ((subcls1 G)^* ) c1 c2"
   194       by (simp add: some_lub_conv) (blast dest: is_lubD is_ubD)
   194       by (simp add: some_lub_conv) (blast dest: is_lubD is_ubD)
   195   } note this [intro]
   195   } note this [intro]
   196       
   196       
   212     with wf_prog
   212     with wf_prog
   213     obtain 
   213     obtain 
   214       "G \<turnstile> c1 \<preceq>C Object"
   214       "G \<turnstile> c1 \<preceq>C Object"
   215       "G \<turnstile> c2 \<preceq>C Object"
   215       "G \<turnstile> c2 \<preceq>C Object"
   216       by (blast intro: subcls_C_Object)
   216       by (blast intro: subcls_C_Object)
   217     with wf_prog univalent
   217     with wf_prog single_valued
   218     obtain u where
   218     obtain u where
   219       "is_lub ((subcls1 G)^* ) c2 c1 u"
   219       "is_lub ((subcls1 G)^* ) c2 c1 u"
   220       by (blast dest: univalent_has_lubs)
   220       by (blast dest: single_valued_has_lubs)
   221     with acyclic
   221     with acyclic
   222     have "G \<turnstile> c1 \<preceq>C some_lub ((subcls1 G)^* ) c2 c1"
   222     have "G \<turnstile> c1 \<preceq>C some_lub ((subcls1 G)^* ) c2 c1"
   223       by (simp add: some_lub_conv) (blast dest: is_lubD is_ubD)
   223       by (simp add: some_lub_conv) (blast dest: is_lubD is_ubD)
   224   } note this [intro]
   224   } note this [intro]
   225       
   225       
   240     from wf_prog is_class
   240     from wf_prog is_class
   241     obtain 
   241     obtain 
   242       "G \<turnstile> c1 \<preceq>C Object"
   242       "G \<turnstile> c1 \<preceq>C Object"
   243       "G \<turnstile> c2 \<preceq>C Object"
   243       "G \<turnstile> c2 \<preceq>C Object"
   244       by (blast intro: subcls_C_Object)
   244       by (blast intro: subcls_C_Object)
   245     with wf_prog univalent
   245     with wf_prog single_valued
   246     obtain u where
   246     obtain u where
   247       lub: "is_lub ((subcls1 G)^* ) c1 c2 u"
   247       lub: "is_lub ((subcls1 G)^* ) c1 c2 u"
   248       by (blast dest: univalent_has_lubs)   
   248       by (blast dest: single_valued_has_lubs)   
   249     with acyclic
   249     with acyclic
   250     have "some_lub ((subcls1 G)^* ) c1 c2 = u"
   250     have "some_lub ((subcls1 G)^* ) c1 c2 = u"
   251       by (rule some_lub_conv)
   251       by (rule some_lub_conv)
   252     moreover
   252     moreover
   253     from lub le
   253     from lub le
   279   
   279   
   280   show ?thesis
   280   show ?thesis
   281     by (unfold esl_def semilat_def sl_def) auto
   281     by (unfold esl_def semilat_def sl_def) auto
   282 qed
   282 qed
   283 
   283 
   284 lemma univalent_subcls1:
   284 lemma single_valued_subcls1:
   285   "wf_prog wf_mb G ==> univalent (subcls1 G)"
   285   "wf_prog wf_mb G ==> single_valued (subcls1 G)"
   286   by (unfold wf_prog_def unique_def univalent_def subcls1_def) auto
   286   by (unfold wf_prog_def unique_def single_valued_def subcls1_def) auto
   287 
   287 
   288 ML_setup {* bind_thm ("acyclic_subcls1", acyclic_subcls1) *}
   288 ML_setup {* bind_thm ("acyclic_subcls1", acyclic_subcls1) *}
   289 
   289 
   290 theorem err_semilat_JType_esl:
   290 theorem err_semilat_JType_esl:
   291   "wf_prog wf_mb G ==> err_semilat (esl G)"
   291   "wf_prog wf_mb G ==> err_semilat (esl G)"
   292   by (frule acyclic_subcls1, frule univalent_subcls1, rule err_semilat_JType_esl_lemma)
   292   by (frule acyclic_subcls1, frule single_valued_subcls1, rule err_semilat_JType_esl_lemma)
   293 
   293 
   294 end
   294 end