Documentation

CslibFrontier.DataStructure.PriorityQueue.FibonacciHeap.Native.Scatter

Native consolidation-table steps #

A consolidation step either places the root and stops or clears its occupied slot, performs the original certified root link, and continues. The maximum-degree accumulator uses a paid native comparison, preserving the original max source expression. The body domain concerns the actual cleared-table memory. The original placement forest supplies those domains and proves the finite cutoff sufficient. Full extraction also needs the root-list and table traversals.

Main definitions #

Main results #

Native compiler conditions for the reached consolidation step. The occupied-slot branch uses the same root-link domain at the memory obtained by its actual zero write.

The original consolidation-table step, with all runtime root and maximum-degree words faithfully retained. The link's local work and argument staging are charged by the shared rules.

theorem Cslib.DataStructure.PriorityQueue.FibonacciHeap.Native.scatterStepSafe_of_placing {n sz w base md : ℕ} {z : Fin n} {mem : Memory.State} {T : WordRAM.FibonacciHeap.FHTree n} {slots : List (WordRAM.FibonacciHeap.FHTree n)} (hfit : WordRAM.Fits w (base + (9 * n + 5))) (h : Placing sz z (view n ((layout n base).abs mem)) T slots md) :
scatterStepSafe w ![n, base, ↑T.root, md] mem

The actual source placement supplies the degree-table bound and both roots' native link conditions after the slot is cleared.

The native consolidation loop's domain: all reached body conditions hold and no active root is discarded by the original finite cutoff. The degree accumulator remains a runtime word.

theorem Cslib.DataStructure.PriorityQueue.FibonacciHeap.Native.scatterSafe_of_placing {n sz w base md : ℕ} {z : Fin n} {mem : Memory.State} {T : WordRAM.FibonacciHeap.FHTree n} {slots : List (WordRAM.FibonacciHeap.FHTree n)} (hfit : WordRAM.Fits w (base + (9 * n + 5))) (halloc : (layout n base).Inv mem) (h : Placing sz z (view n ((layout n base).abs mem)) T slots md) :
scatterSafe w ![n, base, ↑T.root, md] mem

The original placement invariant supplies the native loop domain. Each collision removes one table tree, so the original capacity cutoff suffices; no slot count is executed natively.

One uniform native emitter for the complete original consolidation recursion. It preserves both the linked memory source and its returned maximum degree, using the shared while rule.