Dijkstra's K-state self-stabilizing token ring and enabled-move composite-ring symmetry step #
This module formalizes Dijkstra's first self-stabilizing mutual-exclusion / token-circulation
protocol on a directed ring of n finite-state machines with K states per machine under a
central daemon (Dijkstra, pp. 643–644; manuscript Dijkstra),
together with an original simultaneous atomic-subset transition model (dijkstraDistRing),
original sharp periodic converse counterexamples for both transition models, and scheduler-scoped
enabled-move symmetry steps towards the composite-ring impossibility argument of
Dijkstra (EWD391).
In Dijkstra (p. 644, left column), the ring consists of N + 1 machines numbered
0 through N; here n denotes the total ring size N + 1, indexed by Fin n:
- Bottom machine
0: privileged iffs 0 = s (0 - 1)(s 0 = s ⟨n - 1, _⟩), moving tos 0 + 1((s 0 + 1) mod KinFin K). - Normal machine
i > 0: privileged iffs i ≠ s (i - 1), moving tos (i - 1). - Legitimate configurations (
DijkstraLegitimate n K): configurations in which exactly one machinei : Fin nis privileged.
Dijkstra (p. 643) explicitly assumes a central daemon (dijkstraRing n K) and
excludes a distributed daemon, while the later section of Dijkstra (EWD391)
discusses separate local reads and adjustments rather than atomic simultaneous updates from a
single pre-step state. Accordingly, dijkstraDistRing n K (which fires any nonempty subset S of
privileged machines atomically from the same old state) and its closure, convergence (2 ≤ n ≤ K),
and sharpness (iff) theorems are original results for the simultaneous atomic-subset model.
We establish:
- Deadlock-freedom (
exists_dijkstraPrivileged,dijkstraRing_not_isTerminal,dijkstraDistRing_not_isTerminal): every configuration has at least one privileged machine. - Plateau characterization, closure, and round-robin circulation
(
dijkstraPrivilegedSet_eq_singleton_iff,dijkstraPrivilegedSet_step_of_eq_singleton,dijkstraRing_legitimate_closed,dijkstraDistRing_legitimate_closed,dijkstraRing_token_circulates): legitimate configurations are constant or two-plateau step functions, central and simultaneous atomic-subset transitions coincide on legitimate states, and the unique privilege advances fromptop + 1on every step, visiting every machine once pernsteps. - Worst-case finite stabilization (
dijkstraRing_selfStabilizing_of_pred_le,dijkstraRing_mTr_legitimate_of_le,dijkstraDistRing_mTr_legitimate_of_le,dijkstraDistRing_selfStabilizing_of_le): under a central daemon,n - 1 ≤ K(K ≥ Nwith2 ≤ nand2 ≤ K, Note 1 on p. 644 of Dijkstra) suffices for self-stabilization; in the original simultaneous atomic-subset modeldijkstraDistRing n K,2 ≤ n ≤ Kyields stabilization withinK * (n * (n - 1) / 2) + Ksteps without fairness assumptions. - Sharpness and necessary-and-sufficient bounds (
dijkstraRing_not_selfStabilizing_of_lt_pred,dijkstraDistRing_not_selfStabilizing_of_lt,dijkstraRing_selfStabilizing_iff,dijkstraDistRing_selfStabilizing_iff): original explicit periodic non-stabilizing executions show that for2 ≤ nand2 ≤ K,dijkstraRing n Kis self-stabilizing iffn - 1 ≤ KanddijkstraDistRing n Kis self-stabilizing iffn ≤ K. - Enabled-move composite-ring symmetry steps
(
not_uniform_enabledMove_selfStabilizing_composite_ring,not_uniform_distEnabledMove_selfStabilizing_composite_ring): scheduler-scoped steps towards Dijkstra (EWD391) showing that on a composite ring of sizen = a * b(2 ≤ a,2 ≤ b), no uniform deterministic ring protocol self-stabilizes to unique-privilege states under arbitrary enabled-move central (π.centralLTS) or simultaneous-subset (π.distLTS) schedules; EWD391's fair-command composite-ring endpoint (where every machine receives infinitely many adjustment commands, permitting no-effect commands) remains open (#7291).
Main definitions #
Cslib.Distributed.SelfStabilization.dijkstraPrivileged,Cslib.Distributed.SelfStabilization.dijkstraNextVal,Cslib.Distributed.SelfStabilization.dijkstraStep,Cslib.Distributed.SelfStabilization.dijkstraDistStep: local privilege predicate, central single-machine update, and original simultaneous atomic-subset update for Dijkstra'sK-state ring.Cslib.Distributed.SelfStabilization.dijkstraRing,Cslib.Distributed.SelfStabilization.dijkstraDistRing: central-daemon (Dijkstra, pp. 643–644) and original simultaneous atomic-subset labelled transition systems for Dijkstra'sK-state ring.Cslib.Distributed.SelfStabilization.dijkstraPrivilegedSet,Cslib.Distributed.SelfStabilization.DijkstraLegitimate,Cslib.Distributed.SelfStabilization.dijkstraTokenConfig: privileged set, unique-privilege legitimate configurations, and canonical two-plateau configurations.Cslib.Distributed.SelfStabilization.UniformRingProtocol,Cslib.Distributed.SelfStabilization.IsRingPeriodic: anonymous deterministic local ring protocols anda-periodic configurations.
Main results #
Cslib.Distributed.SelfStabilization.exists_dijkstraPrivileged,Cslib.Distributed.SelfStabilization.dijkstraRing_not_isTerminal,Cslib.Distributed.SelfStabilization.dijkstraDistRing_not_isTerminal: deadlock-freedom on every configuration.Cslib.Distributed.SelfStabilization.dijkstraPrivilegedSet_eq_singleton_iff,Cslib.Distributed.SelfStabilization.dijkstraPrivilegedSet_tokenConfig,Cslib.Distributed.SelfStabilization.dijkstraPrivilegedSet_step_of_eq_singleton: explicit two-plateau characterization of unique-privilege configurations and one-step clockwise rotation of the privilege fromptop + 1.Cslib.Distributed.SelfStabilization.dijkstraRing_legitimate_closed,Cslib.Distributed.SelfStabilization.dijkstraDistRing_tr_iff_dijkstraRing_of_legitimate,Cslib.Distributed.SelfStabilization.dijkstraDistRing_legitimate_closed,Cslib.Distributed.SelfStabilization.dijkstraRing_token_circulates: closure ofDijkstraLegitimateunder central and simultaneous atomic-subset transitions, their coincidence on legitimate configurations, and exactn-step round-robin token circulation.Cslib.Distributed.SelfStabilization.dijkstraRing_selfStabilizing_of_pred_le: central-daemon self-stabilization forn - 1 ≤ K(Dijkstra, p. 644, Note 1).Cslib.Distributed.SelfStabilization.dijkstraDistRing_mTr_legitimate_of_le,Cslib.Distributed.SelfStabilization.dijkstraDistRing_selfStabilizing_of_le,Cslib.Distributed.SelfStabilization.dijkstraRing_mTr_legitimate_of_le: original explicitK * (n * (n - 1) / 2) + Kstabilization bounds for2 ≤ n ≤ Kin the simultaneous atomic-subset and central-daemon models.Cslib.Distributed.SelfStabilization.dijkstraRing_not_selfStabilizing_of_lt_pred,Cslib.Distributed.SelfStabilization.dijkstraDistRing_not_selfStabilizing_of_lt: original explicit periodic non-stabilizing executions whenK + 1 < n(central daemon) andK < n(simultaneous atomic-subset model).Cslib.Distributed.SelfStabilization.dijkstraDistRing_selfStabilizing_iff,Cslib.Distributed.SelfStabilization.dijkstraRing_selfStabilizing_iff: exactn ≤ Kandn - 1 ≤ Kcharacterizations for the simultaneous atomic-subset and central-daemon models (2 ≤ n,2 ≤ K).UniformRingProtocol.card_privilegedSet_dvd_of_isRingPeriodic,UniformRingProtocol.isRingPeriodic_distStep,Cslib.Distributed.SelfStabilization.not_uniform_enabledMove_selfStabilizing_composite_ring,Cslib.Distributed.SelfStabilization.not_uniform_distEnabledMove_selfStabilizing_composite_ring:b-divisor privilege count ona-periodic configurations and scheduler-scoped enabled-move steps towards anonymous composite-ring impossibility on sizesn = a * b(2 ≤ a,2 ≤ b).
References #
Original simultaneous atomic-subset configuration update: every machine in S evaluates
dijkstraNextVal on the same pre-step configuration s and updates simultaneously.
Original simultaneous atomic-subset labelled transition system for Dijkstra's K-state ring on
Fin n: each transition selects a nonempty set S of privileged machines and updates them
atomically from the pre-step configuration s (distinct from Dijkstra, p. 643,
which excludes a distributed daemon, and from the separate read/adjust discussion in
Dijkstra).
Deadlock-freedom #
Every ring configuration has at least one privileged machine: if no machine i > 0 differs
from its left neighbour, then all machines equal s 0, so bottom machine 0 is privileged.
Dijkstra's K-state ring has no terminal configurations in the simultaneous atomic-subset
transition system dijkstraDistRing n K.
Plateau characterization, closure, and round-robin circulation #
Explicit characterization of configurations whose unique privileged machine is p:
constant configurations when p = 0, and two-plateau configurations jumping at p when p > 0.
Every canonical plateau configuration dijkstraTokenConfig n K p c has p as its unique
privileged machine when 2 ≤ K.
Firing the unique privileged machine p in a legitimate configuration transfers the unique
privilege to p + 1 (Dijkstra, p. 644).
Closure of DijkstraLegitimate n K under central-daemon transitions (2 ≤ K).
On DijkstraLegitimate n K, simultaneous atomic-subset transitions (dijkstraDistRing)
coincide with central-daemon transitions (dijkstraRing) since only one machine is privileged.
Original closure theorem for the simultaneous atomic-subset model: DijkstraLegitimate n K is
closed under dijkstraDistRing n K transitions when 2 ≤ K.
Round-robin token circulation: along any multistep execution from a legitimate configuration
with unique privilege at p, the k-th step fires (p + k) mod n and the final configuration has
unique privilege at (p + μs.length) mod n. In particular, over any n consecutive steps every
machine fires once.
Discrepancy potential and worst-case finite stabilization #
Original explicit worst-case convergence bound in the simultaneous atomic-subset model
dijkstraDistRing n K: when 2 ≤ n ≤ K, every execution of length at least
K * (n * (n - 1) / 2) + K ends in DijkstraLegitimate n K, with zero fairness assumptions.
Original convergence theorem for the simultaneous atomic-subset model: whenever 2 ≤ n and
n ≤ K, dijkstraDistRing n K is self-stabilizing to DijkstraLegitimate n K.
Original explicit worst-case convergence bound under a central daemon when 2 ≤ n ≤ K
(quantitative refinement of Dijkstra, p. 644).
Note 1 of Dijkstra (p. 644): under a central daemon, n - 1 ≤ K (K ≥ N for
n = N + 1 machines, with 2 ≤ n and 2 ≤ K) suffices for self-stabilization, within at most
(K + 1) * (n * (n - 1) / 2) + (K + 1) steps.
Impossibility cycles and sharp necessary-and-sufficient characterizations #
Original converse counterexample showing sharpness of Note 1 of Dijkstra
(p. 644): when 2 ≤ K and K + 1 < n (K < N), Dijkstra's K-state ring admits an explicit
periodic central-daemon execution that never enters DijkstraLegitimate n K, so
dijkstraRing n K is not self-stabilizing.
Original converse counterexample in the simultaneous atomic-subset model dijkstraDistRing:
when 2 ≤ K and K < n, dijkstraDistRing n K is not self-stabilizing (at n = K + 1,
synchronous execution from (0, K - 1, K - 2, …, 1, 0) cycles through K states in each of which
all n ≥ 3 machines are privileged).
Original exact characterization in the simultaneous atomic-subset model (2 ≤ n, 2 ≤ K):
dijkstraDistRing n K is self-stabilizing iff n ≤ K.
Exact characterization under a central daemon (2 ≤ n, 2 ≤ K), combining Note 1 of
Dijkstra (p. 644, K ≥ N) with the original converse
dijkstraRing_not_selfStabilizing_of_lt_pred: Dijkstra's K-state token ring is self-stabilizing
iff n - 1 ≤ K.
Enabled-move composite anonymous ring symmetry steps #
A deterministic uniform (anonymous) local ring protocol over state space State, in which
every node executes the identical local privilege predicate and state-transition function on its
(left, self, right) neighbourhood (after Dijkstra; Dijkstra,
pp. 643–644).
- privileged : State → State → State → Bool
Boolean privilege predicate reading
(left, self, right)neighbour states. - step : State → State → State → State
Next local state upon moving, reading
(left, self, right)neighbour states.
Whether node i is privileged in configuration s.
Next state of node i in configuration s.
Set of privileged nodes of π in configuration s.
Configurations in which exactly one node is privileged under π.
Enabled-move central-daemon labelled transition system of π on Fin n: transitions permit
only privileged moves, with no per-machine fairness obligation across residue classes.
Simultaneous atomic-subset enabled-move labelled transition system of π on Fin n: each
transition updates a nonempty set of privileged nodes atomically from the pre-step state.
On a ring of size a * b (1 ≤ a, 1 ≤ b), the number of privileged nodes in any
a-periodic configuration is divisible by b.
Any distributed step whose firing set S is a union of a-residue classes preserves
IsRingPeriodic a.
Scheduler-scoped enabled-move step towards the composite-ring symmetry argument of
Dijkstra (EWD391), and not EWD391's fair-command impossibility endpoint: on a
ring of composite size a * b (2 ≤ a, 2 ≤ b) over a nonempty state type, no uniform
deterministic ring protocol satisfies SelfStabilizing (π.centralLTS (a * b)) Legitimate for any
Legitimate ⊆ π.UniquePrivilege (a * b).
Because 2 ≤ a and 2 ≤ b, the b positions in any single modulo-a residue class have pairwise
ring distance at least 2. Stepping an enabled residue class sequentially in b-move blocks
reaches a new a-periodic configuration every b moves while closure of Legitimate rules out
intermediate visits to Legitimate. Note that π.centralLTS permits only privileged moves with no
fairness obligation across residue classes, whereas EWD391's daemon issues infinitely many
adjustment commands to every machine (permitting no-effect commands); EWD391's fair-command
composite-ring endpoint remains open (#7291).
Scheduler-scoped enabled-move step towards Dijkstra (EWD391) in the
simultaneous atomic-subset model π.distLTS, and not EWD391's fair-command impossibility
endpoint: on a composite ring of size a * b (2 ≤ a, 2 ≤ b) over a nonempty state type, no
uniform deterministic ring protocol satisfies SelfStabilizing (π.distLTS (a * b)) Legitimate for
any Legitimate ⊆ π.UniquePrivilege (a * b).