Documentation

Complexity.Algorithms.WordRAM.FusionTree.Node.Sketch

Composing compression and packed ranks #

All transfers into the two fixed workspaces are charged. Only the actual loaded header values supply node-dependent constants. The caller's registers and all memory are framed.

Main results #

References #

Seven charged transfers into the compression workspace.

Instances For

    Prepare the compression workspace and run the actual multiplier program.

    Instances For
      theorem Cslib.Algorithms.WordRAM.FusionTree.NodeProgram.exec_compress {w n q : ℕ} {keys : Fin n → ℕ} (p : NodeParameters w keys) (hw : 2 ≤ w) (hn : 0 < n) (hnB : n ≤ Lean.FusionTree.branching w) (hlarge : 9 ≤ Nat.log 2 w) (x : WordRAM.Data registers) (hx : Prepared p x) (hq : WordRAM.Fits w q) (hxq : x.regs argument = q) :

      Seven transfers plus the terminal self-copy and 94 arithmetic instructions.

      Transfer a compressed query and seven stored constants to a packed-rank workspace. The Boolean selects strict rank (original packed sketches) or inclusive rank (complements).

      Instances For

        Eight charged transfers followed by the chosen eight-instruction rank program.

        Instances For
          def Cslib.Algorithms.WordRAM.FusionTree.NodeProgram.sketchCut {n : ℕ} (strict : Bool) (w : ℕ) (keys : Fin n → ℕ) (q : ℕ) :

          Perfect-sketch comparison count with the chosen convention.

          Instances For
            theorem Cslib.Algorithms.WordRAM.FusionTree.NodeProgram.exec_rank {w n q : ℕ} {keys : Fin n → ℕ} (p : NodeParameters w keys) (strict : Bool) (hn : 0 < n) (hs : StrictMono keys) (hk : ∀ (i : Fin n), keys i < 2 ^ w) (hnB : n ≤ Lean.FusionTree.branching w) (hlarge : 9 ≤ Nat.log 2 w) (x : WordRAM.Data registers) (hx : Prepared p x) (hxq : x.regs (compressBank 20) = p.compressed q) :
            ∃ (y : WordRAM.Data registers), WordRAM.Exec w (rank strict) x y 17 ∧ y.regs (rankBank 9) = sketchCut strict w keys q ∧ Frame x y

            The rank call includes every transfer and preserves the caller and memory.

            Compression followed by the requested sketch-rank convention.

            Instances For
              theorem Cslib.Algorithms.WordRAM.FusionTree.NodeProgram.exec_sketchQuery {w n q : ℕ} {keys : Fin n → ℕ} (p : NodeParameters w keys) (strict : Bool) (hw : 2 ≤ w) (hn : 0 < n) (hs : StrictMono keys) (hk : ∀ (i : Fin n), keys i < 2 ^ w) (hnB : n ≤ Lean.FusionTree.branching w) (hlarge : 9 ≤ Nat.log 2 w) (x : WordRAM.Data registers) (hx : Prepared p x) (hq : WordRAM.Fits w q) (hxq : x.regs argument = q) :
              ∃ (y : WordRAM.Data registers), WordRAM.Exec w (sketchQuery strict) x y 119 ∧ y.regs (rankBank 9) = sketchCut strict w keys q ∧ Frame x y

              A complete sketch query, including all register transfers, takes 119 instructions.