Documentation

CslibFrontier.Algorithms.WordRAM.TrimmedYates.Regs

Internal register layout, domain buffer predicate, and signed arithmetic wrappers #

Internal register indices across the 47 algorithm registers above the 9-register WordRAM.Signed bank, the interleaved (mask, size) domain buffer invariant HoldsDom, and width-fit wrappers around WordRAM.Signed (add, subtract, multiply) at physical word width w.

Main definitions #

Main results #

Internal scratch register bank #

@[reducible, inline]

Scratch register holding constant 0.

@[reducible, inline]

Scratch register holding constant 1.

@[reducible, inline]

Saved post-preprocessing bump-allocator high-water mark (qWorkStart).

@[reducible, inline]

Current trie root pointer for trie operations.

@[reducible, inline]

Bitmask key argument for trie lookup/insert/add.

@[reducible, inline]

Encoded payload value read from or written to a trie leaf.

@[reducible, inline]

Current trie node pointer while descending bits.

@[reducible, inline]

Remaining trie depth counter during descent.

@[reducible, inline]

Extracted low bit (0 or 1) during trie descent.

@[reducible, inline]

Scratch register for trie node address arithmetic.

@[reducible, inline]

Base address of the active coordinate array.

@[reducible, inline]

Length of the active coordinate array (d or #C).

@[reducible, inline]

Maximum subset cardinality bound for genBounded.

@[reducible, inline]

Base address of the enumerated (mask, size) domain buffer.

@[reducible, inline]

Current number of (mask, size) pairs in rDomPtr.

@[reducible, inline]

Outer coordinate loop index in subset enumeration and extraction.

@[reducible, inline]

Inner domain scan index in genBounded.

@[reducible, inline]

Snapshot of rDomLen at the start of a genBounded coordinate pass.

@[reducible, inline]

Single-bit mask 1 <<< coord for the active coordinate.

@[reducible, inline]

General-purpose address and arithmetic scratch register.

@[reducible, inline]

Fallback cardinality cutoff (0 in preprocessing, s + 1 in high queries).

@[reducible, inline]

Yates pass sign selector (0 for +1 zeta, 1 for -1 Möbius).

@[reducible, inline]

Output base address for an array of d + 1 stage trie roots.

@[reducible, inline]

Base address of preprocessed fallback stage trie roots.

@[reducible, inline]

Current Yates coordinate stage index k ∈ [0, d).

@[reducible, inline]

Current domain cell index p ∈ [0, L) during tabulation.

@[reducible, inline]

Trie root of stage k read by stage k + 1 (or left factor in tabulateMul).

@[reducible, inline]

Fallback trie root for stage k (or right factor in tabulateMul).

@[reducible, inline]

Current query loop index q ∈ [0, |Cs|).

@[reducible, inline]

Current cell bitmask setMask Y (or active query mask setMask C).

@[reducible, inline]

Current cell cardinality #Y.

@[reducible, inline]

Base address of the d + 1 preprocessed f-stage trie roots.

@[reducible, inline]

Base address of the d + 1 preprocessed g-stage trie roots.

@[reducible, inline]

Base address of the d + 1 preprocessed h-stage trie roots.

@[reducible, inline]

Base address of the d + 1 per-query high f-stage trie roots.

@[reducible, inline]

Base address of the d + 1 per-query high g-stage trie roots.

Domain buffer layout and width envelope helper #

def Cslib.Algorithms.WordRAM.TrimmedYates.HoldsDom {d : ℕ} (mem : ℕ → ℕ) (base : ℕ) (xs : List (Finset (Fin d))) :

Interleaved (mask, size) domain layout at base: entry p stores setMask xs[p] at base + 2 * p and #xs[p] at base + 2 * p + 1.

Signed integer wrappers at physical width w #