author | paulson |
Tue, 19 Jan 1999 11:15:40 +0100 | |
changeset 6138 | b7e6e607bb4d |
parent 6012 | 1894bfc4aee9 |
child 6295 | 351b3c2b0d83 |
permissions | -rw-r--r-- |
5597 | 1 |
(* Title: HOL/UNITY/Comp.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1998 University of Cambridge |
|
5 |
||
6 |
Composition |
|
7 |
||
8 |
From Chandy and Sanders, "Reasoning About Program Composition" |
|
6138 | 9 |
|
10 |
QUESTIONS: |
|
11 |
refines_def: needs the States F = States G? |
|
12 |
||
13 |
uv_prop, component: should be States F = States (F Join G) |
|
5597 | 14 |
*) |
15 |
||
16 |
Comp = Union + |
|
17 |
||
18 |
constdefs |
|
19 |
||
20 |
(*Existential and Universal properties. I formalize the two-program |
|
21 |
case, proving equivalence with Chandy and Sanders's n-ary definitions*) |
|
22 |
||
23 |
ex_prop :: 'a program set => bool |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
24 |
"ex_prop X == |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
25 |
ALL F G. (F:X | G: X) & States F = States G --> (F Join G) : X" |
5597 | 26 |
|
27 |
strict_ex_prop :: 'a program set => bool |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
28 |
"strict_ex_prop X == |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
29 |
ALL F G. States F = States G --> (F:X | G: X) = (F Join G : X)" |
5597 | 30 |
|
31 |
uv_prop :: 'a program set => bool |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
32 |
"uv_prop X == |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
33 |
SKIP UNIV : X & |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
34 |
(ALL F G. F:X & G: X & States F = States G --> (F Join G) : X)" |
5597 | 35 |
|
36 |
strict_uv_prop :: 'a program set => bool |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
37 |
"strict_uv_prop X == |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
38 |
SKIP UNIV : X & |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
39 |
(ALL F G. States F = States G --> (F:X & G: X) = (F Join G : X))" |
5597 | 40 |
|
5612
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
41 |
(*Ill-defined programs can arise through "Join"*) |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
42 |
welldef :: 'a program set |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
43 |
"welldef == {F. Init F ~= {}}" |
5597 | 44 |
|
45 |
component :: ['a program, 'a program] => bool |
|
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
46 |
"component F H == EX G. F Join G = H & States F = States G" |
5597 | 47 |
|
48 |
guarantees :: ['a program set, 'a program set] => 'a program set (infixl 65) |
|
49 |
"X guarantees Y == {F. ALL H. component F H --> H:X --> H:Y}" |
|
50 |
||
5612
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
51 |
refines :: ['a program, 'a program, 'a program set] => bool |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
52 |
("(3_ refines _ wrt _)" [10,10,10] 10) |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
53 |
"G refines F wrt X == |
6012
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
54 |
States F = States G & |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
55 |
(ALL H. States F = States H & (F Join H) : welldef Int X |
1894bfc4aee9
Addition of the States component; parts of Comp not working
paulson
parents:
5612
diff
changeset
|
56 |
--> G Join H : welldef Int X)" |
5612
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
57 |
|
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
58 |
iso_refines :: ['a program, 'a program, 'a program set] => bool |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
59 |
("(3_ iso'_refines _ wrt _)" [10,10,10] 10) |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
60 |
"G iso_refines F wrt X == |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
61 |
F : welldef Int X --> G : welldef Int X" |
e981ca6f7332
Finished proofs to end of section 5.1 of Chandy and Sanders
paulson
parents:
5597
diff
changeset
|
62 |
|
5597 | 63 |
end |