src/HOL/MicroJava/BV/Effect.thy
author kleing
Tue, 26 Feb 2002 15:45:32 +0100
changeset 12951 a9fdcb71d252
parent 12911 704713ca07ea
child 12974 7acfab8361d1
permissions -rw-r--r--
introduces SystemClasses and BVExample
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
     1
(*  Title:      HOL/MicroJava/BV/Effect.thy
d09d0f160888 exceptions
kleing
parents:
diff changeset
     2
    ID:         $Id$
d09d0f160888 exceptions
kleing
parents:
diff changeset
     3
    Author:     Gerwin Klein
d09d0f160888 exceptions
kleing
parents:
diff changeset
     4
    Copyright   2000 Technische Universitaet Muenchen
d09d0f160888 exceptions
kleing
parents:
diff changeset
     5
*)
d09d0f160888 exceptions
kleing
parents:
diff changeset
     6
12911
704713ca07ea new document
kleing
parents: 12772
diff changeset
     7
header {* \isaheader{Effect of Instructions on the State Type} *}
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
     8
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
     9
theory Effect = JVMType + JVMExceptions:
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
    10
d09d0f160888 exceptions
kleing
parents:
diff changeset
    11
types
d09d0f160888 exceptions
kleing
parents:
diff changeset
    12
  succ_type = "(p_count \<times> state_type option) list"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    13
d09d0f160888 exceptions
kleing
parents:
diff changeset
    14
text {* Program counter of successor instructions: *}
d09d0f160888 exceptions
kleing
parents:
diff changeset
    15
consts
d09d0f160888 exceptions
kleing
parents:
diff changeset
    16
  succs :: "instr => p_count => p_count list"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    17
primrec 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    18
  "succs (Load idx) pc         = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    19
  "succs (Store idx) pc        = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    20
  "succs (LitPush v) pc        = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    21
  "succs (Getfield F C) pc     = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    22
  "succs (Putfield F C) pc     = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    23
  "succs (New C) pc            = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    24
  "succs (Checkcast C) pc      = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    25
  "succs Pop pc                = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    26
  "succs Dup pc                = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    27
  "succs Dup_x1 pc             = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    28
  "succs Dup_x2 pc             = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    29
  "succs Swap pc               = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    30
  "succs IAdd pc               = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    31
  "succs (Ifcmpeq b) pc        = [pc+1, nat (int pc + b)]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    32
  "succs (Goto b) pc           = [nat (int pc + b)]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    33
  "succs Return pc             = [pc]"  
d09d0f160888 exceptions
kleing
parents:
diff changeset
    34
  "succs (Invoke C mn fpTs) pc = [pc+1]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    35
  "succs Throw pc              = [pc]"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    36
d09d0f160888 exceptions
kleing
parents:
diff changeset
    37
text "Effect of instruction on the state type:"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    38
consts 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    39
eff' :: "instr \<times> jvm_prog \<times> state_type => state_type"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    40
d09d0f160888 exceptions
kleing
parents:
diff changeset
    41
