Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpTickHealProg.StepDispatch

Top-Level whpStepPureGenProg Mode Dispatcher and O_c(1) Fast-Branch Certificate #

This module implements the top-level parameter-free Memory.Prog step dispatcher whpStepPureGenProg across .small, .fast (both O_c(1) fast-branch hits and fallback transitions via fastToCsrGenProg + trySelfHealGenProg), and .fallback, refining whpStepPure c U n_max θ st op inside whpSpace c U V w n_max words with memoryCost ≤ whpFastBranchCost c whenever IsFastStepHit c U n_max ops_prev op θ holds.

Main definitions #

Main results #

References #

c-only memoryCost upper bound on whpStepPureGenProg whenever IsFastStepHit holds (1 mode-word read plus smallOpCostWhp c or fastOpCostWhp c).

@[irreducible]

Top-level parameter-free Memory.Prog step dispatcher for whpStepPure c U n_max θ st op across .small, .fast, and .fallback modes (d = (((wp, base), opTag), (u_val, v_val))).

Precondition for whpStepPureGenProg (d = (((wp, base), opTag), (u_val, v_val))).

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.whpStepPureGenProg_spec {c U V w n_max base : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {st : SuccinctWhp.WhpDictState} {dict : State U} {s : Memory.State} (hc : 0 < c) (hw : 0 < w) (hnU : n_max ≤ U) (hU : WordRAM.Fits w U) (hV : WordRAM.Fits w V) (hfit_sp : WordRAM.Fits w (base + SuccinctWhp.whpSpace c U V w n_max)) (hrep : WhpMemRep base c U V w n_max θ st s.mem) (hv : SuccinctWhp.ValidWhpState c U V n_max θ st dict) {op : Dynamic.Op U} (hval_op : Dynamic.valid V n_max dict op) :
have enc := encodeOpWhp op; have prog := whpStepPureGenProg (((mkWhpParams c U V w n_max, base), enc.1), enc.2); have s' := (Memory.spec 0).clientState s prog; have pureOut := SuccinctWhp.whpStepPure c U n_max θ st op; WhpMemRep base c U V w n_max θ pureOut.1 s'.mem ∧ (Memory.spec 0).clientResult s prog = encodeOptRes pureOut.2 ∧ s'.frontier = s.frontier ∧ Succinct.ValidProg w (base + SuccinctWhp.whpSpace c U V w n_max) s prog ∧ (∀ (a : ℕ), a < base ∨ base + SuccinctWhp.whpSpace c U V w n_max ≤ a → s'.mem a = s.mem a) ∧ ∀ (ops_prev : List (Dynamic.Op U)), st = SuccinctWhp.whpRunPure c U n_max θ ops_prev → SuccinctWhp.IsFastStepHit c U n_max ops_prev op θ → WordRAM.Realization.memoryCost prog s ≤ whpFastBranchCost c

Master Memory.Prog refinement and conditional O_c(1) memoryCost specification for whpStepPureGenProg:

  • For every seed θ and valid state (st, dict), refines whpStepPure c U n_max θ st op, preserves WhpMemRep and frontier, satisfies ValidProg inside [base, base + whpSpace c U V w n_max), and leaves caller memory outside [base, base + whpSpace c U V w n_max) untouched;
  • Whenever st = whpRunPure c U n_max θ ops_prev and IsFastStepHit c U n_max ops_prev op θ holds, executes in at most whpFastBranchCost c (O_c(1)) worst-case memory operations.