author | wenzelm |
Sat, 30 Oct 1999 20:20:48 +0200 | |
changeset 7982 | d534b897ce39 |
parent 7947 | b999c1ab9327 |
child 8002 | fb83cbd469bb |
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 |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
15 |
Goal "D <= C ==> 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
|
16 |
by (auto_tac (claset(), simpset() addsimps [project_act_def])); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
17 |
qed "project_act_mono"; |
7630 | 18 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
19 |
Goal "[| D <= C; project h C F : A co B |] ==> project h D F : A co B"; |
7630 | 20 |
by (auto_tac (claset(), simpset() addsimps [constrains_def])); |
7689 | 21 |
by (dtac project_act_mono 1); |
7630 | 22 |
by (Blast_tac 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
23 |
qed "project_constrains_mono"; |
7630 | 24 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
25 |
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
|
26 |
by (asm_full_simp_tac |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
27 |
(simpset() addsimps [stable_def, project_constrains_mono]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
28 |
qed "project_stable_mono"; |
7630 | 29 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
30 |
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
|
31 |
by (auto_tac (claset(), |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
32 |
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
|
33 |
qed "project_extend_constrains_I"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
34 |
|
7630 | 35 |
Goal "UNIV <= project_set h C \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
36 |
\ ==> 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
|
37 |
by (rtac program_equalityI 1); |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
38 |
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
|
39 |
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
|
40 |
by (simp_tac (simpset() addsimps [project_set_extend_set_Int]) 1); |
7630 | 41 |
qed "project_extend_Join"; |
42 |
||
43 |
Goal "UNIV <= project_set h C \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
44 |
\ ==> (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
|
45 |
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
|
46 |
by (asm_full_simp_tac (simpset() addsimps [project_extend_Join]) 1); |
7630 | 47 |
qed "extend_Join_eq_extend_D"; |
48 |
||
49 |
||
50 |
(** Safety **) |
|
51 |
||
52 |
Goalw [constrains_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
53 |
"(project h C F : A co B) = \ |
7630 | 54 |
\ (F : (C Int extend_set h A) co (extend_set h B) & A <= B)"; |
55 |
by (auto_tac (claset() addSIs [project_act_I], simpset() addsimps [ball_Un])); |
|
56 |
by (force_tac (claset() addSIs [project_act_I] addSDs [subsetD], simpset()) 1); |
|
57 |
(*the <== direction*) |
|
58 |
by (rewtac project_act_def); |
|
59 |
by (force_tac (claset() addSDs [subsetD], simpset()) 1); |
|
60 |
qed "project_constrains"; |
|
61 |
||
62 |
Goalw [stable_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
63 |
"(project h UNIV F : stable A) = (F : stable (extend_set h A))"; |
7630 | 64 |
by (simp_tac (simpset() addsimps [project_constrains]) 1); |
65 |
qed "project_stable"; |
|
66 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
67 |
Goal "F : stable (extend_set h A) ==> project h C F : stable A"; |
7689 | 68 |
by (dtac (project_stable RS iffD2) 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
69 |
by (blast_tac (claset() addIs [project_stable_mono]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
70 |
qed "project_stable_I"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
71 |
|
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
72 |
(*used below to prove Join_project_ensures*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
73 |
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
|
74 |
\ ==> 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
|
75 |
by (asm_full_simp_tac |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
76 |
(simpset() addsimps [unless_def, project_constrains]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
77 |
by (blast_tac (claset() addDs [stable_constrains_Int] |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
78 |
addIs [constrains_weaken]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
79 |
qed_spec_mp "project_unless"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
80 |
|
7630 | 81 |
(*This form's useful with guarantees reasoning*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
82 |
Goal "(F Join project h C G : A co B) = \ |
7630 | 83 |
\ (extend h F Join G : (C Int extend_set h A) co (extend_set h B) & \ |
84 |
\ F : A co B)"; |
|
85 |
by (simp_tac (simpset() addsimps [Join_constrains, project_constrains]) 1); |
|
86 |
by (blast_tac (claset() addIs [extend_constrains RS iffD2 RS constrains_weaken] |
|
87 |
addDs [constrains_imp_subset]) 1); |
|
88 |
qed "Join_project_constrains"; |
|
89 |
||
90 |
(*The condition is required to prove the left-to-right direction; |
|
91 |
could weaken it to G : (C Int extend_set h A) co C*) |
|
92 |
Goalw [stable_def] |
|
93 |
"extend h F Join G : stable C \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
94 |
\ ==> (F Join project h C G : stable A) = \ |
7630 | 95 |
\ (extend h F Join G : stable (C Int extend_set h A) & \ |
96 |
\ F : stable A)"; |
|
97 |
by (simp_tac (simpset() addsimps [Join_project_constrains]) 1); |
|
98 |
by (blast_tac (claset() addIs [constrains_weaken] addDs [constrains_Int]) 1); |
|
99 |
qed "Join_project_stable"; |
|
100 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
101 |
Goal "(F Join project h UNIV G : increasing func) = \ |
7630 | 102 |
\ (extend h F Join G : increasing (func o f))"; |
103 |
by (simp_tac (simpset() addsimps [increasing_def, Join_project_stable]) 1); |
|
104 |
by (auto_tac (claset(), |
|
105 |
simpset() addsimps [Join_stable, Collect_eq_extend_set RS sym, |
|
106 |
extend_stable RS iffD1])); |
|
107 |
qed "Join_project_increasing"; |
|
108 |
||
7689 | 109 |
(*For using project_guarantees in particular cases*) |
110 |
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
|
111 |
\ ==> F Join project h C G : A co B"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
112 |
by (asm_full_simp_tac |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
113 |
(simpset() addsimps [project_constrains, Join_constrains, |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
114 |
extend_constrains]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
115 |
by (blast_tac (claset() addIs [constrains_weaken] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
116 |
addDs [constrains_imp_subset]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
117 |
qed "project_constrains_I"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
118 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
119 |
(*The UNIV argument is essential*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
120 |
Goal "F Join project h UNIV G : A co B \ |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
121 |
\ ==> extend h F Join G : extend_set h A co extend_set h B"; |
7689 | 122 |
by (asm_full_simp_tac |
123 |
(simpset() addsimps [project_constrains, Join_constrains, |
|
124 |
extend_constrains]) 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
125 |
qed "project_constrains_D"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
126 |
|
7841 | 127 |
(** "projecting" and union/intersection **) |
128 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
129 |
Goalw [projecting_def] |
7841 | 130 |
"[| projecting C h F XA' XA; projecting C h F XB' XB |] \ |
131 |
\ ==> projecting C h F (XA' Int XB') (XA Int XB)"; |
|
132 |
by (Blast_tac 1); |
|
133 |
qed "projecting_Int"; |
|
134 |
||
135 |
Goalw [projecting_def] |
|
136 |
"[| projecting C h F XA' XA; projecting C h F XB' XB |] \ |
|
137 |
\ ==> projecting C h F (XA' Un XB') (XA Un XB)"; |
|
138 |
by (Blast_tac 1); |
|
139 |
qed "projecting_Un"; |
|
140 |
||
141 |
val [prem] = Goalw [projecting_def] |
|
142 |
"[| !!i. i:I ==> projecting C h F (X' i) (X i) |] \ |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
143 |
\ ==> projecting C h F (INT i:I. X' i) (INT i:I. X i)"; |
7841 | 144 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
145 |
qed "projecting_INT"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
146 |
|
7841 | 147 |
val [prem] = Goalw [projecting_def] |
148 |
"[| !!i. i:I ==> projecting C h F (X' i) (X i) |] \ |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
149 |
\ ==> projecting C h F (UN i:I. X' i) (UN i:I. X i)"; |
7841 | 150 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
151 |
qed "projecting_UN"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
152 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
153 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
154 |
"[| 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
|
155 |
by Auto_tac; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
156 |
qed "projecting_weaken"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
157 |
|
7841 | 158 |
Goalw [extending_def] |
159 |
"[| extending C h F X' YA' YA; extending C h F X' YB' YB |] \ |
|
160 |
\ ==> extending C h F X' (YA' Int YB') (YA Int YB)"; |
|
161 |
by (Blast_tac 1); |
|
162 |
qed "extending_Int"; |
|
163 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
164 |
Goalw [extending_def] |
7841 | 165 |
"[| extending C h F X' YA' YA; extending C h F X' YB' YB |] \ |
166 |
\ ==> extending C h F X' (YA' Un YB') (YA Un YB)"; |
|
167 |
by (Blast_tac 1); |
|
168 |
qed "extending_Un"; |
|
169 |
||
170 |
(*This is the right way to handle the X' argument. Having (INT i:I. X' i) |
|
171 |
would strengthen the premise.*) |
|
172 |
val [prem] = Goalw [extending_def] |
|
173 |
"[| !!i. i:I ==> extending C h F X' (Y' i) (Y i) |] \ |
|
174 |
\ ==> extending C h F X' (INT i:I. Y' i) (INT i:I. Y i)"; |
|
175 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
176 |
qed "extending_INT"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
177 |
|
7841 | 178 |
val [prem] = Goalw [extending_def] |
179 |
"[| !!i. i:I ==> extending C h F X' (Y' i) (Y i) |] \ |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
180 |
\ ==> extending C h F X' (UN i:I. Y' i) (UN i:I. Y i)"; |
7841 | 181 |
by (blast_tac (claset() addDs [prem RS spec RS mp]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
182 |
qed "extending_UN"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
183 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
184 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
185 |
"[| extending C h F X' Y' Y; U'<= X'; Y'<=V'; V<=Y |] \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
186 |
\ ==> extending C h F U' V' V"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
187 |
by Auto_tac; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
188 |
qed "extending_weaken"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
189 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
190 |
Goal "projecting C h F X' UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
191 |
by (simp_tac (simpset() addsimps [projecting_def]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
192 |
qed "projecting_UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
193 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
194 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
195 |
"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
|
196 |
by (blast_tac (claset() addIs [project_constrains_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
197 |
qed "projecting_constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
198 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
199 |
Goalw [stable_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
200 |
"projecting C h F (stable (extend_set h A)) (stable A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
201 |
by (rtac projecting_constrains 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
202 |
qed "projecting_stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
203 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
204 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
205 |
"projecting (%G. UNIV) h F (increasing (func o f)) (increasing func)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
206 |
by (simp_tac (simpset() addsimps [Join_project_increasing]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
207 |
qed "projecting_increasing"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
208 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
209 |
Goal "extending C h F X' UNIV Y"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
210 |
by (simp_tac (simpset() addsimps [extending_def]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
211 |
qed "extending_UNIV"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
212 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
213 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
214 |
"extending (%G. UNIV) h F X' (extend_set h A co extend_set h B) (A co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
215 |
by (blast_tac (claset() addIs [project_constrains_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
216 |
qed "extending_constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
217 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
218 |
Goalw [stable_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
219 |
"extending (%G. UNIV) h F X' (stable (extend_set h A)) (stable A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
220 |
by (rtac extending_constrains 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
221 |
qed "extending_stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
222 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
223 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
224 |
"extending (%G. UNIV) h F X' (increasing (func o f)) (increasing func)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
225 |
by (simp_tac (simpset() addsimps [Join_project_increasing]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
226 |
qed "extending_increasing"; |
7689 | 227 |
|
7630 | 228 |
|
229 |
(*** Diff, needed for localTo ***) |
|
230 |
||
231 |
(*Opposite direction fails because Diff in the extended state may remove |
|
232 |
fewer actions, i.e. those that affect other state variables.*) |
|
7841 | 233 |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
234 |
Goalw [project_set_def, project_act_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
235 |
"Restrict (project_set h C) (project_act h (Restrict C act)) = \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
236 |
\ project_act h (Restrict C act)"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
237 |
by (Blast_tac 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
238 |
qed "Restrict_project_act"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
239 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
240 |
Goalw [project_set_def, project_act_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
241 |
"project_act h (Restrict C Id) = Restrict (project_set h C) Id"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
242 |
by (Blast_tac 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
243 |
qed "project_act_Restrict_Id"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
244 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
245 |
Goal |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
246 |
"Diff(project_set h C)(project h C G)(project_act h `` Restrict C `` acts) \ |
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
247 |
\ <= project h C (Diff C G acts)"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
248 |
by (simp_tac |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
249 |
(simpset() addsimps [component_eq_subset, Diff_def, |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
250 |
project_act_Restrict_Id, Restrict_image_Diff]) 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
251 |
by (force_tac (claset() delrules [equalityI], |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
252 |
simpset() addsimps [Restrict_project_act, image_eq_UN]) 1); |
7841 | 253 |
qed "Diff_project_project_component_project_Diff"; |
254 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
255 |
Goal "Diff (project_set h C) (project h C G) acts <= \ |
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
256 |
\ project h C (Diff C G (extend_act h `` acts))"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
257 |
by (rtac component_trans 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
258 |
by (rtac Diff_project_project_component_project_Diff 2); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
259 |
by (simp_tac |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
260 |
(simpset() addsimps [component_eq_subset, Diff_def, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
261 |
Restrict_project_act, project_act_Restrict_Id, |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
262 |
image_eq_UN, Restrict_image_Diff]) 1); |
7630 | 263 |
qed "Diff_project_component_project_Diff"; |
264 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
265 |
Goal "Diff C G (extend_act h `` acts) : (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
|
266 |
\ ==> Diff (project_set h C) (project h C G) acts : A co B"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
267 |
by (rtac (Diff_project_component_project_Diff RS component_constrains) 1); |
7630 | 268 |
by (rtac (project_constrains RS iffD2) 1); |
269 |
by (ftac constrains_imp_subset 1); |
|
270 |
by (blast_tac (claset() addIs [constrains_weaken]) 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
271 |
qed "Diff_project_constrains"; |
7630 | 272 |
|
273 |
Goalw [stable_def] |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
274 |
"Diff C G (extend_act h `` acts) : stable (extend_set h A) \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
275 |
\ ==> Diff (project_set h C) (project h C G) acts : stable A"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
276 |
by (etac Diff_project_constrains 1); |
7630 | 277 |
qed "Diff_project_stable"; |
278 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
279 |
(** Some results for Diff, extend and project_set **) |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
280 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
281 |
Goal "Diff C (extend h G) (extend_act h `` acts) \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
282 |
\ : (extend_set h A) co (extend_set h B) \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
283 |
\ ==> Diff (project_set h C) G acts : A co B"; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
284 |
by (rtac (Diff_project_set_component RS component_constrains) 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
285 |
by (ftac constrains_imp_subset 1); |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
286 |
by (asm_full_simp_tac |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
287 |
(simpset() addsimps [project_constrains, extend_set_strict_mono]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
288 |
by (blast_tac (claset() addIs [constrains_weaken]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
289 |
qed "Diff_project_set_constrains_I"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
290 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
291 |
Goalw [stable_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
292 |
"Diff C (extend h G) (extend_act h `` acts) : stable (extend_set h A) \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
293 |
\ ==> Diff (project_set h C) G acts : stable A"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
294 |
by (asm_simp_tac (simpset() addsimps [Diff_project_set_constrains_I]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
295 |
qed "Diff_project_set_stable_I"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
296 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
297 |
Goalw [LOCALTO_def] |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
298 |
"extend h F : (v o f) localTo[C] extend h H \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
299 |
\ ==> F : v localTo[project_set h C] H"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
300 |
by Auto_tac; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
301 |
by (rtac Diff_project_set_stable_I 1); |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
302 |
by (asm_simp_tac (simpset() addsimps [Collect_eq_extend_set RS sym]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
303 |
qed "localTo_project_set_I"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
304 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
305 |
(*Converse fails: even if the conclusion holds, H could modify (v o f) |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
306 |
simultaneously with other variables, and this action would not be |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
307 |
superseded by anything in (extend h G) *) |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
308 |
Goal "H : (v o f) localTo[C] extend h G \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
309 |
\ ==> project h C H : v localTo[project_set h C] G"; |
7630 | 310 |
by (asm_full_simp_tac |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
311 |
(simpset() addsimps [LOCALTO_def, |
7630 | 312 |
project_extend_Join RS sym, |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
313 |
Diff_project_stable, |
7630 | 314 |
Collect_eq_extend_set RS sym]) 1); |
7689 | 315 |
qed "project_localTo_lemma"; |
316 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
317 |
Goal "extend h F Join G : (v o f) localTo[C] extend h H \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
318 |
\ ==> F Join project h C G : v localTo[project_set h C] H"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
319 |
by (asm_full_simp_tac |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
320 |
(simpset() addsimps [Join_localTo, localTo_project_set_I, |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
321 |
project_localTo_lemma]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
322 |
qed "gen_project_localTo_I"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
323 |
|
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
324 |
Goal "extend h F Join G : (v o f) localTo[UNIV] extend h H \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
325 |
\ ==> F Join project h UNIV G : v localTo[UNIV] H"; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
326 |
by (dtac gen_project_localTo_I 1); |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
327 |
by (Asm_full_simp_tac 1); |
7630 | 328 |
qed "project_localTo_I"; |
329 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
330 |
Goalw [projecting_def] |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
331 |
"projecting (%G. UNIV) h F \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
332 |
\ ((v o f) localTo[UNIV] extend h H) (v localTo[UNIV] H)"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
333 |
by (blast_tac (claset() addIs [project_localTo_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
334 |
qed "projecting_localTo"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
335 |
|
7630 | 336 |
|
337 |
(** Reachability and project **) |
|
338 |
||
339 |
Goal "[| reachable (extend h F Join G) <= C; \ |
|
340 |
\ z : reachable (extend h F Join G) |] \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
341 |
\ ==> f z : reachable (F Join project h C G)"; |
7630 | 342 |
by (etac reachable.induct 1); |
343 |
by (force_tac (claset() addIs [reachable.Init, project_set_I], |
|
344 |
simpset()) 1); |
|
345 |
by Auto_tac; |
|
346 |
by (force_tac (claset() addIs [project_act_I RSN (3,reachable.Acts)], |
|
347 |
simpset()) 2); |
|
348 |
by (res_inst_tac [("act","x")] reachable.Acts 1); |
|
349 |
by Auto_tac; |
|
350 |
by (etac extend_act_D 1); |
|
351 |
qed "reachable_imp_reachable_project"; |
|
352 |
||
7689 | 353 |
(*The extra generality in the first premise allows guarantees with STRONG |
354 |
preconditions (localTo) and WEAK postconditions.*) |
|
7630 | 355 |
Goalw [Constrains_def] |
356 |
"[| reachable (extend h F Join G) <= C; \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
357 |
\ F Join project h C G : A Co B |] \ |
7630 | 358 |
\ ==> extend h F Join G : (extend_set h A) Co (extend_set h B)"; |
359 |
by (full_simp_tac (simpset() addsimps [Join_project_constrains]) 1); |
|
360 |
by (Clarify_tac 1); |
|
361 |
by (etac constrains_weaken 1); |
|
362 |
by (auto_tac (claset() addDs [reachable_imp_reachable_project], simpset())); |
|
363 |
qed "project_Constrains_D"; |
|
364 |
||
365 |
Goalw [Stable_def] |
|
366 |
"[| reachable (extend h F Join G) <= C; \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
367 |
\ F Join project h C G : Stable A |] \ |
7630 | 368 |
\ ==> extend h F Join G : Stable (extend_set h A)"; |
369 |
by (asm_simp_tac (simpset() addsimps [project_Constrains_D]) 1); |
|
370 |
qed "project_Stable_D"; |
|
371 |
||
372 |
Goalw [Always_def] |
|
373 |
"[| reachable (extend h F Join G) <= C; \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
374 |
\ F Join project h C G : Always A |] \ |
7630 | 375 |
\ ==> extend h F Join G : Always (extend_set h A)"; |
376 |
by (force_tac (claset() addIs [reachable.Init, project_set_I], |
|
7689 | 377 |
simpset() addsimps [project_Stable_D]) 1); |
7630 | 378 |
qed "project_Always_D"; |
379 |
||
380 |
Goalw [Increasing_def] |
|
381 |
"[| reachable (extend h F Join G) <= C; \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
382 |
\ F Join project h C G : Increasing func |] \ |
7630 | 383 |
\ ==> extend h F Join G : Increasing (func o f)"; |
384 |
by Auto_tac; |
|
385 |
by (stac Collect_eq_extend_set 1); |
|
386 |
by (asm_simp_tac (simpset() addsimps [project_Stable_D]) 1); |
|
387 |
qed "project_Increasing_D"; |
|
388 |
||
389 |
||
390 |
(** Converse results for weak safety: benefits of the argument C *) |
|
391 |
||
392 |
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
|
393 |
\ x : reachable (F Join project h C G) |] \ |
7630 | 394 |
\ ==> EX y. h(x,y) : reachable (extend h F Join G)"; |
395 |
by (etac reachable.induct 1); |
|
396 |
by (ALLGOALS Asm_full_simp_tac); |
|
397 |
(*SLOW: 6.7s*) |
|
398 |
by (force_tac (claset() delrules [Id_in_Acts] |
|
399 |
addIs [reachable.Acts, extend_act_D], |
|
400 |
simpset() addsimps [project_act_def]) 2); |
|
401 |
by (force_tac (claset() addIs [reachable.Init], |
|
402 |
simpset() addsimps [project_set_def]) 1); |
|
403 |
qed "reachable_project_imp_reachable"; |
|
404 |
||
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
405 |
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
|
406 |
\ 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
|
407 |
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
|
408 |
subset_refl RS reachable_project_imp_reachable], |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
409 |
simpset() addsimps [project_set_def])); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
410 |
qed "project_set_reachable_extend_eq"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
411 |
|
7947 | 412 |
Goal "reachable (extend h F Join G) <= C \ |
413 |
\ ==> reachable (extend h F Join G) <= \ |
|
414 |
\ extend_set h (reachable (F Join project h C G))"; |
|
415 |
by (auto_tac (claset() addDs [reachable_imp_reachable_project], |
|
416 |
simpset())); |
|
417 |
qed "reachable_extend_Join_subset"; |
|
418 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
419 |
(*Perhaps should replace C by reachable...*) |
7630 | 420 |
Goalw [Constrains_def] |
421 |
"[| C <= reachable (extend h F Join G); \ |
|
422 |
\ 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
|
423 |
\ ==> F Join project h C G : A Co B"; |
7630 | 424 |
by (full_simp_tac (simpset() addsimps [Join_project_constrains, |
425 |
extend_set_Int_distrib]) 1); |
|
426 |
by (rtac conjI 1); |
|
427 |
by (etac constrains_weaken 1); |
|
428 |
by Auto_tac; |
|
429 |
by (asm_full_simp_tac (simpset() addsimps [Join_constrains]) 1); |
|
430 |
(*Some generalization of constrains_weaken_L would be better, but what is it?*) |
|
431 |
by (rewtac constrains_def); |
|
432 |
by Auto_tac; |
|
433 |
by (thin_tac "ALL act : Acts G. ?P act" 1); |
|
434 |
by (force_tac (claset() addSDs [reachable_project_imp_reachable], |
|
435 |
simpset()) 1); |
|
436 |
qed "project_Constrains_I"; |
|
437 |
||
438 |
Goalw [Stable_def] |
|
439 |
"[| C <= reachable (extend h F Join G); \ |
|
440 |
\ extend h F Join G : Stable (extend_set h A) |] \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
441 |
\ ==> F Join project h C G : Stable A"; |
7630 | 442 |
by (asm_simp_tac (simpset() addsimps [project_Constrains_I]) 1); |
443 |
qed "project_Stable_I"; |
|
444 |
||
7689 | 445 |
Goalw [Always_def] |
446 |
"[| C <= reachable (extend h F Join G); \ |
|
447 |
\ extend h F Join G : Always (extend_set h A) |] \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
448 |
\ ==> F Join project h C G : Always A"; |
7689 | 449 |
by (auto_tac (claset(), simpset() addsimps [project_Stable_I])); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
450 |
by (rewrite_goals_tac [project_set_def, extend_set_def]); |
7689 | 451 |
by (Blast_tac 1); |
452 |
qed "project_Always_I"; |
|
453 |
||
7630 | 454 |
Goalw [Increasing_def] |
455 |
"[| C <= reachable (extend h F Join G); \ |
|
456 |
\ extend h F Join G : Increasing (func o f) |] \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
457 |
\ ==> F Join project h C G : Increasing func"; |
7630 | 458 |
by Auto_tac; |
459 |
by (asm_simp_tac (simpset() addsimps [Collect_eq_extend_set RS sym, |
|
460 |
project_Stable_I]) 1); |
|
461 |
qed "project_Increasing_I"; |
|
462 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
463 |
Goal "(F Join project h (reachable (extend h F Join G)) G : A Co B) = \ |
7630 | 464 |
\ (extend h F Join G : (extend_set h A) Co (extend_set h B))"; |
465 |
by (blast_tac (claset() addIs [project_Constrains_I, project_Constrains_D]) 1); |
|
466 |
qed "project_Constrains"; |
|
467 |
||
468 |
Goalw [Stable_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
469 |
"(F Join project h (reachable (extend h F Join G)) G : Stable A) = \ |
7630 | 470 |
\ (extend h F Join G : Stable (extend_set h A))"; |
471 |
by (rtac project_Constrains 1); |
|
472 |
qed "project_Stable"; |
|
473 |
||
474 |
Goal |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
475 |
"(F Join project h (reachable (extend h F Join G)) G : Increasing func) = \ |
7630 | 476 |
\ (extend h F Join G : Increasing (func o f))"; |
477 |
by (asm_simp_tac (simpset() addsimps [Increasing_def, project_Stable, |
|
478 |
Collect_eq_extend_set RS sym]) 1); |
|
479 |
qed "project_Increasing"; |
|
480 |
||
7947 | 481 |
Goal "[| H <= F; extend h F Join G : (v o f) LocalTo extend h H |] \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
482 |
\ ==> F Join project h (reachable (extend h F Join G)) G : v LocalTo H"; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
483 |
by (asm_full_simp_tac |
7947 | 484 |
(simpset() delsimps [extend_Join] |
485 |
addsimps [LocalTo_def, project_set_reachable_extend_eq RS sym, |
|
486 |
gen_project_localTo_I, extend_Join RS sym, |
|
487 |
Join_assoc RS sym, Join_absorb1]) 1); |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
488 |
qed "project_LocalTo_I"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
489 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
490 |
(** A lot of redundant theorems: all are proved to facilitate reasoning |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
491 |
about guarantees. **) |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
492 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
493 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
494 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
495 |
\ (extend_set h A Co extend_set h B) (A Co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
496 |
by (blast_tac (claset() addIs [project_Constrains_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
497 |
qed "projecting_Constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
498 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
499 |
Goalw [Stable_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
500 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
501 |
\ (Stable (extend_set h A)) (Stable A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
502 |
by (rtac projecting_Constrains 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
503 |
qed "projecting_Stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
504 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
505 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
506 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
507 |
\ (Always (extend_set h A)) (Always A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
508 |
by (blast_tac (claset() addIs [project_Always_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
509 |
qed "projecting_Always"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
510 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
511 |
Goalw [projecting_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
512 |
"projecting (%G. reachable (extend h F Join G)) h F \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
513 |
\ (Increasing (func o f)) (Increasing func)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
514 |
by (blast_tac (claset() addIs [project_Increasing_I]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
515 |
qed "projecting_Increasing"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
516 |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
517 |
Goalw [projecting_def] |
7947 | 518 |
"H <= F ==> projecting (%G. reachable (extend h F Join G)) h F \ |
519 |
\ ((v o f) LocalTo extend h H) (v LocalTo H)"; |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
520 |
by (blast_tac (claset() addIs [project_LocalTo_I]) 1); |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
521 |
qed "projecting_LocalTo"; |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
522 |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
523 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
524 |
"extending (%G. reachable (extend h F Join G)) h F X' \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
525 |
\ (extend_set h A Co extend_set h B) (A Co B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
526 |
by (blast_tac (claset() addIs [project_Constrains_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
527 |
qed "extending_Constrains"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
528 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
529 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
530 |
"extending (%G. reachable (extend h F Join G)) h F X' \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
531 |
\ (Stable (extend_set h A)) (Stable A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
532 |
by (blast_tac (claset() addIs [project_Stable_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
533 |
qed "extending_Stable"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
534 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
535 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
536 |
"extending (%G. reachable (extend h F Join G)) h F X' \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
537 |
\ (Always (extend_set h A)) (Always A)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
538 |
by (blast_tac (claset() addIs [project_Always_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
539 |
qed "extending_Always"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
540 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
541 |
val [prem] = |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
542 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
543 |
"(!!G. reachable (extend h F Join G) <= C G) \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
544 |
\ ==> extending C h F X' \ |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
545 |
\ (Increasing (func o f)) (Increasing func)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
546 |
by (blast_tac (claset() addIs [prem RS project_Increasing_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
547 |
qed "extending_Increasing"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
548 |
|
7630 | 549 |
|
550 |
(** Progress includes safety in the definition of ensures **) |
|
551 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
552 |
(*** Progress for (project h C F) ***) |
7630 | 553 |
|
554 |
(** transient **) |
|
555 |
||
556 |
(*Premise is that C includes the domains of all actions that could be the |
|
557 |
transient one. Could have C=UNIV of course*) |
|
558 |
Goalw [transient_def] |
|
559 |
"[| ALL act: Acts F. act ^^ extend_set h A <= - extend_set h A --> \ |
|
560 |
\ Domain act <= C; \ |
|
561 |
\ F : transient (extend_set h A) |] \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
562 |
\ ==> project h C F : transient A"; |
7630 | 563 |
by (auto_tac (claset() delrules [ballE], |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
564 |
simpset() addsimps [Domain_project_act, Int_absorb1])); |
7630 | 565 |
by (REPEAT (ball_tac 1)); |
566 |
by (auto_tac (claset(), |
|
567 |
simpset() addsimps [extend_set_def, project_set_def, |
|
568 |
project_act_def])); |
|
569 |
by (ALLGOALS Blast_tac); |
|
570 |
qed "transient_extend_set_imp_project_transient"; |
|
571 |
||
572 |
||
573 |
(*UNUSED. WHY?? |
|
574 |
Converse of the above...it requires a strong assumption about actions |
|
575 |
being enabled for all possible values of the new variables.*) |
|
576 |
Goalw [transient_def] |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
577 |
"[| project h C F : transient A; \ |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
578 |
\ ALL act: Acts F. project_act h (Restrict C act) ^^ A <= - A --> \ |
7630 | 579 |
\ Domain act <= C \ |
580 |
\ & extend_set h (project_set h (Domain act)) <= Domain act |] \ |
|
581 |
\ ==> F : transient (extend_set h A)"; |
|
582 |
by (auto_tac (claset() delrules [ballE], |
|
583 |
simpset() addsimps [Domain_project_act])); |
|
584 |
by (ball_tac 1); |
|
585 |
by (rtac bexI 1); |
|
586 |
by (assume_tac 2); |
|
587 |
by Auto_tac; |
|
588 |
by (eres_inst_tac [("P", "A <= ?B")] rev_mp 1); |
|
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
589 |
by (force_tac (claset(), simpset() addsimps [Int_absorb1]) 1); |
7630 | 590 |
(*The Domain requirement's proved; must prove the Image requirement*) |
591 |
by (res_inst_tac [("y1", "x")] (surj_h RS surjD RS exE) 1); |
|
592 |
by (res_inst_tac [("y1", "xa")] (surj_h RS surjD RS exE) 1); |
|
593 |
by Auto_tac; |
|
594 |
by (thin_tac "A <= ?B" 1); |
|
595 |
by (force_tac (claset() addSIs [ImageI, project_act_I], simpset()) 1); |
|
596 |
qed "project_transient_imp_transient_extend_set"; |
|
597 |
||
598 |
||
599 |
(** ensures **) |
|
600 |
||
601 |
(*For simplicity, the complicated condition on C is eliminated |
|
602 |
NOT SURE THIS IS GOOD FOR ANYTHING: CAN'T PROVE LEADSTO THEOREM*) |
|
603 |
Goal "F : (extend_set h A) ensures (extend_set h B) \ |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
604 |
\ ==> project h UNIV F : A ensures B"; |
7630 | 605 |
by (asm_full_simp_tac |
606 |
(simpset() addsimps [ensures_def, project_constrains, |
|
607 |
transient_extend_set_imp_project_transient, |
|
608 |
extend_set_Un_distrib RS sym, |
|
609 |
extend_set_Diff_distrib RS sym]) 1); |
|
610 |
by (Blast_tac 1); |
|
611 |
qed "ensures_extend_set_imp_project_ensures"; |
|
612 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
613 |
(*A strong condition: F can do anything that project G can.*) |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
614 |
Goal "[| ALL D. project h C G : transient D --> F : transient D; \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
615 |
\ extend h F Join G : stable C; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
616 |
\ 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
|
617 |
\ ==> extend h F Join G : (C Int extend_set h A) ensures (extend_set h B)"; |
7630 | 618 |
by (case_tac "A <= B" 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
619 |
by (blast_tac (claset() addIs [subset_imp_ensures] addDs [extend_set_mono]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
620 |
by (full_simp_tac (simpset() addsimps [ensures_def, Join_constrains, |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
621 |
Join_stable, Join_transient]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
622 |
by (REPEAT_FIRST (rtac conjI)); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
623 |
by (blast_tac (claset() addDs [extend_transient RS iffD2] |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
624 |
addIs [transient_strengthen]) 3); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
625 |
by (REPEAT (force_tac (claset() addIs [project_unless RS unlessD, unlessI, |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
626 |
project_extend_constrains_I], |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
627 |
simpset()) 1)); |
7630 | 628 |
qed_spec_mp "Join_project_ensures"; |
629 |
||
7947 | 630 |
(** Lemma useful for both STRONG and WEAK progress*) |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
631 |
|
7947 | 632 |
(*The strange induction formula allows induction over the leadsTo |
633 |
assumption's non-atomic precondition*) |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
634 |
Goal "[| ALL D. project h C G : transient D --> F : transient D; \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
635 |
\ extend h F Join G : stable C; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
636 |
\ F Join project h C G : (project_set h C Int A) leadsTo B |] \ |
7947 | 637 |
\ ==> extend h F Join G : \ |
638 |
\ C Int extend_set h (project_set h C Int A) leadsTo (extend_set h B)"; |
|
7630 | 639 |
by (etac leadsTo_induct 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
640 |
by (asm_simp_tac (simpset() delsimps UN_simps |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
641 |
addsimps [Int_UN_distrib, leadsTo_UN, extend_set_Union]) 3); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
642 |
by (blast_tac (claset() addIs [psp_stable RS leadsTo_weaken, |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
643 |
leadsTo_Trans]) 2); |
7630 | 644 |
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
|
645 |
val lemma = result(); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
646 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
647 |
Goal "[| ALL D. project h C G : transient D --> F : transient D; \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
648 |
\ extend h F Join G : stable C; \ |
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
649 |
\ 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
|
650 |
\ ==> extend h F Join G : (C Int extend_set h A) leadsTo (extend_set h B)"; |
7689 | 651 |
by (rtac (lemma RS leadsTo_weaken) 1); |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
652 |
by (auto_tac (claset() addIs [project_set_I], simpset())); |
7947 | 653 |
qed "project_leadsTo_lemma"; |
7630 | 654 |
|
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
655 |
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
|
656 |
\ ALL D. project h C G : transient D --> F : transient D; \ |
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
657 |
\ 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
|
658 |
\ ==> 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
|
659 |
by (asm_full_simp_tac |
7947 | 660 |
(simpset() addsimps [LeadsTo_def, project_leadsTo_lemma, stable_reachable, |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
661 |
project_set_reachable_extend_eq]) 1); |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
662 |
qed "Join_project_LeadsTo"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
663 |
|
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
664 |
|
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
665 |
(*** GUARANTEES and EXTEND ***) |
7630 | 666 |
|
667 |
(** Strong precondition and postcondition; doesn't seem very useful. **) |
|
668 |
||
669 |
Goal "F : X guarantees Y ==> \ |
|
670 |
\ extend h F : (extend h `` X) guarantees (extend h `` Y)"; |
|
671 |
by (rtac guaranteesI 1); |
|
672 |
by Auto_tac; |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
673 |
by (blast_tac (claset() addDs [project_set_UNIV RS equalityD2 RS |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
674 |
extend_Join_eq_extend_D, |
7630 | 675 |
guaranteesD]) 1); |
676 |
qed "guarantees_imp_extend_guarantees"; |
|
677 |
||
678 |
Goal "extend h F : (extend h `` X) guarantees (extend h `` Y) \ |
|
679 |
\ ==> F : X guarantees Y"; |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
680 |
by (auto_tac (claset(), simpset() addsimps [guarantees_eq])); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
681 |
by (dres_inst_tac [("x", "extend h G")] spec 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
682 |
by (asm_full_simp_tac |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
683 |
(simpset() delsimps [extend_Join] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
684 |
addsimps [extend_Join RS sym, inj_extend RS inj_image_mem_iff]) 1); |
7630 | 685 |
qed "extend_guarantees_imp_guarantees"; |
686 |
||
687 |
Goal "(extend h F : (extend h `` X) guarantees (extend h `` Y)) = \ |
|
688 |
\ (F : X guarantees Y)"; |
|
689 |
by (blast_tac (claset() addIs [guarantees_imp_extend_guarantees, |
|
690 |
extend_guarantees_imp_guarantees]) 1); |
|
691 |
qed "extend_guarantees_eq"; |
|
692 |
||
693 |
||
694 |
(*Weak precondition and postcondition; this is the good one! |
|
695 |
Not clear that it has a converse [or that we want one!]*) |
|
7841 | 696 |
|
697 |
(*The raw version*) |
|
698 |
val [xguary,project,extend] = |
|
699 |
Goal "[| F : X guarantees Y; \ |
|
700 |
\ !!G. extend h F Join G : X' ==> F Join proj G h G : X; \ |
|
7947 | 701 |
\ !!G. [| F Join proj G h G : Y; extend h F Join G : X' |] \ |
7841 | 702 |
\ ==> extend h F Join G : Y' |] \ |
703 |
\ ==> extend h F : X' guarantees Y'"; |
|
704 |
by (rtac (xguary RS guaranteesD RS extend RS guaranteesI) 1); |
|
705 |
by (etac project 1); |
|
706 |
by (assume_tac 1); |
|
707 |
qed "project_guarantees_lemma"; |
|
708 |
||
7630 | 709 |
Goal "[| F : X guarantees Y; \ |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
710 |
\ projecting C h F X' X; extending C h F X' Y' Y |] \ |
7630 | 711 |
\ ==> extend h F : X' guarantees Y'"; |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
712 |
by (rtac guaranteesI 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
713 |
by (auto_tac (claset(), |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
714 |
simpset() addsimps [guaranteesD, projecting_def, extending_def])); |
7630 | 715 |
qed "project_guarantees"; |
716 |
||
7841 | 717 |
(*It seems that neither "guarantees" law can be proved from the other.*) |
7630 | 718 |
|
719 |
||
720 |
(*** guarantees corollaries ***) |
|
721 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
722 |
(** Most could be deleted: the required versions are easy to prove **) |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
723 |
|
7630 | 724 |
Goal "F : UNIV guarantees increasing func \ |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
725 |
\ ==> extend h F : X' guarantees increasing (func o f)"; |
7630 | 726 |
by (etac project_guarantees 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
727 |
by (rtac extending_increasing 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
728 |
by (rtac projecting_UNIV 1); |
7630 | 729 |
qed "extend_guar_increasing"; |
730 |
||
731 |
Goal "F : UNIV guarantees Increasing func \ |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
732 |
\ ==> extend h F : X' guarantees 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); |
7630 | 736 |
by Auto_tac; |
737 |
qed "extend_guar_Increasing"; |
|
738 |
||
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
739 |
Goal "F : (v localTo[UNIV] G) guarantees increasing func \ |
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
740 |
\ ==> extend h F : (v o f) localTo[UNIV] (extend h G) \ |
7630 | 741 |
\ guarantees increasing (func o f)"; |
742 |
by (etac project_guarantees 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
743 |
by (rtac extending_increasing 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
744 |
by (rtac projecting_localTo 1); |
7630 | 745 |
qed "extend_localTo_guar_increasing"; |
746 |
||
7947 | 747 |
Goal "[| F : (v LocalTo H) guarantees Increasing func; H <= F |] \ |
748 |
\ ==> extend h F : (v o f) LocalTo (extend h H) \ |
|
7630 | 749 |
\ guarantees Increasing (func o f)"; |
750 |
by (etac project_guarantees 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
751 |
by (rtac extending_Increasing 2); |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
752 |
by (rtac projecting_LocalTo 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
753 |
by Auto_tac; |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
754 |
qed "extend_LocalTo_guar_Increasing"; |
7630 | 755 |
|
7689 | 756 |
Goal "F : Always A guarantees Always B \ |
757 |
\ ==> extend h F : Always(extend_set h A) guarantees Always(extend_set h B)"; |
|
758 |
by (etac project_guarantees 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
759 |
by (rtac extending_Always 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
760 |
by (rtac projecting_Always 1); |
7689 | 761 |
qed "extend_guar_Always"; |
762 |
||
7630 | 763 |
|
764 |
(** Guarantees with a leadsTo postcondition **) |
|
765 |
||
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
766 |
Goalw [LOCALTO_def, transient_def, Diff_def] |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
767 |
"[| G : f localTo[C] extend h F; project h C G : transient D |] \ |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
768 |
\ ==> F : transient D"; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
769 |
by Auto_tac; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
770 |
by (case_tac "Restrict C act : Restrict C ``extend_act h `` Acts F" 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
771 |
by Auto_tac; |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
772 |
by (rtac bexI 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
773 |
by (assume_tac 2); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
774 |
by (Blast_tac 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
775 |
by (case_tac "D={}" 1); |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
776 |
by (Blast_tac 1); |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
777 |
by (auto_tac (claset(), |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
778 |
simpset() addsimps [stable_def, constrains_def])); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
779 |
by (subgoal_tac "ALL z. Restrict C act ^^ {s. f s = z} <= {s. f s = z}" 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
780 |
by (blast_tac (claset() addSDs [bspec]) 2); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
781 |
by (thin_tac "ALL z. ?P z" 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
782 |
by (subgoal_tac "project_act h (Restrict C act) ^^ D <= D" 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
783 |
by (Clarify_tac 2); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
784 |
by (asm_full_simp_tac (simpset() addsimps [project_act_def]) 2); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
785 |
by (force_tac (claset() addSDs [spec, ImageI RSN (2, subsetD)], simpset()) 2); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
786 |
by (blast_tac (claset() addSDs [subsetD]) 1); |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
787 |
qed "localTo_project_transient_transient"; |
7630 | 788 |
|
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
789 |
Goal "[| F Join project h UNIV G : A leadsTo B; \ |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
790 |
\ G : f localTo[UNIV] extend h F |] \ |
7689 | 791 |
\ ==> extend h F Join G : (extend_set h A) leadsTo (extend_set h B)"; |
7947 | 792 |
by (res_inst_tac [("C1", "UNIV")] (project_leadsTo_lemma RS leadsTo_weaken) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
793 |
by (auto_tac (claset(), |
7947 | 794 |
simpset() addsimps [localTo_UNIV_imp_localTo RS |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
795 |
localTo_project_transient_transient])); |
7689 | 796 |
qed "project_leadsTo_D"; |
797 |
||
7880
62fb24e28e5e
exchanged the first two args of "project" and "drop_prog"
paulson
parents:
7878
diff
changeset
|
798 |
Goal "[| F Join project h (reachable (extend h F Join G)) G : A LeadsTo B; \ |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
799 |
\ G : f LocalTo extend h F |] \ |
7689 | 800 |
\ ==> 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
|
801 |
by (rtac (refl RS Join_project_LeadsTo) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
802 |
by (auto_tac (claset(), |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
803 |
simpset() addsimps [LocalTo_def, |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
804 |
localTo_project_transient_transient])); |
7689 | 805 |
qed "project_LeadsTo_D"; |
806 |
||
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
807 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
808 |
"extending (%G. UNIV) h F \ |
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
809 |
\ (f localTo[UNIV] extend h F) \ |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
810 |
\ (extend_set h A leadsTo extend_set h B) (A leadsTo B)"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
811 |
by (blast_tac (claset() addSDs [Join_localTo RS iffD1] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
812 |
addIs [project_leadsTo_D]) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
813 |
qed "extending_leadsTo"; |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
814 |
|
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
815 |
Goalw [extending_def] |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
816 |
"extending (%G. reachable (extend h F Join G)) h F \ |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
817 |
\ (f LocalTo extend h F) \ |
7841 | 818 |
\ (extend_set h A LeadsTo extend_set h B) (A LeadsTo B)"; |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
819 |
by (force_tac (claset() addIs [project_LeadsTo_D], |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
820 |
simpset()addsimps [LocalTo_def, Join_assoc RS sym, |
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
821 |
Join_localTo]) 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
822 |
qed "extending_LeadsTo"; |
7689 | 823 |
|
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
824 |
(*STRONG precondition and postcondition*) |
7630 | 825 |
Goal "F : (A co A') guarantees (B leadsTo B') \ |
826 |
\ ==> extend h F : ((extend_set h A) co (extend_set h A')) \ |
|
7878
43b03d412b82
working version with localTo[C] instead of localTo
paulson
parents:
7841
diff
changeset
|
827 |
\ Int (f localTo[UNIV] (extend h F)) \ |
7630 | 828 |
\ guarantees ((extend_set h B) leadsTo (extend_set h B'))"; |
829 |
by (etac project_guarantees 1); |
|
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
830 |
by (rtac (extending_leadsTo RS extending_weaken) 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
831 |
by (rtac (projecting_constrains RS projecting_weaken) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
832 |
by Auto_tac; |
7630 | 833 |
qed "extend_co_guar_leadsTo"; |
834 |
||
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
835 |
(*WEAK precondition and postcondition*) |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
836 |
Goal "F : (A Co A') guarantees (B LeadsTo B') \ |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
837 |
\ ==> extend h F : ((extend_set h A) Co (extend_set h A')) \ |
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7880
diff
changeset
|
838 |
\ Int (f LocalTo (extend h F)) \ |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
839 |
\ guarantees ((extend_set h B) LeadsTo (extend_set h B'))"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
840 |
by (etac project_guarantees 1); |
7826
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
841 |
by (rtac (extending_LeadsTo RS extending_weaken) 2); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
842 |
by (rtac (projecting_Constrains RS projecting_weaken) 1); |
c6a8b73b6c2a
working shapshot with "projecting" and "extending"
paulson
parents:
7689
diff
changeset
|
843 |
by Auto_tac; |
7660
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
844 |
qed "extend_Co_guar_LeadsTo"; |
7e38237edfcb
now with (weak safety) guarantees (weak progress) with Extend
paulson
parents:
7630
diff
changeset
|
845 |
|
7630 | 846 |
Close_locale "Extend"; |