Certified Memory.Prog Implementations of locState, permuteByTarget, and fastToCsr #
This module implements the overflow-free 2-bit locState accessors (readLocStateGenProg,
writeLocStateGenProg), the bucket-interval scanner scanBucketLoopProg, the in-place
cycle-following permutation permuteByTargetProg shared by fastToCsr and csrToFast, and the
fastToCsrGenProg transition from FastMemRep to CsrMemRep, all certified over Basis.exact
with zero local work via realize and Realizes.iterate₀.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readLocStateGenProg,writeLocStateGenProg: overflow-free 2-bitoffLocStateaccessors avoidingb * totalLocproduct overflow whenn_maxapproaches2 ^ w.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.permuteByTargetProg,fastToCsrGenProg: parameter-freeMemory.Progimplementations of in-place slot permutation and fallback CSR compaction.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_readLocStateGen,realizes_writeLocStateGen,realizes_permuteByTarget,realizes_fastToCsrGen: parameter-freeRealizes .exactcertificates.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.permuteByTargetProg_spec,fastToCsrGenProg_spec: exact memory refinement specifications preservingSeedWhpMemRepand framing memory outsidelargeSpaceWhp.
Section 1: Overflow-Free 2-Bit offLocState Accessors #
Section 2: PermRt, scanBucketProg, permuteByTargetProg, and fastToCsrGenProg #
Compact 19-word runtime parameter bundle for permuteByTarget, fastToCsr, and csrToFast
array loops:
(((base, w), (n_max, M)), (((cf, cb), (frontTotal, poolSize)),
(((gBits, quotBits), (valBits, permActBits)),
((offQuot, offVal), ((offPermAct, offBktMeta), (offFbStart, (offBackPtr, offPoolOwner))))))).
Base word address extracted from PermRt.
Pure constructor for PermRt (19 words).
Extract PermRt from (cp, base) in 0 memory operations.
Complete in-place permuteByTarget in Memory.Prog (d = (prt, mode)).
Exact memory specification of permuteByTargetProg: rearranges offQuotWhp and offValWhp
according to permuteByTarget n_max dest act₀ qArr vArr while leaving all memory words outside
[base + offQuotWhp c w n_max, base + offLocState c U V w n_max) unchanged.
Section 3: fastToCsrGenProg (FastMemRep → CsrMemRep) #
Convert FastMemRep in place to CsrMemRep (d = (cp, base)).
Exact specification of fastToCsrGenProg: converts any valid FastMemRep into CsrMemRep for
fastToCsr n_max fs while preserving SeedWhpMemRep and leaving memory outside
[base, base + largeSpaceWhp c U V w n_max) untouched.
Exact evaluation of permEvalActDestProg in mode mode ≠ 1 (csrToFast).