Dijkstra's memory program with natural-number arguments #
The source takes ordinary priority-queue memory programs as parameters. Its registers can carry
natural handles and keys; its extraction branch performs the original checked finite-handle
observation. No new priority-queue specification, backend or decoder is introduced. In
particular, relaxation retains the original du + c < old test and the fallback for an invalid
edge target. Arithmetic passed to an opaque method is staged explicitly as source pure steps.
The equalities retain the entire free-monad program, not only its answer. The binary instance
uses the original two-query dirty allocator and recovers Dijkstra.Memory.run exactly. Native
method certificates, reached-state domains, word-fit obligations and instruction bounds remain
separate requirements; the source equalities assign no free native cost to the staged values.
Main definitions #
relaxWord,scanWord,loopWord,clientWord: the natural-argument client.runWord: read the graph input and allocate before executing that client.
Main results #
relaxWord_eq,scanWord_eq,loopWord_eq,clientWord_eq: exact linked-source transport.runWord_eq_binary: the canonical binary-heap instance is the original memory program.
Read a tentative distance and perform the original insertion or decrease-key relaxation.
Read one edge, retaining the source fallback for an invalid target, and relax its target.
The natural-argument relaxation is the complete original linked program.
Scan the returned degree with a bounded increasing edge-index loop.
The natural-argument scan retains every original query in its original order.
Extract once; an empty or invalid observed entry sets the remaining rounds to zero.
Checked observation transports one complete word-level extraction and scan.
Exact erasure of the original typed extraction transports the complete word-level round. The checked runtime handle branch succeeds on every typed source reply; no decoder is assumed.
The original round cutoff with a genuine empty-queue exit.
The word-level main loop is exactly the original linked main loop.
Exact typed-result erasure preserves the full early-exit loop and its query history.
Install the source distance, stage the zero key, and execute the original main loop.
The word-level client retains the complete linked source.
The complete initialized source client is unchanged by erasing typed extraction results.
Read the graph header, allocate the original distance table and supplied queue, then run Dijkstra.
The canonical binary-heap allocator and observed source methods recover the exact original run.