src/HOL/NanoJava/AxSem.thy
author oheimb
Wed, 08 Aug 2001 12:36:48 +0200
changeset 11476 06c1998340a8
parent 11449 d25be0ad1a6c
child 11486 8f32860eac3a
permissions -rw-r--r--
changed to full expressions with side effects
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     1
(*  Title:      HOL/NanoJava/AxSem.thy
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     2
    ID:         $Id$
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     3
    Author:     David von Oheimb
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     4
    Copyright   2001 Technische Universitaet Muenchen
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     5
*)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     6
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     7
header "Axiomatic Semantics (Hoare Logic)"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     8
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
     9
theory AxSem = State:
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    10
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    11
types assn   = "state => bool"
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    12
     vassn   = "val \<Rightarrow> assn"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    13
      triple = "assn \<times> stmt \<times>  assn"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    14
     etriple = "assn \<times> expr \<times> vassn"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    15
translations
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    16
  "assn"   \<leftharpoondown> (type)"state => bool"
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    17
 "vassn"   \<leftharpoondown> (type)"val => assn"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    18
  "triple" \<leftharpoondown> (type)"assn \<times> stmt \<times>  assn"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    19
 "etriple" \<leftharpoondown> (type)"assn \<times> expr \<times> vassn"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    20
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    21
consts   hoare   :: "(triple set \<times>  triple set) set"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    22
consts  ehoare   :: "(triple set \<times> etriple    ) set"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    23
syntax (xsymbols)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    24
 "@hoare"  :: "[triple set,  triple set    ] => bool" ("_ |\<turnstile>/ _" [61,61]    60)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    25
 "@hoare1" :: "[triple set,  assn,stmt,assn] => bool" 
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    26
                                   ("_ \<turnstile>/ ({(1_)}/ (_)/ {(1_)})" [61,3,90,3]60)
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    27
"@ehoare"  :: "[triple set,  etriple       ] => bool" ("_ |\<turnstile>e/ _"[61,61]60)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    28
"@ehoare1" :: "[triple set,  assn,expr,vassn]=> bool"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    29
                                  ("_ \<turnstile>e/ ({(1_)}/ (_)/ {(1_)})" [61,3,90,3]60)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    30