recdef eff' "{}"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    42
"eff' (Load idx,  G, (ST, LT))          = (ok_val (LT ! idx) # ST, LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    43
"eff' (Store idx, G, (ts#ST, LT))       = (ST, LT[idx:= OK ts])"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    44
"eff' (LitPush v, G, (ST, LT))           = (the (typeof (\<lambda>v. None) v) # ST, LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    45
"eff' (Getfield F C, G, (oT#ST, LT))    = (snd (the (field (G,C) F)) # ST, LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    46
"eff' (Putfield F C, G, (vT#oT#ST, LT)) = (ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    47
"eff' (New C, G, (ST,LT))               = (Class C # ST, LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    48
"eff' (Checkcast C, G, (RefT rt#ST,LT)) = (Class C # ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    49
"eff' (Pop, G, (ts#ST,LT))              = (ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    50
"eff' (Dup, G, (ts#ST,LT))              = (ts#ts#ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    51
"eff' (Dup_x1, G, (ts1#ts2#ST,LT))      = (ts1#ts2#ts1#ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    52
"eff' (Dup_x2, G, (ts1#ts2#ts3#ST,LT))  = (ts1#ts2#ts3#ts1#ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    53
"eff' (Swap, G, (ts1#ts2#ST,LT))        = (ts2#ts1#ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    54
"eff' (IAdd, G, (PrimT Integer#PrimT Integer#ST,LT)) 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    55
                                         = (PrimT Integer#ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    56
"eff' (Ifcmpeq b, G, (ts1#ts2#ST,LT))   = (ST,LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    57
"eff' (Goto b, G, s)                    = s"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    58
  -- "Return has no successor instruction in the same method"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    59
"eff' (Return, G, s)                    = s" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    60
  -- "Throw always terminates abruptly"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    61
"eff' (Throw, G, s)                     = s"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    62
"eff' (Invoke C mn fpTs, G, (ST,LT))    = (let ST' = drop (length fpTs) ST 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    63
  in  (fst (snd (the (method (G,C) (mn,fpTs))))#(tl ST'),LT))" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    64
d09d0f160888 exceptions
kleing
parents:
diff changeset
    65
d09d0f160888 exceptions
kleing
parents:
diff changeset
    66
consts
d09d0f160888 exceptions
kleing
parents:
diff changeset
    67
  match_any :: "jvm_prog \<Rightarrow> p_count \<Rightarrow> exception_table \<Rightarrow> cname list"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    68
primrec
d09d0f160888 exceptions
kleing
parents:
diff changeset
    69
  "match_any G pc [] = []"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    70
  "match_any G pc (e#es) = (let (start_pc, end_pc, handler_pc, catch_type) = e;
d09d0f160888 exceptions
kleing
parents:
diff changeset
    71
                                es' = match_any G pc es 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    72
                            in 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    73
                            if start_pc <= pc \<and> pc < end_pc then catch_type#es' else es')"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    74
12951
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    75
consts
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    76
  match :: "jvm_prog \<Rightarrow> cname \<Rightarrow> p_count \<Rightarrow> exception_table \<Rightarrow> cname list"
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    77
primrec
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    78
  "match G X pc [] = []"
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    79
  "match G X pc (e#es) = 
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    80
  (if match_exception_entry G X pc e then [X] else match G X pc es)"
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    81
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    82
lemma match_some_entry:
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    83
  "match G X pc et = (if \<exists>e \<in> set et. match_exception_entry G X pc e then [X] else [])"
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    84
  by (induct et) auto
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
    85
d09d0f160888 exceptions
kleing
parents:
diff changeset
    86
consts
d09d0f160888 exceptions
kleing
parents:
diff changeset
    87
  xcpt_names :: "instr \<times> jvm_prog \<times> p_count \<times> exception_table => cname list" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    88
recdef xcpt_names "{}"
12951
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    89
  "xcpt_names (Getfield F C, G, pc, et) = match G (Xcpt NullPointer) pc et" 
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    90
  "xcpt_names (Putfield F C, G, pc, et) = match G (Xcpt NullPointer) pc et" 
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    91
  "xcpt_names (New C, G, pc, et)        = match G (Xcpt OutOfMemory) pc et"
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
    92
  "xcpt_names (Checkcast C, G, pc, et)  = match G (Xcpt ClassCast) pc et"
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
    93
  "xcpt_names (Throw, G, pc, et)        = match_any G pc et"
d09d0f160888 exceptions
kleing
parents:
diff changeset
    94
  "xcpt_names (Invoke C m p, G, pc, et) = match_any G pc et" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    95
  "xcpt_names (i, G, pc, et)            = []" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
    96
d09d0f160888 exceptions
kleing
parents:
diff changeset
    97
d09d0f160888 exceptions
kleing
parents:
diff changeset
    98
constdefs
d09d0f160888 exceptions
kleing
parents:
diff changeset
    99
  xcpt_eff :: "instr \<Rightarrow> jvm_prog \<Rightarrow> p_count \<Rightarrow> state_type option \<Rightarrow> exception_table \<Rightarrow> succ_type"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   100
  "xcpt_eff i G pc s et == 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   101
   map (\<lambda>C. (the (match_exception_table G C pc et), case s of None \<Rightarrow> None | Some s' \<Rightarrow> Some ([Class C], snd s'))) 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   102
       (xcpt_names (i,G,pc,et))"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   103
d09d0f160888 exceptions
kleing
parents:
diff changeset
   104
  norm_eff :: "instr \<Rightarrow> jvm_prog \<Rightarrow> state_type option \<Rightarrow> state_type option"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   105
  "norm_eff i G == option_map (\<lambda>s. eff' (i,G,s))"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   106
d09d0f160888 exceptions
kleing
parents:
diff changeset
   107
  eff :: "instr => jvm_prog => p_count => exception_table => state_type option => succ_type"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   108
  "eff i G pc et s == (map (\<lambda>pc'. (pc',norm_eff i G s)) (succs i pc)) @ (xcpt_eff i G pc s et)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   109
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   110
constdefs
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   111
  isPrimT :: "ty \<Rightarrow> bool"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   112
  "isPrimT T == case T of PrimT T' \<Rightarrow> True | RefT T' \<Rightarrow> False"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   113
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   114
  isRefT :: "ty \<Rightarrow> bool"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   115
  "isRefT T == case T of PrimT T' \<Rightarrow> False | RefT T' \<Rightarrow> True"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   116
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   117
lemma isPrimT [simp]:
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   118
  "isPrimT T = (\<exists>T'. T = PrimT T')" by (simp add: isPrimT_def split: ty.splits)
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   119
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   120
lemma isRefT [simp]:
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   121
  "isRefT T = (\<exists>T'. T = RefT T')" by (simp add: isRefT_def split: ty.splits)
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   122
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   123
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   124
lemma "list_all2 P a b \<Longrightarrow> \<forall>(x,y) \<in> set (zip a b). P x y"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   125
  by (simp add: list_all2_def) 
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   126
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   127
d09d0f160888 exceptions
kleing
parents:
diff changeset
   128
text "Conditions under which eff is applicable:"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   129
consts
d09d0f160888 exceptions
kleing
parents:
diff changeset
   130
app' :: "instr \<times> jvm_prog \<times> nat \<times> ty \<times> state_type => bool"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   131
d09d0f160888 exceptions
kleing
parents:
diff changeset
   132
recdef app' "{}"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   133
"app' (Load idx, G, maxs, rT, s)                  = (idx < length (snd s) \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   134
                                                    (snd s) ! idx \<noteq> Err \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   135
                                                    length (fst s) < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   136
"app' (Store idx, G, maxs, rT, (ts#ST, LT))       = (idx < length LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   137
"app' (LitPush v, G, maxs, rT, s)                  = (length (fst s) < maxs \<and> typeof (\<lambda>t. None) v \<noteq> None)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   138
"app' (Getfield F C, G, maxs, rT, (oT#ST, LT))    = (is_class G C \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   139
                                              field (G,C) F \<noteq> None \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   140
                                              fst (the (field (G,C) F)) = C \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   141
                                              G \<turnstile> oT \<preceq> (Class C))"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   142
