Asynchronous point-to-point FIFO message-passing networks #
This module models asynchronous distributed systems communicating over point-to-point first-in,
first-out (FIFO) channels along a directed communication graph Digraph P, following the underlying
system model of [CL85] (§2, pp. 65–68, and §1, p. 64 for stable properties).
Each ordered pair (src, dest) of processes has an unbounded reliable FIFO queue
chan src dest : List M whose head is the next message deliverable to dest and whose tail
receives newly sent messages via append. Where §2 (p. 66, Figure 1) allows parallel labeled
channels and single-channel 5-tuple events ⟨p, s, s', M, c⟩ over finite process/channel sets,
System P S M over Digraph P models at most one channel per ordered pair (including self-loops),
leaves P S M : Type* unrestricted, and allows each step to emit a list sent : List (P × M) of
outgoing messages atomically:
- a directed communication graph
graph : Digraph P, - allowed spontaneous internal/send steps
internal p st st' sentat processp, and - allowed message-receive steps
recv src dest st msg st' sentatdestconsumingmsgfrom the head ofchan src dest.
Both local transition relations may be nondeterministic, while the induced labelled transition
system System.lts over Event P S M is deterministic given the event label (lts_deterministic).
Because System.lts includes no artificial stuttering transition, sys.lts.IsTerminal expresses
genuine global deadlock or termination, which is automatically a stable global predicate
(isStablePred_isTerminal).
The fundamental FIFO queue commutation property (System.tr_comm_of_ne) shows that two transitions
at distinct processes p ≠ q commute in sys.lts whenever the second step does not pop from an
initially empty channel (p, q)—because head-pop and tail-append commute on every non-empty list
((h :: t) ++ out = h :: (t ++ out)).
Main definitions #
Cslib.Distributed.ChandyLamport.GlobalState: global configuration consisting of local statesproc : P → Sand FIFO channelschan : P → P → List M.Cslib.Distributed.ChandyLamport.outgoingTo: filter outgoing(dest, m)pairs addressed to a given destination while preserving send order.Cslib.Distributed.ChandyLamport.Event: transition labels (internalandrecv) of an asynchronous FIFO network.Cslib.Distributed.ChandyLamport.GlobalState.applyEvent,Cslib.Distributed.ChandyLamport.GlobalState.runEvents: single-event and multi-event state transitions induced byEvent.Cslib.Distributed.ChandyLamport.System: asynchronous message-passing system over aDigraph P.Cslib.Distributed.ChandyLamport.System.lts,Cslib.Distributed.ChandyLamport.System.validTrace: labelled transition system (Cslib.LTS) of aSystemand its executable multi-step trace predicate.Cslib.Distributed.ChandyLamport.System.WellFormedChan: invariant stating that non-edges carry empty channels.Cslib.Distributed.ChandyLamport.IsStablePred: global state predicates closed under transitions ofsys.lts(such as deadlock, termination, garbage collection, or token bounds).
Main results #
Cslib.Distributed.ChandyLamport.System.mTr_iff_validTrace: finite executions ofsys.ltsmatchvalidTrace+GlobalState.runEvents.Cslib.Distributed.ChandyLamport.System.wellFormedChan_mTr: channel well-formedness is preserved across finite executions.Cslib.Distributed.ChandyLamport.System.tr_comm_of_ne: transitions at distinct processesp ≠ qcommute insys.ltswhenever the second transition does not pop from an initially empty channel(p, q).Cslib.Distributed.ChandyLamport.isStablePred_isTerminal: global deadlock/termination (sys.lts.IsTerminal) is a stable predicate.
References #
Global configuration of an asynchronous point-to-point FIFO message-passing network.
Extract the payloads addressed to dest from an outgoing list of (recipient, payload) pairs,
preserving emission order.
Payload m appears in outgoingTo sent dest if and only if (dest, m) ∈ sent.
outgoingTo sent dest is empty when no entry of sent targets dest.
Pop the head message from channel (src, dest), leaving all other channels and all local
process states unchanged.
Update process p's local state to nextState and append its outgoing messages sent to the
tails of the corresponding outgoing channels (p, v).
Transition label of an asynchronous FIFO message-passing system.
Next global state obtained by applying event e to s.
State reached from s by applying each event in xl sequentially.
Underlying asynchronous message-passing system over a directed communication graph Digraph P.
Both spontaneous steps (internal) and message-receive steps (recv) may be relational
(nondeterministic).
- graph : Digraph P
Directed communication topology: channel
(u, v)exists whengraph.Adj u v.
Whether event e is enabled in global state s.
Instances For
Labelled transition system of sys with FIFO point-to-point channels.
Instances For
sys.lts is deterministic: each state and Event label determines at most one successor.
Executable trace-validity predicate checking that each event in xl is enabled when reached
from s.
Instances For
Because sys.lts is deterministic, sys.lts.MTr s xl s' holds if and only if xl is a valid
trace from s and s' = s.runEvents xl.
A global state has well-formed channels if every non-edge of sys.graph is empty.
Instances For
Non-edge channels remain empty across any finite execution of sys.lts.
FIFO causal commutation for distinct processes: if e₁ (at actor p) is followed by e₂
(at actor q ≠ p), and e₂ does not pop from an initially empty channel (p, q) in s, then
e₂ is already enabled in s and executing e₂ before e₁ reaches the exact same state s₂.
Stable global predicates #
A global predicate Φ is stable for sys if once Φ holds in a state s, it continues to
hold in every successor state s' of sys.lts ([CL85], §1, p. 64, equivalent via
IsStablePred.canReach to closure under reachability). Standard examples include deadlock,
computation termination, and loss of all tokens in a token ring.
A stable predicate persists across arbitrary finite executions (CanReach).
Contrapositive backward transfer: if a stable predicate fails at a reachable state s₂, it was
already false at s₁.
Global deadlock/termination (sys.lts.IsTerminal) is a stable predicate.