Documentation

CslibFrontier.Algorithms.WordRAM.Arborescence.Internal.Workspace

Workspace layout, fitting lemmas, and initialized arborescence memory (internal) #

Defines base offsets (curAdjBase, …, frameRepAddr, wsSize), WsFits, word-bound fitting lemmas, and initial memory lemmas for ArborescenceInput.encode.

@[reducible, inline]

Word-pair encoding of two ℕ values into two words.

Workspace layout #

@[reducible, inline]

Base address of the active working n × n adjacency table in the workspace.

@[reducible, inline]

Base address of the active working n × n signed cost table in the workspace.

@[reducible, inline]

Base address of the scratch n × n adjacency table used during contraction.

@[reducible, inline]

Base address of the scratch n × n signed cost table used during contraction.

@[reducible, inline]

Base address of the n-word candidate feasibility mask array for argmin scans.

@[reducible, inline]

Base address of the n-word candidate cost array for argmin scans.

@[reducible, inline]

Base address of the active n-word parent array in the workspace.

@[reducible, inline]

Base address of the scratch n-word parent array used during expansion.

@[reducible, inline]

Base address of contraction stack frame k (size 4 * n + 1 words).

@[reducible, inline]

Base address of frame k's selected n-word parent table.

@[reducible, inline]

Base address of frame k's n-word contracted-cycle membership mask.

@[reducible, inline]

Base address of frame k's n-word best-entry vertex array.

@[reducible, inline]

Base address of frame k's n-word best-exit vertex array.

@[reducible, inline]

Address storing frame k's cycle representative vertex.

@[reducible, inline]

Total word footprint of the dense Chu–Liu/Edmonds workspace for n vertices.

@[reducible, inline]

Uniform address-fit predicate covering all workspace offsets and small constants.

theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.frame_le_frames {n k : ℕ} (hk : k < n) :
k * (4 * n + 1) + (4 * n + 1) ≤ n * (4 * n + 1)
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.fits_mem_flatten_adj_signed {w n m M₀ : ℕ} (adj : Fin n → Fin n → Bool) (wt : Fin n → Fin n → ℤ) (hM : ∀ (u v : Fin n), (wt u v).natAbs ≤ M₀) (hwb : WordRAM.Fits w (wordBound m M₀)) {x : ℕ} (hx : x ∈ flattenBoolMatrix n adj ++ flattenSignedMatrix n wt) :