Deterministic Cell-Probe State-Transition Implementations #
This file connects deterministic adaptive cell-probe schemes (Cslib.CellProbe.Scheme,
[Mil99], §1.2) to the general relational data-structure specification hierarchy
(Cslib.DataStructure.StateTransitionSpec, [CLRS09], Section 17.3).
A Cslib.DataStructure.CellProbe.StateTransitionImpl D P s₀ certifies that a time-invariant
cell-probe scheme P : Cslib.CellProbe.Scheme D.Op D.Result cells w implements D starting from
abstract initial state s₀ in cells cells of w-bit words (cells * w bits total, with no
persistent registers across operations), with nonnegative integer potential potential and
amortized per-operation probe charge charge.
From a single StateTransitionImpl, this file derives:
- Projections to
Cslib.DataStructure.StateTransitionImpl,Cslib.DataStructure.Amortized, and (whenpotentialis identically zero)Cslib.DataStructure.BoundoverExecOp P, inheriting all adaptive-client (D.Client α) soundness and potential-telescoping theorems; - Multi-operation sequence theorems connecting
P.runSeq opsandP.seqProbes opsdirectly toD.ValidTranscript(andD.run s₀ ops/D.totalCoston deterministic specifications[D.HasStepFn f]); - Cell-space monotonicity
StateTransitionImpl.padCells(cells ≤ cells').
Main definitions #
Cslib.DataStructure.CellProbe.OperationTrace: native single-operation cell-probe trace recordingprobesandprobedCells.Cslib.DataStructure.CellProbe.ExecOp: nativeDataStructure.Executionsemantics of a deterministicCslib.CellProbe.Scheme.Cslib.DataStructure.CellProbe.StateTransitionImpl: certified deterministic cell-probe implementation ofD : StateTransitionSpecfrom initial states₀.Cslib.DataStructure.CellProbe.StateTransitionImpl.ofFn: constructor for deterministic specifications ([D.HasStepFn f]).Cslib.DataStructure.CellProbe.StateTransitionImpl.toBaseImpl: projection toCslib.DataStructure.StateTransitionImpl D (ExecOp P).Cslib.DataStructure.CellProbe.StateTransitionImpl.padCells: lift an implementation fromcellstocells'cells (cells ≤ cells') viaCslib.CellProbe.Scheme.padCells.
Main results #
Cslib.DataStructure.CellProbe.execOp_run,Cslib.DataStructure.CellProbe.ExecOp.eq_of_execOp,Cslib.DataStructure.CellProbe.ExecOp.card_probedCells_le_probes: totality, determinism, and probed-cell cardinality bound forExecOp.Cslib.DataStructure.CellProbe.StateTransitionImpl.toAmortized,Cslib.DataStructure.CellProbe.StateTransitionImpl.toBound: projections toDataStructure.AmortizedandDataStructure.Bound.Cslib.DataStructure.CellProbe.StateTransitionImpl.run_client_demonic_amortized,Cslib.DataStructure.CellProbe.StateTransitionImpl.run_client_amortized,Cslib.DataStructure.CellProbe.StateTransitionImpl.run_client_bound: adaptive-client probe bounds fromP.init.Cslib.DataStructure.CellProbe.StateTransitionImpl.runFrom_amortized,Cslib.DataStructure.CellProbe.StateTransitionImpl.runSeq_amortized,Cslib.DataStructure.CellProbe.StateTransitionImpl.runSeq_ofFn,Cslib.DataStructure.CellProbe.StateTransitionImpl.seqProbes_le_ofFn: multi-operation sequence correctness and amortized probe bounds onP.runFrom,P.runSeq, andP.seqProbes.
References #
Native single-operation execution evidence #
Native execution evidence of a single deterministic cell-probe operation: the number of probes incurred and the finite set of distinct cells accessed.
- probes : ℕ
Number of cell reads and writes executed during the operation.
Set of distinct cell indices accessed during the operation.
Native Cslib.DataStructure.Execution semantics of a deterministic cell-probe Scheme.
Every memory m and operation o admits a canonical ExecOp step of P.
ExecOp P is deterministic: its answer, post-memory, and trace are uniquely determined by
(P.step o) and m.
On any ExecOp P step, the number of distinct probed cells is at most tr.probes.
Deterministic cell-probe StateTransitionImpl #
Certified deterministic cell-probe implementation of D : StateTransitionSpec from initial
state s₀ using cells cells of w-bit words (cells * w bits total) with nonnegative potential
potential and per-operation amortized probe charge charge.
Representation invariant linking abstract states of
Dto concreteMem cells wstates.- potential : CellProbe.Mem cells w → ℕ
Nonnegative integer potential on cell memories (
0when worst-case / unamortized). - initPotential : ℕ
Upper bound on initial potential at
P.init(0when unamortized). Per-operation amortized probe charge.
Initial cell memory
P.initrepresentss₀.Potential at
P.initis bounded byinitPotential.- step_exec {s : D.State} {m : CellProbe.Mem cells w} (o : D.Op) : self.rep s m → D.valid s o → ∃ (s' : D.State), D.step s o s' ((P.step o).run m).1 ∧ self.rep s' ((P.step o).run m).2 ∧ (P.step o).probes m + self.potential ((P.step o).run m).2 ≤ self.charge s o + self.potential m
Angelic step correctness and potential-amortized probe bound for every admissible
o.
Construct a deterministic cell-probe StateTransitionImpl on a functional specification
(D.HasStepFn f) from a functional step-correctness and amortized probe proof.
Project a cell-probe StateTransitionImpl to the backend-agnostic
Cslib.DataStructure.StateTransitionImpl D (ExecOp P).
Project a cell-probe StateTransitionImpl to Cslib.DataStructure.Amortized with probe count
weight OperationTrace.probes.
When C.potential is identically zero, StateTransitionImpl projects directly to a worst-case
per-operation Cslib.DataStructure.Bound certificate.
Adaptive-client and multi-operation sequence theorems #
Adaptive-client amortized probe bound from P.init along any demonically admissible client
p : D.Client α.
Adaptive-client amortized probe bound from P.init on a deterministic specification
(D.HasStepFn f).
Adaptive-client worst-case probe bound from P.init on a deterministic specification when
C.potential is identically zero.
Multi-operation execution of P.runFrom m ops from any represented memory m: every
demonically admissible sequence ops witnesses a valid relational transcript tr whose labels
equal (P.runFrom m ops).1 and whose total charge bounds P.probesFrom m ops up to potential.
Multi-operation execution of P.runSeq ops from P.init: every demonically admissible
sequence D.ValidOpSeq s₀ ops produces a valid relational transcript tr matching
(P.runSeq ops).1 with P.seqProbes ops + C.potential (P.runSeq ops).2 ≤ C.initPotential + D.totalCostTranscript C.charge s₀ tr.
On a deterministic specification (D.HasStepFn f), P.runSeq ops on any admissible history
D.ValidHistory s₀ ops produces the exact canonical transcript (D.run s₀ ops).2, reaches a
memory representing (D.run s₀ ops).1, and satisfies
P.seqProbes ops + C.potential (P.runSeq ops).2 ≤ C.initPotential + D.totalCost C.charge s₀ ops.
Total cell probes P.seqProbes ops across any admissible history D.ValidHistory s₀ ops on a
deterministic specification is at most C.initPotential + D.totalCost C.charge s₀ ops.
Cell padding (cells ≤ cells') #
Lift a deterministic cell-probe StateTransitionImpl from cells cells to cells' cells
(cells ≤ cells') via Cslib.CellProbe.Scheme.padCells, preserving initPotential and charge.