File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,3 +13,5 @@ INVARIANT NoDeadlock
1313INVARIANT QueueEmpty
1414
1515PROPERTIES GlobalTermination
16+
17+ PROPERTIES BQSpec
Original file line number Diff line number Diff line change @@ -122,4 +122,22 @@ GlobalTermination ==
122122Spec ==
123123 Init /\ [] [ Next ]_ vars /\ WF_ vars ( Next )
124124
125+ -----------------------------------------------------------------------------
126+ \* This spec still implementes the high-level BlockingQueue spec.
127+
128+ BQ == INSTANCE BlockingQueue
129+ \* Replace Poison with some Producer. The high-level
130+ \* BlockingQueue spec is a peculiar about the elements
131+ \* in its buffer. If this wouldn't be a tutotial but
132+ \* a real-world spec, the high-level spec would be
133+ \* corrected to be oblivious to the elements in buffer.
134+ WITH buffer <-
135+ [ i \in DOMAIN buffer |-> IF buffer [ i ] = Poison
136+ THEN CHOOSE p \in Producers : TRUE
137+ ELSE buffer [ i ] ]
138+
139+ BQSpec == BQ ! Spec
140+
141+ THEOREM Spec => BQSpec
142+
125143=============================================================================
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ This tutorial is work in progress. More chapters will be added in the future. In
1313
1414--------------------------------------------------------------------------
1515
16+ ### v35 (Termination): Check refinement of BlockingQueue by BlockingQueuePoisonPill.
17+
1618### v34 (Termination): Terminate Consumers when Producers are done by sending a poison pill in a termination stage.
1719
1820### v33 (Refinement Fair): Prove BlockingQueueFair implements BlockingQueueSplit.
You can’t perform that action at this time.
0 commit comments