Bounded-while views of the linked Dijkstra client #
The edge scan and main loop use the existing boundedWhile source representation. Their
equalities hold for every memory method table, without assuming correctness or admissibility
of its implementation. They retain the complete free-monad program, hence every reached
memory and query history. In particular, extracting an empty queue exits immediately.
These source equalities do not provide native code or bound its instructions. The native realization must separately charge arithmetic, argument delivery and control, establish each callee's reached-state domain, and exclude cutoff truncation.
Main definitions #
scanView: scan exactly the returned degree with an increasing edge index.loopStep: extract and scan once, or set the remaining rounds to zero on an empty queue.loopView: extract and scan until the queue is empty, with the original round cutoff.clientView: initialize the source and execute the loop.
Main results #
scanView_eq,loopView_eq,clientView_eq: equality with the original linked source.
Query the degree, then scan its edge indices in their original order.
The scan view retains the complete linked program, including repeated offset queries.
One extraction and scan, setting the counter to zero when the queue is empty.
The original round cutoff with genuine early exit when extraction returns none.
The main-loop view retains all source behavior, including the empty-queue exit.
Initialize the source distance and queue, then execute the original early-exit loop.
The bounded-while client is exactly the linked original Dijkstra program.