Asynchronous diffusing computations and the Dijkstra–Scholten overlay #
This module models asynchronous diffusing computations and the single-parent message-passing
termination-detection overlay as a milestone step toward #7286, after [DS80]
(inspected in author manuscript EWD687a, EWD687a - 0–5, PDF pp. 3–8).
Given a process type P and a distinguished initiator root : P, a global State P is completely
ghost-free:
- each process
p : Pstores onlyProcState P:active : Bool,deficit : ℕ(outgoing unacknowledged basic-message countDinEWD687a - 2, PDF p. 5), andparent : Option P(incoming engagement-tree pointer); basicMsgs : Multiset (BasicMsg P)holds unordered in-flight basic messages⟨src, dst⟩;signals : Multiset Pholds unordered in-flight acknowledgement signals addressed to their recipientp : P(matchingEWD687a - 5, PDF p. 8: recipients need not distinguish which successor emitted a signal).
Compared with EWD687a's abstract directed-graph formulation (atomic edge-deficit updates, no
incoming edges at the environment, and arbitrary "cornet" pointed bags deferring non-engagement
signals subject to guard G), lts root models asynchronous in-flight packets and the concrete
single-parent eager-acknowledgement policy:
Action.sendBasic src dst: an active processsrcemits basic message⟨src, dst⟩and incrementsdeficit src.Action.recvBasic src dst: delivering⟨src, dst⟩ ∈ basicMsgssetsactive dst := true. Ifdst ≠ rootandparent dst = none,dstattaches to the engagement tree viaparent dst := some src; otherwise (dst = rootordstis already engaged in the tree),dstkeeps its existingparentand immediately emits asignaltosrc.Action.becomeIdle p: an active processpturnsactive p := false.Action.recvSignal p: delivering an in-flight signalp ∈ signalsdecrementsdeficit p.Action.detach p q: an idle non-root processp ≠ rootwithdeficit p = 0andparent p = some qdetaches (parent p := none) and emits asignaltoq.
root detects termination (State.Terminated root) when active root = false ∧ deficit root = 0.
Both the labelled transition system lts root and multi-step execution runTrace? root share one
executable transition function step? root, enabling kernel decide trace verification.
Main definitions #
Cslib.Distributed.DijkstraScholten.ProcState: ghost-free local process state (active,deficit,parent).Cslib.Distributed.DijkstraScholten.BasicMsg: point-to-point basic message⟨src, dst⟩.Cslib.Distributed.DijkstraScholten.State: global asynchronous configuration.Cslib.Distributed.DijkstraScholten.initState: initial diffusing configuration with onlyrootactive and empty channels.Cslib.Distributed.DijkstraScholten.Action: LTS transition labels (sendBasic,recvBasic,becomeIdle,recvSignal,detach).Cslib.Distributed.DijkstraScholten.step?,Cslib.Distributed.DijkstraScholten.runTrace?: executable single-step and multi-step transition evaluators.Cslib.Distributed.DijkstraScholten.lts,Cslib.Distributed.DijkstraScholten.deterministic_lts: deterministicCslib.LTSfor the Dijkstra–Scholten overlay.Cslib.Distributed.DijkstraScholten.Reachable: reachability frominitState rootinlts root.Cslib.Distributed.DijkstraScholten.State.Terminated: local root termination predicate (active root = false ∧ deficit root = 0).Cslib.Distributed.DijkstraScholten.State.GlobalQuiescent: global quiescence (all processes idle with zero deficit andparent = none, and no basic or signal packets in flight).Cslib.Distributed.DijkstraScholten.State.ComputationIdle: underlying diffusing computation has ceased (∀ p, active p = falseandbasicMsgs = 0), while control signals/detachments may still be draining.
Main results #
Cslib.Distributed.DijkstraScholten.mtr_iff_runTrace?_eq_some: multi-step transitions inlts rootcoincide withrunTrace? root s tr = some s'.
References #
Ghost-free local state of a process in the Dijkstra–Scholten overlay (EWD687a - 2–5,
PDF pp. 5–8): active status in the diffusing computation, outgoing deficit counter deficit, and
optional engagement-tree parent.
- active : Bool
Whether the process is currently active in the underlying diffusing computation.
- deficit : ℕ
Outgoing basic messages sent minus acknowledgement signals received (
DinEWD687a). - parent : Option P
Incoming engagement-tree parent (
noneatrootand when neutral/detached).
Instances For
Global configuration of an asynchronous diffusing computation with the Dijkstra–Scholten control overlay.
Computable equality check on global states over a finite process type P.
Transition labels of the asynchronous Dijkstra–Scholten overlay.
- sendBasic {P : Type u_1} (src dst : P) : Action P
- recvBasic {P : Type u_1} (src dst : P) : Action P
Recipient
dstreceives in-flight basic message⟨src, dst⟩. - becomeIdle {P : Type u_1} (p : P) : Action P
Active process
pbecomes idle. - recvSignal {P : Type u_1} (p : P) : Action P
Process
preceives an in-flight signal and decrementsdeficit p. - detach {P : Type u_1} (p q : P) : Action P
Instances For
Post-state of Action.sendBasic src dst.
Post-state of Action.recvBasic src dst for diffusing root root.
If dst ≠ root and (s.proc dst).parent = none (which in every reachable state implies dst is
idle with deficit = 0), dst attaches with parent := some src; otherwise (dst = root or
dst is already engaged in the tree), dst keeps its parent and emits a signal to src.
Post-state of Action.becomeIdle p.
Post-state of Action.recvSignal p.
Post-state of Action.detach p q.
Root local termination condition (EWD687a - 2–5, PDF pp. 5–8): root is idle and its
deficit has returned to 0.
Instances For
The underlying diffusing computation has ceased: all processes are idle and no basic messages are in flight, though acknowledgement signals and tree detachments may still be draining.
Instances For
Executable single-step transition evaluator for the Dijkstra–Scholten overlay rooted at
root. Returns some s' iff action a is enabled in s with post-state s'.
Execute a finite action trace tr from s under step? root.
Labelled transition system for the asynchronous Dijkstra–Scholten overlay rooted at root.
Instances For
Computable transition check for (lts root).Tr s a s' over a finite process type P.
A global configuration s is reachable in the Dijkstra–Scholten overlay rooted at root if
lts root can reach s from initState root.
Every label at every state has at most one successor in lts root.