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