Documentation

Complexity.Algorithms.WordRAM.ThreeSum.Frontend.Execute

Complete descriptor-table execution #

The invariant retains every completed descriptor and compact payload, both full radix arrays, and all memory outside the allocated frontend region.

Main results #

The enumeration loop charges each native array scan, descriptor store and allocation advance.

Immutable registers of the complete enumeration loop.

Instances For
    theorem Cslib.Algorithms.WordRAM.ThreeSum.Frontend.Arrays.Registers.transfer {l : Layout} {U k : ℕ} {x y : WordRAM.Data 48} (h : Registers l U k x) (hr : ∀ (i : Fin 48), WordRAM.Code.Preserves i body → y.regs i = x.regs i) :
    Registers l U k y

    The body preserves every immutable layout and source register.

    Every layout scalar and partial allocation is below the explicit arithmetic budget.

    theorem Cslib.Algorithms.WordRAM.ThreeSum.Frontend.Arrays.setup_exec {w U : ℕ} (l : Layout) (k : ℕ) (x : WordRAM.Data 48) (hU : x.regs Select.magnitude = U) (hn : x.regs inputLen = l.n) (hΛ : x.regs digits = l.digits) (hk : x.regs Scan.keys = 1 + 2 * l.n) (hc : x.regs Scan.counts = 1 + 3 * l.n) (hlen : x.regs Scan.len = k) (hd : x.regs descriptors = l.descriptors) (hfit : WordRAM.Fits w (budget l U)) :
    ∃ (y : WordRAM.Data 48), WordRAM.ExecWithin w setup x y 19 ∧ Registers l U k y ∧ y.regs current = 0 ∧ y.regs heap = l.pointer 0 ∧ y.mem = x.mem

    Setup computes all constants and addresses with actual instructions, preserving all memory.

    theorem Cslib.Algorithms.WordRAM.ThreeSum.Frontend.Arrays.loop_exec {w U : ℕ} (l : Layout) (rs : List (ℕ × ℕ)) (x : WordRAM.Data 48) (hr : Registers l U rs.length x) (hidx : x.regs current = 0) (hheap : x.regs heap = l.pointer 0) (hlen : rs.length ≤ l.n) (hk : WordRAM.Block.HoldsList (1 + 2 * l.n) (List.map Prod.fst rs) x.mem) (hc : WordRAM.Block.HoldsList (1 + 3 * l.n) (List.map Prod.snd rs) x.mem) (hkeys : ∀ p ∈ rs, p.1 ≤ 2 * U + 1 ∧ p.1 / 2 ≤ U) (hfit : WordRAM.Fits w (budget l U)) :

    All compact arrays and six-word descriptors are produced by the complete native loop.

    theorem Cslib.Algorithms.WordRAM.ThreeSum.Frontend.Arrays.exec {w U : ℕ} (l : Layout) (rs : List (ℕ × ℕ)) (x : WordRAM.Data 48) (hU : x.regs Select.magnitude = U) (hn : x.regs inputLen = l.n) (hΛ : x.regs digits = l.digits) (hkreg : x.regs Scan.keys = 1 + 2 * l.n) (hcreg : x.regs Scan.counts = 1 + 3 * l.n) (hlenreg : x.regs Scan.len = rs.length) (hd : x.regs descriptors = l.descriptors) (hlen : rs.length ≤ l.n) (hk : WordRAM.Block.HoldsList (1 + 2 * l.n) (List.map Prod.fst rs) x.mem) (hc : WordRAM.Block.HoldsList (1 + 3 * l.n) (List.map Prod.snd rs) x.mem) (hkeys : ∀ p ∈ rs, p.1 ≤ 2 * U + 1 ∧ p.1 / 2 ≤ U) (hfit : WordRAM.Fits w (budget l U)) :

    Complete array/descriptor construction, including all native constant and layout setup.