| author | haftmann | 
| Tue, 25 Sep 2007 12:16:08 +0200 | |
| changeset 24699 | c6674504103f | 
| parent 23757 | 087b0a241557 | 
| child 30235 | 58d147683393 | 
| permissions | -rw-r--r-- | 
| 13673 | 1 | (* Title: HOL/MicroJava/Comp/LemmasComp.thy | 
| 2 | ID: $Id$ | |
| 3 | Author: Martin Strecker | |
| 4 | *) | |
| 5 | ||
| 6 | (* Lemmas for compiler correctness proof *) | |
| 7 | ||
| 23022 
9872ef956276
added qualification for ambiguous definition names
 haftmann parents: 
22271diff
changeset | 8 | theory LemmasComp | 
| 
9872ef956276
added qualification for ambiguous definition names
 haftmann parents: 
22271diff
changeset | 9 | imports TranslComp | 
| 
9872ef956276
added qualification for ambiguous definition names
 haftmann parents: 
22271diff
changeset | 10 | begin | 
| 13673 | 11 | |
| 14045 | 12 | |
| 13 | declare split_paired_All [simp del] | |
| 14 | declare split_paired_Ex [simp del] | |
| 15 | ||
| 16 | ||
| 13673 | 17 | (**********************************************************************) | 
| 18 | (* misc lemmas *) | |
| 19 | ||
| 14045 | 20 | |
| 21 | ||
| 13673 | 22 | lemma split_pairs: "(\<lambda>(a,b). (F a b)) (ab) = F (fst ab) (snd ab)" | 
| 23 | proof - | |
| 24 | have "(\<lambda>(a,b). (F a b)) (fst ab,snd ab) = F (fst ab) (snd ab)" | |
| 25 | by (simp add: split_def) | |
| 26 | then show ?thesis by simp | |
| 27 | qed | |
| 28 | ||
| 29 | ||
| 30 | lemma c_hupd_conv: | |
| 31 | "c_hupd h' (xo, (h,l)) = (xo, (if xo = None then h' else h),l)" | |
| 32 | by (simp add: c_hupd_def) | |
| 33 | ||
| 34 | lemma gl_c_hupd [simp]: "(gl (c_hupd h xs)) = (gl xs)" | |
| 35 | by (simp add: gl_def c_hupd_def split_pairs) | |
| 36 | ||
| 37 | lemma c_hupd_xcpt_invariant [simp]: "gx (c_hupd h' (xo, st)) = xo" | |
| 38 | by (case_tac st, simp only: c_hupd_conv gx_conv) | |
| 39 | ||
| 40 | (* not added to simpset because of interference with c_hupd_conv *) | |
| 41 | lemma c_hupd_hp_invariant: "gh (c_hupd hp (None, st)) = hp" | |
| 42 | by (case_tac st, simp add: c_hupd_conv gh_def) | |
| 43 | ||
| 44 | ||
| 14045 | 45 | lemma unique_map_fst [rule_format]: "(\<forall> x \<in> set xs. (fst x = fst (f x) )) \<longrightarrow> | 
| 46 | unique (map f xs) = unique xs" | |
| 47 | proof (induct xs) | |
| 48 | case Nil show ?case by simp | |
| 49 | next | |
| 50 | case (Cons a list) | |
| 51 | show ?case | |
| 52 | proof | |
| 53 | assume fst_eq: "\<forall>x\<in>set (a # list). fst x = fst (f x)" | |
| 54 | ||
| 55 | have fst_set: "(fst a \<in> fst ` set list) = (fst (f a) \<in> fst ` f ` set list)" | |
| 56 | proof | |
| 57 | assume as: "fst a \<in> fst ` set list" | |
| 58 | then obtain x where fst_a_x: "x\<in>set list \<and> fst a = fst x" | |
| 59 | by (auto simp add: image_iff) | |
| 60 | then have "fst (f a) = fst (f x)" by (simp add: fst_eq) | |
| 61 | with as show "(fst (f a) \<in> fst ` f ` set list)" by (simp add: fst_a_x) | |
| 62 | next | |
| 63 | assume as: "fst (f a) \<in> fst ` f ` set list" | |
| 64 | then obtain x where fst_a_x: "x\<in>set list \<and> fst (f a) = fst (f x)" | |
| 65 | by (auto simp add: image_iff) | |
| 66 | then have "fst a = fst x" by (simp add: fst_eq) | |
| 67 | with as show "fst a \<in> fst ` set list" by (simp add: fst_a_x) | |
| 68 | qed | |
| 69 | ||
| 70 | with fst_eq Cons | |
| 71 | show "unique (map f (a # list)) = unique (a # list)" | |
| 72 | by (simp add: unique_def fst_set) | |
| 73 | qed | |
| 74 | qed | |
| 75 | ||
| 76 | lemma comp_unique: "unique (comp G) = unique G" | |
| 77 | apply (simp add: comp_def) | |
| 78 | apply (rule unique_map_fst) | |
| 79 | apply (simp add: compClass_def split_beta) | |
| 80 | done | |
| 81 | ||
| 82 | ||
| 13673 | 83 | (**********************************************************************) | 
| 84 | (* invariance of properties under compilation *) | |
| 85 | ||
| 86 | lemma comp_class_imp: | |
| 87 | "(class G C = Some(D, fs, ms)) \<Longrightarrow> | |
| 88 | (class (comp G) C = Some(D, fs, map (compMethod G C) ms))" | |
| 89 | apply (simp add: class_def comp_def compClass_def) | |
| 90 | apply (rule HOL.trans) | |
| 91 | apply (rule map_of_map2) | |
| 92 | apply auto | |
| 93 | done | |
| 94 | ||
| 95 | lemma comp_class_None: | |
| 96 | "(class G C = None) = (class (comp G) C = None)" | |
| 97 | apply (simp add: class_def comp_def compClass_def) | |
| 98 | apply (simp add: map_of_in_set) | |
| 99 | apply (simp add: image_compose [THEN sym] o_def split_beta del: image_compose) | |
| 100 | done | |
| 101 | ||
| 14045 | 102 | lemma comp_is_class: "is_class (comp G) C = is_class G C" | 
| 13673 | 103 | by (case_tac "class G C", auto simp: is_class_def comp_class_None dest: comp_class_imp) | 
| 104 | ||
| 105 | ||
| 14045 | 106 | lemma comp_is_type: "is_type (comp G) T = is_type G T" | 
| 13673 | 107 | by ((cases T),simp,(induct G)) ((simp),(simp only: comp_is_class),(simp add: comp_is_class),(simp only: comp_is_class)) | 
| 108 | ||
| 14045 | 109 | lemma comp_classname: "is_class G C | 
| 110 | \<Longrightarrow> fst (the (class G C)) = fst (the (class (comp G) C))" | |
| 13673 | 111 | by (case_tac "class G C", auto simp: is_class_def dest: comp_class_imp) | 
| 112 | ||
| 14045 | 113 | lemma comp_subcls1: "subcls1 (comp G) = subcls1 G" | 
| 23757 | 114 | by (auto simp add: subcls1_def2 comp_classname comp_is_class expand_fun_eq) | 
| 13673 | 115 | |
| 22271 | 116 | lemma comp_widen: "widen (comp G) = widen G" | 
| 117 | apply (simp add: expand_fun_eq) | |
| 118 | apply (intro allI iffI) | |
| 119 | apply (erule widen.cases) | |
| 14045 | 120 | apply (simp_all add: comp_subcls1 widen.null) | 
| 22271 | 121 | apply (erule widen.cases) | 
| 14045 | 122 | apply (simp_all add: comp_subcls1 widen.null) | 
| 13673 | 123 | done | 
| 124 | ||
| 22271 | 125 | lemma comp_cast: "cast (comp G) = cast G" | 
| 126 | apply (simp add: expand_fun_eq) | |
| 127 | apply (intro allI iffI) | |
| 128 | apply (erule cast.cases) | |
| 14045 | 129 | apply (simp_all add: comp_subcls1 cast.widen cast.subcls) | 
| 130 | apply (rule cast.widen) apply (simp add: comp_widen) | |
| 22271 | 131 | apply (erule cast.cases) | 
| 14045 | 132 | apply (simp_all add: comp_subcls1 cast.widen cast.subcls) | 
| 133 | apply (rule cast.widen) apply (simp add: comp_widen) | |
| 13673 | 134 | done | 
| 135 | ||
| 14045 | 136 | lemma comp_cast_ok: "cast_ok (comp G) = cast_ok G" | 
| 13673 | 137 | by (simp add: expand_fun_eq cast_ok_def comp_widen) | 
| 138 | ||
| 139 | ||
| 14045 | 140 | lemma compClass_fst [simp]: "(fst (compClass G C)) = (fst C)" | 
| 141 | by (simp add: compClass_def split_beta) | |
| 142 | ||
| 143 | lemma compClass_fst_snd [simp]: "(fst (snd (compClass G C))) = (fst (snd C))" | |
| 144 | by (simp add: compClass_def split_beta) | |
| 145 | ||
| 146 | lemma compClass_fst_snd_snd [simp]: "(fst (snd (snd (compClass G C)))) = (fst (snd (snd C)))" | |
| 147 | by (simp add: compClass_def split_beta) | |
| 148 | ||
| 149 | lemma comp_wf_fdecl [simp]: "wf_fdecl (comp G) fd = wf_fdecl G fd" | |
| 150 | by (case_tac fd, simp add: wf_fdecl_def comp_is_type) | |
| 151 | ||
| 152 | ||
| 153 | lemma compClass_forall [simp]: " | |
| 154 | (\<forall>x\<in>set (snd (snd (snd (compClass G C)))). P (fst x) (fst (snd x))) = | |
| 155 | (\<forall>x\<in>set (snd (snd (snd C))). P (fst x) (fst (snd x)))" | |
| 156 | by (simp add: compClass_def compMethod_def split_beta) | |
| 157 | ||
| 158 | lemma comp_wf_mhead: "wf_mhead (comp G) S rT = wf_mhead G S rT" | |
| 159 | by (simp add: wf_mhead_def split_beta comp_is_type) | |
| 160 | ||
| 161 | lemma comp_ws_cdecl: " | |
| 162 | ws_cdecl (TranslComp.comp G) (compClass G C) = ws_cdecl G C" | |
| 163 | apply (simp add: ws_cdecl_def split_beta comp_is_class comp_subcls1) | |
| 164 | apply (simp (no_asm_simp) add: comp_wf_mhead) | |
| 165 | apply (simp add: compClass_def compMethod_def split_beta unique_map_fst) | |
| 13673 | 166 | done | 
| 167 | ||
| 14045 | 168 | |
| 169 | lemma comp_wf_syscls: "wf_syscls (comp G) = wf_syscls G" | |
| 13673 | 170 | apply (simp add: wf_syscls_def comp_def compClass_def split_beta) | 
| 171 | apply (simp only: image_compose [THEN sym]) | |
| 14045 | 172 | apply (subgoal_tac "(Fun.comp fst (\<lambda>(C, cno::cname, fdls::fdecl list, jmdls). | 
| 173 | (C, cno, fdls, map (compMethod G C) jmdls))) = fst") | |
| 13673 | 174 | apply (simp del: image_compose) | 
| 175 | apply (simp add: expand_fun_eq split_beta) | |
| 176 | done | |
| 177 | ||
| 178 | ||
| 14045 | 179 | lemma comp_ws_prog: "ws_prog (comp G) = ws_prog G" | 
| 180 | apply (rule sym) | |
| 181 | apply (simp add: ws_prog_def comp_ws_cdecl comp_unique) | |
| 182 | apply (simp add: comp_wf_syscls) | |
| 183 | apply (auto simp add: comp_ws_cdecl [THEN sym] TranslComp.comp_def) | |
| 184 | done | |
| 13673 | 185 | |
| 186 | ||
| 22271 | 187 | lemma comp_class_rec: " wfP ((subcls1 G)^--1) \<Longrightarrow> | 
| 13673 | 188 | class_rec (comp G) C t f = | 
| 189 | class_rec G C t (\<lambda> C' fs' ms' r'. f C' fs' (map (compMethod G C') ms') r')" | |
| 22271 | 190 | apply (rule_tac a = C in wfP_induct) apply assumption | 
| 191 | apply (subgoal_tac "wfP ((subcls1 (comp G))\<inverse>\<inverse>)") | |
| 13673 | 192 | apply (subgoal_tac "(class G x = None) \<or> (\<exists> D fs ms. (class G x = Some (D, fs, ms)))") | 
| 193 | apply (erule disjE) | |
| 194 | ||
| 195 | (* case class G x = None *) | |
| 23757 | 196 | apply (simp (no_asm_simp) add: class_rec_def comp_subcls1 | 
| 197 | wfrec [to_pred, where r="(subcls1 G)^--1", simplified]) | |
| 13673 | 198 | apply (simp add: comp_class_None) | 
| 199 | ||
| 200 | (* case \<exists> D fs ms. (class G x = Some (D, fs, ms)) *) | |
| 201 | apply (erule exE)+ | |
| 202 | apply (frule comp_class_imp) | |
| 203 | apply (frule_tac G="comp G" and C=x and t=t and f=f in class_rec_lemma) | |
| 204 | apply assumption | |
| 205 | apply (frule_tac G=G and C=x and t=t | |
| 206 | and f="(\<lambda>C' fs' ms'. f C' fs' (map (compMethod G C') ms'))" in class_rec_lemma) | |
| 207 | apply assumption | |
| 208 | apply (simp only:) | |
| 209 | ||
| 210 | apply (case_tac "x = Object") | |
| 211 | apply simp | |
| 212 | apply (frule subcls1I, assumption) | |
| 213 | apply (drule_tac x=D in spec, drule mp, simp) | |
| 214 | apply simp | |
| 215 | ||
| 216 | (* subgoals *) | |
| 217 | apply (case_tac "class G x") | |
| 218 | apply auto | |
| 219 | apply (simp add: comp_subcls1) | |
| 220 | done | |
| 221 | ||
| 22271 | 222 | lemma comp_fields: "wfP ((subcls1 G)^--1) \<Longrightarrow> | 
| 14045 | 223 | fields (comp G,C) = fields (G,C)" | 
| 13673 | 224 | by (simp add: fields_def comp_class_rec) | 
| 225 | ||
| 22271 | 226 | lemma comp_field: "wfP ((subcls1 G)^--1) \<Longrightarrow> | 
| 14045 | 227 | field (comp G,C) = field (G,C)" | 
| 23022 
9872ef956276
added qualification for ambiguous definition names
 haftmann parents: 
22271diff
changeset | 228 | by (simp add: TypeRel.field_def comp_fields) | 
| 13673 | 229 | |
| 230 | ||
| 231 | ||
| 14045 | 232 | lemma class_rec_relation [rule_format (no_asm)]: "\<lbrakk> ws_prog G; | 
| 13673 | 233 | \<forall> fs ms. R (f1 Object fs ms t1) (f2 Object fs ms t2); | 
| 234 | \<forall> C fs ms r1 r2. (R r1 r2) \<longrightarrow> (R (f1 C fs ms r1) (f2 C fs ms r2)) \<rbrakk> | |
| 235 | \<Longrightarrow> ((class G C) \<noteq> None) \<longrightarrow> | |
| 236 | R (class_rec G C t1 f1) (class_rec G C t2 f2)" | |
| 237 | apply (frule wf_subcls1) (* establish wf ((subcls1 G)^-1) *) | |
| 22271 | 238 | apply (rule_tac a = C in wfP_induct) apply assumption | 
| 13673 | 239 | apply (intro strip) | 
| 240 | apply (subgoal_tac "(\<exists>D rT mb. class G x = Some (D, rT, mb))") | |
| 241 | apply (erule exE)+ | |
| 242 | apply (frule_tac C=x and t=t1 and f=f1 in class_rec_lemma) | |
| 243 | apply assumption | |
| 244 | apply (frule_tac C=x and t=t2 and f=f2 in class_rec_lemma) | |
| 245 | apply assumption | |
| 246 | apply (simp only:) | |
| 247 | ||
| 248 | apply (case_tac "x = Object") | |
| 249 | apply simp | |
| 250 | apply (frule subcls1I, assumption) | |
| 251 | apply (drule_tac x=D in spec, drule mp, simp) | |
| 252 | apply simp | |
| 253 | apply (subgoal_tac "(\<exists>D' rT' mb'. class G D = Some (D', rT', mb'))") | |
| 254 | apply blast | |
| 255 | ||
| 256 | (* subgoals *) | |
| 257 | ||
| 14045 | 258 | apply (frule class_wf_struct) apply assumption | 
| 259 | apply (simp add: ws_cdecl_def is_class_def) | |
| 13673 | 260 | |
| 261 | apply (simp add: subcls1_def2 is_class_def) | |
| 14045 | 262 | apply auto | 
| 13673 | 263 | done | 
| 264 | ||
| 265 | ||
| 266 | syntax | |
| 267 | mtd_mb :: "cname \<times> ty \<times> 'c \<Rightarrow> 'c" | |
| 268 | translations | |
| 269 | "mtd_mb" => "Fun.comp snd snd" | |
| 270 | ||
| 14045 | 271 | lemma map_of_map_fst: "\<lbrakk> inj f; | 
| 13673 | 272 | \<forall>x\<in>set xs. fst (f x) = fst x; \<forall>x\<in>set xs. fst (g x) = fst x \<rbrakk> | 
| 14045 | 273 | \<Longrightarrow> map_of (map g xs) k | 
| 274 | = option_map (\<lambda> e. (snd (g ((inv f) (k, e))))) (map_of (map f xs) k)" | |
| 13673 | 275 | apply (induct xs) | 
| 276 | apply simp | |
| 277 | apply (simp del: split_paired_All) | |
| 278 | apply (case_tac "k = fst a") | |
| 279 | apply (simp del: split_paired_All) | |
| 14045 | 280 | apply (subgoal_tac "(inv f (fst a, snd (f a))) = a", simp) | 
| 281 | apply (subgoal_tac "(fst a, snd (f a)) = f a", simp) | |
| 282 | apply (erule conjE)+ | |
| 283 | apply (drule_tac s ="fst (f a)" and t="fst a" in sym) | |
| 13673 | 284 | apply simp | 
| 14045 | 285 | apply (simp add: surjective_pairing) | 
| 13673 | 286 | done | 
| 287 | ||
| 288 | ||
| 14045 | 289 | lemma comp_method [rule_format (no_asm)]: "\<lbrakk> ws_prog G; is_class G C\<rbrakk> \<Longrightarrow> | 
| 290 | ((method (comp G, C) S) = | |
| 291 | option_map (\<lambda> (D,rT,b). (D, rT, mtd_mb (compMethod G D (S, rT, b)))) | |
| 292 | (method (G, C) S))" | |
| 13673 | 293 | apply (simp add: method_def) | 
| 294 | apply (frule wf_subcls1) | |
| 295 | apply (simp add: comp_class_rec) | |
| 296 | apply (simp add: map_compose [THEN sym] split_iter split_compose del: map_compose) | |
| 14045 | 297 | apply (rule_tac R="%x y. ((x S) = (option_map (\<lambda>(D, rT, b). | 
| 298 | (D, rT, snd (snd (compMethod G D (S, rT, b))))) (y S)))" | |
| 299 | in class_rec_relation) | |
| 300 | apply assumption | |
| 13673 | 301 | |
| 302 | apply (intro strip) | |
| 303 | apply simp | |
| 304 | ||
| 14045 | 305 | apply (rule trans) | 
| 306 | ||
| 307 | apply (rule_tac f="(\<lambda>(s, m). (s, Object, m))" and | |
| 308 | g="(Fun.comp (\<lambda>(s, m). (s, Object, m)) (compMethod G Object))" | |
| 309 | in map_of_map_fst) | |
| 310 | defer (* inj \<dots> *) | |
| 311 | apply (simp add: inj_on_def split_beta) | |
| 13673 | 312 | apply (simp add: split_beta compMethod_def) | 
| 14045 | 313 | apply (simp add: map_of_map [THEN sym]) | 
| 314 | apply (simp add: split_beta) | |
| 315 | apply (simp add: map_compose [THEN sym] Fun.comp_def split_beta) | |
| 316 | apply (subgoal_tac "(\<lambda>x\<Colon>(vname list \<times> fdecl list \<times> stmt \<times> expr) mdecl. | |
| 317 | (fst x, Object, | |
| 318 | snd (compMethod G Object | |
| 319 | (inv (\<lambda>(s\<Colon>sig, m\<Colon>ty \<times> vname list \<times> fdecl list \<times> stmt \<times> expr). | |
| 320 | (s, Object, m)) | |
| 321 | (S, Object, snd x))))) | |
| 322 | = (\<lambda>x. (fst x, Object, fst (snd x), | |
| 323 | snd (snd (compMethod G Object (S, snd x)))))") | |
| 13673 | 324 | apply (simp only:) | 
| 14045 | 325 | apply (simp add: expand_fun_eq) | 
| 326 | apply (intro strip) | |
| 327 | apply (subgoal_tac "(inv (\<lambda>(s, m). (s, Object, m)) (S, Object, snd x)) = (S, snd x)") | |
| 13673 | 328 | apply (simp only:) | 
| 329 | apply (simp add: compMethod_def split_beta) | |
| 14045 | 330 | apply (rule inv_f_eq) | 
| 331 | defer | |
| 332 | defer | |
| 13673 | 333 | |
| 334 | apply (intro strip) | |
| 14025 | 335 | apply (simp add: map_add_Some_iff map_of_map del: split_paired_Ex) | 
| 14045 | 336 | apply (simp add: map_add_def) | 
| 337 | apply (subgoal_tac "inj (\<lambda>(s, m). (s, Ca, m))") | |
| 338 | apply (drule_tac g="(Fun.comp (\<lambda>(s, m). (s, Ca, m)) (compMethod G Ca))" and xs=ms | |
| 339 | and k=S in map_of_map_fst) | |
| 340 | apply (simp add: split_beta) | |
| 341 | apply (simp add: compMethod_def split_beta) | |
| 342 | apply (case_tac "(map_of (map (\<lambda>(s, m). (s, Ca, m)) ms) S)") | |
| 343 | apply simp | |
| 344 | apply simp apply (simp add: split_beta map_of_map) apply (erule exE) apply (erule conjE)+ | |
| 345 | apply (drule_tac t=a in sym) | |
| 346 | apply (subgoal_tac "(inv (\<lambda>(s, m). (s, Ca, m)) (S, a)) = (S, snd a)") | |
| 347 | apply simp | |
| 13673 | 348 | apply (subgoal_tac "\<forall>x\<in>set ms. fst ((Fun.comp (\<lambda>(s, m). (s, Ca, m)) (compMethod G Ca)) x) = fst x") | 
| 14045 | 349 | prefer 2 apply (simp (no_asm_simp) add: compMethod_def split_beta) | 
| 13673 | 350 | apply (simp add: map_of_map2) | 
| 351 | apply (simp (no_asm_simp) add: compMethod_def split_beta) | |
| 352 | ||
| 14045 | 353 | -- "remaining subgoals" | 
| 354 | apply (auto intro: inv_f_eq simp add: inj_on_def is_class_def) | |
| 13673 | 355 | done | 
| 356 | ||
| 357 | ||
| 358 | ||
| 14045 | 359 | lemma comp_wf_mrT: "\<lbrakk> ws_prog G; is_class G D\<rbrakk> \<Longrightarrow> | 
| 360 | wf_mrT (TranslComp.comp G) (C, D, fs, map (compMethod G a) ms) = | |
| 361 | wf_mrT G (C, D, fs, ms)" | |
| 362 | apply (simp add: wf_mrT_def compMethod_def split_beta) | |
| 363 | apply (simp add: comp_widen) | |
| 364 | apply (rule iffI) | |
| 13673 | 365 | apply (intro strip) | 
| 366 | apply simp | |
| 14045 | 367 | apply (drule bspec) apply assumption | 
| 368 | apply (drule_tac x=D' in spec) apply (drule_tac x=rT' in spec) apply (drule mp) | |
| 369 | prefer 2 apply assumption | |
| 370 | apply (simp add: comp_method [of G D]) | |
| 371 | apply (erule exE)+ | |
| 372 | apply (subgoal_tac "z =(fst z, fst (snd z), snd (snd z))") | |
| 373 | apply (rule exI) | |
| 374 | apply (simp) | |
| 375 | apply (simp add: split_paired_all) | |
| 376 | apply (intro strip) | |
| 377 | apply (simp add: comp_method) | |
| 378 | apply auto | |
| 13673 | 379 | done | 
| 380 | ||
| 381 | ||
| 382 | (**********************************************************************) | |
| 383 | (* DIVERSE OTHER LEMMAS *) | |
| 384 | (**********************************************************************) | |
| 385 | ||
| 386 | lemma max_spec_preserves_length: | |
| 387 |   "max_spec G C (mn, pTs) = {((md,rT),pTs')} 
 | |
