Skip to content

Commit

Permalink
v35 (Termination): Check refinement of BlockingQueue by BlockingQueue…
Browse files Browse the repository at this point in the history
…PoisonPill.
  • Loading branch information
lemmy committed Oct 27, 2024
1 parent 05f0755 commit 8e44372
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BlockingQueuePoisonPill.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ INVARIANT NoDeadlock
INVARIANT QueueEmpty

PROPERTIES GlobalTermination

PROPERTIES BQSpec
18 changes: 18 additions & 0 deletions BlockingQueuePoisonPill.tla
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,22 @@ GlobalTermination ==
Spec ==
Init /\ [][Next]_vars /\ WF_vars(Next)

-----------------------------------------------------------------------------
\* This spec still implementes the high-level BlockingQueue spec.

BQ == INSTANCE BlockingQueue
\* Replace Poison with some Producer. The high-level
\* BlockingQueue spec is a peculiar about the elements
\* in its buffer. If this wouldn't be a tutotial but
\* a real-world spec, the high-level spec would be
\* corrected to be oblivious to the elements in buffer.
WITH buffer <-
[ i \in DOMAIN buffer |-> IF buffer[i] = Poison
THEN CHOOSE p \in Producers: TRUE
ELSE buffer[i] ]

BQSpec == BQ!Spec

THEOREM Spec => BQSpec

=============================================================================
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This tutorial is work in progress. More chapters will be added in the future. In

--------------------------------------------------------------------------

### v35 (Termination): Check refinement of BlockingQueue by BlockingQueuePoisonPill.

### v34 (Termination): Terminate Consumers when Producers are done by sending a poison pill in a termination stage.

### v33 (Refinement Fair): Prove BlockingQueueFair implements BlockingQueueSplit.
Expand Down

0 comments on commit 8e44372

Please sign in to comment.