author | nipkow |
Tue, 09 Aug 2005 11:44:38 +0200 | |
changeset 17040 | 6682c93b7d9f |
parent 16417 | 9bc16273c2d4 |
child 22271 | 51a80e238b29 |
permissions | -rw-r--r-- |
8011 | 1 |
(* Title: HOL/MicroJava/J/Eval.thy |
2 |
ID: $Id$ |
|
3 |
Author: David von Oheimb |
|
4 |
Copyright 1999 Technische Universitaet Muenchen |
|
11070 | 5 |
*) |
8011 | 6 |
|
12911 | 7 |
header {* \isaheader{Operational Evaluation (big step) Semantics} *} |
8011 | 8 |
|
16417 | 9 |
theory Eval imports State WellType begin |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
10 |
|
13672 | 11 |
|
12 |
-- "Auxiliary notions" |
|
13 |
||
14 |
constdefs |
|
15 |
fits :: "java_mb prog \<Rightarrow> state \<Rightarrow> val \<Rightarrow> ty \<Rightarrow> bool" ("_,_\<turnstile>_ fits _"[61,61,61,61]60) |
|
16 |
"G,s\<turnstile>a' fits T \<equiv> case T of PrimT T' \<Rightarrow> False | RefT T' \<Rightarrow> a'=Null \<or> G\<turnstile>obj_ty(lookup_obj s a')\<preceq>T" |
|
17 |
||
18 |
constdefs |
|
19 |
catch ::"java_mb prog \<Rightarrow> xstate \<Rightarrow> cname \<Rightarrow> bool" ("_,_\<turnstile>catch _"[61,61,61]60) |
|
20 |
"G,s\<turnstile>catch C\<equiv> case abrupt s of None \<Rightarrow> False | Some a \<Rightarrow> G,store s\<turnstile> a fits Class C" |
|
21 |
||
22 |
||
23 |
||
24 |
constdefs |
|
25 |
lupd :: "vname \<Rightarrow> val \<Rightarrow> state \<Rightarrow> state" ("lupd'(_\<mapsto>_')"[10,10]1000) |
|
26 |
"lupd vn v \<equiv> \<lambda> (hp,loc). (hp, (loc(vn\<mapsto>v)))" |
|
27 |
||
28 |
constdefs |
|
29 |
new_xcpt_var :: "vname \<Rightarrow> xstate \<Rightarrow> xstate" |
|
30 |
"new_xcpt_var vn \<equiv> \<lambda>(x,s). Norm (lupd(vn\<mapsto>the x) s)" |
|
31 |
||
32 |
||
33 |
-- "Evaluation relations" |
|
34 |
||
8011 | 35 |
consts |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
36 |
eval :: "java_mb prog => (xstate \<times> expr \<times> val \<times> xstate) set" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
37 |
evals :: "java_mb prog => (xstate \<times> expr list \<times> val list \<times> xstate) set" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
38 |
exec :: "java_mb prog => (xstate \<times> stmt \<times> xstate) set" |
8011 | 39 |
|
11372 | 40 |
syntax (xsymbols) |
10056 | 41 |
eval :: "[java_mb prog,xstate,expr,val,xstate] => bool " |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
42 |
("_ \<turnstile> _ -_\<succ>_-> _" [51,82,60,82,82] 81) |
8082 | 43 |
evals:: "[java_mb prog,xstate,expr list, |
10056 | 44 |
val list,xstate] => bool " |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
45 |
("_ \<turnstile> _ -_[\<succ>]_-> _" [51,82,60,51,82] 81) |
10056 | 46 |
exec :: "[java_mb prog,xstate,stmt, xstate] => bool " |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
47 |
("_ \<turnstile> _ -_-> _" [51,82,60,82] 81) |
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10056
diff
changeset
|
48 |
|
11372 | 49 |
syntax |
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10056
diff
changeset
|
50 |
eval :: "[java_mb prog,xstate,expr,val,xstate] => bool " |
10828
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10763
diff
changeset
|
51 |
("_ |- _ -_>_-> _" [51,82,60,82,82] 81) |
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10056
diff
changeset
|
52 |
evals:: "[java_mb prog,xstate,expr list, |
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10056
diff
changeset
|
53 |
val list,xstate] => bool " |
10828
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10763
diff
changeset
|
54 |
("_ |- _ -_[>]_-> _" [51,82,60,51,82] 81) |
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10056
diff
changeset
|
55 |
exec :: "[java_mb prog,xstate,stmt, xstate] => bool " |
10828
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10763
diff
changeset
|
56 |
("_ |- _ -_-> _" [51,82,60,82] 81) |
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10056
diff
changeset
|
57 |
|
8011 | 58 |
|
59 |
translations |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
60 |
"G\<turnstile>s -e \<succ> v-> (x,s')" <= "(s, e, v, x, s') \<in> eval G" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
61 |
"G\<turnstile>s -e \<succ> v-> s' " == "(s, e, v, s') \<in> eval G" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
62 |
"G\<turnstile>s -e[\<succ>]v-> (x,s')" <= "(s, e, v, x, s') \<in> evals G" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
63 |
"G\<turnstile>s -e[\<succ>]v-> s' " == "(s, e, v, s') \<in> evals G" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
64 |
"G\<turnstile>s -c -> (x,s')" <= "(s, c, x, s') \<in> exec G" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
65 |
"G\<turnstile>s -c -> s' " == "(s, c, s') \<in> exec G" |
8011 | 66 |
|
12517 | 67 |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
68 |
inductive "eval G" "evals G" "exec G" intros |
8011 | 69 |
|
12517 | 70 |
(* evaluation of expressions *) |
8011 | 71 |
|
12517 | 72 |
XcptE:"G\<turnstile>(Some xc,s) -e\<succ>arbitrary-> (Some xc,s)" -- "cf. 15.5" |
8011 | 73 |
|
12517 | 74 |
-- "cf. 15.8.1" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
75 |
NewC: "[| h = heap s; (a,x) = new_Addr h; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
76 |
h'= h(a\<mapsto>(C,init_vars (fields (G,C)))) |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
77 |
G\<turnstile>Norm s -NewC C\<succ>Addr a-> c_hupd h' (x,s)" |
8011 | 78 |
|
12517 | 79 |
-- "cf. 15.15" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
80 |
Cast: "[| G\<turnstile>Norm s0 -e\<succ>v-> (x1,s1); |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
81 |
x2 = raise_if (\<not> cast_ok G C (heap s1) v) ClassCast x1 |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
82 |
G\<turnstile>Norm s0 -Cast C e\<succ>v-> (x2,s1)" |
8011 | 83 |
|
12517 | 84 |
-- "cf. 15.7.1" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
85 |
Lit: "G\<turnstile>Norm s -Lit v\<succ>v-> Norm s" |
8011 | 86 |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
87 |
BinOp:"[| G\<turnstile>Norm s -e1\<succ>v1-> s1; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
88 |
G\<turnstile>s1 -e2\<succ>v2-> s2; |
10056 | 89 |
v = (case bop of Eq => Bool (v1 = v2) |
90 |
| Add => Intg (the_Intg v1 + the_Intg v2)) |] ==> |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
91 |
G\<turnstile>Norm s -BinOp bop e1 e2\<succ>v-> s2" |
9240 | 92 |
|
12517 | 93 |
-- "cf. 15.13.1, 15.2" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
94 |
LAcc: "G\<turnstile>Norm s -LAcc v\<succ>the (locals s v)-> Norm s" |
8011 | 95 |
|
12517 | 96 |
-- "cf. 15.25.1" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
97 |
LAss: "[| G\<turnstile>Norm s -e\<succ>v-> (x,(h,l)); |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
98 |
l' = (if x = None then l(va\<mapsto>v) else l) |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
99 |
G\<turnstile>Norm s -va::=e\<succ>v-> (x,(h,l'))" |
8011 | 100 |
|
12517 | 101 |
-- "cf. 15.10.1, 15.2" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
102 |
FAcc: "[| G\<turnstile>Norm s0 -e\<succ>a'-> (x1,s1); |
10056 | 103 |
v = the (snd (the (heap s1 (the_Addr a'))) (fn,T)) |] ==> |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
104 |
G\<turnstile>Norm s0 -{T}e..fn\<succ>v-> (np a' x1,s1)" |
8011 | 105 |
|
12517 | 106 |
-- "cf. 15.25.1" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
107 |
FAss: "[| G\<turnstile> Norm s0 -e1\<succ>a'-> (x1,s1); a = the_Addr a'; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
108 |
G\<turnstile>(np a' x1,s1) -e2\<succ>v -> (x2,s2); |
10056 | 109 |
h = heap s2; (c,fs) = the (h a); |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
110 |
h' = h(a\<mapsto>(c,(fs((fn,T)\<mapsto>v)))) |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
111 |
G\<turnstile>Norm s0 -{T}e1..fn:=e2\<succ>v-> c_hupd h' (x2,s2)" |
8011 | 112 |
|
12517 | 113 |
-- "cf. 15.11.4.1, 15.11.4.2, 15.11.4.4, 15.11.4.5, 14.15" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
114 |
Call: "[| G\<turnstile>Norm s0 -e\<succ>a'-> s1; a = the_Addr a'; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
115 |
G\<turnstile>s1 -ps[\<succ>]pvs-> (x,(h,l)); dynT = fst (the (h a)); |
10056 | 116 |
(md,rT,pns,lvars,blk,res) = the (method (G,dynT) (mn,pTs)); |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
117 |
G\<turnstile>(np a' x,(h,(init_vars lvars)(pns[\<mapsto>]pvs)(This\<mapsto>a'))) -blk-> s3; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
118 |
G\<turnstile> s3 -res\<succ>v -> (x4,s4) |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
119 |
G\<turnstile>Norm s0 -{C}e..mn({pTs}ps)\<succ>v-> (x4,(heap s4,l))" |
8011 | 120 |
|
121 |
||
12517 | 122 |
-- "evaluation of expression lists" |
123 |
||
124 |
-- "cf. 15.5" |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
125 |
XcptEs:"G\<turnstile>(Some xc,s) -e[\<succ>]arbitrary-> (Some xc,s)" |
8011 | 126 |
|
12517 | 127 |
-- "cf. 15.11.???" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
128 |
Nil: "G\<turnstile>Norm s0 -[][\<succ>][]-> Norm s0" |
8011 | 129 |
|
12517 | 130 |
-- "cf. 15.6.4" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
131 |
Cons: "[| G\<turnstile>Norm s0 -e \<succ> v -> s1; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
132 |
G\<turnstile> s1 -es[\<succ>]vs-> s2 |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
133 |
G\<turnstile>Norm s0 -e#es[\<succ>]v#vs-> s2" |
8011 | 134 |
|
135 |
||
12517 | 136 |
-- "execution of statements" |
137 |
||
138 |
-- "cf. 14.1" |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
139 |
XcptS:"G\<turnstile>(Some xc,s) -c-> (Some xc,s)" |
8011 | 140 |
|
12517 | 141 |
-- "cf. 14.5" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
142 |
Skip: "G\<turnstile>Norm s -Skip-> Norm s" |
8011 | 143 |
|
12517 | 144 |
-- "cf. 14.7" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
145 |
Expr: "[| G\<turnstile>Norm s0 -e\<succ>v-> s1 |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
146 |
G\<turnstile>Norm s0 -Expr e-> s1" |
8011 | 147 |
|
12517 | 148 |
-- "cf. 14.2" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
149 |
Comp: "[| G\<turnstile>Norm s0 -c1-> s1; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
150 |
G\<turnstile> s1 -c2-> s2|] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
151 |
G\<turnstile>Norm s0 -c1;; c2-> s2" |
8011 | 152 |
|
12517 | 153 |
-- "cf. 14.8.2" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
154 |
Cond: "[| G\<turnstile>Norm s0 -e\<succ>v-> s1; |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
155 |
G\<turnstile> s1 -(if the_Bool v then c1 else c2)-> s2|] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
156 |
G\<turnstile>Norm s0 -If(e) c1 Else c2-> s2" |
8011 | 157 |
|
12517 | 158 |
-- "cf. 14.10, 14.10.1" |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
159 |
LoopF:"[| G\<turnstile>Norm s0 -e\<succ>v-> s1; \<not>the_Bool v |] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
160 |
G\<turnstile>Norm s0 -While(e) c-> s1" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
161 |
LoopT:"[| G\<turnstile>Norm s0 -e\<succ>v-> s1; the_Bool v; |
12517 | 162 |
G\<turnstile>s1 -c-> s2; G\<turnstile>s2 -While(e) c-> s3 |] ==> |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
163 |
G\<turnstile>Norm s0 -While(e) c-> s3" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
164 |
|
12517 | 165 |
|
11040 | 166 |
lemmas eval_evals_exec_induct = eval_evals_exec.induct [split_format (complete)] |
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
167 |
|
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
168 |
lemma NewCI: "[|new_Addr (heap s) = (a,x); |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
169 |
s' = c_hupd (heap s(a\<mapsto>(C,init_vars (fields (G,C))))) (x,s)|] ==> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
170 |
G\<turnstile>Norm s -NewC C\<succ>Addr a-> s'" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
171 |
apply (simp (no_asm_simp)) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
172 |
apply (rule eval_evals_exec.NewC) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
173 |
apply auto |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
174 |
done |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
175 |
|
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
176 |
lemma eval_evals_exec_no_xcpt: |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
177 |
"!!s s'. (G\<turnstile>(x,s) -e \<succ> v -> (x',s') --> x'=None --> x=None) \<and> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
178 |
(G\<turnstile>(x,s) -es[\<succ>]vs-> (x',s') --> x'=None --> x=None) \<and> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
179 |
(G\<turnstile>(x,s) -c -> (x',s') --> x'=None --> x=None)" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
180 |
apply(simp (no_asm_simp) only: split_tupled_all) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
181 |
apply(rule eval_evals_exec_induct) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
182 |
apply(unfold c_hupd_def) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
183 |
apply(simp_all) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
184 |
done |
10828
b207d6d1bedc
improved evaluation judgment syntax; modified Loop rule
oheimb
parents:
10763
diff
changeset
|
185 |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
186 |
lemma eval_no_xcpt: "G\<turnstile>(x,s) -e\<succ>v-> (None,s') ==> x=None" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
187 |
apply (drule eval_evals_exec_no_xcpt [THEN conjunct1, THEN mp]) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
188 |
apply (fast) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
189 |
done |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
190 |
|
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
191 |
lemma evals_no_xcpt: "G\<turnstile>(x,s) -e[\<succ>]v-> (None,s') ==> x=None" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
192 |
apply (drule eval_evals_exec_no_xcpt [THEN conjunct2, THEN conjunct1, THEN mp]) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
193 |
apply (fast) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
194 |
done |
8011 | 195 |
|
14141 | 196 |
lemma exec_no_xcpt: "G \<turnstile> (x, s) -c-> (None, s') |
197 |
\<Longrightarrow> x = None" |
|
198 |
apply (drule eval_evals_exec_no_xcpt [THEN conjunct2 [THEN conjunct2], rule_format]) |
|
199 |
apply simp+ |
|
200 |
done |
|
201 |
||
202 |
||
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
203 |
lemma eval_evals_exec_xcpt: |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
204 |
"!!s s'. (G\<turnstile>(x,s) -e \<succ> v -> (x',s') --> x=Some xc --> x'=Some xc \<and> s'=s) \<and> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
205 |
(G\<turnstile>(x,s) -es[\<succ>]vs-> (x',s') --> x=Some xc --> x'=Some xc \<and> s'=s) \<and> |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
206 |
(G\<turnstile>(x,s) -c -> (x',s') --> x=Some xc --> x'=Some xc \<and> s'=s)" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
207 |
apply (simp (no_asm_simp) only: split_tupled_all) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
208 |
apply (rule eval_evals_exec_induct) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
209 |
apply (unfold c_hupd_def) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
210 |
apply (simp_all) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
211 |
done |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
212 |
|
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
213 |
lemma eval_xcpt: "G\<turnstile>(Some xc,s) -e\<succ>v-> (x',s') ==> x'=Some xc \<and> s'=s" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
214 |
apply (drule eval_evals_exec_xcpt [THEN conjunct1, THEN mp]) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
215 |
apply (fast) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
216 |
done |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
217 |
|
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
218 |
lemma exec_xcpt: "G\<turnstile>(Some xc,s) -s0-> (x',s') ==> x'=Some xc \<and> s'=s" |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
219 |
apply (drule eval_evals_exec_xcpt [THEN conjunct2, THEN conjunct2, THEN mp]) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
220 |
apply (fast) |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
221 |
done |
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10927
diff
changeset
|
222 |
|
11642 | 223 |
end |