Documentation

CslibFrontier.Algorithms.Lean.Dijkstra.Native.Word

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 #

Main results #

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.

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.

Install the source distance, stage the zero key, and execute the original main loop.

Read the graph header, allocate the original distance table and supplied queue, then run Dijkstra.