src/HOL/MicroJava/BV/Correct.thy
author wenzelm
Thu, 27 Mar 2008 17:21:41 +0100
changeset 26438 090ced251009
parent 22271 51a80e238b29
child 33954 1bc3b688548c
permissions -rw-r--r--
fixed theory imports;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12545
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
     1
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     2
(*  Title:      HOL/MicroJava/BV/Correct.thy
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     3
    ID:         $Id$
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
     4
    Author:     Cornelia Pusch, Gerwin Klein
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     5
    Copyright   1999 Technische Universitaet Muenchen
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     6
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     7
The invariant for the type safety proof.
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     8
*)
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
     9
12911
704713ca07ea new document
kleing
parents: 12774
diff changeset
    10
header {* \isaheader{BV Type Safety Invariant} *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    11
26438
090ced251009 fixed theory imports;
wenzelm
parents: 22271
diff changeset
    12
theory Correct imports BVSpec "../JVM/JVMExec" begin
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    13
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    14
constdefs
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    15
  approx_val :: "[jvm_prog,aheap,val,ty err] \<Rightarrow> bool"
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    16
  "approx_val G h v any == case any of Err \<Rightarrow> True | OK T \<Rightarrow> G,h\<turnstile>v::\<preceq>T"
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    17
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    18
  approx_loc :: "[jvm_prog,aheap,val list,locvars_type] \<Rightarrow> bool"
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
    19
  "approx_loc G hp loc LT == list_all2 (approx_val G hp) loc LT"
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
    20
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    21
  approx_stk :: "[jvm_prog,aheap,opstack,opstack_type] \<Rightarrow> bool"
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10060
diff changeset
    22
  "approx_stk G hp stk ST == approx_loc G hp stk (map OK ST)"
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    23
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    24
  correct_frame  :: "[jvm_prog,aheap,state_type,nat,bytecode] \<Rightarrow> frame \<Rightarrow> bool"
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
    25
  "correct_frame G hp == \<lambda>(ST,LT) maxl ins (stk,loc,C,sig,pc).
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
    26
                         approx_stk G hp stk ST  \<and> approx_loc G hp loc LT \<and> 
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
    27
                         pc < length ins \<and> length loc=length(snd sig)+maxl+1"
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    28
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    29
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    30
consts
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    31
 correct_frames  :: "[jvm_prog,aheap,prog_type,ty,sig,frame list] \<Rightarrow> bool"
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    32
primrec
8045
816f566c414f Fixed a problem with returning from the last frame.
nipkow
parents: 8034
diff changeset
    33
"correct_frames G hp phi rT0 sig0 [] = True"
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    34
8045
816f566c414f Fixed a problem with returning from the last frame.
nipkow
parents: 8034
diff changeset
    35
"correct_frames G hp phi rT0 sig0 (f#frs) =
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    36
  (let (stk,loc,C,sig,pc) = f in
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    37
  (\<exists>ST LT rT maxs maxl ins et.
10625
022c6b2bcd6b strengthened invariant: current class must be defined
kleing
parents: 10612
diff changeset
    38
    phi C sig ! pc = Some (ST,LT) \<and> is_class G C \<and> 
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    39
    method (G,C) sig = Some(C,rT,(maxs,maxl,ins,et)) \<and>
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    40
  (\<exists>C' mn pTs. ins!pc = (Invoke C' mn pTs) \<and> 
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    41
         (mn,pTs) = sig0 \<and> 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    42
         (\<exists>apTs D ST' LT'.
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    43
         (phi C sig)!pc = Some ((rev apTs) @ (Class D) # ST', LT') \<and>
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    44
         length apTs = length pTs \<and>
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    45
         (\<exists>D' rT' maxs' maxl' ins' et'.
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    46
           method (G,D) sig0 = Some(D',rT',(maxs',maxl',ins',et')) \<and>
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    47
           G \<turnstile> rT0 \<preceq> rT') \<and>
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    48
   correct_frame G hp (ST, LT) maxl ins f \<and> 
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    49
   correct_frames G hp phi rT sig frs))))"
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    50
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    51
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    52
constdefs
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    53
 correct_state :: "[jvm_prog,prog_type,jvm_state] \<Rightarrow> bool"
11372
648795477bb5 corrected xsymbol/HTML syntax
oheimb
parents: 11252
diff changeset
    54
                  ("_,_ |-JVM _ [ok]"  [51,51] 50)
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
    55
"correct_state G phi == \<lambda>(xp,hp,frs).
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
    56
   case xp of
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    57
     None \<Rightarrow> (case frs of
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    58
             [] \<Rightarrow> True
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    59
             | (f#fs) \<Rightarrow> G\<turnstile>h hp\<surd> \<and> preallocated hp \<and> 
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    60
      (let (stk,loc,C,sig,pc) = f
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    61
             in
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    62
                         \<exists>rT maxs maxl ins et s.
10625
022c6b2bcd6b strengthened invariant: current class must be defined
kleing
parents: 10612
diff changeset
    63
                         is_class G C \<and>
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    64
                         method (G,C) sig = Some(C,rT,(maxs,maxl,ins,et)) \<and>
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    65
                         phi C sig ! pc = Some s \<and>
12516
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    66
       correct_frame G hp s maxl ins f \<and> 
d09d0f160888 exceptions
kleing
parents: 11372
diff changeset
    67
             correct_frames G hp phi rT sig fs))
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    68
   | Some x \<Rightarrow> frs = []" 
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    69
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    70
11372
648795477bb5 corrected xsymbol/HTML syntax
oheimb
parents: 11252
diff changeset
    71
syntax (xsymbols)
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
    72
 correct_state :: "[jvm_prog,prog_type,jvm_state] \<Rightarrow> bool"
11372
648795477bb5 corrected xsymbol/HTML syntax
oheimb
parents: 11252
diff changeset
    73
                  ("_,_ \<turnstile>JVM _ \<surd>"  [51,51] 50)
10060
4522e59b7d84 added HTML syntax
kleing
parents: 10056
diff changeset
    74
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    75
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    76
lemma sup_ty_opt_OK:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    77
  "(G \<turnstile> X <=o (OK T')) = (\<exists>T. X = OK T \<and> G \<turnstile> T \<preceq> T')"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    78
  apply (cases X)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    79
  apply auto
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    80
  done
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    81
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    82
11085
b830bf10bf71 tuned for 99-2 release
kleing
parents: 10920
diff changeset
    83
section {* approx-val *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    84
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    85
lemma approx_val_Err [simp,intro!]:
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    86
  "approx_val G hp x Err"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    87
  by (simp add: approx_val_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    88
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    89
lemma approx_val_OK [iff]: 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    90
  "approx_val G hp x (OK T) = (G,hp \<turnstile> x ::\<preceq> T)"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    91
  by (simp add: approx_val_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    92
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    93
lemma approx_val_Null [simp,intro!]:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    94
  "approx_val G hp Null (OK (RefT x))"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    95
  by (auto simp add: approx_val_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
    96
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    97
lemma approx_val_sup_heap:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    98
  "\<lbrakk> approx_val G hp v T; hp \<le>| hp' \<rbrakk> \<Longrightarrow> approx_val G hp' v T"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
    99
  by (cases T) (blast intro: conf_hext)+
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   100
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   101
lemma approx_val_heap_update:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   102
  "\<lbrakk> hp a = Some obj'; G,hp\<turnstile> v::\<preceq>T; obj_ty obj = obj_ty obj'\<rbrakk> 
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   103
  \<Longrightarrow> G,hp(a\<mapsto>obj)\<turnstile> v::\<preceq>T"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   104
  by (cases v, auto simp add: obj_ty_def conf_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   105
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   106
lemma approx_val_widen:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   107
  "\<lbrakk> approx_val G hp v T; G \<turnstile> T <=o T'; wf_prog wt G \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   108
  \<Longrightarrow> approx_val G hp v T'"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   109
  by (cases T', auto simp add: sup_ty_opt_OK intro: conf_widen)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   110
11085
b830bf10bf71 tuned for 99-2 release
kleing
parents: 10920
diff changeset
   111
section {* approx-loc *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   112
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   113
lemma approx_loc_Nil [simp,intro!]:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   114
  "approx_loc G hp [] []"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   115
  by (simp add: approx_loc_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   116
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   117
lemma approx_loc_Cons [iff]:
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   118
  "approx_loc G hp (l#ls) (L#LT) = 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   119
  (approx_val G hp l L \<and> approx_loc G hp ls LT)"
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   120
by (simp add: approx_loc_def)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   121
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   122
lemma approx_loc_nth:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   123
  "\<lbrakk> approx_loc G hp loc LT; n < length LT \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   124
  \<Longrightarrow> approx_val G hp (loc!n) (LT!n)"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   125
  by (simp add: approx_loc_def list_all2_conv_all_nth)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   126
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   127
lemma approx_loc_imp_approx_val_sup:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   128
  "\<lbrakk>approx_loc G hp loc LT; n < length LT; LT ! n = OK T; G \<turnstile> T \<preceq> T'; wf_prog wt G\<rbrakk> 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   129
  \<Longrightarrow> G,hp \<turnstile> (loc!n) ::\<preceq> T'"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   130
  apply (drule approx_loc_nth, assumption) 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   131
  apply simp
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   132
  apply (erule conf_widen, assumption+)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   133
  done
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   134
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   135
lemma approx_loc_conv_all_nth:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   136
  "approx_loc G hp loc LT = 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   137
  (length loc = length LT \<and> (\<forall>n < length loc. approx_val G hp (loc!n) (LT!n)))"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   138
  by (simp add: approx_loc_def list_all2_conv_all_nth)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   139
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   140
lemma approx_loc_sup_heap:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   141
  "\<lbrakk> approx_loc G hp loc LT; hp \<le>| hp' \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   142
  \<Longrightarrow> approx_loc G hp' loc LT"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   143
  apply (clarsimp simp add: approx_loc_conv_all_nth)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   144
  apply (blast intro: approx_val_sup_heap)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   145
  done
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   146
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   147
lemma approx_loc_widen:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   148
  "\<lbrakk> approx_loc G hp loc LT; G \<turnstile> LT <=l LT'; wf_prog wt G \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   149
  \<Longrightarrow> approx_loc G hp loc LT'"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   150
apply (unfold Listn.le_def lesub_def sup_loc_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   151
apply (simp (no_asm_use) only: list_all2_conv_all_nth approx_loc_conv_all_nth)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   152
apply (simp (no_asm_simp))
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   153
apply clarify
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   154
apply (erule allE, erule impE) 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   155
 apply simp
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   156
apply (erule approx_val_widen)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   157
 apply simp
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   158
apply assumption
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
   159
done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   160
13052
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   161
lemma loc_widen_Err [dest]:
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   162
  "\<And>XT. G \<turnstile> replicate n Err <=l XT \<Longrightarrow> XT = replicate n Err"
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   163
  by (induct n) auto
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   164
  
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   165
lemma approx_loc_Err [iff]:
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   166
  "approx_loc G hp (replicate n v) (replicate n Err)"
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   167
  by (induct n) auto
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   168
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   169
lemma approx_loc_subst:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   170
  "\<lbrakk> approx_loc G hp loc LT; approx_val G hp x X \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   171
  \<Longrightarrow> approx_loc G hp (loc[idx:=x]) (LT[idx:=X])"
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   172
apply (unfold approx_loc_def list_all2_def)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   173
apply (auto dest: subsetD [OF set_update_subset_insert] simp add: zip_update)
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
   174
done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   175
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   176
lemma approx_loc_append:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   177
  "length l1=length L1 \<Longrightarrow>
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
   178
  approx_loc G hp (l1@l2) (L1@L2) = 
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
   179
  (approx_loc G hp l1 L1 \<and> approx_loc G hp l2 L2)"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   180
  apply (unfold approx_loc_def list_all2_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   181
  apply (simp cong: conj_cong)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   182
  apply blast
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   183
  done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   184
11085
b830bf10bf71 tuned for 99-2 release
kleing
parents: 10920
diff changeset
   185
section {* approx-stk *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   186
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   187
lemma approx_stk_rev_lem:
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   188
  "approx_stk G hp (rev s) (rev t) = approx_stk G hp s t"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   189
  apply (unfold approx_stk_def approx_loc_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   190
  apply (simp add: rev_map [THEN sym])
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   191
  done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   192
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   193
lemma approx_stk_rev:
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   194
  "approx_stk G hp (rev s) t = approx_stk G hp s (rev t)"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   195
  by (auto intro: subst [OF approx_stk_rev_lem])
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   196
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   197
lemma approx_stk_sup_heap:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   198
  "\<lbrakk> approx_stk G hp stk ST; hp \<le>| hp' \<rbrakk> \<Longrightarrow> approx_stk G hp' stk ST"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   199
  by (auto intro: approx_loc_sup_heap simp add: approx_stk_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   200
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   201
lemma approx_stk_widen:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   202
  "\<lbrakk> approx_stk G hp stk ST; G \<turnstile> map OK ST <=l map OK ST'; wf_prog wt G \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   203
  \<Longrightarrow> approx_stk G hp stk ST'" 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   204
  by (auto elim: approx_loc_widen simp add: approx_stk_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   205
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   206
lemma approx_stk_Nil [iff]:
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   207
  "approx_stk G hp [] []"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   208
  by (simp add: approx_stk_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   209
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   210
lemma approx_stk_Cons [iff]:
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   211
  "approx_stk G hp (x#stk) (S#ST) = 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   212
  (approx_val G hp x (OK S) \<and> approx_stk G hp stk ST)"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   213
  by (simp add: approx_stk_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   214
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   215
lemma approx_stk_Cons_lemma [iff]:
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   216
  "approx_stk G hp stk (S#ST') = 
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10060
diff changeset
   217
  (\<exists>s stk'. stk = s#stk' \<and> approx_val G hp s (OK S) \<and> approx_stk G hp stk' ST')"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   218
  by (simp add: list_all2_Cons2 approx_stk_def approx_loc_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   219
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   220
lemma approx_stk_append:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   221
  "approx_stk G hp stk (S@S') \<Longrightarrow>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   222
  (\<exists>s stk'. stk = s@stk' \<and> length s = length S \<and> length stk' = length S' \<and> 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   223
            approx_stk G hp s S \<and> approx_stk G hp stk' S')"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   224
  by (simp add: list_all2_append2 approx_stk_def approx_loc_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   225
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   226
lemma approx_stk_all_widen:
22271
51a80e238b29 Adapted to new inductive definition package.
berghofe
parents: 16417
diff changeset
   227
  "\<lbrakk> approx_stk G hp stk ST; \<forall>(x, y) \<in> set (zip ST ST'). G \<turnstile> x \<preceq> y; length ST = length ST'; wf_prog wt G \<rbrakk> 
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   228
  \<Longrightarrow> approx_stk G hp stk ST'"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   229
apply (unfold approx_stk_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   230
apply (clarsimp simp add: approx_loc_conv_all_nth all_set_conv_all_nth)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   231
apply (erule allE, erule impE, assumption)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   232
apply (erule allE, erule impE, assumption)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   233
apply (erule conf_widen, assumption+)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   234
done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   235
11085
b830bf10bf71 tuned for 99-2 release
kleing
parents: 10920
diff changeset
   236
section {* oconf *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   237
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   238
lemma oconf_field_update:
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   239
  "\<lbrakk>map_of (fields (G, oT)) FD = Some T; G,hp\<turnstile>v::\<preceq>T; G,hp\<turnstile>(oT,fs)\<surd> \<rbrakk>
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   240
  \<Longrightarrow> G,hp\<turnstile>(oT, fs(FD\<mapsto>v))\<surd>"
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   241
  by (simp add: oconf_def lconf_def)
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   242
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   243
lemma oconf_newref:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   244
  "\<lbrakk>hp oref = None; G,hp \<turnstile> obj \<surd>; G,hp \<turnstile> obj' \<surd>\<rbrakk> \<Longrightarrow> G,hp(oref\<mapsto>obj') \<turnstile> obj \<surd>"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   245
  apply (unfold oconf_def lconf_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   246
  apply simp
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   247
  apply (blast intro: conf_hext hext_new)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   248
  done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   249
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   250
lemma oconf_heap_update:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   251
  "\<lbrakk> hp a = Some obj'; obj_ty obj' = obj_ty obj''; G,hp\<turnstile>obj\<surd> \<rbrakk>
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   252
  \<Longrightarrow> G,hp(a\<mapsto>obj'')\<turnstile>obj\<surd>"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   253
  apply (unfold oconf_def lconf_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   254
  apply (fastsimp intro: approx_val_heap_update)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   255
  done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   256
11085
b830bf10bf71 tuned for 99-2 release
kleing
parents: 10920
diff changeset
   257
section {* hconf *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   258
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   259
lemma hconf_newref:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   260
  "\<lbrakk> hp oref = None; G\<turnstile>h hp\<surd>; G,hp\<turnstile>obj\<surd> \<rbrakk> \<Longrightarrow> G\<turnstile>h hp(oref\<mapsto>obj)\<surd>"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   261
  apply (simp add: hconf_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   262
  apply (fast intro: oconf_newref)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   263
  done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   264
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   265
lemma hconf_field_update:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   266
  "\<lbrakk> map_of (fields (G, oT)) X = Some T; hp a = Some(oT,fs); 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   267
     G,hp\<turnstile>v::\<preceq>T; G\<turnstile>h hp\<surd> \<rbrakk> 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   268
  \<Longrightarrow> G\<turnstile>h hp(a \<mapsto> (oT, fs(X\<mapsto>v)))\<surd>"
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   269
  apply (simp add: hconf_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   270
  apply (fastsimp intro: oconf_heap_update oconf_field_update 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   271
                  simp add: obj_ty_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   272
  done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   273
12545
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   274
section {* preallocated *}
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   275
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   276
lemma preallocated_field_update:
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   277
  "\<lbrakk> map_of (fields (G, oT)) X = Some T; hp a = Some(oT,fs); 
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   278
     G\<turnstile>h hp\<surd>; preallocated hp \<rbrakk> 
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   279
  \<Longrightarrow> preallocated (hp(a \<mapsto> (oT, fs(X\<mapsto>v))))"
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   280
  apply (unfold preallocated_def)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   281
  apply (rule allI)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   282
  apply (erule_tac x=x in allE)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   283
  apply simp
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   284
  apply (rule ccontr)  
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   285
  apply (unfold hconf_def)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   286
  apply (erule allE, erule allE, erule impE, assumption)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   287
  apply (unfold oconf_def lconf_def)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   288
  apply (simp del: split_paired_All)
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   289
  done  
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   290
7319d384d0d3 removed preallocated heaps axiom (now in type safety invariant)
kleing
parents: 12516
diff changeset
   291
13052
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   292
lemma 
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   293
  assumes none: "hp oref = None" and alloc: "preallocated hp"
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   294
  shows preallocated_newref: "preallocated (hp(oref\<mapsto>obj))"
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   295
proof (cases oref)
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   296
  case (XcptRef x) 
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   297
  with none alloc have "False" by (auto elim: preallocatedE [of _ x])
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   298
  thus ?thesis ..
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   299
next
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   300
  case (Loc l)
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   301
  with alloc show ?thesis by (simp add: preallocated_def)
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   302
qed
3bf41c474a88 canonical start state
kleing
parents: 13006
diff changeset
   303
  
11085
b830bf10bf71 tuned for 99-2 release
kleing
parents: 10920
diff changeset
   304
section {* correct-frames *}
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   305
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   306
lemmas [simp del] = fun_upd_apply
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   307
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   308
lemma correct_frames_field_update [rule_format]:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   309
  "\<forall>rT C sig. 
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   310
  correct_frames G hp phi rT sig frs \<longrightarrow> 
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   311
  hp a = Some (C,fs) \<longrightarrow> 
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   312
  map_of (fields (G, C)) fl = Some fd \<longrightarrow> 
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
   313
  G,hp\<turnstile>v::\<preceq>fd 
13006
51c5f3f11d16 symbolized
kleing
parents: 12911
diff changeset
   314
  \<longrightarrow> correct_frames G (hp(a \<mapsto> (C, fs(fl\<mapsto>v)))) phi rT sig frs";
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   315
apply (induct frs)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   316
 apply simp
10920
9b74eceea2d2 newref -> new_Addr
kleing
parents: 10812
diff changeset
   317
apply clarify
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   318
apply (simp (no_asm_use))
10920
9b74eceea2d2 newref -> new_Addr
kleing
parents: 10812
diff changeset
   319
apply clarify
9b74eceea2d2 newref -> new_Addr
kleing
parents: 10812
diff changeset
   320
apply (unfold correct_frame_def)
9b74eceea2d2 newref -> new_Addr
kleing
parents: 10812
diff changeset
   321
apply (simp (no_asm_use))
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   322
apply clarify
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   323
apply (intro exI conjI)
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   324
    apply assumption+
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   325
   apply (erule approx_stk_sup_heap)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   326
   apply (erule hext_upd_obj)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   327
  apply (erule approx_loc_sup_heap)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   328
  apply (erule hext_upd_obj)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   329
 apply assumption+
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   330
apply blast
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
   331
done
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   332
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   333
lemma correct_frames_newref [rule_format]:
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   334
  "\<forall>rT C sig. 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   335
  hp x = None \<longrightarrow> 
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   336
  correct_frames G hp phi rT sig frs \<longrightarrow>
13681
06cce9be31a4 simplified lemma correct_frames_newref
kleing
parents: 13052
diff changeset
   337
  correct_frames G (hp(x \<mapsto> obj)) phi rT sig frs"
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   338
apply (induct frs)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   339
 apply simp
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   340
apply clarify
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   341
apply (simp (no_asm_use))
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   342
apply clarify
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   343
apply (unfold correct_frame_def)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   344
apply (simp (no_asm_use))
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   345
apply clarify
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9549
diff changeset
   346
apply (intro exI conjI)
11252
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   347
    apply assumption+
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   348
   apply (erule approx_stk_sup_heap)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   349
   apply (erule hext_new)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   350
  apply (erule approx_loc_sup_heap)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   351
  apply (erule hext_new)
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   352
 apply assumption+
71c00cb091d2 cleanup, tuned
kleing
parents: 11178
diff changeset
   353
apply blast
10056
9f84ffa4a8d0 tuned spacing for document generation
kleing
parents: 10042
diff changeset
   354
done
8011
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
   355
d14c4e9e9c8e *** empty log message ***
nipkow
parents:
diff changeset
   356
end