Initialization establishes the concrete invariant at the first queue-test visit
ProvedDirKECC1549.Main.reverse_search_queue_first_visitgraph-algorithmsword-ram
Let G have n vertices and m edges with root r, and let original memory M contain GraphLayout G and the root at parameter cell 5B+2, where B=n+2m+3. Assume
Suppose execution of the fixed reverseSearchAlgorithm reaches a running state at counter 70 after fuel f, and no smaller fuel gives a running state at counter 70. Then that state satisfies
This is the one-time initialization obligation: it concerns only the first running visit to the queue test. The concrete invariant includes the fixed registers and array bases, saved original register words, the unchanged input region, parent and abstract scan data, queue/discovery-list agreement, visited flags, and processed-prefix coverage. There is no later-halt or running-time assumption.
Preamble
import Definitions.Def_DirKECC1549_Main_ReverseSearchQueueInvariant set_option autoImplicit false open WordRAM
Formal statement
namespace DirKECC1549.Main
theorem reverse_search_queue_first_visit
(n m : ℕ) (G : Fin m → Fin n × Fin n) (r : Fin n)
(w : Width) (mem : Memory w) (steps : ℕ)
(hwidth : 32 * blk n m + 256 ≤ 2 ^ w.bits)
(hgraph : GraphLayout G mem)
(hroot : (mem (paramCell n m 2)).toNat = r)
(hpc : (runFrom reverseSearchAlgorithm.code w mem steps).pc = 70)
(hrunning : (runFrom reverseSearchAlgorithm.code w mem steps).halted = false)
(hfirst : ∀ j < steps,
¬ ((runFrom reverseSearchAlgorithm.code w mem j).pc = 70 ∧
(runFrom reverseSearchAlgorithm.code w mem j).halted = false)) :
ReverseSearchQueueInvariant G r mem
(runFrom reverseSearchAlgorithm.code w mem steps) := by sorry
end DirKECC1549.Main
Source
Initialization/preservation decomposition of DirKECC1549.Main.reverse_search_dequeue_invariant, https://prove2.me/theorems/ce954fc0-ecef-4653-a28a-65dc63c36dda. The concrete assertion is Definitions.Def_DirKECC1549_Main_ReverseSearchQueueInvariant; actual instructions are reverseSearchAlgorithm in Definitions.Def_DirKECC1549_Main_ReverseSearchCode. PCs 0–69 initialize the search; PC 70 tests the queue; PCs 71–110 process a dequeued vertex and incoming-edge scans.