"app' (Putfield F C, G, maxs, rT, (vT#oT#ST, LT)) = (is_class G C \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   143
                                              field (G,C) F \<noteq> None \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   144
                                              fst (the (field (G,C) F)) = C \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   145
                                              G \<turnstile> oT \<preceq> (Class C) \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   146
                                              G \<turnstile> vT \<preceq> (snd (the (field (G,C) F))))" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   147
"app' (New C, G, maxs, rT, s)                     = (is_class G C \<and> length (fst s) < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   148
"app' (Checkcast C, G, maxs, rT, (RefT rt#ST,LT)) = (is_class G C)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   149
"app' (Pop, G, maxs, rT, (ts#ST,LT))              = True"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   150
"app' (Dup, G, maxs, rT, (ts#ST,LT))              = (1+length ST < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   151
"app' (Dup_x1, G, maxs, rT, (ts1#ts2#ST,LT))      = (2+length ST < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   152
"app' (Dup_x2, G, maxs, rT, (ts1#ts2#ts3#ST,LT))  = (3+length ST < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   153
"app' (Swap, G, maxs, rT, (ts1#ts2#ST,LT))        = True"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   154
"app' (IAdd, G, maxs, rT, (PrimT Integer#PrimT Integer#ST,LT)) 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   155
                                                 = True"
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   156
"app' (Ifcmpeq b, G, maxs, rT, (ts#ts'#ST,LT))    = (isPrimT ts \<and> ts' = ts \<or> 
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   157
                                                     isRefT ts \<and> isRefT ts')"
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   158
"app' (Goto b, G, maxs, rT, s)                    = True"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   159
"app' (Return, G, maxs, rT, (T#ST,LT))            = (G \<turnstile> T \<preceq> rT)"
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   160
"app' (Throw, G, maxs, rT, (T#ST,LT))             = isRefT T"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   161
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   162
"app' (Invoke C mn fpTs, G, maxs, rT, s)          = 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   163
   (length fpTs < length (fst s) \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   164
   (let apTs = rev (take (length fpTs) (fst s));
d09d0f160888 exceptions
kleing
parents:
diff changeset
   165
        X    = hd (drop (length fpTs) (fst s)) 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   166
    in  
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   167
        G \<turnstile> X \<preceq> Class C \<and> is_class G C \<and> method (G,C) (mn,fpTs) \<noteq> None \<and>
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   168
        list_all2 (\<lambda>x y. G \<turnstile> x \<preceq> y) apTs fpTs))"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   169
  
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   170
"app' (i,G,maxs,rT,s)                             = False"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   171
d09d0f160888 exceptions
kleing
parents:
diff changeset
   172