syntax
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    31
 "@hoare"  :: "[triple set,  triple set    ] => bool" ("_ ||-/ _" [61,61] 60)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    32
 "@hoare1" :: "[triple set,  assn,stmt,assn] => bool" 
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    33
                                  ("_ |-/ ({(1_)}/ (_)/ {(1_)})" [61,3,90,3] 60)
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    34
"@ehoare"  :: "[triple set,  etriple       ] => bool" ("_ ||-e/ _"[61,61] 60)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    35
"@ehoare1" :: "[triple set,  assn,expr,vassn]=> bool"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    36
                                 ("_ |-e/ ({(1_)}/ (_)/ {(1_)})" [61,3,90,3] 60)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    37
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    38
translations "A |\<turnstile> C"        \<rightleftharpoons> "(A,C) \<in> hoare"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    39
             "A  \<turnstile> {P}c{Q}"  \<rightleftharpoons> "A |\<turnstile> {(P,c,Q)}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    40
             "A |\<turnstile>e t"       \<rightleftharpoons> "(A,t) \<in> ehoare"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    41
             "A |\<turnstile>e (P,e,Q)" \<rightleftharpoons> "(A,P,e,Q) \<in> ehoare" (** shouldn't be necess.**)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    42
             "A  \<turnstile>e{P}e{Q}"  \<rightleftharpoons> "A |\<turnstile>e (P,e,Q)"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    43
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    44
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    45
inductive hoare ehoare
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    46
intros
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    47
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    48
  Skip:  "A |- {P} Skip {P}"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    49
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    50
  Comp: "[| A |- {P} c1 {Q}; A |- {Q} c2 {R} |] ==> A |- {P} c1;;c2 {R}"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    51
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    52
  Cond: "[| A |-e {P} e {Q}; 
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    53
            \<forall>v. A |- {Q v} (if v \<noteq> Null then c1 else c2) {R} |] ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    54
            A |- {P} If(e) c1 Else c2 {R}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    55
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    56
  Loop: "A |- {\<lambda>s. P s \<and> s<x> \<noteq> Null} c {P} ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    57
         A |- {P} While(x) c {\<lambda>s. P s \<and> s<x> = Null}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    58
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    59
  LAcc: "A |-e {\<lambda>s. P (s<x>) s} LAcc x {P}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    60
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    61
  LAss: "A |-e {P} e {\<lambda>v s.  Q (lupd(x\<mapsto>v) s)} ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    62
         A |-  {P} x:==e {Q}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    63
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    64
  FAcc: "A |-e {P} e {\<lambda>v s. \<forall>a. v=Addr a --> Q (get_field s a f) s} ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    65
         A |-e {P} e..f {Q}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    66
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    67
  FAss: "[| A |-e {P} e1 {\<lambda>v s. \<forall>a. v=Addr a --> Q a s};
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    68
        \<forall>a. A |-e {Q a} e2 {\<lambda>v s. R (upd_obj a f v s)} |] ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    69
            A |-  {P} e1..f:==e2 {R}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    70
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    71
  NewC: "A |-e {\<lambda>s. \<forall>a. new_Addr s = Addr a --> P (Addr a) (new_obj a C s)}
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    72
                new C {P}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    73
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    74
  Cast: "A |-e {P} e {\<lambda>v s. (case v of Null => True 
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    75
                                 | Addr a => obj_class s a <=C C) --> Q v s} ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    76
         A |-e {P} Cast C e {Q}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    77
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    78
  Call: "[| A |-e {P} e1 {Q}; \<forall>a. A |-e {Q a} e2 {R a};
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    79
    \<forall>a p l. A |- {\<lambda>s'. \<exists>s. R a p s \<and> l = s \<and> 
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    80
                    s' = lupd(This\<mapsto>a)(lupd(Param\<mapsto>p)(init_locs C m s))}
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    81
                  Meth C m {\<lambda>s. S (s<Res>) (set_locs l s)} |] ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    82
             A |-e {P} {C}e1..m(e2) {S}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    83
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    84
  Meth: "\<forall>D. A |- {\<lambda>s. \<exists>a. s<This> = Addr a \<and> D=obj_class s a \<and> D <=C C \<and> P s}
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    85
                  Impl D m {Q} ==>
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    86
             A |- {P} Meth C m {Q}"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    87
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    88
  (*\<Union>z instead of \<forall>z in the conclusion and
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    89
      z restricted to type state due to limitations of the inductive package *)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    90
  Impl: "A\<union>   (\<Union>z::state. (\<lambda>(C,m). (P z C m, Impl C m, Q z C m))`ms) ||- 
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    91
               (\<Union>z::state. (\<lambda>(C,m). (P z C m, body C m, Q z C m))`ms) ==>
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    92
         A ||- (\<Union>z::state. (\<lambda>(C,m). (P z C m, Impl C m, Q z C m))`ms)"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    93
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    94
(* structural rules *)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
    95
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    96
  Asm:  "   a \<in> A ==> A ||- {a}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    97
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    98
  ConjI: " \<forall>c \<in> C. A ||- {c} ==> A ||- C"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
    99
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   100
  ConjE: "[|A ||- C; c \<in> C |] ==> A ||- {c}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   101
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   102
  (* z restricted to type state due to limitations of the inductive package *)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   103
  Conseq:"[| \<forall>z::state. A |- {P' z} c {Q' z};
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   104
             \<forall>s t. (\<forall>z::state. P' z s --> Q' z t) --> (P s --> Q t) |] ==>
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   105
            A |- {P} c {Q }"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   106
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   107
  (* z restricted to type state due to limitations of the inductive package *)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   108
 eConseq:"[| \<forall>z::state. A |-e {P' z} c {Q' z};
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   109
             \<forall>s v t. (\<forall>z::state. P' z s --> Q' z v t) --> (P s --> Q v t) |] ==>
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   110
            A |-e {P} c {Q }"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   111
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   112
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   113
subsection "Derived Rules"
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   114
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   115
lemma Conseq1: "\<lbrakk>A \<turnstile> {P'} c {Q}; \<forall>s. P s \<longrightarrow> P' s\<rbrakk> \<Longrightarrow> A \<turnstile> {P} c {Q}"
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   116
apply (rule hoare_ehoare.Conseq)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   117
apply  (rule allI, assumption)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   118
apply fast
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   119
done
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   120
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   121
lemma Conseq2: "\<lbrakk>A \<turnstile> {P} c {Q'}; \<forall>t. Q' t \<longrightarrow> Q t\<rbrakk> \<Longrightarrow> A \<turnstile> {P} c {Q}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   122
apply (rule hoare_ehoare.Conseq)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   123
apply  (rule allI, assumption)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   124
apply fast
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   125
done
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   126
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   127
lemma eConseq1: "\<lbrakk>A \<turnstile>e {P'} e {Q}; \<forall>s. P s \<longrightarrow> P' s\<rbrakk> \<Longrightarrow> A \<turnstile>e {P} e {Q}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   128
apply (rule hoare_ehoare.eConseq)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   129
apply  (rule allI, assumption)
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   130
apply fast
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   131
done
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   132
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   133
lemma eConseq2: "\<lbrakk>A \<turnstile>e {P} e {Q'}; \<forall>v t. Q' v t \<longrightarrow> Q v t\<rbrakk> \<Longrightarrow> A \<turnstile>e {P} e {Q}"
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   134
apply (rule hoare_ehoare.eConseq)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   135
apply  (rule allI, assumption)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   136
apply fast
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   137
done
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   138
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   139
lemma Weaken: "\<lbrakk>A |\<turnstile> C'; C \<subseteq> C'\<rbrakk> \<Longrightarrow> A |\<turnstile> C"
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   140
apply (rule hoare_ehoare.ConjI)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   141
apply clarify
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   142
apply (drule hoare_ehoare.ConjE)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   143
apply  fast
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   144
apply assumption
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   145
done
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   146
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   147
lemma Union: "A |\<turnstile> (\<Union>z. C z) = (\<forall>z. A |\<turnstile> C z)"
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   148
by (auto intro: hoare_ehoare.ConjI hoare_ehoare.ConjE)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   149
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   150
lemma Impl': 
11449
d25be0ad1a6c cosmetics
oheimb
parents: 11376
diff changeset
   151
  "\<forall>z. A\<union> (\<Union>z. (\<lambda>(C,m). (P z C m, Impl C m, Q (z::state) C m))`ms) ||- 
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   152
                (\<lambda>(C,m). (P z C m, body C m, Q (z::state) C m))`ms ==>
11449
d25be0ad1a6c cosmetics
oheimb
parents: 11376
diff changeset
   153
       A    ||- (\<lambda>(C,m). (P z C m, Impl C m, Q (z::state) C m))`ms"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   154
