Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.Stack

Actual five-word query-stack operations #

Every pushed task writes all five words before a pop can read them. The caller may start with dirty stack memory. These execution lemmas instantiate Cslib.WordRAM.writeWords and Cslib.WordRAM.WordStack to charge the address arithmetic, stores, loads and top update, and preserve all other memory and registers.

The five actual stores performed when appending one native task.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.writeTask_read (F n k c u e p : ℕ) (μ : ℕ → ℕ) :
writeTask F n k c u e p μ (F + n * 5) = k ∧ writeTask F n k c u e p μ (F + n * 5 + 1) = c ∧ writeTask F n k c u e p μ (F + n * 5 + 2) = u ∧ writeTask F n k c u e p μ (F + n * 5 + 3) = e ∧ writeTask F n k c u e p μ (F + n * 5 + 4) = p

The new task's descriptor is exactly the five words supplied by the computed child.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.writeTask_frame (F n k c u e p : ℕ) (μ : ℕ → ℕ) (q : ℕ) (hq : ¬(F + n * 5 ≤ q ∧ q < F + n * 5 + 5)) :
writeTask F n k c u e p μ q = μ q

All words outside the newly appended five-word record retain their old contents.

Registers modified by one real task push.

Instances For
    @[reducible, inline]

    Source field registers of push.

    @[reducible, inline]

    Target field registers of pop.

    theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.exec_push {w F n k c u e p : ℕ} (x : WordRAM.Data registers) (hF : x.regs Reg.stack = F) (hn : x.regs Reg.top = n) (hk : x.regs Reg.depth = k) (hc : x.regs Reg.childCode = c) (hu : x.regs Reg.childUsed = u) (he : x.regs Reg.childStars = e) (hp : x.regs Reg.childPower = p) (h5 : x.regs Reg.five = 5) (h1 : x.regs BoxTable.Reg.one = 1) (hfit : WordRAM.Fits w (F + 5 * (n + 1) + 8)) :
    ∃ (y : WordRAM.Data registers), WordRAM.ExecWithin w push x y 12 ∧ y.regs Reg.top = n + 1 ∧ y.mem = writeTask F n k c u e p x.mem ∧ ∀ (i : Fin registers), ¬PushLocal i → y.regs i = x.regs i

    Store and append one complete task within twelve native instructions.