src/HOL/Bali/WellForm.thy
changeset 23350 50c5b0912a0c
parent 22424 8a5412121687
child 24019 67bde7cfcf10
equal deleted inserted replaced
23349:23a8345f89f5 23350:50c5b0912a0c
  1990     and   nObj: "C \<noteq> Object"
  1990     and   nObj: "C \<noteq> Object"
  1991     let ?newMethods = "table_of (map (\<lambda>(s, m). (s, C, m)) (methods c)) sig"
  1991     let ?newMethods = "table_of (map (\<lambda>(s, m). (s, C, m)) (methods c)) sig"
  1992     show "?thesis m d" 
  1992     show "?thesis m d" 
  1993     proof (cases "?newMethods")
  1993     proof (cases "?newMethods")
  1994       case None
  1994       case None
  1995       from None clsC nObj ws m declC hyp  
  1995       from None clsC nObj ws m declC
  1996       show "?thesis" by (auto simp add: methd_rec)
  1996       show "?thesis" by (auto simp add: methd_rec) (rule hyp)
  1997     next
  1997     next
  1998       case Some
  1998       case Some
  1999       from Some clsC nObj ws m declC hyp  
  1999       from Some clsC nObj ws m declC
  2000       show "?thesis" 
  2000       show "?thesis" 
  2001 	by (auto simp add: methd_rec
  2001 	by (auto simp add: methd_rec
  2002                      dest: wf_prog_cdecl wf_cdecl_supD is_acc_class_is_class)
  2002                      dest: wf_prog_cdecl wf_cdecl_supD is_acc_class_is_class)
  2003     qed
  2003     qed
  2004   qed
  2004   qed
  2663       have "newM=statM" 
  2663       have "newM=statM" 
  2664 	by (auto simp add: dynmethd_C_C)
  2664 	by (auto simp add: dynmethd_C_C)
  2665       with neq show ?thesis 
  2665       with neq show ?thesis 
  2666 	by (contradiction)
  2666 	by (contradiction)
  2667     next
  2667     next
  2668       case Subcls show ?thesis .
  2668       case Subcls then show ?thesis .
  2669     qed 
  2669     qed 
  2670     moreover
  2670     moreover
  2671     from stat_acc wf 
  2671     from stat_acc wf 
  2672     have "G\<turnstile>Methd sig statM in statC dyn_accessible_from accC"
  2672     have "G\<turnstile>Methd sig statM in statC dyn_accessible_from accC"
  2673       by (blast intro: static_to_dynamic_accessible_from)
  2673       by (blast intro: static_to_dynamic_accessible_from)
  2918 proof -
  2918 proof -
  2919   from dyn_acc priv
  2919   from dyn_acc priv
  2920   show ?thesis
  2920   show ?thesis
  2921   proof (induct)
  2921   proof (induct)
  2922     case (Immediate m C)
  2922     case (Immediate m C)
  2923     have "G \<turnstile> m in C permits_acc_from accC" and "accmodi m = Private" .
  2923     from `G \<turnstile> m in C permits_acc_from accC` and `accmodi m = Private`
  2924     then show ?case
  2924     show ?case
  2925       by (simp add: permits_acc_def)
  2925       by (simp add: permits_acc_def)
  2926   next
  2926   next
  2927     case Overriding
  2927     case Overriding
  2928     then show ?case
  2928     then show ?case
  2929       by (auto dest!: overrides_commonD)
  2929       by (auto dest!: overrides_commonD)
  2983 proof -
  2983 proof -
  2984   from dyn_acc pack field
  2984   from dyn_acc pack field
  2985   show ?thesis
  2985   show ?thesis
  2986   proof (induct)
  2986   proof (induct)
  2987     case (Immediate f C)
  2987     case (Immediate f C)
  2988     have "G \<turnstile> f in C permits_acc_from accC" and "accmodi f = Package" .
  2988     from `G \<turnstile> f in C permits_acc_from accC` and `accmodi f = Package`
  2989     then show ?case
  2989     show ?case
  2990       by (simp add: permits_acc_def)
  2990       by (simp add: permits_acc_def)
  2991   next
  2991   next
  2992     case Overriding
  2992     case Overriding
  2993     then show ?case by (simp add: is_field_def)
  2993     then show ?case by (simp add: is_field_def)
  2994   qed
  2994   qed
  3007 proof -
  3007 proof -
  3008   from dyn_acc prot field instance_field outside
  3008   from dyn_acc prot field instance_field outside
  3009   show ?thesis
  3009   show ?thesis
  3010   proof (induct)
  3010   proof (induct)
  3011     case (Immediate f C)
  3011     case (Immediate f C)
  3012     have "G \<turnstile> f in C permits_acc_from accC" .
  3012     note `G \<turnstile> f in C permits_acc_from accC`
  3013     moreover 
  3013     moreover 
  3014     assume "accmodi f = Protected" and  "is_field f" and "\<not> is_static f" and
  3014     assume "accmodi f = Protected" and  "is_field f" and "\<not> is_static f" and
  3015            "pid (declclass f) \<noteq> pid accC"
  3015            "pid (declclass f) \<noteq> pid accC"
  3016     ultimately 
  3016     ultimately 
  3017     show "G\<turnstile> C \<preceq>\<^sub>C accC"
  3017     show "G\<turnstile> C \<preceq>\<^sub>C accC"
  3034   show ?thesis
  3034   show ?thesis
  3035   proof (induct)
  3035   proof (induct)
  3036     case (Immediate f C)
  3036     case (Immediate f C)
  3037     assume "accmodi f = Protected" and  "is_field f" and "is_static f" and
  3037     assume "accmodi f = Protected" and  "is_field f" and "is_static f" and
  3038            "pid (declclass f) \<noteq> pid accC"
  3038            "pid (declclass f) \<noteq> pid accC"
  3039     moreover 
  3039     moreover
  3040     have "G \<turnstile> f in C permits_acc_from accC" .
  3040     note `G \<turnstile> f in C permits_acc_from accC`
  3041     ultimately
  3041     ultimately
  3042     have "G\<turnstile> accC \<preceq>\<^sub>C declclass f"
  3042     have "G\<turnstile> accC \<preceq>\<^sub>C declclass f"
  3043       by (auto simp add: permits_acc_def)
  3043       by (auto simp add: permits_acc_def)
  3044     moreover
  3044     moreover
  3045     have "G \<turnstile> f member_in C" .
  3045     from `G \<turnstile> f member_in C`
  3046     then have "G\<turnstile>C \<preceq>\<^sub>C declclass f"
  3046     have "G\<turnstile>C \<preceq>\<^sub>C declclass f"
  3047       by (rule member_in_class_relation)
  3047       by (rule member_in_class_relation)
  3048     ultimately show ?case
  3048     ultimately show ?case
  3049       by blast
  3049       by blast
  3050   next
  3050   next
  3051     case Overriding
  3051     case Overriding