constdefs
d09d0f160888 exceptions
kleing
parents:
diff changeset
   173
  xcpt_app :: "instr \<Rightarrow> jvm_prog \<Rightarrow> nat \<Rightarrow> exception_table \<Rightarrow> bool"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   174
  "xcpt_app i G pc et \<equiv> \<forall>C\<in>set(xcpt_names (i,G,pc,et)). is_class G C"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   175
d09d0f160888 exceptions
kleing
parents:
diff changeset
   176
  app :: "instr => jvm_prog => nat => ty => nat => exception_table => state_type option => bool"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   177
  "app i G maxs rT pc et s == case s of None => True | Some t => app' (i,G,maxs,rT,t) \<and> xcpt_app i G pc et"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   178
d09d0f160888 exceptions
kleing
parents:
diff changeset
   179
d09d0f160888 exceptions
kleing
parents:
diff changeset
   180
lemma 1: "2 < length a ==> (\<exists>l l' l'' ls. a = l#l'#l''#ls)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   181
proof (cases a)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   182
  fix x xs assume "a = x#xs" "2 < length a"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   183
  thus ?thesis by - (cases xs, simp, cases "tl xs", auto)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   184
qed auto
d09d0f160888 exceptions
kleing
parents:
diff changeset
   185
d09d0f160888 exceptions
kleing
parents:
diff changeset
   186
lemma 2: "\<not>(2 < length a) ==> a = [] \<or> (\<exists> l. a = [l]) \<or> (\<exists> l l'. a = [l,l'])"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   187
proof -;
d09d0f160888 exceptions
kleing
parents:
diff changeset
   188
  assume "\<not>(2 < length a)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   189
  hence "length a < (Suc (Suc (Suc 0)))" by simp
