Macaw.Live.Specs.Turn (macaw_live v0.1.0)

Copy Markdown View Source

The turn's replay (spec/03 §2.1), modeled so every ordering it reaches is checked (spec/00 §3). The page holds a monitor and changes it with edits (a push, an ask, a budget); a tick runs in a turn on a copy of the monitor. While the turn runs, each edit is made in the page's copy and kept, and when the turn answers, the kept edits are replayed onto the monitor it answers. A tick asked while a turn runs runs once after it. A turn past its liveness bound is killed: the page keeps its own copy, edits included, and takes the killed turn's answer from its mailbox if it came before the :DOWN.

The monitor is modeled by the edits it reflects (has), the number the page made (made), and the turn by the edits its copy reflects (base) and the edits kept since it started (kept). The invariants: the monitor the page holds once no turn runs reflects every edit made, in order (has == made); at most one turn runs; and an answer of a killed turn is never applied. With replay: false the kept edits are dropped, and with flush: false a killed turn's answer stays in the mailbox and is applied, and the model is shown to find each broken protocol.

Summary

Functions

The compiled specification (ExTLA.Spec.Compiled).

Functions

__tla_spec__()

The compiled specification (ExTLA.Spec.Compiled).