author | kleing |
Sun, 07 Jan 2001 18:43:13 +0100 | |
changeset 10812 | ead84e90bfeb |
parent 10628 | 4ea7f3e8e471 |
child 11085 | b830bf10bf71 |
permissions | -rw-r--r-- |
8388 | 1 |
(* Title: HOL/MicroJava/BV/LBVComplete.thy |
2 |
ID: $Id$ |
|
3 |
Author: Gerwin Klein |
|
4 |
Copyright 2000 Technische Universitaet Muenchen |
|
9054 | 5 |
*) |
8388 | 6 |
|
9054 | 7 |
header {* Completeness of the LBV *} |
8388 | 8 |
|
9559 | 9 |
theory LBVComplete = BVSpec + LBVSpec + StepMono: |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
10 |
|
8388 | 11 |
constdefs |
10042 | 12 |
contains_targets :: "[instr list, certificate, method_type, p_count] => bool" |
13 |
"contains_targets ins cert phi pc == |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
14 |
\<forall>pc' \<in> set (succs (ins!pc) pc). |
10042 | 15 |
pc' \<noteq> pc+1 \<and> pc' < length ins --> cert!pc' = phi!pc'" |
8388 | 16 |
|
10042 | 17 |
fits :: "[instr list, certificate, method_type] => bool" |
18 |
"fits ins cert phi == \<forall>pc. pc < length ins --> |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
19 |
contains_targets ins cert phi pc \<and> |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
20 |
(cert!pc = None \<or> cert!pc = phi!pc)" |
9012 | 21 |
|
10042 | 22 |
is_target :: "[instr list, p_count] => bool" |
23 |
"is_target ins pc == |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
24 |
\<exists>pc'. pc \<noteq> pc'+1 \<and> pc' < length ins \<and> pc \<in> set (succs (ins!pc') pc')" |
8388 | 25 |
|
26 |
||
27 |
constdefs |
|
10042 | 28 |
make_cert :: "[instr list, method_type] => certificate" |
29 |
"make_cert ins phi == |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
30 |
map (\<lambda>pc. if is_target ins pc then phi!pc else None) [0..length ins(]" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
31 |
|
10042 | 32 |
make_Cert :: "[jvm_prog, prog_type] => prog_certificate" |
10628 | 33 |
"make_Cert G Phi == \<lambda> C sig. let (C,rT,(maxs,maxl,b)) = the (method (G,C) sig) |
34 |
in make_cert b (Phi C sig)" |
|
8388 | 35 |
|
9012 | 36 |
|
9559 | 37 |
lemmas [simp del] = split_paired_Ex |
38 |
||
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
39 |
lemma make_cert_target: |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
40 |
"[| pc < length ins; is_target ins pc |] ==> make_cert ins phi ! pc = phi!pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
41 |
by (simp add: make_cert_def) |
9012 | 42 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
43 |
lemma make_cert_approx: |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
44 |
"[| pc < length ins; make_cert ins phi ! pc \<noteq> phi ! pc |] ==> |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
45 |
make_cert ins phi ! pc = None" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
46 |
by (auto simp add: make_cert_def) |
9012 | 47 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
48 |
lemma make_cert_contains_targets: |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
49 |
"pc < length ins ==> contains_targets ins (make_cert ins phi) phi pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
50 |
proof (unfold contains_targets_def, intro strip, elim conjE) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
51 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
52 |
fix pc' |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
53 |
assume "pc < length ins" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
54 |
"pc' \<in> set (succs (ins ! pc) pc)" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
55 |
"pc' \<noteq> pc+1" and |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
56 |
pc': "pc' < length ins" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
57 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
58 |
hence "is_target ins pc'" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
59 |
by (auto simp add: is_target_def) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
60 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
61 |
with pc' |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
62 |
show "make_cert ins phi ! pc' = phi ! pc'" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
63 |
by (auto intro: make_cert_target) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
64 |
qed |
9012 | 65 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
66 |
theorem fits_make_cert: |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
67 |
"fits ins (make_cert ins phi) phi" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
68 |
by (auto dest: make_cert_approx simp add: fits_def make_cert_contains_targets) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
69 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
70 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
71 |
lemma fitsD: |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
72 |
"[| fits ins cert phi; pc' \<in> set (succs (ins!pc) pc); |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
73 |
pc' \<noteq> Suc pc; pc < length ins; pc' < length ins |] |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
74 |
==> cert!pc' = phi!pc'" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
75 |
by (clarsimp simp add: fits_def contains_targets_def) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
76 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
77 |
lemma fitsD2: |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
78 |
"[| fits ins cert phi; pc < length ins; cert!pc = Some s |] |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
79 |
==> cert!pc = phi!pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
80 |
by (auto simp add: fits_def) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
81 |
|
9012 | 82 |
|
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
83 |
lemma wtl_inst_mono: |
10592 | 84 |
"[| wtl_inst i G rT s1 cert mxs mpc pc = OK s1'; fits ins cert phi; |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
85 |
pc < length ins; G \<turnstile> s2 <=' s1; i = ins!pc |] ==> |
10592 | 86 |
\<exists> s2'. wtl_inst (ins!pc) G rT s2 cert mxs mpc pc = OK s2' \<and> (G \<turnstile> s2' <=' s1')" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
87 |
proof - |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
88 |
assume pc: "pc < length ins" "i = ins!pc" |
10592 | 89 |
assume wtl: "wtl_inst i G rT s1 cert mxs mpc pc = OK s1'" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
90 |
assume fits: "fits ins cert phi" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
91 |
assume G: "G \<turnstile> s2 <=' s1" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
92 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
93 |
let "?step s" = "step i G s" |
9012 | 94 |
|
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
95 |
from wtl G |
10592 | 96 |
have app: "app i G mxs rT s2" by (auto simp add: wtl_inst_OK app_mono) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
97 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
98 |
from wtl G |
10496 | 99 |
have step: "G \<turnstile> ?step s2 <=' ?step s1" |
100 |
by (auto intro: step_mono simp add: wtl_inst_OK) |
|
9012 | 101 |
|
10496 | 102 |
{ also |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
103 |
fix pc' |
10496 | 104 |
assume "pc' \<in> set (succs i pc)" "pc' \<noteq> pc+1" |
105 |
with wtl |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
106 |
have "G \<turnstile> ?step s1 <=' cert!pc'" |
10496 | 107 |
by (auto simp add: wtl_inst_OK) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
108 |
finally |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
109 |
have "G\<turnstile> ?step s2 <=' cert!pc'" . |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
110 |
} note cert = this |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
111 |
|
10592 | 112 |
have "\<exists>s2'. wtl_inst i G rT s2 cert mxs mpc pc = OK s2' \<and> G \<turnstile> s2' <=' s1'" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
113 |
proof (cases "pc+1 \<in> set (succs i pc)") |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
114 |
case True |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
115 |
with wtl |
10496 | 116 |
have s1': "s1' = ?step s1" by (simp add: wtl_inst_OK) |
9012 | 117 |
|
10592 | 118 |
have "wtl_inst i G rT s2 cert mxs mpc pc = OK (?step s2) \<and> G \<turnstile> ?step s2 <=' s1'" |
9580 | 119 |
(is "?wtl \<and> ?G") |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
120 |
proof |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
121 |
from True s1' |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
122 |
show ?G by (auto intro: step) |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
123 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
124 |
from True app wtl |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
125 |
show ?wtl |
10496 | 126 |
by (clarsimp intro!: cert simp add: wtl_inst_OK) |
9376 | 127 |
qed |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
128 |
thus ?thesis by blast |
9376 | 129 |
next |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
130 |
case False |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
131 |
with wtl |
10496 | 132 |
have "s1' = cert ! Suc pc" by (simp add: wtl_inst_OK) |
9012 | 133 |
|
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
134 |
with False app wtl |
10592 | 135 |
have "wtl_inst i G rT s2 cert mxs mpc pc = OK s1' \<and> G \<turnstile> s1' <=' s1'" |
10496 | 136 |
by (clarsimp intro!: cert simp add: wtl_inst_OK) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
137 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
138 |
thus ?thesis by blast |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
139 |
qed |
9012 | 140 |
|
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
141 |
with pc show ?thesis by simp |
9376 | 142 |
qed |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
143 |
|
9559 | 144 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
145 |
lemma wtl_cert_mono: |
10592 | 146 |
"[| wtl_cert i G rT s1 cert mxs mpc pc = OK s1'; fits ins cert phi; |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
147 |
pc < length ins; G \<turnstile> s2 <=' s1; i = ins!pc |] ==> |
10592 | 148 |
\<exists> s2'. wtl_cert (ins!pc) G rT s2 cert mxs mpc pc = OK s2' \<and> (G \<turnstile> s2' <=' s1')" |
9559 | 149 |
proof - |
10592 | 150 |
assume wtl: "wtl_cert i G rT s1 cert mxs mpc pc = OK s1'" and |
9559 | 151 |
fits: "fits ins cert phi" "pc < length ins" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
152 |
"G \<turnstile> s2 <=' s1" "i = ins!pc" |
9559 | 153 |
|
154 |
show ?thesis |
|
9664 | 155 |
proof (cases (open) "cert!pc") |
9559 | 156 |
case None |
9580 | 157 |
with wtl fits |
158 |
show ?thesis |
|
9941
fe05af7ec816
renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents:
9906
diff
changeset
|
159 |
by - (rule wtl_inst_mono [elim_format], (simp add: wtl_cert_def)+) |
9559 | 160 |
next |
161 |
case Some |
|
9580 | 162 |
with wtl fits |
9559 | 163 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
164 |
have G: "G \<turnstile> s2 <=' (Some a)" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
165 |
by - (rule sup_state_opt_trans, auto simp add: wtl_cert_def split: if_splits) |
9559 | 166 |
|
167 |
from Some wtl |
|
10592 | 168 |
have "wtl_inst i G rT (Some a) cert mxs mpc pc = OK s1'" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
169 |
by (simp add: wtl_cert_def split: if_splits) |
9559 | 170 |
|
171 |
with G fits |
|
10592 | 172 |
have "\<exists> s2'. wtl_inst (ins!pc) G rT (Some a) cert mxs mpc pc = OK s2' \<and> |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
173 |
(G \<turnstile> s2' <=' s1')" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
174 |
by - (rule wtl_inst_mono, (simp add: wtl_cert_def)+) |
9559 | 175 |
|
9580 | 176 |
with Some G |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
177 |
show ?thesis by (simp add: wtl_cert_def) |
9559 | 178 |
qed |
179 |
qed |
|
180 |
||
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
181 |
|
9012 | 182 |
lemma wt_instr_imp_wtl_inst: |
10592 | 183 |
"[| wt_instr (ins!pc) G rT phi mxs max_pc pc; fits ins cert phi; |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
184 |
pc < length ins; length ins = max_pc |] ==> |
10592 | 185 |
wtl_inst (ins!pc) G rT (phi!pc) cert mxs max_pc pc \<noteq> Err" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
186 |
proof - |
10592 | 187 |
assume wt: "wt_instr (ins!pc) G rT phi mxs max_pc pc" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
188 |
assume fits: "fits ins cert phi" |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
189 |
assume pc: "pc < length ins" "length ins = max_pc" |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
190 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
191 |
from wt |
10592 | 192 |
have app: "app (ins!pc) G mxs rT (phi!pc)" by (simp add: wt_instr_def) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
193 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
194 |
from wt pc |
10042 | 195 |
have pc': "!!pc'. pc' \<in> set (succs (ins!pc) pc) ==> pc' < length ins" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
196 |
by (simp add: wt_instr_def) |
9376 | 197 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
198 |
let ?s' = "step (ins!pc) G (phi!pc)" |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
199 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
200 |
from wt fits pc |
10042 | 201 |
have cert: "!!pc'. [|pc' \<in> set (succs (ins!pc) pc); pc' < max_pc; pc' \<noteq> pc+1|] |
202 |
==> G \<turnstile> ?s' <=' cert!pc'" |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
203 |
by (auto dest: fitsD simp add: wt_instr_def) |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
204 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
205 |
from app pc cert pc' |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
206 |
show ?thesis |
10496 | 207 |
by (auto simp add: wtl_inst_OK) |
9376 | 208 |
qed |
9012 | 209 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
210 |
lemma wt_less_wtl: |
10592 | 211 |
"[| wt_instr (ins!pc) G rT phi mxs max_pc pc; |
212 |
wtl_inst (ins!pc) G rT (phi!pc) cert mxs max_pc pc = OK s; |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
213 |
fits ins cert phi; Suc pc < length ins; length ins = max_pc |] ==> |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
214 |
G \<turnstile> s <=' phi ! Suc pc" |
9376 | 215 |
proof - |
10592 | 216 |
assume wt: "wt_instr (ins!pc) G rT phi mxs max_pc pc" |
217 |
assume wtl: "wtl_inst (ins!pc) G rT (phi!pc) cert mxs max_pc pc = OK s" |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
218 |
assume fits: "fits ins cert phi" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
219 |
assume pc: "Suc pc < length ins" "length ins = max_pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
220 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
221 |
{ assume suc: "Suc pc \<in> set (succs (ins ! pc) pc)" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
222 |
with wtl have "s = step (ins!pc) G (phi!pc)" |
10496 | 223 |
by (simp add: wtl_inst_OK) |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
224 |
also from suc wt have "G \<turnstile> ... <=' phi!Suc pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
225 |
by (simp add: wt_instr_def) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
226 |
finally have ?thesis . |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
227 |
} |
9012 | 228 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
229 |
moreover |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
230 |
{ assume "Suc pc \<notin> set (succs (ins ! pc) pc)" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
231 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
232 |
with wtl |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
233 |
have "s = cert!Suc pc" |
10496 | 234 |
by (simp add: wtl_inst_OK) |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
235 |
with fits pc |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
236 |
have ?thesis |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
237 |
by - (cases "cert!Suc pc", simp, drule fitsD2, assumption+, simp) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
238 |
} |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
239 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
240 |
ultimately |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
241 |
show ?thesis by blast |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
242 |
qed |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
243 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
244 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
245 |
lemma wt_instr_imp_wtl_cert: |
10592 | 246 |
"[| wt_instr (ins!pc) G rT phi mxs max_pc pc; fits ins cert phi; |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
247 |
pc < length ins; length ins = max_pc |] ==> |
10592 | 248 |
wtl_cert (ins!pc) G rT (phi!pc) cert mxs max_pc pc \<noteq> Err" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
249 |
proof - |
10592 | 250 |
assume "wt_instr (ins!pc) G rT phi mxs max_pc pc" and |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
251 |
fits: "fits ins cert phi" and |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
252 |
pc: "pc < length ins" and |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
253 |
"length ins = max_pc" |
9012 | 254 |
|
10592 | 255 |
hence wtl: "wtl_inst (ins!pc) G rT (phi!pc) cert mxs max_pc pc \<noteq> Err" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
256 |
by (rule wt_instr_imp_wtl_inst) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
257 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
258 |
hence "cert!pc = None ==> ?thesis" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
259 |
by (simp add: wtl_cert_def) |
9012 | 260 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
261 |
moreover |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
262 |
{ fix s |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
263 |
assume c: "cert!pc = Some s" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
264 |
with fits pc |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
265 |
have "cert!pc = phi!pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
266 |
by (rule fitsD2) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
267 |
from this c wtl |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
268 |
have ?thesis |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
269 |
by (clarsimp simp add: wtl_cert_def) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
270 |
} |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
271 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
272 |
ultimately |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
273 |
show ?thesis by blast |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
274 |
qed |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
275 |
|
9012 | 276 |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
277 |
lemma wt_less_wtl_cert: |
10592 | 278 |
"[| wt_instr (ins!pc) G rT phi mxs max_pc pc; |
279 |
wtl_cert (ins!pc) G rT (phi!pc) cert mxs max_pc pc = OK s; |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
280 |
fits ins cert phi; Suc pc < length ins; length ins = max_pc |] ==> |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
281 |
G \<turnstile> s <=' phi ! Suc pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
282 |
proof - |
10592 | 283 |
assume wtl: "wtl_cert (ins!pc) G rT (phi!pc) cert mxs max_pc pc = OK s" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
284 |
|
10592 | 285 |
assume wti: "wt_instr (ins!pc) G rT phi mxs max_pc pc" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
286 |
"fits ins cert phi" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
287 |
"Suc pc < length ins" "length ins = max_pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
288 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
289 |
{ assume "cert!pc = None" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
290 |
with wtl |
10592 | 291 |
have "wtl_inst (ins!pc) G rT (phi!pc) cert mxs max_pc pc = OK s" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
292 |
by (simp add: wtl_cert_def) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
293 |
with wti |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
294 |
have ?thesis |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
295 |
by - (rule wt_less_wtl) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
296 |
} |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
297 |
moreover |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
298 |
{ fix t |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
299 |
assume c: "cert!pc = Some t" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
300 |
with wti |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
301 |
have "cert!pc = phi!pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
302 |
by - (rule fitsD2, simp+) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
303 |
with c wtl |
10592 | 304 |
have "wtl_inst (ins!pc) G rT (phi!pc) cert mxs max_pc pc = OK s" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
305 |
by (simp add: wtl_cert_def) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
306 |
with wti |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
307 |
have ?thesis |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
308 |
by - (rule wt_less_wtl) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
309 |
} |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
310 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
311 |
ultimately |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
312 |
show ?thesis by blast |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
313 |
qed |
9012 | 314 |
|
9376 | 315 |
|
9559 | 316 |
text {* |
317 |
\medskip |
|
318 |
Main induction over the instruction list. |
|
319 |
*} |
|
9012 | 320 |
|
321 |
theorem wt_imp_wtl_inst_list: |
|
10042 | 322 |
"\<forall> pc. (\<forall>pc'. pc' < length all_ins --> |
10592 | 323 |
wt_instr (all_ins ! pc') G rT phi mxs (length all_ins) pc') --> |
10042 | 324 |
fits all_ins cert phi --> |
325 |
(\<exists>l. pc = length l \<and> all_ins = l@ins) --> |
|
326 |
pc < length all_ins --> |
|
327 |
(\<forall> s. (G \<turnstile> s <=' (phi!pc)) --> |
|
10592 | 328 |
wtl_inst_list ins G rT cert mxs (length all_ins) pc s \<noteq> Err)" |
10042 | 329 |
(is "\<forall>pc. ?wt --> ?fits --> ?l pc ins --> ?len pc --> ?wtl pc ins" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
330 |
is "\<forall>pc. ?C pc ins" is "?P ins") |
9559 | 331 |
proof (induct "?P" "ins") |
332 |
case Nil |
|
333 |
show "?P []" by simp |
|
334 |
next |
|
335 |
fix i ins' |
|
336 |
assume Cons: "?P ins'" |
|
9012 | 337 |
|
9559 | 338 |
show "?P (i#ins')" |
339 |
proof (intro allI impI, elim exE conjE) |
|
340 |
fix pc s l |
|
10042 | 341 |
assume wt : "\<forall>pc'. pc' < length all_ins --> |
10592 | 342 |
wt_instr (all_ins ! pc') G rT phi mxs (length all_ins) pc'" |
9559 | 343 |
assume fits: "fits all_ins cert phi" |
344 |
assume l : "pc < length all_ins" |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
345 |
assume G : "G \<turnstile> s <=' phi ! pc" |
9559 | 346 |
assume pc : "all_ins = l@i#ins'" "pc = length l" |
347 |
hence i : "all_ins ! pc = i" |
|
348 |
by (simp add: nth_append) |
|
9012 | 349 |
|
9559 | 350 |
from l wt |
10592 | 351 |
have wti: "wt_instr (all_ins!pc) G rT phi mxs (length all_ins) pc" by blast |
9012 | 352 |
|
9559 | 353 |
with fits l |
10592 | 354 |
have c: "wtl_cert (all_ins!pc) G rT (phi!pc) cert mxs (length all_ins) pc \<noteq> Err" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
355 |
by - (drule wt_instr_imp_wtl_cert, auto) |
9559 | 356 |
|
357 |
from Cons |
|
358 |
have "?C (Suc pc) ins'" by blast |
|
359 |
with wt fits pc |
|
10042 | 360 |
have IH: "?len (Suc pc) --> ?wtl (Suc pc) ins'" by auto |
9012 | 361 |
|
10592 | 362 |
show "wtl_inst_list (i#ins') G rT cert mxs (length all_ins) pc s \<noteq> Err" |
9559 | 363 |
proof (cases "?len (Suc pc)") |
364 |
case False |
|
365 |
with pc |
|
366 |
have "ins' = []" by simp |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
367 |
with G i c fits l |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
368 |
show ?thesis by (auto dest: wtl_cert_mono) |
9559 | 369 |
next |
370 |
case True |
|
371 |
with IH |
|
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
372 |
have wtl: "?wtl (Suc pc) ins'" by blast |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
373 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
374 |
from c wti fits l True |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
375 |
obtain s'' where |
10592 | 376 |
"wtl_cert (all_ins!pc) G rT (phi!pc) cert mxs (length all_ins) pc = OK s''" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
377 |
"G \<turnstile> s'' <=' phi ! Suc pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
378 |
by clarsimp (drule wt_less_wtl_cert, auto) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
379 |
moreover |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
380 |
from calculation fits G l |
9559 | 381 |
obtain s' where |
10592 | 382 |
c': "wtl_cert (all_ins!pc) G rT s cert mxs (length all_ins) pc = OK s'" and |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
383 |
"G \<turnstile> s' <=' s''" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
384 |
by - (drule wtl_cert_mono, auto) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
385 |
ultimately |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
386 |
have G': "G \<turnstile> s' <=' phi ! Suc pc" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
387 |
by - (rule sup_state_opt_trans) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
388 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
389 |
with wtl |
10592 | 390 |
have "wtl_inst_list ins' G rT cert mxs (length all_ins) (Suc pc) s' \<noteq> Err" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
391 |
by auto |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
392 |
|
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
393 |
with i c' |
9559 | 394 |
show ?thesis by auto |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
395 |
qed |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
396 |
qed |
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
397 |
qed |
9559 | 398 |
|
9012 | 399 |
|
400 |
lemma fits_imp_wtl_method_complete: |
|
10592 | 401 |
"[| wt_method G C pTs rT mxs mxl ins phi; fits ins cert phi |] |
402 |
==> wtl_method G C pTs rT mxs mxl ins cert" |
|
9594 | 403 |
by (simp add: wt_method_def wtl_method_def) |
9941
fe05af7ec816
renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents:
9906
diff
changeset
|
404 |
(rule wt_imp_wtl_inst_list [rule_format, elim_format], auto simp add: wt_start_def) |
9012 | 405 |
|
406 |
||
407 |
lemma wtl_method_complete: |
|
10592 | 408 |
"wt_method G C pTs rT mxs mxl ins phi |
409 |
==> wtl_method G C pTs rT mxs mxl ins (make_cert ins phi)" |
|
9580 | 410 |
proof - |
10592 | 411 |
assume "wt_method G C pTs rT mxs mxl ins phi" |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
412 |
moreover |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
413 |
have "fits ins (make_cert ins phi) phi" |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
414 |
by (rule fits_make_cert) |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
415 |
ultimately |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
416 |
show ?thesis |
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
417 |
by (rule fits_imp_wtl_method_complete) |
9580 | 418 |
qed |
9012 | 419 |
|
420 |
||
10628 | 421 |
theorem wtl_complete: |
9757
1024a2d80ac0
functional LBV style, dead code, type safety -> Isar
kleing
parents:
9664
diff
changeset
|
422 |
"wt_jvm_prog G Phi ==> wtl_jvm_prog G (make_Cert G Phi)" |
10628 | 423 |
proof - |
424 |
assume wt: "wt_jvm_prog G Phi" |
|
425 |
||
426 |
{ fix C S fs mdecls sig rT code |
|
427 |
assume "(C,S,fs,mdecls) \<in> set G" "(sig,rT,code) \<in> set mdecls" |
|
428 |
moreover |
|
429 |
from wt obtain wf_mb where "wf_prog wf_mb G" |
|
430 |
by (blast dest: wt_jvm_progD) |
|
431 |
ultimately |
|
432 |
have "method (G,C) sig = Some (C,rT,code)" |
|
433 |
by (simp add: methd) |
|
434 |
} note this [simp] |
|
435 |
||
436 |
from wt |
|
437 |
show ?thesis |
|
438 |
apply (clarsimp simp add: wt_jvm_prog_def wtl_jvm_prog_def wf_prog_def wf_cdecl_def) |
|
439 |
apply (drule bspec, assumption) |
|
440 |
apply (clarsimp simp add: wf_mdecl_def) |
|
441 |
apply (drule bspec, assumption) |
|
442 |
apply (clarsimp simp add: make_Cert_def) |
|
443 |
apply (clarsimp dest!: wtl_method_complete) |
|
444 |
done |
|
10592 | 445 |
|
10628 | 446 |
qed |
447 |
||
9559 | 448 |
lemmas [simp] = split_paired_Ex |
9549
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
449 |
|
40d64cb4f4e6
BV and LBV specified in terms of app and step functions
kleing
parents:
9376
diff
changeset
|
450 |
end |