d09d0f160888 exceptions
kleing
parents:
diff changeset
   190
  hence * : "length a = 0 \<or> length a = Suc 0 \<or> length a = Suc (Suc 0)" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   191
    by (auto simp add: less_Suc_eq)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   192
d09d0f160888 exceptions
kleing
parents:
diff changeset
   193
  { 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   194
    fix x 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   195
    assume "length x = Suc 0"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   196
    hence "\<exists> l. x = [l]"  by - (cases x, auto)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   197
  } note 0 = this
d09d0f160888 exceptions
kleing
parents:
diff changeset
   198
d09d0f160888 exceptions
kleing
parents:
diff changeset
   199
  have "length a = Suc (Suc 0) ==> \<exists>l l'. a = [l,l']" by (cases a, auto dest: 0)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   200
  with * show ?thesis by (auto dest: 0)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   201
qed
d09d0f160888 exceptions
kleing
parents:
diff changeset
   202
d09d0f160888 exceptions
kleing
parents:
diff changeset
   203
lemmas [simp] = app_def xcpt_app_def
d09d0f160888 exceptions
kleing
parents:
diff changeset
   204
d09d0f160888 exceptions
kleing
parents:
diff changeset
   205
text {* 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   206
\medskip
d09d0f160888 exceptions
kleing
parents:
diff changeset
   207
simp rules for @{term app}
d09d0f160888 exceptions
kleing
parents:
diff changeset
   208
*}
d09d0f160888 exceptions
kleing
parents:
diff changeset
   209
lemma appNone[simp]: "app i G maxs rT pc et None = True" by simp
d09d0f160888 exceptions
kleing
parents:
diff changeset
   210
d09d0f160888 exceptions
kleing
parents:
diff changeset
   211
d09d0f160888 exceptions
kleing
parents:
diff changeset
   212
