Runtime Trinomial-Step, Power-of-Three, and HashParams Core Evaluators #
Implements the bounded trinomialStepAux and 3 ^ e loops together with the read-only
computeHashCoreProg subroutine computing ((w0, minW0), (c, (l0, p))) for mkHashParams.
Bounded trinomialStepAux and 3 ^ e Loops #
computeHashCoreProg and Arithmetic Invariants #
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.ParamsComputeAux.computeHashCore_arith {w U N dstMetaBase : ℕ} (hw : 0 < w) (hN : 1 ≤ N) (hNU : N ≤ U) (hU : WordRAM.Fits w U) (hfit_dst : WordRAM.Fits w (dstMetaBase + offCompItems U w N)) :
have B := Probability.reducedTargetBits (epochQBits U N) (epochHashB N) (SuccinctBucket.totalMicroBits N);
have t := Probability.reducedTrinomialStep (epochQBits U N) (epochHashB N) (SuccinctBucket.totalMicroBits N);
have c := Probability.reducedChunkBits t;
8 ≤ w ∧ epochQBits U N ≤ w ∧ SuccinctBucket.totalMicroBits N ≤ w ∧ Nat.log 2 N < w ∧ 2 * c < w ∧ B ≤ 3 * Nat.log 2 N + 3 ∧ 2 * c ≤ N + 8 ∧ WordRAM.Fits w (B + 2) ∧ WordRAM.Fits w (3 ^ (t - 3)) ∧ WordRAM.Fits w (3 ^ min t 3) ∧ WordRAM.Fits w (min (2 * c) (Nat.log 2 (w / (2 * c))) + 1)
Pure arithmetic invariants for computeHashCoreProg and writeHashParamsSubProg.
def Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.ParamsComputeAux.ComputeHashCorePre (w : ℕ) :
Precondition for computeHashCoreProg.
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.ParamsComputeAux.computeHashCoreProg_exec {w U N hdrBase dstMetaBase : ℕ} {s : Memory.State} (hw : 0 < w) (hN : 1 ≤ N) (hNU : N ≤ U) (hU : WordRAM.Fits w U) (hhdr : hdrBase < s.frontier) (hfit_dst : WordRAM.Fits w (dstMetaBase + offCompItems U w N)) :
have d := ((hdrBase, w), FeistelQuotient.quotientBits U N, Nat.log 2 N);
have t := Probability.reducedTrinomialStep (epochQBits U N) (epochHashB N) (SuccinctBucket.totalMicroBits N);
(Memory.spec w).ValidHistory s ((Memory.spec w).clientHistory s (computeHashCoreProg d)) ∧ (Memory.spec 0).clientState s (computeHashCoreProg d) = s ∧ (Memory.spec 0).clientResult s (computeHashCoreProg d) = ((epochQBits U N, min (epochQBits U N) (3 * epochHashB N)), Probability.reducedChunkBits t, Probability.reducedHalfLimbs t, Probability.reducedPackShift t w) ∧ WordRAM.Realization.memoryCost (computeHashCoreProg d) s ≤ 7 * N + 20
Functional specification and ≤ 7 * N + 20 cost bound for computeHashCoreProg.
computeHashCoreProg compiles via RealizesBounded .exact.