apply (drule Union[THEN iffD2])
11476
06c1998340a8 changed to full expressions with side effects
oheimb
parents: 11449
diff changeset
   155
apply (drule hoare_ehoare.Impl)
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   156
apply (drule Union[THEN iffD1])
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   157
apply (erule spec)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   158
done
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   159
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   160
lemma Impl1: 
11449
d25be0ad1a6c cosmetics
oheimb
parents: 11376
diff changeset
   161
   "\<lbrakk>\<forall>z. A\<union> (\<Union>z. (\<lambda>(C,m). (P z C m, Impl C m, Q (z::state) C m))`ms) ||- 
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   162
                 (\<lambda>(C,m). (P z C m, body C m, Q (z::state) C m))`ms; 
11449
d25be0ad1a6c cosmetics
oheimb
parents: 11376
diff changeset
   163
    (C,m)\<in> ms\<rbrakk> \<Longrightarrow> 
d25be0ad1a6c cosmetics
oheimb
parents: 11376
diff changeset
   164
         A             |- {P z C m} Impl C m {Q (z::state) C m}"
11376
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   165
apply (drule Impl')
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   166
apply (erule Weaken)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   167
apply (auto del: image_eqI intro: rev_image_eqI)
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   168
done
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   169
bf98ad1c22c6 added NanoJava
oheimb
parents:
diff changeset
   170
end