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