Wait-free shared-memory consensus and the critical-configuration engine #
This module models deterministic asynchronous shared-memory protocols interacting with an indexed
family of typed deterministic sequential shared objects (ObjSpec), following [Her91]
(§§2.2–3.1, pp. 128–133; see also prior register-impossibility work [LAA87] cited in
[Her91], §3.1, p. 132). It serves as the shared-memory counterpart to Cslib.FLP
(asynchronous crash-fault message passing) and reuses Cslib.LTS for multistep reachability.
In each global configuration (Config), every shared object i : I holds a sequential state in
ObjState i, and every process p : P holds an internal local state in S together with a
write-once decision slot decided : Option V (ProcState). In an atomic step (Protocol.step),
an undecided (Config.Active) process p invokes a single shared object i = π.target p s with
operation π.op p s, updates object i to the resulting sequential state, updates p's local
state from the returned response, and optionally writes its decision to decided. Once p has
decided, its decision is immutable and p takes no further active transitions in Protocol.lts.
Protocol.SolvesWaitFreeConsensus specifies wait-free consensus ([Her91], §3, p. 130):
- Wait-free termination (
Protocol.WaitFree): from every initial configurationπ.initConfig inp, the active-step relationProtocol.StepRelis accessible (∀ inp, Acc π.StepRel (π.initConfig inp)), i.e., no infinite sequence of active steps exists from any reachable configuration (Protocol.Reachable.acc). Unlike globalWellFounded, unreachable local states inSimpose no restriction on impossibility theorems, while bounded-step protocols dischargeWaitFreein one line viaProtocol.WaitFree.of_wellFounded. - Agreement (
Config.Agreed): no reachable configuration decides two distinct values. - Validity: every value decided in a reachable configuration equals some process's initial input.
For binary consensus (V = Bool), we develop the constructive bivalence and critical-configuration
engine ([Her91], §3.1, pp. 131–133):
Protocol.soloRuncomputably drives any single processpto a decision from any accessible configuration viaWellFounded.fixF, andProtocol.soloRun_mem_proc_eqshows thatp's solo execution depends only onc.memandc.proc p.Protocol.exists_bivalent_initproves that when2 ≤ Fintype.card P, every wait-free binary consensus protocol admits a bivalent initial configuration by flipping inputs one process at a time from unanimousfalseto unanimoustrue(extending [Her91], §3.1, p. 131 from|P| = 2to arbitrary2 ≤ Fintype.card P).Protocol.exists_critical_configuses structural recursion onAcc π.StepReldirectly (without König's lemma) to reach a critical bivalent configurationc*where every process is active and two distinct processesp ≠ qstep tofalse-univalent andtrue-univalent configurations respectively.
Main definitions #
Cslib.Distributed.SharedMemory.ObjSpec: deterministic sequential shared-object specification.Cslib.Distributed.SharedMemory.ProcState: per-process internal state and write-once decision.Cslib.Distributed.SharedMemory.Config: global shared-memory configuration.Cslib.Distributed.SharedMemory.Protocol: asynchronous deterministic shared-memory protocol.Cslib.Distributed.SharedMemory.Protocol.lts: active-stepCslib.LTSof a protocol.Cslib.Distributed.SharedMemory.Protocol.StepRel,Cslib.Distributed.SharedMemory.Protocol.WaitFree: active-step relation and reachable wait-free termination from everyinitConfig.Cslib.Distributed.SharedMemory.Protocol.SolvesWaitFreeConsensus: wait-free consensus specification (termination, agreement, validity).Cslib.Distributed.SharedMemory.Protocol.soloRun: solo execution of a single process to completion.Cslib.Distributed.SharedMemory.Protocol.CanDecide,Cslib.Distributed.SharedMemory.Protocol.IsUnivalent,Cslib.Distributed.SharedMemory.Protocol.IsBivalent,Cslib.Distributed.SharedMemory.Protocol.IsCritical: bivalence and criticality predicates.
Main results #
Cslib.Distributed.SharedMemory.Protocol.soloRun_mem_proc_eq: solo-run indistinguishability when shared memory and the running process's state agree.Cslib.Distributed.SharedMemory.Protocol.not_univalent_of_indistinguishable: configurations reachable fromfalse-univalent andtrue-univalent states cannot agree on shared memory and any single witness processw.Cslib.Distributed.SharedMemory.Protocol.exists_bivalent_init: every wait-free binary consensus protocol on2 ≤ Fintype.card Pprocesses has a bivalent initial configuration.Cslib.Distributed.SharedMemory.Protocol.exists_critical_config: every reachable bivalent configuration of a wait-free binary consensus protocol reaches a critical configuration with all processes active and distinctfalse-univalent andtrue-univalent successor steps.