Packing a weighted graph and initializing the RAM query registers
ProvedDirectedHamiltonicity.Main.InputRAM.prepareRequest_execA graph view contains vertices, labelled arcs of weights at most , and two distinguished endpoints. Let be the scheduled number of trials and the saved target. The finite RAM subroutine constructs a request whose graph argument encodes the normalized Boolean adjacency grid of length
Assume the caller's bank is above the reserved registers, the initial store fits width , and the grid addresses, argument width and report cap fit the specified bounds. The resulting request contains the graph dimensions, endpoints, packed adjacency word, trial budget and target. Let be the chosen request field width, let be the fixed length of the register-initialization circuit, and put . The execution takes at most
primitive steps. The output and every cell beyond both the bank and the grid are preserved.
import Definitions.Def_DirectedHamiltonicity_ParityRAMInterfaces open DirectedHamiltonicity DirectedHamiltonicity.Main DirectedHamiltonicity.Main.InputRAM open Multidigraph NativeGraph TargetedSamplers TargetedSamplers.Structured TargetedSamplers.Structured.Word open TargetedSamplers.Structured.BinaryStack
theorem DirectedHamiltonicity.Main.InputRAM.prepareRequest_exec {τ : Tapes} {b n m W raw : ℕ} {tail head : Fin m → Fin n} {w : Fin m → ℕ}
(hw : ∀ e, w e ≤ W) {s t : Fin n} (bank M D : ℕ) (u : Store)
(view : GraphView (W := W) tail head w s t raw u) (trials : u.mem 54=M) (target : u.mem 53=D)
(high : 60 ≤ cell bank) (fit : u.Fits b) (hb : 2 ≤ b) :
let H : Multidigraph (Fin n) (Fin m) := ⟨tail,head⟩
let wbits := argumentWidth n (W+1)
let N := n*(n*(W+1))
let dst := raw+3*m+2
let L := b*(5*b+9)+15
(dst+2*N+2*n+2).size ≤ b → wbits+2 ≤ b → (12*M).size ≤ b →
∃ z j, Exec τ (fun v => v.Fits b) (prepareRequest bank) u z j ∧
j ≤ 6*L+N*(5*L+18*m+19)+14*N+16+(wbits+initFields.length)*L ∧
PreparedRequest (cell bank) n (W+1) s.val t.val (packed (adjacencyBits H w hw s t)) M D (dst+N) z ∧
z.out=u.out ∧ ∀ i, cell bank+68 < i → dst+N ≤ i → z.mem i=u.mem i := by sorry