author | paulson |
Fri, 14 Jan 2000 12:17:53 +0100 | |
changeset 8128 | 3a5864b465e2 |
parent 8122 | b43ad07660b9 |
child 8251 | 9be357df93d4 |
permissions | -rw-r--r-- |
7630 | 1 |
(* Title: HOL/UNITY/Project.ML |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1999 University of Cambridge |
|
5 |
||
6 |
Projections of state sets (also of actions and programs) |
|
7 |
||
8 |
Inheritance of GUARANTEES properties under extension |
|
9 |
*) |
|
10 |
||
11 |
Open_locale "Extend"; |
|
12 |
||
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
13 |
(** projection: monotonicity for safety **) |
7630 | 14 |
|
8041 | 15 |
Goal "D <= C ==> \ |
16 |
\ project_act h (Restrict D act) <= project_act h (Restrict C act)"; |
|
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
17 |
by (auto_tac (claset(), simpset() addsimps [project_act_def])); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
18 |
qed "project_act_mono"; |
7630 | 19 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
20 |
Goal "[| D <= C; project h C F : A co B |] ==> project h D F : A co B"; |
7630 | 21 |
by (auto_tac (claset(), simpset() addsimps [constrains_def])); |
7689 | 22 |
by (dtac project_act_mono 1); |
7630 | 23 |
by (Blast_tac 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
24 |
qed "project_constrains_mono"; |
7630 | 25 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
26 |
Goal "[| D <= C; project h C F : stable A |] ==> project h D F : stable A"; |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
27 |
by (asm_full_simp_tac |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
28 |
(simpset() addsimps [stable_def, project_constrains_mono]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
29 |
qed "project_stable_mono"; |
7630 | 30 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
31 |
Goal "F : A co B ==> project h C (extend h F) : A co B"; |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
32 |
by (auto_tac (claset(), |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
33 |
simpset() addsimps [extend_act_def, project_act_def, constrains_def])); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
34 |
qed "project_extend_constrains_I"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
35 |
|
7630 | 36 |
Goal "UNIV <= project_set h C \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
37 |
\ ==> project h C ((extend h F) Join G) = F Join (project h C G)"; |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
38 |
by (rtac program_equalityI 1); |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
39 |
by (asm_simp_tac (simpset() addsimps [image_eq_UN, UN_Un, |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
40 |
subset_UNIV RS subset_trans RS Restrict_triv]) 2); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
41 |
by (simp_tac (simpset() addsimps [project_set_extend_set_Int]) 1); |
7630 | 42 |
qed "project_extend_Join"; |
43 |
||
44 |
Goal "UNIV <= project_set h C \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
45 |
\ ==> (extend h F) Join G = extend h H ==> H = F Join (project h C G)"; |
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
46 |
by (dres_inst_tac [("f", "project h C")] arg_cong 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
47 |
by (asm_full_simp_tac (simpset() addsimps [project_extend_Join]) 1); |
7630 | 48 |
qed "extend_Join_eq_extend_D"; |
49 |
||
50 |
||
51 |
(** Safety **) |
|
52 |
||
53 |
Goalw [constrains_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
54 |
"(project h C F : A co B) = \ |
7630 | 55 |
\ (F : (C Int extend_set h A) co (extend_set h B) & A <= B)"; |
56 |
by (auto_tac (claset() addSIs [project_act_I], simpset() addsimps [ball_Un])); |
|
57 |
by (force_tac (claset() addSIs [project_act_I] addSDs [subsetD], simpset()) 1); |
|
58 |
(*the <== direction*) |
|
59 |
by (rewtac project_act_def); |
|
60 |
by (force_tac (claset() addSDs [subsetD], simpset()) 1); |
|
61 |
qed "project_constrains"; |
|
62 |
||
63 |
Goalw [stable_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
64 |
"(project h UNIV F : stable A) = (F : stable (extend_set h A))"; |
7630 | 65 |
by (simp_tac (simpset() addsimps [project_constrains]) 1); |
66 |
qed "project_stable"; |
|
67 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
68 |
Goal "F : stable (extend_set h A) ==> project h C F : stable A"; |
7689 | 69 |
by (dtac (project_stable RS iffD2) 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
70 |
by (blast_tac (claset() addIs [project_stable_mono]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
71 |
qed "project_stable_I"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
72 |
|
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
73 |
(*used below to prove Join_project_ensures*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
74 |
Goal "[| G : stable C; project h C G : A unless B |] \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
75 |
\ ==> G : (C Int extend_set h A) unless (extend_set h B)"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
76 |
by (asm_full_simp_tac |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
77 |
(simpset() addsimps [unless_def, project_constrains]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
78 |
by (blast_tac (claset() addDs [stable_constrains_Int] |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
79 |
addIs [constrains_weaken]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
80 |
qed_spec_mp "project_unless"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
81 |
|
7630 | 82 |
(*This form's useful with guarantees reasoning*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
83 |
Goal "(F Join project h C G : A co B) = \ |
7630 | 84 |
\ (extend h F Join G : (C Int extend_set h A) co (extend_set h B) & \ |
85 |
\ F : A co B)"; |
|
86 |
by (simp_tac (simpset() addsimps [Join_constrains, project_constrains]) 1); |
|
87 |
by (blast_tac (claset() addIs [extend_constrains RS iffD2 RS constrains_weaken] |
|
88 |
addDs [constrains_imp_subset]) 1); |
|
89 |
qed "Join_project_constrains"; |
|
90 |
||
91 |
(*The condition is required to prove the left-to-right direction; |
|
92 |
could weaken it to G : (C Int extend_set h A) co C*) |
|
93 |
Goalw [stable_def] |
|
94 |
"extend h F Join G : stable C \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
95 |
\ ==> (F Join project h C G : stable A) = \ |
7630 | 96 |
\ (extend h F Join G : stable (C Int extend_set h A) & \ |
97 |
\ F : stable A)"; |
|
98 |
by (simp_tac (simpset() addsimps [Join_project_constrains]) 1); |
|
99 |
by (blast_tac (claset() addIs [constrains_weaken] addDs [constrains_Int]) 1); |
|
100 |
qed "Join_project_stable"; |
|
101 |
||
7689 | 102 |
(*For using project_guarantees in particular cases*) |
103 |
Goal "extend h F Join G : extend_set h A co extend_set h B \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
104 |
\ ==> F Join project h C G : A co B"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
105 |
by (asm_full_simp_tac |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
106 |
(simpset() addsimps [project_constrains, Join_constrains, |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
107 |
extend_constrains]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
108 |
by (blast_tac (claset() addIs [constrains_weaken] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
109 |
addDs [constrains_imp_subset]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
110 |
qed "project_constrains_I"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
111 |
|
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
112 |
Goalw [increasing_def, stable_def] |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
113 |
"extend h F Join G : increasing (func o f) \ |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
114 |
\ ==> F Join project h C G : increasing func"; |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
115 |
by (asm_full_simp_tac (simpset() addsimps [project_constrains_I, |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
116 |
Collect_eq_extend_set RS sym]) 1); |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
117 |
qed "project_increasing_I"; |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
118 |
|
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
119 |
Goal "(F Join project h UNIV G : increasing func) = \ |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
120 |
\ (extend h F Join G : increasing (func o f))"; |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
121 |
by (rtac iffI 1); |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
122 |
by (etac project_increasing_I 2); |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
123 |
by (asm_full_simp_tac |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
124 |
(simpset() addsimps [increasing_def, Join_project_stable]) 1); |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
125 |
by (auto_tac (claset(), |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
126 |
simpset() addsimps [Join_stable, Collect_eq_extend_set RS sym, |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
127 |
extend_stable RS iffD1])); |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
128 |
qed "Join_project_increasing"; |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
129 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
130 |
(*The UNIV argument is essential*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
131 |
Goal "F Join project h UNIV G : A co B \ |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
132 |
\ ==> extend h F Join G : extend_set h A co extend_set h B"; |
7689 | 133 |
by (asm_full_simp_tac |
134 |
(simpset() addsimps [project_constrains, Join_constrains, |
|
135 |
extend_constrains]) 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
136 |
qed "project_constrains_D"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
137 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
138 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
139 |
(*** preserves ***) |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
140 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
141 |
Goal "G : preserves (v o f) ==> project h C G : preserves v"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
142 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
143 |
simpset() addsimps [preserves_def, project_stable_I, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
144 |
Collect_eq_extend_set RS sym])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
145 |
qed "project_preserves_I"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
146 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
147 |
(*to preserve f is to preserve the whole original state*) |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
148 |
Goal "G : preserves f ==> project h C G : preserves id"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
149 |
by (asm_simp_tac (simpset() addsimps [project_preserves_I]) 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
150 |
qed "project_preserves_id_I"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
151 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
152 |
Goal "(extend h G : preserves (v o f)) = (G : preserves v)"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
153 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
154 |
simpset() addsimps [preserves_def, extend_stable RS sym, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
155 |
Collect_eq_extend_set RS sym])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
156 |
qed "extend_preserves"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
157 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
158 |
Goal "inj h ==> (extend h G : preserves g)"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
159 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
160 |
simpset() addsimps [preserves_def, extend_def, extend_act_def, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
161 |
stable_def, constrains_def, g_def])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
162 |
qed "inj_extend_preserves"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
163 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
164 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
165 |
(*** "projecting" and union/intersection (no converses) ***) |
7841 | 166 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
167 |
Goalw [projecting_def] |
7841 | 168 |
"[| projecting C h F XA' XA; projecting C h F XB' XB |] \ |
169 |
\ ==> projecting C h F (XA' Int XB') (XA Int XB)"; |
|
170 |
by (Blast_tac 1); |
|
171 |
qed "projecting_Int"; |
|
172 |
||
173 |
Goalw [projecting_def] |
|
174 |
"[| projecting C h F XA' XA; projecting C h F XB' XB |] \ |
|
175 |
\ ==> projecting C h F (XA' Un XB') (XA Un XB)"; |
|
176 |
by (Blast_tac 1); |
|
177 |
qed "projecting_Un"; |
|
178 |
||
179 |
val [prem] = Goalw [projecting_def] |
|
180 |
"[| !!i. i:I ==> projecting C h F (X' i) (X i) |] \ |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
181 |
\ ==> projecting C h F (INT i:I. X' i) (INT i:I. X i)"; |
7841 | 182 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
183 |
qed "projecting_INT"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
184 |
|
7841 | 185 |
val [prem] = Goalw [projecting_def] |
186 |
"[| !!i. i:I ==> projecting C h F (X' i) (X i) |] \ |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
187 |
\ ==> projecting C h F (UN i:I. X' i) (UN i:I. X i)"; |
7841 | 188 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
189 |
qed "projecting_UN"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
190 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
191 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
192 |
"[| projecting C h F X' X; U'<=X'; X<=U |] ==> projecting C h F U' U"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
193 |
by Auto_tac; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
194 |
qed "projecting_weaken"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
195 |
|
8073 | 196 |
Goalw [projecting_def] |
197 |
"[| projecting C h F X' X; U'<=X' |] ==> projecting C h F U' X"; |
|
198 |
by Auto_tac; |
|
199 |
qed "projecting_weaken_L"; |
|
200 |
||
7841 | 201 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
202 |
"[| extending v C h F YA' YA; extending v C h F YB' YB |] \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
203 |
\ ==> extending v C h F (YA' Int YB') (YA Int YB)"; |
7841 | 204 |
by (Blast_tac 1); |
205 |
qed "extending_Int"; |
|
206 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
207 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
208 |
"[| extending v C h F YA' YA; extending v C h F YB' YB |] \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
209 |
\ ==> extending v C h F (YA' Un YB') (YA Un YB)"; |
7841 | 210 |
by (Blast_tac 1); |
211 |
qed "extending_Un"; |
|
212 |
||
213 |
val [prem] = Goalw [extending_def] |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
214 |
"[| !!i. i:I ==> extending v C h F (Y' i) (Y i) |] \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
215 |
\ ==> extending v C h F (INT i:I. Y' i) (INT i:I. Y i)"; |
7841 | 216 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
217 |
qed "extending_INT"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
218 |
|
7841 | 219 |
val [prem] = Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
220 |
"[| !!i. i:I ==> extending v C h F (Y' i) (Y i) |] \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
221 |
\ ==> extending v C h F (UN i:I. Y' i) (UN i:I. Y i)"; |
7841 | 222 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
223 |
qed "extending_UN"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
224 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
225 |
Goalw [extending_def] |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
226 |
"[| extending v C h F Y' Y; Y'<=V'; V<=Y; \ |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
227 |
\ preserves w <= preserves v |] \ |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
228 |
\ ==> extending w C h F V' V"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
229 |
by Auto_tac; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
230 |
qed "extending_weaken"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
231 |
|
8073 | 232 |
Goalw [extending_def] |
233 |
"[| extending v C h F Y' Y; Y'<=V' |] ==> extending v C h F V' Y"; |
|
234 |
by Auto_tac; |
|
235 |
qed "extending_weaken_L"; |
|
236 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
237 |
Goal "projecting C h F X' UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
238 |
by (simp_tac (simpset() addsimps [projecting_def]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
239 |
qed "projecting_UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
240 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
241 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
242 |
"projecting C h F (extend_set h A co extend_set h B) (A co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
243 |
by (blast_tac (claset() addIs [project_constrains_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
244 |
qed "projecting_constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
245 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
246 |
Goalw [stable_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
247 |
"projecting C h F (stable (extend_set h A)) (stable A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
248 |
by (rtac projecting_constrains 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
249 |
qed "projecting_stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
250 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
251 |
Goalw [projecting_def] |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
252 |
"projecting C h F (increasing (func o f)) (increasing func)"; |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
253 |
by (blast_tac (claset() addIs [project_increasing_I]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
254 |
qed "projecting_increasing"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
255 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
256 |
Goal "extending v C h F UNIV Y"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
257 |
by (simp_tac (simpset() addsimps [extending_def]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
258 |
qed "extending_UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
259 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
260 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
261 |
"extending v (%G. UNIV) h F (extend_set h A co extend_set h B) (A co B)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
262 |
by (blast_tac (claset() addIs [project_constrains_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
263 |
qed "extending_constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
264 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
265 |
Goalw [stable_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
266 |
"extending v (%G. UNIV) h F (stable (extend_set h A)) (stable A)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
267 |
by (rtac extending_constrains 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
268 |
qed "extending_stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
269 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
270 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
271 |
"extending v (%G. UNIV) h F (increasing (func o f)) (increasing func)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
272 |
by (simp_tac (simpset() addsimps [Join_project_increasing]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
273 |
qed "extending_increasing"; |
7689 | 274 |
|
7630 | 275 |
|
276 |
(** Reachability and project **) |
|
277 |
||
278 |
Goal "[| reachable (extend h F Join G) <= C; \ |
|
279 |
\ z : reachable (extend h F Join G) |] \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
280 |
\ ==> f z : reachable (F Join project h C G)"; |
7630 | 281 |
by (etac reachable.induct 1); |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
282 |
by (force_tac (claset() addSIs [reachable.Init], |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
283 |
simpset() addsimps [split_extended_all]) 1); |
7630 | 284 |
by Auto_tac; |
285 |
by (force_tac (claset() addIs [project_act_I RSN (3,reachable.Acts)], |
|
286 |
simpset()) 2); |
|
287 |
by (res_inst_tac [("act","x")] reachable.Acts 1); |
|
288 |
by Auto_tac; |
|
289 |
by (etac extend_act_D 1); |
|
290 |
qed "reachable_imp_reachable_project"; |
|
291 |
||
292 |
Goalw [Constrains_def] |
|
8128 | 293 |
"F Join project h (reachable (extend h F Join G)) G : A Co B \ |
7630 | 294 |
\ ==> extend h F Join G : (extend_set h A) Co (extend_set h B)"; |
295 |
by (full_simp_tac (simpset() addsimps [Join_project_constrains]) 1); |
|
296 |
by (Clarify_tac 1); |
|
297 |
by (etac constrains_weaken 1); |
|
8128 | 298 |
by (auto_tac (claset() addIs [reachable_imp_reachable_project], simpset())); |
7630 | 299 |
qed "project_Constrains_D"; |
300 |
||
301 |
Goalw [Stable_def] |
|
8128 | 302 |
"F Join project h (reachable (extend h F Join G)) G : Stable A \ |
7630 | 303 |
\ ==> extend h F Join G : Stable (extend_set h A)"; |
304 |
by (asm_simp_tac (simpset() addsimps [project_Constrains_D]) 1); |
|
305 |
qed "project_Stable_D"; |
|
306 |
||
307 |
Goalw [Always_def] |
|
8128 | 308 |
"F Join project h (reachable (extend h F Join G)) G : Always A \ |
7630 | 309 |
\ ==> extend h F Join G : Always (extend_set h A)"; |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
310 |
by (force_tac (claset() addIs [reachable.Init], |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
311 |
simpset() addsimps [project_Stable_D, split_extended_all]) 1); |
7630 | 312 |
qed "project_Always_D"; |
313 |
||
314 |
Goalw [Increasing_def] |
|
8128 | 315 |
"F Join project h (reachable (extend h F Join G)) G : Increasing func \ |
7630 | 316 |
\ ==> extend h F Join G : Increasing (func o f)"; |
317 |
by Auto_tac; |
|
318 |
by (stac Collect_eq_extend_set 1); |
|
319 |
by (asm_simp_tac (simpset() addsimps [project_Stable_D]) 1); |
|
320 |
qed "project_Increasing_D"; |
|
321 |
||
322 |
||
323 |
(** Converse results for weak safety: benefits of the argument C *) |
|
324 |
||
325 |
Goal "[| C <= reachable(extend h F Join G); \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
326 |
\ x : reachable (F Join project h C G) |] \ |
7630 | 327 |
\ ==> EX y. h(x,y) : reachable (extend h F Join G)"; |
328 |
by (etac reachable.induct 1); |
|
329 |
by (ALLGOALS Asm_full_simp_tac); |
|
330 |
(*SLOW: 6.7s*) |
|
331 |
by (force_tac (claset() delrules [Id_in_Acts] |
|
332 |
addIs [reachable.Acts, extend_act_D], |
|
333 |
simpset() addsimps [project_act_def]) 2); |
|
334 |
by (force_tac (claset() addIs [reachable.Init], |
|
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
335 |
simpset()) 1); |
7630 | 336 |
qed "reachable_project_imp_reachable"; |
337 |
||
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
338 |
Goal "project_set h (reachable (extend h F Join G)) = \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
339 |
\ reachable (F Join project h (reachable (extend h F Join G)) G)"; |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
340 |
by (auto_tac (claset() addDs [subset_refl RS reachable_imp_reachable_project, |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
341 |
subset_refl RS reachable_project_imp_reachable], |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
342 |
simpset())); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
343 |
qed "project_set_reachable_extend_eq"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
344 |
|
7947 | 345 |
Goal "reachable (extend h F Join G) <= C \ |
346 |
\ ==> reachable (extend h F Join G) <= \ |
|
347 |
\ extend_set h (reachable (F Join project h C G))"; |
|
348 |
by (auto_tac (claset() addDs [reachable_imp_reachable_project], |
|
349 |
simpset())); |
|
350 |
qed "reachable_extend_Join_subset"; |
|
351 |
||
7630 | 352 |
Goalw [Constrains_def] |
8128 | 353 |
"extend h F Join G : (extend_set h A) Co (extend_set h B) \ |
354 |
\ ==> F Join project h (reachable (extend h F Join G)) G : A Co B"; |
|
7630 | 355 |
by (full_simp_tac (simpset() addsimps [Join_project_constrains, |
356 |
extend_set_Int_distrib]) 1); |
|
357 |
by (rtac conjI 1); |
|
8128 | 358 |
by (force_tac |
359 |
(claset() addEs [constrains_weaken_L] |
|
360 |
addSDs [extend_constrains_project_set, |
|
361 |
subset_refl RS reachable_project_imp_reachable], |
|
362 |
simpset() addsimps [Join_constrains]) 2); |
|
363 |
by (blast_tac (claset() addIs [constrains_weaken_L]) 1); |
|
7630 | 364 |
qed "project_Constrains_I"; |
365 |
||
366 |
Goalw [Stable_def] |
|
8128 | 367 |
"extend h F Join G : Stable (extend_set h A) \ |
368 |
\ ==> F Join project h (reachable (extend h F Join G)) G : Stable A"; |
|
7630 | 369 |
by (asm_simp_tac (simpset() addsimps [project_Constrains_I]) 1); |
370 |
qed "project_Stable_I"; |
|
371 |
||
7689 | 372 |
Goalw [Always_def] |
8128 | 373 |
"extend h F Join G : Always (extend_set h A) \ |
374 |
\ ==> F Join project h (reachable (extend h F Join G)) G : Always A"; |
|
7689 | 375 |
by (auto_tac (claset(), simpset() addsimps [project_Stable_I])); |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
376 |
by (rewtac extend_set_def); |
7689 | 377 |
by (Blast_tac 1); |
378 |
qed "project_Always_I"; |
|
379 |
||
7630 | 380 |
Goalw [Increasing_def] |
8128 | 381 |
"extend h F Join G : Increasing (func o f) \ |
382 |
\ ==> F Join project h (reachable (extend h F Join G)) G : Increasing func"; |
|
7630 | 383 |
by Auto_tac; |
384 |
by (asm_simp_tac (simpset() addsimps [Collect_eq_extend_set RS sym, |
|
385 |
project_Stable_I]) 1); |
|
386 |
qed "project_Increasing_I"; |
|
387 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
388 |
Goal "(F Join project h (reachable (extend h F Join G)) G : A Co B) = \ |
7630 | 389 |
\ (extend h F Join G : (extend_set h A) Co (extend_set h B))"; |
390 |
by (blast_tac (claset() addIs [project_Constrains_I, project_Constrains_D]) 1); |
|
391 |
qed "project_Constrains"; |
|
392 |
||
393 |
Goalw [Stable_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
394 |
"(F Join project h (reachable (extend h F Join G)) G : Stable A) = \ |
7630 | 395 |
\ (extend h F Join G : Stable (extend_set h A))"; |
396 |
by (rtac project_Constrains 1); |
|
397 |
qed "project_Stable"; |
|
398 |
||
399 |
Goal |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
400 |
"(F Join project h (reachable (extend h F Join G)) G : Increasing func) = \ |
7630 | 401 |
\ (extend h F Join G : Increasing (func o f))"; |
402 |
by (asm_simp_tac (simpset() addsimps [Increasing_def, project_Stable, |
|
403 |
Collect_eq_extend_set RS sym]) 1); |
|
404 |
qed "project_Increasing"; |
|
405 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
406 |
(** A lot of redundant theorems: all are proved to facilitate reasoning |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
407 |
about guarantees. **) |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
408 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
409 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
410 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
411 |
\ (extend_set h A Co extend_set h B) (A Co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
412 |
by (blast_tac (claset() addIs [project_Constrains_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
413 |
qed "projecting_Constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
414 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
415 |
Goalw [Stable_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
416 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
417 |
\ (Stable (extend_set h A)) (Stable A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
418 |
by (rtac projecting_Constrains 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
419 |
qed "projecting_Stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
420 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
421 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
422 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
423 |
\ (Always (extend_set h A)) (Always A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
424 |
by (blast_tac (claset() addIs [project_Always_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
425 |
qed "projecting_Always"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
426 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
427 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
428 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
429 |
\ (Increasing (func o f)) (Increasing func)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
430 |
by (blast_tac (claset() addIs [project_Increasing_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
431 |
qed "projecting_Increasing"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
432 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
433 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
434 |
"extending v (%G. reachable (extend h F Join G)) h F \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
435 |
\ (extend_set h A Co extend_set h B) (A Co B)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
436 |
by (blast_tac (claset() addIs [project_Constrains_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
437 |
qed "extending_Constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
438 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
439 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
440 |
"extending v (%G. reachable (extend h F Join G)) h F \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
441 |
\ (Stable (extend_set h A)) (Stable A)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
442 |
by (blast_tac (claset() addIs [project_Stable_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
443 |
qed "extending_Stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
444 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
445 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
446 |
"extending v (%G. reachable (extend h F Join G)) h F \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
447 |
\ (Always (extend_set h A)) (Always A)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
448 |
by (blast_tac (claset() addIs [project_Always_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
449 |
qed "extending_Always"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
450 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
451 |
Goalw [extending_def] |
8128 | 452 |
"extending v (%G. reachable (extend h F Join G)) h F \ |
453 |
\ (Increasing (func o f)) (Increasing func)"; |
|
454 |
by (blast_tac (claset() addIs [project_Increasing_D]) 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
455 |
qed "extending_Increasing"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
456 |
|
7630 | 457 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
458 |
(*** leadsETo in the precondition (??) ***) |
7630 | 459 |
|
460 |
(** transient **) |
|
461 |
||
462 |
Goalw [transient_def] |
|
8110 | 463 |
"[| G : transient (C Int extend_set h A); G : stable C |] \ |
464 |
\ ==> project h C G : transient (project_set h C Int A)"; |
|
465 |
by (auto_tac (claset(), simpset() addsimps [Domain_project_act])); |
|
466 |
by (subgoal_tac "act ^^ (C Int extend_set h A) <= - extend_set h A" 1); |
|
467 |
by (asm_full_simp_tac |
|
468 |
(simpset() addsimps [stable_def, constrains_def]) 2); |
|
469 |
by (Blast_tac 2); |
|
470 |
(*back to main goal*) |
|
471 |
by (thin_tac "?AA <= -C Un ?BB" 1); |
|
472 |
by (ball_tac 1); |
|
473 |
by (asm_full_simp_tac |
|
474 |
(simpset() addsimps [extend_set_def, project_act_def]) 1); |
|
475 |
by (Blast_tac 1); |
|
7630 | 476 |
qed "transient_extend_set_imp_project_transient"; |
477 |
||
8110 | 478 |
(*converse might hold too?*) |
479 |
Goalw [transient_def] |
|
480 |
"project h C (extend h F) : transient (project_set h C Int D) \ |
|
481 |
\ ==> F : transient (project_set h C Int D)"; |
|
482 |
by (auto_tac (claset(), simpset() addsimps [Domain_project_act])); |
|
483 |
by (rtac bexI 1); |
|
484 |
by (assume_tac 2); |
|
485 |
by Auto_tac; |
|
486 |
by (rewtac extend_act_def); |
|
487 |
by (Blast_tac 1); |
|
488 |
qed "project_extend_transient_D"; |
|
7630 | 489 |
|
8110 | 490 |
|
491 |
(** ensures -- a primitive combining progress with safety **) |
|
7630 | 492 |
|
8110 | 493 |
(*Used to prove project_leadsETo_I*) |
494 |
Goal "[| extend h F : stable C; G : stable C; \ |
|
495 |
\ extend h F Join G : A ensures B; A-B = C Int extend_set h D |] \ |
|
496 |
\ ==> F Join project h C G \ |
|
497 |
\ : (project_set h C Int project_set h A) ensures (project_set h B)"; |
|
7630 | 498 |
by (asm_full_simp_tac |
8110 | 499 |
(simpset() addsimps [ensures_def, Join_constrains, project_constrains, |
500 |
Join_transient, extend_transient]) 1); |
|
501 |
by (Clarify_tac 1); |
|
502 |
by (REPEAT_FIRST (rtac conjI)); |
|
503 |
(*first subgoal*) |
|
504 |
by (blast_tac (claset() addIs [extend_stable_project_set RS stableD RS |
|
505 |
constrains_Int RS constrains_weaken] |
|
506 |
addSDs [extend_constrains_project_set] |
|
507 |
addSDs [equalityD1]) 1); |
|
508 |
(*2nd subgoal*) |
|
509 |
by (etac (stableD RS constrains_Int RS constrains_weaken) 1); |
|
510 |
by (assume_tac 1); |
|
511 |
by (Blast_tac 3); |
|
512 |
by (full_simp_tac (simpset() addsimps [extend_set_Int_distrib, |
|
513 |
extend_set_Un_distrib]) 2); |
|
514 |
by (blast_tac (claset() addSIs [impOfSubs extend_set_project_set]) 2); |
|
515 |
by (full_simp_tac (simpset() addsimps [extend_set_def]) 1); |
|
516 |
by (blast_tac (claset() addSEs [equalityE]) 1); |
|
517 |
(*The transient part*) |
|
518 |
by Auto_tac; |
|
519 |
by (force_tac (claset() addSDs [equalityD1] |
|
520 |
addIs [transient_extend_set_imp_project_transient RS |
|
521 |
transient_strengthen], |
|
522 |
simpset()) 2); |
|
523 |
by (full_simp_tac (simpset() addsimps [Int_Diff]) 1); |
|
524 |
by (force_tac (claset() addSDs [equalityD1] |
|
525 |
addIs [transient_extend_set_imp_project_transient RS |
|
526 |
project_extend_transient_D RS transient_strengthen], |
|
527 |
simpset()) 1); |
|
7630 | 528 |
qed "ensures_extend_set_imp_project_ensures"; |
529 |
||
8110 | 530 |
(*Used to prove project_leadsETo_D*) |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
531 |
Goal "[| project h C G ~: transient (A-B) | A<=B; \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
532 |
\ extend h F Join G : stable C; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
533 |
\ F Join project h C G : A ensures B |] \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
534 |
\ ==> extend h F Join G : (C Int extend_set h A) ensures (extend_set h B)"; |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
535 |
by (etac disjE 1); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
536 |
by (blast_tac (claset() addIs [subset_imp_ensures]) 2); |
8002 | 537 |
by (auto_tac (claset() addDs [extend_transient RS iffD2] |
8041 | 538 |
addIs [transient_strengthen, project_set_I, |
8002 | 539 |
project_unless RS unlessD, unlessI, |
540 |
project_extend_constrains_I], |
|
541 |
simpset() addsimps [ensures_def, Join_constrains, |
|
542 |
Join_stable, Join_transient])); |
|
7630 | 543 |
qed_spec_mp "Join_project_ensures"; |
544 |
||
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
545 |
(** Lemma useful for both STRONG and WEAK progress, but the transient |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
546 |
condition's very strong **) |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
547 |
|
7947 | 548 |
(*The strange induction formula allows induction over the leadsTo |
549 |
assumption's non-atomic precondition*) |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
550 |
Goal "[| ALL D. project h C G : transient D --> D={}; \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
551 |
\ extend h F Join G : stable C; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
552 |
\ F Join project h C G : (project_set h C Int A) leadsTo B |] \ |
7947 | 553 |
\ ==> extend h F Join G : \ |
554 |
\ C Int extend_set h (project_set h C Int A) leadsTo (extend_set h B)"; |
|
7630 | 555 |
by (etac leadsTo_induct 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
556 |
by (asm_simp_tac (simpset() delsimps UN_simps |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
557 |
addsimps [Int_UN_distrib, leadsTo_UN, extend_set_Union]) 3); |
8041 | 558 |
by (blast_tac (claset() addIs [psp_stable2 RS leadsTo_weaken_L, |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
559 |
leadsTo_Trans]) 2); |
7630 | 560 |
by (blast_tac (claset() addIs [leadsTo_Basis, Join_project_ensures]) 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
561 |
val lemma = result(); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
562 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
563 |
Goal "[| ALL D. project h C G : transient D --> D={}; \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
564 |
\ extend h F Join G : stable C; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
565 |
\ F Join project h C G : (project_set h C Int A) leadsTo B |] \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
566 |
\ ==> extend h F Join G : (C Int extend_set h A) leadsTo (extend_set h B)"; |
7689 | 567 |
by (rtac (lemma RS leadsTo_weaken) 1); |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
568 |
by (auto_tac (claset(), simpset() addsimps [split_extended_all])); |
8110 | 569 |
qed "project_leadsTo_D_lemma"; |
7630 | 570 |
|
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
571 |
Goal "[| C = (reachable (extend h F Join G)); \ |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
572 |
\ ALL D. project h C G : transient D --> D={}; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
573 |
\ F Join project h C G : A LeadsTo B |] \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
574 |
\ ==> extend h F Join G : (extend_set h A) LeadsTo (extend_set h B)"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
575 |
by (asm_full_simp_tac |
8110 | 576 |
(simpset() addsimps [LeadsTo_def, project_leadsTo_D_lemma, |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
577 |
project_set_reachable_extend_eq]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
578 |
qed "Join_project_LeadsTo"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
579 |
|
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
580 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
581 |
(*** Towards project_Ensures_D ***) |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
582 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
583 |
|
7630 | 584 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
585 |
Goalw [project_set_def, extend_set_def, project_act_def] |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
586 |
"act ^^ (C Int extend_set h A) <= B \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
587 |
\ ==> project_act h (Restrict C act) ^^ (project_set h C Int A) \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
588 |
\ <= project_set h B"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
589 |
by (Blast_tac 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
590 |
qed "act_subset_imp_project_act_subset"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
591 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
592 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
593 |
Goal "[| G : stable ((C Int extend_set h A) - (extend_set h B)); \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
594 |
\ project h C G : transient (project_set h C Int A - B) |] \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
595 |
\ ==> G : transient (C Int extend_set h A - extend_set h B)"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
596 |
by (case_tac "C Int extend_set h A <= extend_set h B" 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
597 |
by (asm_simp_tac (simpset() addsimps [Diff_eq_empty_iff RS iffD2]) 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
598 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
599 |
simpset() addsimps [transient_def, subset_Compl_self_eq, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
600 |
Domain_project_act, split_extended_all])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
601 |
by (Blast_tac 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
602 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
603 |
simpset() addsimps [stable_def, constrains_def])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
604 |
by (ball_tac 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
605 |
by (thin_tac "ALL act: Acts G. ?P act" 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
606 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
607 |
simpset() addsimps [Int_Diff, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
608 |
extend_set_Diff_distrib RS sym])); |
8128 | 609 |
by (dtac act_subset_imp_project_act_subset 1); |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
610 |
by (subgoal_tac |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
611 |
"project_act h (Restrict C act) ^^ (project_set h C Int (A - B)) <= {}" 1); |
8128 | 612 |
by (rewrite_goals_tac [Restrict_def, project_set_def, extend_set_def, project_act_def]); |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
613 |
(*using Int_greatest actually slows the next step!*) |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
614 |
by (Blast_tac 2); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
615 |
by (force_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
616 |
simpset() addsimps [split_extended_all]) 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
617 |
qed "stable_project_transient"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
618 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
619 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
620 |
Goal "[| G : stable C; project h C G : (project_set h C Int A) unless B |] \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
621 |
\ ==> G : (C Int extend_set h A) unless (extend_set h B)"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
622 |
by (auto_tac |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
623 |
(claset() addDs [stable_constrains_Int] |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
624 |
addIs [constrains_weaken], |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
625 |
simpset() addsimps [unless_def, project_constrains, Diff_eq, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
626 |
Int_assoc, Int_extend_set_lemma])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
627 |
qed_spec_mp "project_unless2"; |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
628 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
629 |
Goal "[| G : stable ((C Int extend_set h A) - (extend_set h B)); \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
630 |
\ F Join project h C G : (project_set h C Int A) ensures B; \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
631 |
\ extend h F Join G : stable C |] \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
632 |
\ ==> extend h F Join G : (C Int extend_set h A) ensures (extend_set h B)"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
633 |
(*unless*) |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
634 |
by (auto_tac (claset() addSIs [rewrite_rule [unless_def] project_unless2] |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
635 |
addIs [project_extend_constrains_I], |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
636 |
simpset() addsimps [ensures_def, Join_constrains, |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
637 |
Join_stable])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
638 |
(*transient*) |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
639 |
by (auto_tac (claset(), simpset() addsimps [Join_transient])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
640 |
by (blast_tac (claset() addIs [stable_project_transient]) 2); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
641 |
by (force_tac (claset() addSEs [extend_transient RS iffD2 RS |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
642 |
transient_strengthen], |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
643 |
simpset() addsimps [Join_transient, split_extended_all]) 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
644 |
qed "project_ensures_D_lemma"; |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
645 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
646 |
Goal "[| F Join project h UNIV G : A ensures B; \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
647 |
\ G : stable (extend_set h A - extend_set h B) |] \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
648 |
\ ==> extend h F Join G : (extend_set h A) ensures (extend_set h B)"; |
8128 | 649 |
by (rtac (project_ensures_D_lemma RS revcut_rl) 1); |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
650 |
by (stac stable_UNIV 3); |
8128 | 651 |
by Auto_tac; |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
652 |
qed "project_ensures_D"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
653 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
654 |
Goalw [Ensures_def] |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
655 |
"[| F Join project h (reachable (extend h F Join G)) G : A Ensures B; \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
656 |
\ G : stable (reachable (extend h F Join G) Int extend_set h A - \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
657 |
\ extend_set h B) |] \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
658 |
\ ==> extend h F Join G : (extend_set h A) Ensures (extend_set h B)"; |
8128 | 659 |
by (rtac (project_ensures_D_lemma RS revcut_rl) 1); |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
660 |
by (auto_tac (claset(), |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
661 |
simpset() addsimps [project_set_reachable_extend_eq RS sym])); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
662 |
qed "project_Ensures_D"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
663 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
664 |
|
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
665 |
(*** GUARANTEES and EXTEND ***) |
8065
658e0d4e4ed9
first working version to Alloc/System_Client_Progress;
paulson
parents:
8055
diff
changeset
|
666 |
|
7630 | 667 |
(** Strong precondition and postcondition; doesn't seem very useful. **) |
668 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
669 |
Goal "F : X guarantees[v] Y ==> \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
670 |
\ extend h F : (extend h `` X) guarantees[v o f] (extend h `` Y)"; |
7630 | 671 |
by (rtac guaranteesI 1); |
672 |
by Auto_tac; |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
673 |
by (blast_tac (claset() addIs [project_preserves_I] |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
674 |
addDs [project_set_UNIV RS equalityD2 RS |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
675 |
extend_Join_eq_extend_D, |
7630 | 676 |
guaranteesD]) 1); |
677 |
qed "guarantees_imp_extend_guarantees"; |
|
678 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
679 |
Goal "extend h F : (extend h `` X) guarantees[v o f] (extend h `` Y) \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
680 |
\ ==> F : X guarantees[v] Y"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
681 |
by (auto_tac (claset(), simpset() addsimps [guar_def])); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
682 |
by (dres_inst_tac [("x", "extend h G")] spec 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
683 |
by (asm_full_simp_tac |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
684 |
(simpset() delsimps [extend_Join] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
685 |
addsimps [extend_Join RS sym, extend_preserves, |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
686 |
inj_extend RS inj_image_mem_iff]) 1); |
7630 | 687 |
qed "extend_guarantees_imp_guarantees"; |
688 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
689 |
Goal "(extend h F : (extend h `` X) guarantees[v o f] (extend h `` Y)) = \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
690 |
\ (F : X guarantees[v] Y)"; |
7630 | 691 |
by (blast_tac (claset() addIs [guarantees_imp_extend_guarantees, |
692 |
extend_guarantees_imp_guarantees]) 1); |
|
693 |
qed "extend_guarantees_eq"; |
|
694 |
||
695 |
||
696 |
(*Weak precondition and postcondition; this is the good one! |
|
697 |
Not clear that it has a converse [or that we want one!]*) |
|
7841 | 698 |
|
699 |
(*The raw version*) |
|
700 |
val [xguary,project,extend] = |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
701 |
Goal "[| F : X guarantees[v] Y; \ |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
702 |
\ !!G. extend h F Join G : X' ==> F Join project h (C G) G : X; \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
703 |
\ !!G. [| F Join project h (C G) G : Y; extend h F Join G : X'; \ |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
704 |
\ G : preserves (v o f) |] \ |
7841 | 705 |
\ ==> extend h F Join G : Y' |] \ |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
706 |
\ ==> extend h F : X' guarantees[v o f] Y'"; |
7841 | 707 |
by (rtac (xguary RS guaranteesD RS extend RS guaranteesI) 1); |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
708 |
by (etac project_preserves_I 1); |
7841 | 709 |
by (etac project 1); |
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8110
diff
changeset
|
710 |
by Auto_tac; |
8041 | 711 |
qed "project_guarantees_raw"; |
7841 | 712 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
713 |
Goal "[| F : X guarantees[v] Y; \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
714 |
\ projecting C h F X' X; extending w C h F Y' Y; \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
715 |
\ preserves w <= preserves (v o f) |] \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
716 |
\ ==> extend h F : X' guarantees[w] Y'"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
717 |
by (rtac guaranteesI 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
718 |
by (auto_tac (claset(), |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
719 |
simpset() addsimps [project_preserves_I, guaranteesD, projecting_def, |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
720 |
extending_def])); |
7630 | 721 |
qed "project_guarantees"; |
722 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
723 |
|
7841 | 724 |
(*It seems that neither "guarantees" law can be proved from the other.*) |
7630 | 725 |
|
726 |
||
727 |
(*** guarantees corollaries ***) |
|
728 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
729 |
(** Some could be deleted: the required versions are easy to prove **) |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
730 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
731 |
Goal "F : UNIV guarantees[v] increasing func \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
732 |
\ ==> extend h F : X' guarantees[v o f] increasing (func o f)"; |
7630 | 733 |
by (etac project_guarantees 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
734 |
by (rtac extending_increasing 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
735 |
by (rtac projecting_UNIV 1); |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
736 |
by Auto_tac; |
7630 | 737 |
qed "extend_guar_increasing"; |
738 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
739 |
Goal "F : UNIV guarantees[v] Increasing func \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
740 |
\ ==> extend h F : X' guarantees[v o f] Increasing (func o f)"; |
7630 | 741 |
by (etac project_guarantees 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
742 |
by (rtac extending_Increasing 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
743 |
by (rtac projecting_UNIV 1); |
7630 | 744 |
by Auto_tac; |
745 |
qed "extend_guar_Increasing"; |
|
746 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
747 |
Goal "F : Always A guarantees[v] Always B \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
748 |
\ ==> extend h F : Always(extend_set h A) guarantees[v o f] \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
749 |
\ Always(extend_set h B)"; |
7689 | 750 |
by (etac project_guarantees 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
751 |
by (rtac extending_Always 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
752 |
by (rtac projecting_Always 1); |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
753 |
by Auto_tac; |
7689 | 754 |
qed "extend_guar_Always"; |
755 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
756 |
Goal "[| G : preserves f; project h C G : transient D |] ==> D={}"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
757 |
by (rtac stable_transient_empty 1); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
758 |
by (assume_tac 2); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
759 |
by (blast_tac (claset() addIs [project_preserves_id_I, |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
760 |
impOfSubs preserves_id_subset_stable]) 1); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
761 |
qed "preserves_project_transient_empty"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
762 |
|
7630 | 763 |
|
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
764 |
(** Guarantees with a leadsTo postcondition |
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8065
diff
changeset
|
765 |
THESE ARE ALL TOO WEAK because G can't affect F's variables at all**) |
7630 | 766 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
767 |
Goal "[| F Join project h UNIV G : A leadsTo B; \ |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
768 |
\ G : preserves f |] \ |
7689 | 769 |
\ ==> extend h F Join G : (extend_set h A) leadsTo (extend_set h B)"; |
8110 | 770 |
by (res_inst_tac [("C1", "UNIV")] |
771 |
(project_leadsTo_D_lemma RS leadsTo_weaken) 1); |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
772 |
by (auto_tac (claset() addDs [preserves_project_transient_empty], |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
773 |
simpset())); |
7689 | 774 |
qed "project_leadsTo_D"; |
775 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
776 |
Goal "[| F Join project h (reachable (extend h F Join G)) G : A LeadsTo B; \ |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
777 |
\ G : preserves f |] \ |
7689 | 778 |
\ ==> extend h F Join G : (extend_set h A) LeadsTo (extend_set h B)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
779 |
by (rtac (refl RS Join_project_LeadsTo) 1); |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
780 |
by (auto_tac (claset() addDs [preserves_project_transient_empty], |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
781 |
simpset())); |
7689 | 782 |
qed "project_LeadsTo_D"; |
783 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
784 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
785 |
"extending f (%G. UNIV) h F \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
786 |
\ (extend_set h A leadsTo extend_set h B) (A leadsTo B)"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
787 |
by (blast_tac (claset() addIs [project_leadsTo_D]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
788 |
qed "extending_leadsTo"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
789 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
790 |
Goalw [extending_def] |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
791 |
"extending f (%G. reachable (extend h F Join G)) h F \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
792 |
\ (extend_set h A LeadsTo extend_set h B) (A LeadsTo B)"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
793 |
by (blast_tac (claset() addIs [project_LeadsTo_D]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
794 |
qed "extending_LeadsTo"; |
7689 | 795 |
|
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
796 |
(*STRONG precondition and postcondition*) |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
797 |
Goal "F : (A co A') guarantees[v] (B leadsTo B') \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
798 |
\ ==> extend h F : (extend_set h A co extend_set h A') \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
799 |
\ guarantees[f] (extend_set h B leadsTo extend_set h B')"; |
7630 | 800 |
by (etac project_guarantees 1); |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
801 |
by (rtac subset_preserves_o 3); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
802 |
by (rtac extending_leadsTo 2); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
803 |
by (rtac projecting_constrains 1); |
7630 | 804 |
qed "extend_co_guar_leadsTo"; |
805 |
||
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
806 |
(*WEAK precondition and postcondition*) |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
807 |
Goal "F : (A Co A') guarantees[v] (B LeadsTo B') \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
808 |
\ ==> extend h F : (extend_set h A Co extend_set h A') \ |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
809 |
\ guarantees[f] (extend_set h B LeadsTo extend_set h B')"; |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
810 |
by (etac project_guarantees 1); |
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
811 |
by (rtac subset_preserves_o 3); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
812 |
by (rtac extending_LeadsTo 2); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8041
diff
changeset
|
813 |
by (rtac projecting_Constrains 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
814 |
qed "extend_Co_guar_LeadsTo"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
815 |
|
7630 | 816 |
Close_locale "Extend"; |