Documentation

CslibFrontier.Computability.Distributed.SetAgreement.AtomicSnapshot.TraceSteps

Internal transition-kind specializations of TraceInv #

Specializes TraceInv.of_actor_step to invocation (of_invoke), local active scan steps (of_local_active), and operation completion (of_complete); never re-exported through AtomicSnapshot.

Main results #

theorem Cslib.Distributed.SetAgreement.SnapshotTrace.TraceInv.of_invoke {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} {τ : SnapshotTrace ord dInit} {t : ℕ} (inv : τ.TraceInv t) (i : P) (mode : ScanMode Data) (hpi : (τ.stateAt t).proc i = ProcSnapshotState.idle) (hnow : ¬∃ (j : P), τ.isWriteStep j t) (hs₁ : have opId := (τ.stateAt t).history.length; have dummy := fun (x : P) => SnapshotReg.init dInit; have st := { mode := mode, opId := opId, moved := ∅, phase := CollectPhase.collectA, rem := ord.elems, collectAVal := dummy, collectBVal := dummy }; have kind := match mode with | ScanMode.external => SnapshotOpKind.scan | ScanMode.embedded v => SnapshotOpKind.update v; { reg := (τ.stateAt t).reg, proc := Function.update (τ.stateAt t).proc i (ProcSnapshotState.scanning st), history := (τ.stateAt t).history ++ [{ caller := i, kind := kind, invStep := (τ.stateAt t).stepCount, status := SnapshotOpStatus.pending }], stepCount := (τ.stateAt t).stepCount + 1 } = τ.stateAt (t + 1)) :
τ.TraceInv (t + 1)

Specialization of TraceInv.of_actor_step for .invokeScan i and .invokeUpdate i val.

theorem Cslib.Distributed.SetAgreement.SnapshotTrace.TraceInv.of_local_active {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} {τ : SnapshotTrace ord dInit} {t : ℕ} (inv : τ.TraceInv t) {i : P} {st : ActiveScan P Data} (hpi : (τ.stateAt t).proc i = ProcSnapshotState.scanning st) (hnow : ¬∃ (j : P), τ.isWriteStep j t) (ps_new : ProcSnapshotState P Data) (hps_ne : ps_new ≠ ProcSnapshotState.idle) (hs_eq : (have __src := τ.stateAt t; { reg := __src.reg, proc := Function.update (τ.stateAt t).proc i ps_new, history := __src.history, stepCount := (τ.stateAt t).stepCount + 1 }) = τ.stateAt (t + 1)) (hact_new : HasActiveOpId ps_new st.opId) (hready_i : ∀ (id' : ℕ) (v' : Data) (sn' : P → Data), ps_new = ProcSnapshotState.readyToWrite id' v' sn' → id' = st.opId ∧ st.mode = ScanMode.embedded v' ∧ ∃ (v : ℕ), τ.lastIdleStep i t + 1 ≤ v ∧ v ≤ t + 1 ∧ memSnapshot (τ.stateAt v).reg = sn') (hscan_i : ∀ (st' : ActiveScan P Data), ps_new = ProcSnapshotState.scanning st' → st'.opId = st.opId ∧ st'.mode = st.mode ∧ τ.ScanLoopInv (τ.lastIdleStep i t) (t + 1) st') :
τ.TraceInv (t + 1)

Specialization of TraceInv.of_actor_step when active scan st of i transitions to a non-idle local state ps_new without modifying reg or history.

theorem Cslib.Distributed.SetAgreement.SnapshotTrace.TraceInv.of_complete {P : Type u_1} {Data : Type u_2} [Fintype P] [DecidableEq P] {ord : ScanOrder P} {dInit : Data} {τ : SnapshotTrace ord dInit} {t : ℕ} (inv : τ.TraceInv t) {i : P} {activeId : ℕ} (hId : activeId < (τ.stateAt t).history.length) (oldKind : SnapshotOpKind Data) (newSt : SnapshotOpStatus P Data) (hnew_ne : newSt ≠ SnapshotOpStatus.pending) (hrec_i : (τ.stateAt t).history[activeId] = { caller := i, kind := oldKind, invStep := τ.lastIdleStep i t, status := SnapshotOpStatus.pending }) (hact_i : HasActiveOpId ((τ.stateAt t).proc i) activeId) (hstepCount : (τ.stateAt (t + 1)).stepCount = t + 1) (hproc_eq : (τ.stateAt (t + 1)).proc = Function.update (τ.stateAt t).proc i ProcSnapshotState.idle) (hhist_upd : (τ.stateAt (t + 1)).history = completeHistoryAt (τ.stateAt t).history activeId newSt) (hreg_t : ∀ (j : P), τ.isWriteStep j t → ∃ (v : ℕ), τ.lastIdleStep j t + 1 ≤ v ∧ v ≤ t ∧ memSnapshot (τ.stateAt v).reg = ((τ.stateAt (t + 1)).reg j).view) (hdoneScan_new : ∀ (resp : ℕ) (snap : P → Data), newSt = SnapshotOpStatus.doneScan resp snap → oldKind = SnapshotOpKind.scan ∧ τ.lastIdleStep i t < resp ∧ resp < t + 1 ∧ ∃ (v : ℕ), τ.lastIdleStep i t + 1 ≤ v ∧ v ≤ resp ∧ memSnapshot (τ.stateAt v).reg = snap) (hdoneUpdate_new : ∀ (resp : ℕ), newSt = SnapshotOpStatus.doneUpdate resp → ∃ (val : Data), oldKind = SnapshotOpKind.update val ∧ τ.lastIdleStep i t < resp ∧ resp < t + 1 ∧ τ.isWriteStep i resp ∧ (τ.stateAt (resp + 1)).reg i = { data := val, seq := ((τ.stateAt resp).reg i).seq + 1, view := ((τ.stateAt (resp + 1)).reg i).view }) (hwrite_t : ∀ (j : P), τ.isWriteStep j t → j = i ∧ newSt = SnapshotOpStatus.doneUpdate t) :
τ.TraceInv (t + 1)

Specialization of TraceInv.of_actor_step when active operation activeId of i completes (newSt ≠ .pending) and proc i returns to .idle.