src/HOL/MicroJava/BV/Effect.thy
changeset 25362 8d06e11a01d1
parent 18576 8d98b7711e47
child 30235 58d147683393
equal deleted inserted replaced
25361:1aa441e48496 25362:8d06e11a01d1
   302   by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
   302   by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
   303 
   303 
   304 
   304 
   305 lemma appSwap[simp]:
   305 lemma appSwap[simp]:
   306 "app Swap G maxs rT pc et (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT))" 
   306 "app Swap G maxs rT pc et (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT))" 
   307   by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
   307   by (cases s, cases "2 <length (fst s)") (auto dest: 1 2)
   308 
   308 
   309 
   309 
   310 lemma appIAdd[simp]:
   310 lemma appIAdd[simp]:
   311 "app IAdd G maxs rT pc et (Some s) = (\<exists> ST LT. s = (PrimT Integer#PrimT Integer#ST,LT))"
   311 "app IAdd G maxs rT pc et (Some s) = (\<exists> ST LT. s = (PrimT Integer#PrimT Integer#ST,LT))"
   312   (is "?app s = ?P s")
   312   (is "?app s = ?P s")
   313 proof (cases (open) s)
   313 proof (cases s)
   314   case Pair
   314   case (Pair a b)
   315   have "?app (a,b) = ?P (a,b)"
   315   have "?app (a,b) = ?P (a,b)"
   316   proof (cases "a")
   316   proof (cases a)
   317     fix t ts assume a: "a = t#ts"
   317     fix t ts assume a: "a = t#ts"
   318     show ?thesis
   318     show ?thesis
   319     proof (cases t)
   319     proof (cases t)
   320       fix p assume p: "t = PrimT p"
   320       fix p assume p: "t = PrimT p"
   321       show ?thesis
   321       show ?thesis
   326           fix t' ts' assume t': "ts = t' # ts'"
   326           fix t' ts' assume t': "ts = t' # ts'"
   327           show ?thesis
   327           show ?thesis
   328           proof (cases t')
   328           proof (cases t')
   329             fix p' assume "t' = PrimT p'"
   329             fix p' assume "t' = PrimT p'"
   330             with t' ip p a
   330             with t' ip p a
   331             show ?thesis by - (cases p', auto)
   331             show ?thesis by (cases p') auto
   332           qed (auto simp add: a p ip t')
   332           qed (auto simp add: a p ip t')
   333         qed (auto simp add: a p ip)
   333         qed (auto simp add: a p ip)
   334       qed (auto simp add: a p)
   334       qed (auto simp add: a p)
   335     qed (auto simp add: a)
   335     qed (auto simp add: a)
   336   qed auto
   336   qed auto
   361 "app (Invoke C mn fpTs) G maxs rT pc et (Some s) = (\<exists>apTs X ST LT mD' rT' b'.
   361 "app (Invoke C mn fpTs) G maxs rT pc et (Some s) = (\<exists>apTs X ST LT mD' rT' b'.
   362   s = ((rev apTs) @ (X # ST), LT) \<and> length apTs = length fpTs \<and> is_class G C \<and>
   362   s = ((rev apTs) @ (X # ST), LT) \<and> length apTs = length fpTs \<and> is_class G C \<and>
   363   G \<turnstile> X \<preceq> Class C \<and> (\<forall>(aT,fT)\<in>set(zip apTs fpTs). G \<turnstile> aT \<preceq> fT) \<and> 
   363   G \<turnstile> X \<preceq> Class C \<and> (\<forall>(aT,fT)\<in>set(zip apTs fpTs). G \<turnstile> aT \<preceq> fT) \<and> 
   364   method (G,C) (mn,fpTs) = Some (mD', rT', b') \<and> 
   364   method (G,C) (mn,fpTs) = Some (mD', rT', b') \<and> 
   365   (\<forall>C \<in> set (match_any G pc et). is_class G C))" (is "?app s = ?P s")
   365   (\<forall>C \<in> set (match_any G pc et). is_class G C))" (is "?app s = ?P s")
   366 proof (cases (open) s)
   366 proof (cases s)
   367   note list_all2_def [simp]
   367   note list_all2_def [simp]
   368   case Pair
   368   case (Pair a b)
   369   have "?app (a,b) \<Longrightarrow> ?P (a,b)"
   369   have "?app (a,b) \<Longrightarrow> ?P (a,b)"
   370   proof -
   370   proof -
   371     assume app: "?app (a,b)"
   371     assume app: "?app (a,b)"
   372     hence "a = (rev (rev (take (length fpTs) a))) @ (drop (length fpTs) a) \<and> 
   372     hence "a = (rev (rev (take (length fpTs) a))) @ (drop (length fpTs) a) \<and> 
   373            length fpTs < length a" (is "?a \<and> ?l") 
   373            length fpTs < length a" (is "?a \<and> ?l")