| 388 | \<Longrightarrow> length pTs = length pTs'" | |
| 389 | apply (frule max_spec2mheads) | |
| 390 | apply (erule exE)+ | |
| 391 | apply (simp add: list_all2_def) | |
| 392 | done | |
| 393 | ||
| 394 | ||
| 395 | lemma ty_exprs_length [simp]: "(E\<turnstile>es[::]Ts \<longrightarrow> length es = length Ts)" | |
| 396 | apply (subgoal_tac "(E\<turnstile>e::T \<longrightarrow> True) \<and> (E\<turnstile>es[::]Ts \<longrightarrow> length es = length Ts) \<and> (E\<turnstile>s\<surd> \<longrightarrow> True)") | |
| 397 | apply blast | |
| 398 | apply (rule ty_expr_ty_exprs_wt_stmt.induct) | |
| 399 | apply auto | |
| 400 | done | |
| 401 | ||
| 402 | ||
| 403 | lemma max_spec_preserves_method_rT [simp]: | |
| 404 |   "max_spec G C (mn, pTs) = {((md,rT),pTs')}
 | |
| 405 | \<Longrightarrow> method_rT (the (method (G, C) (mn, pTs'))) = rT" | |
| 406 | apply (frule max_spec2mheads) | |
| 407 | apply (erule exE)+ | |
| 408 | apply (simp add: method_rT_def) | |
| 409 | done | |
| 410 | ||
| 14045 | 411 | (**********************************************************************************) | 
| 412 | ||
| 413 | declare compClass_fst [simp del] | |
| 414 | declare compClass_fst_snd [simp del] | |
| 415 | declare compClass_fst_snd_snd [simp del] | |
| 416 | ||
| 417 | declare split_paired_All [simp add] | |
| 418 | declare split_paired_Ex [simp add] | |
| 13673 | 419 | |
| 420 | end |