Documentation

CslibFrontier.Computability.Distributed.SetAgreement.AtomicSnapshot.Trace

Execution traces of the atomic snapshot implementation #

Defines SnapshotTrace, indexed state projection stateAt, and conversion from snapshotLTS.MTr derivations (of_mtr).

Main definitions #

Main results #

Execution traces and register write monotonicity (Lemma 3.1) #

structure Cslib.Distributed.SetAgreement.SnapshotTrace {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] (ord : ScanOrder P) (dInit : Data) :
Type (max u_1 u_2)

An indexed execution trace of snapshotLTS ord dInit starting from SnapshotState.init dInit: states has length events.length + 1, states[0] = init, and each events[t] steps states[t] to states[t + 1].

def Cslib.Distributed.SetAgreement.SnapshotTrace.stateAt {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} (τ : SnapshotTrace ord dInit) (t : ℕ) :

State at index t of trace τ (clamped at the final state if t ≥ τ.states.length).

@[simp]
theorem Cslib.Distributed.SetAgreement.SnapshotTrace.stateAt_zero {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} (τ : SnapshotTrace ord dInit) :
theorem Cslib.Distributed.SetAgreement.SnapshotTrace.stateAt_step {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} (τ : SnapshotTrace ord dInit) {t : ℕ} (ht : t < τ.events.length) :
stepSnapshot ord dInit (τ.stateAt t) τ.events[t] = some (τ.stateAt (t + 1))
theorem Cslib.Distributed.SetAgreement.SnapshotTrace.of_mtr {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} {tr : List (SnapshotEvent P Data)} {s : SnapshotState P Data} (hmtr : (snapshotLTS ord dInit).MTr (SnapshotState.init dInit) tr s) :
∃ (τ : SnapshotTrace ord dInit), τ.events = tr ∧ τ.stateAt tr.length = s

Convert any MTr reachability derivation from init into a SnapshotTrace.