Skip to content

Commit 48a0f38

Browse files
committed
v35 (Termination): Check refinement of BlockingQueue by BlockingQueuePoisonPill.
1 parent 9b999ba commit 48a0f38

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

BlockingQueuePoisonPill.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ INVARIANT NoDeadlock
1313
INVARIANT QueueEmpty
1414

1515
PROPERTIES GlobalTermination
16+
17+
PROPERTIES BQSpec

BlockingQueuePoisonPill.tla

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,22 @@ GlobalTermination ==
122122
Spec ==
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
=============================================================================

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)