lemma appLoad[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   213
"(app (Load idx) G maxs rT pc et (Some s)) = (\<exists>ST LT. s = (ST,LT) \<and> idx < length LT \<and> LT!idx \<noteq> Err \<and> length ST < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   214
  by (cases s, simp)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   215
d09d0f160888 exceptions
kleing
parents:
diff changeset
   216
lemma appStore[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   217
"(app (Store idx) G maxs rT pc et (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT) \<and> idx < length LT)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   218
  by (cases s, cases "2 < length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   219
d09d0f160888 exceptions
kleing
parents:
diff changeset
   220
lemma appLitPush[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   221
"(app (LitPush v) G maxs rT pc et (Some s)) = (\<exists>ST LT. s = (ST,LT) \<and> length ST < maxs \<and> typeof (\<lambda>v. None) v \<noteq> None)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   222
  by (cases s, simp)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   223
d09d0f160888 exceptions
kleing
parents:
diff changeset
   224
lemma appGetField[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   225
"(app (Getfield F C) G maxs rT pc et (Some s)) = 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   226
 (\<exists> oT vT ST LT. s = (oT#ST, LT) \<and> is_class G C \<and>  
12951
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   227
  field (G,C) F = Some (C,vT) \<and> G \<turnstile> oT \<preceq> (Class C) \<and> (\<forall>x \<in> set (match G (Xcpt NullPointer) pc et). is_class G x))"
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   228
  by (cases s, cases "2 <length (fst s)", auto dest!: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   229
d09d0f160888 exceptions
kleing
parents:
diff changeset
   230
lemma appPutField[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   231
"(app (Putfield F C) G maxs rT pc et (Some s)) = 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   232
 (\<exists> vT vT' oT ST LT. s = (vT#oT#ST, LT) \<and> is_class G C \<and> 
12951
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   233
  field (G,C) F = Some (C, vT') \<and> G \<turnstile> oT \<preceq> (Class C) \<and> G \<turnstile> vT \<preceq> vT' \<and>
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   234
  (\<forall>x \<in> set (match G (Xcpt NullPointer) pc et). is_class G x))"
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   235
  by (cases s, cases "2 <length (fst s)", auto dest!: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   236
d09d0f160888 exceptions
kleing
parents:
diff changeset
   237
lemma appNew[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   238
  "(app (New C) G maxs rT pc et (Some s)) = 
12951
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   239
  (\<exists>ST LT. s=(ST,LT) \<and> is_class G C \<and> length ST < maxs \<and>
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   240
  (\<forall>x \<in> set (match G (Xcpt OutOfMemory) pc et). is_class G x))"
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   241
  by (cases s, simp)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   242
d09d0f160888 exceptions
kleing
parents:
diff changeset
   243
lemma appCheckcast[simp]: 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   244
  "(app (Checkcast C) G maxs rT pc et (Some s)) =  
12951
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   245
  (\<exists>rT ST LT. s = (RefT rT#ST,LT) \<and> is_class G C \<and>
a9fdcb71d252 introduces SystemClasses and BVExample
kleing
parents: 12911
diff changeset
   246
  (\<forall>x \<in> set (match G (Xcpt ClassCast) pc et). is_class G x))"
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   247
  by (cases s, cases "fst s", simp add: app_def) (cases "hd (fst s)", auto)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   248
d09d0f160888 exceptions
kleing
parents:
diff changeset
   249
lemma appPop[simp]: 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   250
"(app Pop G maxs rT pc et (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT))"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   251
  by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   252
d09d0f160888 exceptions
kleing
parents:
diff changeset
   253
d09d0f160888 exceptions
kleing
parents:
diff changeset
   254
lemma appDup[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   255
"(app Dup G maxs rT pc et (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT) \<and> 1+length ST < maxs)" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   256
  by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   257
d09d0f160888 exceptions
kleing
parents:
diff changeset
   258
d09d0f160888 exceptions
kleing
parents:
diff changeset
   259
lemma appDup_x1[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   260
"(app Dup_x1 G maxs rT pc et (Some s)) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT) \<and> 2+length ST < maxs)" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   261
  by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   262
d09d0f160888 exceptions
kleing
parents:
diff changeset
   263
d09d0f160888 exceptions
kleing
parents:
diff changeset
   264
lemma appDup_x2[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   265
"(app Dup_x2 G maxs rT pc et (Some s)) = (\<exists>ts1 ts2 ts3 ST LT. s = (ts1#ts2#ts3#ST,LT) \<and> 3+length ST < maxs)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   266
  by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   267
d09d0f160888 exceptions
kleing
parents:
diff changeset
   268
d09d0f160888 exceptions
kleing
parents:
diff changeset
   269
lemma appSwap[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   270
"app Swap G maxs rT pc et (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT))" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   271
  by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   272
d09d0f160888 exceptions
kleing
parents:
diff changeset
   273
d09d0f160888 exceptions
kleing
parents:
diff changeset
   274
lemma appIAdd[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   275
"app IAdd G maxs rT pc et (Some s) = (\<exists> ST LT. s = (PrimT Integer#PrimT Integer#ST,LT))"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   276
  (is "?app s = ?P s")
d09d0f160888 exceptions
kleing
parents:
diff changeset
   277
proof (cases (open) s)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   278
  case Pair
d09d0f160888 exceptions
kleing
parents:
diff changeset
   279
  have "?app (a,b) = ?P (a,b)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   280
  proof (cases "a")
d09d0f160888 exceptions
kleing
parents:
diff changeset
   281
    fix t ts assume a: "a = t#ts"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   282
    show ?thesis
d09d0f160888 exceptions
kleing
parents:
diff changeset
   283
    proof (cases t)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   284
      fix p assume p: "t = PrimT p"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   285
      show ?thesis
d09d0f160888 exceptions
kleing
parents:
diff changeset
   286
      proof (cases p)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   287
        assume ip: "p = Integer"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   288
        show ?thesis
d09d0f160888 exceptions
kleing
parents:
diff changeset
   289
        proof (cases ts)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   290
          fix t' ts' assume t': "ts = t' # ts'"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   291
          show ?thesis
d09d0f160888 exceptions
kleing
parents:
diff changeset
   292
          proof (cases t')
d09d0f160888 exceptions
kleing
parents:
diff changeset
   293
            fix p' assume "t' = PrimT p'"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   294
            with t' ip p a
d09d0f160888 exceptions
kleing
parents:
diff changeset
   295
            show ?thesis by - (cases p', auto)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   296
          qed (auto simp add: a p ip t')
d09d0f160888 exceptions
kleing
parents:
diff changeset
   297
        qed (auto simp add: a p ip)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   298
      qed (auto simp add: a p)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   299
    qed (auto simp add: a)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   300
  qed auto
d09d0f160888 exceptions
kleing
parents:
diff changeset
   301
  with Pair show ?thesis by simp
d09d0f160888 exceptions
kleing
parents:
diff changeset
   302
qed
d09d0f160888 exceptions
kleing
parents:
diff changeset
   303
d09d0f160888 exceptions
kleing
parents:
diff changeset
   304
d09d0f160888 exceptions
kleing
parents:
diff changeset
   305
lemma appIfcmpeq[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   306
"app (Ifcmpeq b) G maxs rT pc et (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT) \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   307
 ((\<exists> p. ts1 = PrimT p \<and> ts2 = PrimT p) \<or> (\<exists>r r'. ts1 = RefT r \<and> ts2 = RefT r')))" 
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   308
  by (cases s, cases "2 <length (fst s)", auto dest!: 1 2)
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   309
d09d0f160888 exceptions
kleing
parents:
diff changeset
   310
lemma appReturn[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   311
"app Return G maxs rT pc et (Some s) = (\<exists>T ST LT. s = (T#ST,LT) \<and> (G \<turnstile> T \<preceq> rT))" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   312
  by (cases s, cases "2 <length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   313
d09d0f160888 exceptions
kleing
parents:
diff changeset
   314
lemma appGoto[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   315
"app (Goto branch) G maxs rT pc et (Some s) = True"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   316
  by simp
d09d0f160888 exceptions
kleing
parents:
diff changeset
   317
d09d0f160888 exceptions
kleing
parents:
diff changeset
   318
lemma appThrow[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   319
  "app Throw G maxs rT pc et (Some s) = 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   320
  (\<exists>T ST LT r. s=(T#ST,LT) \<and> T = RefT r \<and> (\<forall>C \<in> set (match_any G pc et). is_class G C))"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   321
  by (cases s, cases "2 < length (fst s)", auto dest: 1 2)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   322
d09d0f160888 exceptions
kleing
parents:
diff changeset
   323
lemma appInvoke[simp]:
d09d0f160888 exceptions
kleing
parents:
diff changeset
   324
"app (Invoke C mn fpTs) G maxs rT pc et (Some s) = (\<exists>apTs X ST LT mD' rT' b'.
d09d0f160888 exceptions
kleing
parents:
diff changeset
   325
  s = ((rev apTs) @ (X # ST), LT) \<and> length apTs = length fpTs \<and> is_class G C \<and>
d09d0f160888 exceptions
kleing
parents:
diff changeset
   326
  G \<turnstile> X \<preceq> Class C \<and> (\<forall>(aT,fT)\<in>set(zip apTs fpTs). G \<turnstile> aT \<preceq> fT) \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   327
  method (G,C) (mn,fpTs) = Some (mD', rT', b') \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   328
  (\<forall>C \<in> set (match_any G pc et). is_class G C))" (is "?app s = ?P s")
d09d0f160888 exceptions
kleing
parents:
diff changeset
   329
proof (cases (open) s)
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   330
  note list_all2_def [simp]
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   331
  case Pair
d09d0f160888 exceptions
kleing
parents:
diff changeset
   332
  have "?app (a,b) ==> ?P (a,b)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   333
  proof -
d09d0f160888 exceptions
kleing
parents:
diff changeset
   334
    assume app: "?app (a,b)"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   335
    hence "a = (rev (rev (take (length fpTs) a))) @ (drop (length fpTs) a) \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   336
           length fpTs < length a" (is "?a \<and> ?l") 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   337
      by (auto simp add: app_def)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   338
    hence "?a \<and> 0 < length (drop (length fpTs) a)" (is "?a \<and> ?l") 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   339
      by auto
d09d0f160888 exceptions
kleing
parents:
diff changeset
   340
    hence "?a \<and> ?l \<and> length (rev (take (length fpTs) a)) = length fpTs" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   341
      by (auto simp add: min_def)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   342
    hence "\<exists>apTs ST. a = rev apTs @ ST \<and> length apTs = length fpTs \<and> 0 < length ST" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   343
      by blast
d09d0f160888 exceptions
kleing
parents:
diff changeset
   344
    hence "\<exists>apTs ST. a = rev apTs @ ST \<and> length apTs = length fpTs \<and> ST \<noteq> []" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   345
      by blast
d09d0f160888 exceptions
kleing
parents:
diff changeset
   346
    hence "\<exists>apTs ST. a = rev apTs @ ST \<and> length apTs = length fpTs \<and> 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   347
           (\<exists>X ST'. ST = X#ST')" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   348
      by (simp add: neq_Nil_conv)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   349
    hence "\<exists>apTs X ST. a = rev apTs @ X # ST \<and> length apTs = length fpTs" 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   350
      by blast
d09d0f160888 exceptions
kleing
parents:
diff changeset
   351
    with app
d09d0f160888 exceptions
kleing
parents:
diff changeset
   352
    show ?thesis by (unfold app_def, clarsimp) blast
d09d0f160888 exceptions
kleing
parents:
diff changeset
   353
  qed
d09d0f160888 exceptions
kleing
parents:
diff changeset
   354
  with Pair 
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   355
  have "?app s \<Longrightarrow> ?P s" by (simp only:)
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   356
  moreover
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   357
  have "?P s \<Longrightarrow> ?app s" by (unfold app_def) (clarsimp simp add: min_def)
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   358
  ultimately
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   359
  show ?thesis by (rule iffI) 
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   360
qed 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   361
d09d0f160888 exceptions
kleing
parents:
diff changeset
   362
lemma effNone: 
d09d0f160888 exceptions
kleing
parents:
diff changeset
   363
  "(pc', s') \<in> set (eff i G pc et None) \<Longrightarrow> s' = None"
d09d0f160888 exceptions
kleing
parents:
diff changeset
   364
  by (auto simp add: eff_def xcpt_eff_def norm_eff_def)
d09d0f160888 exceptions
kleing
parents:
diff changeset
   365
12772
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   366
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   367
text {* some helpers to make the specification directly executable: *}
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   368
declare list_all2_Nil [code]
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   369
declare list_all2_Cons [code]
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   370
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   371
lemma xcpt_app_lemma [code]:
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   372
  "xcpt_app i G pc et = list_all (is_class G) (xcpt_names (i, G, pc, et))"
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   373
  by (simp add: list_all_conv)
7b7051ae49a0 tuned for directly executable definitions
kleing
parents: 12516
diff changeset
   374
12516
d09d0f160888 exceptions
kleing
parents:
diff changeset
   375
lemmas [simp del] = app_def xcpt_app_def
d09d0f160888 exceptions
kleing
parents:
diff changeset
   376
d09d0f160888 exceptions
kleing
parents:
diff changeset
   377
end