Execution traces of the atomic snapshot implementation #
Defines SnapshotTrace, indexed state projection stateAt, and conversion from snapshotLTS.MTr
derivations (of_mtr).
Main definitions #
Cslib.Distributed.SetAgreement.SnapshotTrace,Cslib.Distributed.SetAgreement.SnapshotTrace.stateAt: indexed trace representation.
Main results #
Cslib.Distributed.SetAgreement.SnapshotTrace.stateAt_zero,Cslib.Distributed.SetAgreement.SnapshotTrace.stateAt_step,Cslib.Distributed.SetAgreement.SnapshotTrace.of_mtr: basic trace andMTrconversion lemmas.
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].
- events : List (SnapshotEvent P Data)
Sequence of executed atomic events.
- states : List (SnapshotState P Data)
Sequence of visited configurations (
length = events.length + 1). Length alignment.
Initial configuration is
SnapshotState.init dInit.- step_valid (t : ℕ) (ht : t < self.events.length) : stepSnapshot ord dInit self.states[t] self.events[t] = some self.states[t + 1]
Valid step relation at every index
t < events.length.
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 : ℕ) :
SnapshotState P Data
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) :
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) :
Convert any MTr reachability derivation from init into a SnapshotTrace.