Shared Low-Level Memory.Prog Combinators, Bounded log₂ Loop, and Block Writers #
Internal primitive evaluators, Fits offset helpers, bounded floor-log₂ iteration
(log2CapProg), saturating/min/max/zero-branch combinators, and 3/4/8-word contiguous block writers
shared across the ParamsCompute submodules.
Word-Width Fits and Ceiling-Logarithm Helpers #
Any word width accommodating 225 satisfies 8 ≤ w.
Whenever Fits w 225, 3 * w + 5 also fits in w bits.
Any header offset dstMetaBase + k with k ≤ 225 fits in w bits when
dstMetaBase + offCompItems U w N fits.
The end of the hash-table region (dstMetaBase + epochHdrWords) + epochHashSpace U w N fits
in w bits when dstMetaBase + offCompItems U w N fits.
Bounded Floor-log₂ Loop (log2CapProg) #
Bounded K-step evaluator computing min K (Nat.log 2 x₀) via iterate.
Precondition for log2CapProg.
log2CapProg compiles via RealizesBounded .exact.
Functional specification and ≤ K cost bound for log2CapProg.
Pure Scalar Combinators and Read/Write Step Helpers #
ValidHistory step lemma for a single Memory.read.
ValidHistory step lemma for a single Memory.write.
Saturating natural subtraction a - b in Memory.Prog without underflow.
Minimum min a b in Memory.Prog.
Maximum max a b in Memory.Prog.
Zero-comparison conditional if x = 0 then tVal else fVal in Memory.Prog.
Contiguous 3-, 4-, and 8-Word Block Writers #
Precondition for writeBlock3Prog.
Precondition for writeBlock4Prog.
Specification for two consecutive writeBlock4Prog calls writing slice [off, off + 8) of
g : Fin n → ℕ into [base, base + 8).
Specification for two consecutive writeBlock4Prog calls followed by pure ret.