Skip to content

Commit 06d04f1

Browse files
committed
If spec A has more than a one variable that does not appear in the other
spec, we unfortunately have to adapt the composition and create more restsOfTheUniverse. The next-state relation of this composition evaluates to false after the initial state, because it defines variables z and zz to always have equal values. This is only satisfied in the special case where the values of variables z and zz in A are equal throughout all behaviors (e.g. Init changed to ... /\ zz = TRUE).
1 parent cf50a02 commit 06d04f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

specifications/composition/Composition.tla

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ VARIABLES x, \* Abstract/very high-level representation of the overall computati
2323
y, \* Represents the phase that the composed system is in.
2424
\* This toy example has three phases: <<"A", "B", "C">>.
2525
z \* z is the variable that is only going to be present in spec A.
26-
varsA == <<x, y, z>>
26+
,zz \* The more the merrier.
27+
varsA == <<x, y, z, zz>>
2728

2829
InitA ==
2930
/\ x = 0
3031
/\ y = "A"
3132
/\ z = TRUE
33+
/\ zz= FALSE \* Could happen to be zz=TRUE.
3234

3335
NextA ==
3436
/\ y = "A"
@@ -37,6 +39,7 @@ NextA ==
3739
THEN y' = "B"
3840
ELSE UNCHANGED y
3941
/\ z' = ~ z
42+
/\ zz'= ~ zz
4043

4144
==================================
4245

@@ -83,7 +86,7 @@ vars ==
8386
(* Down here we know about the internals *)
8487
(* of spec A and B (whitebox component). *)
8588

86-
INSTANCE A WITH z <- restOfTheUniverse
89+
INSTANCE A WITH z <- restOfTheUniverse, zz <- restOfTheUniverse
8790

8891
Spec == InitA /\ InitB /\ [][ \/ [NextA]_vars
8992
\/ [OpenNextB]_vars
@@ -94,6 +97,6 @@ THEOREM Spec => Inv
9497

9598
=============================================================================
9699
\* Modification History
97-
\* Last modified Fri Jun 12 16:30:33 PDT 2020 by markus
100+
\* Last modified Fri Jun 12 16:44:17 PDT 2020 by markus
98101
\* Last modified Fri Jun 12 16:30:19 PDT 2020 by Markus Kuppe
99102
\* Created Fri Jun 12 10:30:09 PDT 2020 by Leslie Lamport

0 commit comments

Comments
 (0)