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