author | paulson |
Fri, 18 Feb 2000 15:20:44 +0100 | |
changeset 8251 | 9be357df93d4 |
parent 8216 | e4b3192dfefa |
child 8314 | 463f63a9a7f2 |
permissions | -rw-r--r-- |
5252 | 1 |
(* Title: HOL/UNITY/Union.ML |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1998 University of Cambridge |
|
5 |
||
6 |
Unions of programs |
|
7 |
||
8 |
From Misra's Chapter 5: Asynchronous Compositions of Programs |
|
9 |
*) |
|
10 |
||
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
11 |
Addcongs [UN_cong, INT_cong]; |
5252 | 12 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
13 |
|
5867 | 14 |
(** SKIP **) |
15 |
||
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
16 |
Goal "Init SKIP = UNIV"; |
5648 | 17 |
by (simp_tac (simpset() addsimps [SKIP_def]) 1); |
5611 | 18 |
qed "Init_SKIP"; |
19 |
||
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
20 |
Goal "Acts SKIP = {Id}"; |
5648 | 21 |
by (simp_tac (simpset() addsimps [SKIP_def]) 1); |
22 |
qed "Acts_SKIP"; |
|
23 |
||
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
24 |
Addsimps [Init_SKIP, Acts_SKIP]; |
5648 | 25 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
26 |
Goal "reachable SKIP = UNIV"; |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
27 |
by (force_tac (claset() addEs [reachable.induct] |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
28 |
addIs reachable.intrs, simpset()) 1); |
5867 | 29 |
qed "reachable_SKIP"; |
30 |
||
31 |
Addsimps [reachable_SKIP]; |
|
32 |
||
6836 | 33 |
(** SKIP and safety properties **) |
34 |
||
35 |
Goalw [constrains_def] "(SKIP : A co B) = (A<=B)"; |
|
36 |
by Auto_tac; |
|
37 |
qed "SKIP_in_constrains_iff"; |
|
38 |
AddIffs [SKIP_in_constrains_iff]; |
|
39 |
||
40 |
Goalw [Constrains_def] "(SKIP : A Co B) = (A<=B)"; |
|
41 |
by Auto_tac; |
|
42 |
qed "SKIP_in_Constrains_iff"; |
|
43 |
AddIffs [SKIP_in_Constrains_iff]; |
|
44 |
||
45 |
Goalw [stable_def] "SKIP : stable A"; |
|
46 |
by Auto_tac; |
|
47 |
qed "SKIP_in_stable"; |
|
48 |
AddIffs [SKIP_in_stable, SKIP_in_stable RS stable_imp_Stable]; |
|
49 |
||
5867 | 50 |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
51 |
(** Join **) |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
52 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
53 |
Goal "Init (F Join G) = Init F Int Init G"; |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
54 |
by (simp_tac (simpset() addsimps [Join_def]) 1); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
55 |
qed "Init_Join"; |
5252 | 56 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
57 |
Goal "Acts (F Join G) = Acts F Un Acts G"; |
5596 | 58 |
by (auto_tac (claset(), simpset() addsimps [Join_def])); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
59 |
qed "Acts_Join"; |
5252 | 60 |
|
7537 | 61 |
Addsimps [Init_Join, Acts_Join]; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
62 |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
63 |
|
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
64 |
(** JN **) |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
65 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
66 |
Goalw [JOIN_def, SKIP_def] "(JN i:{}. F i) = SKIP"; |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
67 |
by Auto_tac; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
68 |
qed "JN_empty"; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
69 |
Addsimps [JN_empty]; |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
70 |
|
6633 | 71 |
Goal "(JN i:insert a I. F i) = (F a) Join (JN i:I. F i)"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
72 |
by (rtac program_equalityI 1); |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
73 |
by (ALLGOALS (simp_tac (simpset() addsimps [JOIN_def, Join_def]))); |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
74 |
qed "JN_insert"; |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
75 |
Addsimps[JN_empty, JN_insert]; |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
76 |
|
5611 | 77 |
Goal "Init (JN i:I. F i) = (INT i:I. Init (F i))"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
78 |
by (simp_tac (simpset() addsimps [JOIN_def]) 1); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
79 |
qed "Init_JN"; |
5252 | 80 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
81 |
Goal "Acts (JN i:I. F i) = insert Id (UN i:I. Acts (F i))"; |
5596 | 82 |
by (auto_tac (claset(), simpset() addsimps [JOIN_def])); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
83 |
qed "Acts_JN"; |
5252 | 84 |
|
7537 | 85 |
Addsimps [Init_JN, Acts_JN]; |
5867 | 86 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
87 |
val prems = Goalw [JOIN_def] |
6633 | 88 |
"[| I=J; !!i. i:J ==> F i = G i |] ==> \ |
89 |
\ (JN i:I. F i) = (JN i:J. G i)"; |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
90 |
by (asm_simp_tac (simpset() addsimps prems) 1); |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
91 |
qed "JN_cong"; |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
92 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
93 |
Addcongs [JN_cong]; |
5584 | 94 |
|
95 |
||
5611 | 96 |
(** Algebraic laws **) |
5259 | 97 |
|
5611 | 98 |
Goal "F Join G = G Join F"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
99 |
by (simp_tac (simpset() addsimps [Join_def, Un_commute, Int_commute]) 1); |
5259 | 100 |
qed "Join_commute"; |
101 |
||
7360 | 102 |
Goal "A Join (B Join C) = B Join (A Join C)"; |
103 |
by (simp_tac (simpset() addsimps Un_ac@Int_ac@[Join_def]) 1); |
|
104 |
qed "Join_left_commute"; |
|
105 |
||
5611 | 106 |
Goal "(F Join G) Join H = F Join (G Join H)"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
107 |
by (simp_tac (simpset() addsimps Un_ac@[Join_def, Int_assoc]) 1); |
5259 | 108 |
qed "Join_assoc"; |
5596 | 109 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
110 |
Goalw [Join_def, SKIP_def] "SKIP Join F = F"; |
5611 | 111 |
by (rtac program_equalityI 1); |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
112 |
by (ALLGOALS (simp_tac (simpset() addsimps [insert_absorb]))); |
5611 | 113 |
qed "Join_SKIP_left"; |
5584 | 114 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
115 |
Goalw [Join_def, SKIP_def] "F Join SKIP = F"; |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
116 |
by (rtac program_equalityI 1); |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
117 |
by (ALLGOALS (simp_tac (simpset() addsimps [insert_absorb]))); |
5611 | 118 |
qed "Join_SKIP_right"; |
119 |
||
120 |
Addsimps [Join_SKIP_left, Join_SKIP_right]; |
|
121 |
||
122 |
Goalw [Join_def] "F Join F = F"; |
|
123 |
by (rtac program_equalityI 1); |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
124 |
by Auto_tac; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
125 |
qed "Join_absorb"; |
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
126 |
|
5611 | 127 |
Addsimps [Join_absorb]; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
128 |
|
7915
c7fd7eb3b0ef
ALMOST working version: LocalTo results commented out
paulson
parents:
7878
diff
changeset
|
129 |
Goalw [Join_def] "F Join (F Join G) = F Join G"; |
7360 | 130 |
by (rtac program_equalityI 1); |
131 |
by Auto_tac; |
|
132 |
qed "Join_left_absorb"; |
|
133 |
||
134 |
(*Join is an AC-operator*) |
|
135 |
val Join_ac = [Join_assoc, Join_left_absorb, Join_commute, Join_left_commute]; |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
136 |
|
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
137 |
|
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
138 |
(*** JN laws ***) |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
139 |
|
6633 | 140 |
(*Also follows by JN_insert and insert_absorb, but the proof is longer*) |
141 |
Goal "k:I ==> F k Join (JN i:I. F i) = (JN i:I. F i)"; |
|
7537 | 142 |
by (auto_tac (claset() addSIs [program_equalityI], simpset())); |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
143 |
qed "JN_absorb"; |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
144 |
|
6633 | 145 |
Goal "(JN i: I Un J. F i) = ((JN i: I. F i) Join (JN i:J. F i))"; |
7537 | 146 |
by (auto_tac (claset() addSIs [program_equalityI], simpset())); |
6633 | 147 |
qed "JN_Un"; |
5970 | 148 |
|
6836 | 149 |
Goal "(JN i:I. c) = (if I={} then SKIP else c)"; |
7537 | 150 |
by (auto_tac (claset() addSIs [program_equalityI], simpset())); |
5970 | 151 |
qed "JN_constant"; |
152 |
||
6633 | 153 |
Goal "(JN i:I. F i Join G i) = (JN i:I. F i) Join (JN i:I. G i)"; |
7537 | 154 |
by (auto_tac (claset() addSIs [program_equalityI], simpset())); |
5970 | 155 |
qed "JN_Join_distrib"; |
5584 | 156 |
|
6633 | 157 |
Goal "i : I ==> (JN i:I. F i Join G) = ((JN i:I. F i) Join G)"; |
158 |
by (asm_simp_tac (simpset() addsimps [JN_Join_distrib, JN_constant]) 1); |
|
6836 | 159 |
by Auto_tac; |
6633 | 160 |
qed "JN_Join_miniscope"; |
161 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
162 |
(*Used to prove guarantees_JN_I*) |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
163 |
Goalw [JOIN_def, Join_def] "i: I ==> F i Join JOIN (I - {i}) F = JOIN I F"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
164 |
by (rtac program_equalityI 1); |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
165 |
by Auto_tac; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
166 |
qed "JN_Join_diff"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
167 |
|
5584 | 168 |
|
6536 | 169 |
(*** Safety: co, stable, FP ***) |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
170 |
|
8251
9be357df93d4
New treatment of "guarantees" with polymorphic components and bijections.
paulson
parents:
8216
diff
changeset
|
171 |
(*Fails if I={} because it collapses to SKIP : A co B, i.e. to A<=B. So an |
9be357df93d4
New treatment of "guarantees" with polymorphic components and bijections.
paulson
parents:
8216
diff
changeset
|
172 |
alternative precondition is A<=B, but most proofs using this rule require |
9be357df93d4
New treatment of "guarantees" with polymorphic components and bijections.
paulson
parents:
8216
diff
changeset
|
173 |
I to be nonempty for other reasons anyway.*) |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
174 |
Goalw [constrains_def, JOIN_def] |
6633 | 175 |
"i : I ==> (JN i:I. F i) : A co B = (ALL i:I. F i : A co B)"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
176 |
by (Simp_tac 1); |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
177 |
by (Blast_tac 1); |
7523 | 178 |
qed "JN_constrains"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
179 |
|
6633 | 180 |
Goal "(F Join G : A co B) = (F : A co B & G : A co B)"; |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
181 |
by (auto_tac |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
182 |
(claset(), |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
183 |
simpset() addsimps [constrains_def, Join_def])); |
7523 | 184 |
qed "Join_constrains"; |
5620 | 185 |
|
8122
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8069
diff
changeset
|
186 |
Goal "(F Join G : A unless B) = (F : A unless B & G : A unless B)"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8069
diff
changeset
|
187 |
by (simp_tac (simpset() addsimps [Join_constrains, unless_def]) 1); |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8069
diff
changeset
|
188 |
qed "Join_unless"; |
b43ad07660b9
working version, with Alloc now working on the same state space as the whole
paulson
parents:
8069
diff
changeset
|
189 |
|
6633 | 190 |
(*Analogous weak versions FAIL; see Misra [1994] 5.4.1, Substitution Axiom. |
191 |
reachable (F Join G) could be much bigger than reachable F, reachable G |
|
192 |
*) |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5970
diff
changeset
|
193 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
194 |
|
6536 | 195 |
Goal "[| F : A co A'; G : B co B' |] \ |
196 |
\ ==> F Join G : (A Int B) co (A' Un B')"; |
|
7523 | 197 |
by (simp_tac (simpset() addsimps [Join_constrains]) 1); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
198 |
by (blast_tac (claset() addIs [constrains_weaken]) 1); |
7523 | 199 |
qed "Join_constrains_weaken"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
200 |
|
8251
9be357df93d4
New treatment of "guarantees" with polymorphic components and bijections.
paulson
parents:
8216
diff
changeset
|
201 |
(*If I={}, it degenerates to SKIP : UNIV co {}, which is false.*) |
6633 | 202 |
Goal "[| ALL i:I. F i : A i co A' i; i: I |] \ |
203 |
\ ==> (JN i:I. F i) : (INT i:I. A i) co (UN i:I. A' i)"; |
|
7523 | 204 |
by (asm_simp_tac (simpset() addsimps [JN_constrains]) 1); |
6633 | 205 |
by (blast_tac (claset() addIs [constrains_weaken]) 1); |
7523 | 206 |
qed "JN_constrains_weaken"; |
6633 | 207 |
|
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
208 |
Goal "(JN i:I. F i) : stable A = (ALL i:I. F i : stable A)"; |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
209 |
by (asm_simp_tac |
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
210 |
(simpset() addsimps [stable_def, constrains_def, JOIN_def]) 1); |
7523 | 211 |
qed "JN_stable"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
212 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
213 |
Goal "[| ALL i:I. F i : invariant A; i : I |] \ |
5970 | 214 |
\ ==> (JN i:I. F i) : invariant A"; |
7523 | 215 |
by (asm_full_simp_tac (simpset() addsimps [invariant_def, JN_stable]) 1); |
5970 | 216 |
by (Blast_tac 1); |
217 |
bind_thm ("invariant_JN_I", ballI RS result()); |
|
218 |
||
7594
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
219 |
Goal "(F Join G : stable A) = \ |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
220 |
\ (F : stable A & G : stable A)"; |
7523 | 221 |
by (simp_tac (simpset() addsimps [stable_def, Join_constrains]) 1); |
222 |
qed "Join_stable"; |
|
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
223 |
|
7594
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
224 |
Goal "(F Join G : increasing f) = \ |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
225 |
\ (F : increasing f & G : increasing f)"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
226 |
by (simp_tac (simpset() addsimps [increasing_def, Join_stable]) 1); |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
227 |
by (Blast_tac 1); |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
228 |
qed "Join_increasing"; |
8a188ef6545e
working version with co-guarantees-leadsto results
paulson
parents:
7537
diff
changeset
|
229 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
230 |
Goal "[| F : invariant A; G : invariant A |] \ |
5970 | 231 |
\ ==> F Join G : invariant A"; |
7523 | 232 |
by (full_simp_tac (simpset() addsimps [invariant_def, Join_stable]) 1); |
5970 | 233 |
by (Blast_tac 1); |
234 |
qed "invariant_JoinI"; |
|
235 |
||
8055
bb15396278fb
abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents:
8042
diff
changeset
|
236 |
Goal "FP (JN i:I. F i) = (INT i:I. FP (F i))"; |
7523 | 237 |
by (asm_simp_tac (simpset() addsimps [FP_def, JN_stable, INTER_def]) 1); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
238 |
qed "FP_JN"; |
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
239 |
|
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
240 |
|
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
241 |
(*** Progress: transient, ensures ***) |
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
242 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
243 |
Goal "i : I ==> \ |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
244 |
\ (JN i:I. F i) : transient A = (EX i:I. F i : transient A)"; |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
245 |
by (auto_tac (claset(), |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
246 |
simpset() addsimps [transient_def, JOIN_def])); |
7523 | 247 |
qed "JN_transient"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
248 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
249 |
Goal "F Join G : transient A = \ |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
250 |
\ (F : transient A | G : transient A)"; |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
251 |
by (auto_tac (claset(), |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
252 |
simpset() addsimps [bex_Un, transient_def, |
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
253 |
Join_def])); |
7523 | 254 |
qed "Join_transient"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
255 |
|
8216 | 256 |
Goal "F : transient A ==> F Join G : transient A"; |
257 |
by (asm_simp_tac (simpset() addsimps [Join_transient]) 1); |
|
258 |
qed "Join_transient_I1"; |
|
259 |
||
260 |
Goal "G : transient A ==> F Join G : transient A"; |
|
261 |
by (asm_simp_tac (simpset() addsimps [Join_transient]) 1); |
|
262 |
qed "Join_transient_I2"; |
|
263 |
||
8251
9be357df93d4
New treatment of "guarantees" with polymorphic components and bijections.
paulson
parents:
8216
diff
changeset
|
264 |
(*If I={} it degenerates to (SKIP : A ensures B) = False, i.e. to ~(A<=B) *) |
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
265 |
Goal "i : I ==> \ |
6536 | 266 |
\ (JN i:I. F i) : A ensures B = \ |
8251
9be357df93d4
New treatment of "guarantees" with polymorphic components and bijections.
paulson
parents:
8216
diff
changeset
|
267 |
\ ((ALL i:I. F i : (A-B) co (A Un B)) & (EX i:I. F i : A ensures B))"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
268 |
by (auto_tac (claset(), |
7523 | 269 |
simpset() addsimps [ensures_def, JN_constrains, JN_transient])); |
270 |
qed "JN_ensures"; |
|
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
271 |
|
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
272 |
Goalw [ensures_def] |
6536 | 273 |
"F Join G : A ensures B = \ |
7630 | 274 |
\ (F : (A-B) co (A Un B) & G : (A-B) co (A Un B) & \ |
275 |
\ (F : transient (A-B) | G : transient (A-B)))"; |
|
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
276 |
by (auto_tac (claset(), |
7523 | 277 |
simpset() addsimps [Join_constrains, Join_transient])); |
278 |
qed "Join_ensures"; |
|
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
279 |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
280 |
Goalw [stable_def, constrains_def, Join_def] |
6536 | 281 |
"[| F : stable A; G : A co A' |] \ |
282 |
\ ==> F Join G : A co A'"; |
|
6295
351b3c2b0d83
removed the infernal States, eqStates, compatible, etc.
paulson
parents:
6019
diff
changeset
|
283 |
by (asm_full_simp_tac (simpset() addsimps [ball_Un]) 1); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
284 |
by (Blast_tac 1); |
7523 | 285 |
qed "stable_Join_constrains"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
286 |
|
6633 | 287 |
(*Premise for G cannot use Always because F: Stable A is weaker than |
5648 | 288 |
G : stable A *) |
6570 | 289 |
Goal "[| F : stable A; G : invariant A |] ==> F Join G : Always A"; |
290 |
by (full_simp_tac (simpset() addsimps [Always_def, invariant_def, |
|
7523 | 291 |
Stable_eq_stable, Join_stable]) 1); |
8069
19b9f92ca503
working with weak LeadsTo in guarantees precondition\!
paulson
parents:
8055
diff
changeset
|
292 |
by (force_tac(claset() addIs [stable_Int], simpset()) 1); |
8216 | 293 |
qed "stable_Join_Always1"; |
294 |
||
295 |
(*As above, but exchanging the roles of F and G*) |
|
296 |
Goal "[| F : invariant A; G : stable A |] ==> F Join G : Always A"; |
|
297 |
by (stac Join_commute 1); |
|
298 |
by (blast_tac (claset() addIs [stable_Join_Always1]) 1); |
|
299 |
qed "stable_Join_Always2"; |
|
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
300 |
|
6536 | 301 |
Goal "[| F : stable A; G : A ensures B |] ==> F Join G : A ensures B"; |
7523 | 302 |
by (asm_simp_tac (simpset() addsimps [Join_ensures]) 1); |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
303 |
by (asm_full_simp_tac (simpset() addsimps [stable_def, ensures_def]) 1); |
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
304 |
by (etac constrains_weaken 1); |
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
305 |
by Auto_tac; |
7523 | 306 |
qed "stable_Join_ensures1"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
307 |
|
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
308 |
(*As above, but exchanging the roles of F and G*) |
6536 | 309 |
Goal "[| F : A ensures B; G : stable A |] ==> F Join G : A ensures B"; |
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
310 |
by (stac Join_commute 1); |
7523 | 311 |
by (blast_tac (claset() addIs [stable_Join_ensures1]) 1); |
312 |
qed "stable_Join_ensures2"; |
|
5313
1861a564d7e2
Constrains, Stable, Invariant...more of the substitution axiom, but Union
paulson
parents:
5259
diff
changeset
|
313 |
|
5648 | 314 |