src/HOL/MicroJava/J/Conform.thy
changeset 58886 8a6cac7c7247
parent 58263 6c907aad90ba
child 59199 cb8e5f7a5e4a
equal deleted inserted replaced
58885:47fdd4f40d00 58886:8a6cac7c7247
     1 (*  Title:      HOL/MicroJava/J/Conform.thy
     1 (*  Title:      HOL/MicroJava/J/Conform.thy
     2     Author:     David von Oheimb
     2     Author:     David von Oheimb
     3     Copyright   1999 Technische Universitaet Muenchen
     3     Copyright   1999 Technische Universitaet Muenchen
     4 *)
     4 *)
     5 
     5 
     6 header {* \isaheader{Conformity Relations for Type Soundness Proof} *}
     6 section {* Conformity Relations for Type Soundness Proof *}
     7 
     7 
     8 theory Conform imports State WellType Exceptions begin
     8 theory Conform imports State WellType Exceptions begin
     9 
     9 
    10 type_synonym 'c env' = "'c prog \<times> (vname \<rightharpoonup> ty)"  -- "same as @{text env} of @{text WellType.thy}"
    10 type_synonym 'c env' = "'c prog \<times> (vname \<rightharpoonup> ty)"  -- "same as @{text env} of @{text WellType.thy}"
    11 
    11 
    42   oconf  ("_,_ \<turnstile> _ \<surd>" [51,51,51] 50) and
    42   oconf  ("_,_ \<turnstile> _ \<surd>" [51,51,51] 50) and
    43   hconf  ("_ \<turnstile>h _ \<surd>" [51,51] 50) and
    43   hconf  ("_ \<turnstile>h _ \<surd>" [51,51] 50) and
    44   conforms  ("_ ::\<preceq> _" [51,51] 50)
    44   conforms  ("_ ::\<preceq> _" [51,51] 50)
    45 
    45 
    46 
    46 
    47 section "hext"
    47 subsection "hext"
    48 
    48 
    49 lemma hextI: 
    49 lemma hextI: 
    50 " \<forall>a C fs . h  a = Some (C,fs) -->   
    50 " \<forall>a C fs . h  a = Some (C,fs) -->   
    51       (\<exists>fs'. h' a = Some (C,fs')) ==> h\<le>|h'"
    51       (\<exists>fs'. h' a = Some (C,fs')) ==> h\<le>|h'"
    52 apply (unfold hext_def)
    52 apply (unfold hext_def)
    77 apply (rule hextI)
    77 apply (rule hextI)
    78 apply auto
    78 apply auto
    79 done
    79 done
    80 
    80 
    81 
    81 
    82 section "conf"
    82 subsection "conf"
    83 
    83 
    84 lemma conf_Null [simp]: "G,h\<turnstile>Null::\<preceq>T = G\<turnstile>RefT NullT\<preceq>T"
    84 lemma conf_Null [simp]: "G,h\<turnstile>Null::\<preceq>T = G\<turnstile>RefT NullT\<preceq>T"
    85 apply (unfold conf_def)
    85 apply (unfold conf_def)
    86 apply (simp (no_asm))
    86 apply (simp (no_asm))
    87 done
    87 done
   180 apply(clarify)
   180 apply(clarify)
   181 apply(fast elim: conf_widen)
   181 apply(fast elim: conf_widen)
   182 done
   182 done
   183 
   183 
   184 
   184 
   185 section "lconf"
   185 subsection "lconf"
   186 
   186 
   187 lemma lconfD: "[| G,h\<turnstile>vs[::\<preceq>]Ts; Ts n = Some T |] ==> G,h\<turnstile>(the (vs n))::\<preceq>T"
   187 lemma lconfD: "[| G,h\<turnstile>vs[::\<preceq>]Ts; Ts n = Some T |] ==> G,h\<turnstile>(the (vs n))::\<preceq>T"
   188 apply (unfold lconf_def)
   188 apply (unfold lconf_def)
   189 apply (force)
   189 apply (force)
   190 done
   190 done
   240 apply (intro strip)
   240 apply (intro strip)
   241 apply (case_tac "n = vn")
   241 apply (case_tac "n = vn")
   242 apply auto
   242 apply auto
   243 done
   243 done
   244 
   244 
   245 section "oconf"
   245 subsection "oconf"
   246 
   246 
   247 lemma oconf_hext: "G,h\<turnstile>obj\<surd> ==> h\<le>|h' ==> G,h'\<turnstile>obj\<surd>"
   247 lemma oconf_hext: "G,h\<turnstile>obj\<surd> ==> h\<le>|h' ==> G,h'\<turnstile>obj\<surd>"
   248 apply (unfold oconf_def)
   248 apply (unfold oconf_def)
   249 apply (fast)
   249 apply (fast)
   250 done
   250 done
   256 done
   256 done
   257 
   257 
   258 lemmas oconf_objD = oconf_obj [THEN iffD1, THEN spec, THEN spec, THEN mp]
   258 lemmas oconf_objD = oconf_obj [THEN iffD1, THEN spec, THEN spec, THEN mp]
   259 
   259 
   260 
   260 
   261 section "hconf"
   261 subsection "hconf"
   262 
   262 
   263 lemma hconfD: "[|G\<turnstile>h h\<surd>; h a = Some obj|] ==> G,h\<turnstile>obj\<surd>"
   263 lemma hconfD: "[|G\<turnstile>h h\<surd>; h a = Some obj|] ==> G,h\<turnstile>obj\<surd>"
   264 apply (unfold hconf_def)
   264 apply (unfold hconf_def)
   265 apply (fast)
   265 apply (fast)
   266 done
   266 done
   269 apply (unfold hconf_def)
   269 apply (unfold hconf_def)
   270 apply (fast)
   270 apply (fast)
   271 done
   271 done
   272 
   272 
   273 
   273 
   274 section "xconf"
   274 subsection "xconf"
   275 
   275 
   276 lemma xconf_raise_if: "xconf h x \<Longrightarrow> xconf h (raise_if b xcn x)"
   276 lemma xconf_raise_if: "xconf h x \<Longrightarrow> xconf h (raise_if b xcn x)"
   277 by (simp add: xconf_def raise_if_def)
   277 by (simp add: xconf_def raise_if_def)
   278 
   278 
   279 
   279 
   280 
   280 
   281 section "conforms"
   281 subsection "conforms"
   282 
   282 
   283 lemma conforms_heapD: "(x, (h, l))::\<preceq>(G, lT) ==> G\<turnstile>h h\<surd>"
   283 lemma conforms_heapD: "(x, (h, l))::\<preceq>(G, lT) ==> G\<turnstile>h h\<surd>"
   284 apply (unfold conforms_def)
   284 apply (unfold conforms_def)
   285 apply (simp)
   285 apply (simp)
   286 done
   286 done