Native Fibonacci-heap Dijkstra from the existing framed memory client #
Dijkstra.Native.Fibonacci.run is realized by instantiating the shared
Dijkstra.Native.NativeMethods and Dijkstra.Native.NativeAllocator interfaces with the 2-word
HeapLayout record (word_enc_structure layoutWords), FibonacciHeap.framed, and the native
Fibonacci-heap update, extraction, and dirty-reservation certificates.
The original amortized potential pays for memory operations; the native code separately charges arithmetic, argument copies, loop control and initialization. Flat exports retain the original graph input and word envelope, include their real prefix and halt, and preserve the full final memory.
Main definitions #
HeapLayout,layoutWords: 2-word runtime Fibonacci-heap handle and its register encoding.ValidHeap: static validity witness for a runtime Fibonacci-heap handle at capacityn.nativeMethods,nativeAllocator: Fibonacci-heap instances of the shared native Dijkstra kernel.
Main results #
realizes_run: one uniform emitter for the original allocated Fibonacci memory client.exists_program_state: its sharper halt-inclusive flat clock and exact whole-state export.
References #
Faithful two-word register encoding of HeapLayout.
The tuple word encoding of the fields of layoutWords.
Static validity predicate for a runtime Fibonacci-heap handle e at word width w, vertex
capacity n, and key bound K.
Handle capacity matches
n.- fits_n : WordRAM.Fits w n
Vertex capacity
nfits inwbits. - fits_K : WordRAM.Fits w K
Key bound
Kfits inwbits. End of the
9 * n + 5cell block fits inwbits.
Fibonacci-heap instance of Dijkstra.Native.NativeMethods over the 2-word HeapLayout
register encoding.
Dirty-reservation adapter connecting Memory.allocDirty (9 * n + 5) to nativeMethods.
One native emitter realizes the original Fibonacci-heap Dijkstra memory client. Its domain retains the unchanged graph encoding and word envelope. Arithmetic, argument delivery, dirty allocation and early-exit loop control are included in the uniform instruction factor.
One flat exact-basis program, chosen before all graphs and widths, computes every distance
within the sharper reachable-vertex Fibonacci bound. Its actual prefix, memory client and halt
are charged, and its entire final memory/frontier is the original memory client's final state.
As in the statement specification, placing the raw graph words in Data.init is uncharged.