src/HOL/MicroJava/BV/BVNoTypeError.thy
changeset 55524 f41ef840f09d
parent 53024 e0968e1f6fe9
child 56073 29e308b56d23
equal deleted inserted replaced
55523:9429e7b5b827 55524:f41ef840f09d
   145   length apTs = length fpTs \<and> is_class G C \<and>
   145   length apTs = length fpTs \<and> is_class G C \<and>
   146   (\<forall>(aT,fT)\<in>set(zip apTs fpTs). G \<turnstile> aT \<preceq> fT) \<and> 
   146   (\<forall>(aT,fT)\<in>set(zip apTs fpTs). G \<turnstile> aT \<preceq> fT) \<and> 
   147   method (G,C) (mn,fpTs) = Some (mD', rT', b') \<and> G \<turnstile> X \<preceq> Class C)"
   147   method (G,C) (mn,fpTs) = Some (mD', rT', b') \<and> G \<turnstile> X \<preceq> Class C)"
   148   (is "?app ST LT = ?P ST LT")
   148   (is "?app ST LT = ?P ST LT")
   149 proof
   149 proof
   150   assume "?P ST LT" thus "?app ST LT" by (auto simp add: list_all2_def)
   150   assume "?P ST LT" thus "?app ST LT" by (auto simp add: list_all2_iff)
   151 next  
   151 next  
   152   assume app: "?app ST LT"
   152   assume app: "?app ST LT"
   153   hence l: "length fpTs < length ST" by simp
   153   hence l: "length fpTs < length ST" by simp
   154   obtain xs ys where xs: "ST = xs @ ys" "length xs = length fpTs"
   154   obtain xs ys where xs: "ST = xs @ ys" "length xs = length fpTs"
   155   proof -
   155   proof -
   168   from l xs obtain X ST' where "ys = X#ST'" by (auto simp add: neq_Nil_conv)
   168   from l xs obtain X ST' where "ys = X#ST'" by (auto simp add: neq_Nil_conv)
   169   ultimately
   169   ultimately
   170   have "ST = (rev apTs) @ X # ST'" "length apTs = length fpTs" by auto
   170   have "ST = (rev apTs) @ X # ST'" "length apTs = length fpTs" by auto
   171   with app
   171   with app
   172   show "?P ST LT"
   172   show "?P ST LT"
   173     apply (clarsimp simp add: list_all2_def)
   173     apply (clarsimp simp add: list_all2_iff)
   174     apply (intro exI conjI)
   174     apply (intro exI conjI)
   175     apply auto
   175     apply auto
   176     done
   176     done
   177 qed
   177 qed
   178 
   178 
   179 lemma approx_loc_len [simp]:
   179 lemma approx_loc_len [simp]:
   180   "approx_loc G hp loc LT \<Longrightarrow> length loc = length LT"
   180   "approx_loc G hp loc LT \<Longrightarrow> length loc = length LT"
   181   by (simp add: approx_loc_def list_all2_def)
   181   by (simp add: approx_loc_def list_all2_iff)
   182 
   182 
   183 lemma approx_stk_len [simp]:
   183 lemma approx_stk_len [simp]:
   184   "approx_stk G hp stk ST \<Longrightarrow> length stk = length ST"
   184   "approx_stk G hp stk ST \<Longrightarrow> length stk = length ST"
   185   by (simp add: approx_stk_def)
   185   by (simp add: approx_stk_def)
   186 
   186 
   339       have [simp]: "stk!length ps = x" by (simp add: nth_append)
   339       have [simp]: "stk!length ps = x" by (simp add: nth_append)
   340       from stk' l ps
   340       from stk' l ps
   341       have [simp]: "take (length ps) stk = aps" by simp
   341       have [simp]: "take (length ps) stk = aps" by simp
   342       from w ps
   342       from w ps
   343       have widen: "list_all2 (\<lambda>x y. G \<turnstile> x \<preceq> y) apTs ps"
   343       have widen: "list_all2 (\<lambda>x y. G \<turnstile> x \<preceq> y) apTs ps"
   344         by (simp add: list_all2_def) 
   344         by (simp add: list_all2_iff) 
   345 
   345 
   346       from stk' l ps have "length ps < length stk" by simp
   346       from stk' l ps have "length ps < length stk" by simp
   347       moreover
   347       moreover
   348       from wf x C 
   348       from wf x C 
   349       have x: "G,hp \<turnstile> x ::\<preceq> Class C" by (rule conf_widen) 
   349       have x: "G,hp \<turnstile> x ::\<preceq> Class C" by (rule conf_widen)