Documentation

Complexity.Algorithms.WordRAM.ThreeSum.ChanHe.TraversalChildren

Native preparation of the three Chan–He child records #

The third child is pushed first. Original descriptors are retained above the stack dispatcher and restored before replacing another column. All descriptor moves and the fuel decrement are native instructions; the same finite code is used at every recursion level.

Main definitions #

Main results #

The native stack controller and proofs are original.

Save both descriptors needed for restoration and prepare the third child.

Instances For

    Restore the third original column and prepare the second child.

    Instances For

      Restore the second original column and prepare the first child.

      Instances For

        Exact child-record serialization. Only the selected column is replaced by its heavy output.

        Instances For

          Every child occupies exactly one seven-word native record.

          The fuel subtraction and all six descriptor copies cost seven native instructions.

          Restoring the third column and replacing the second costs four native copies.

          Restoring the second column and replacing the first costs four native copies.

          Child pushes preserve every persistent controller parameter outside the record and stack.

          theorem Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Traversal.pushChildren_exec {w base capacity : ℕ} (x : WordRAM.Data 128) (vs : List ℕ) (hx : WordRAM.Data.Bounded w x) (hone : x.regs one = 1) (h2 : WordRAM.Fits w 2) (hcap : WordRAM.Fits w (base + capacity)) (hr : WordRAM.Stack.Rep w base capacity vs (WordRAM.Data.comap registers x)) (hcapacity : 21 + vs.length ≤ capacity) :
          ∃ (y : WordRAM.Data 128), WordRAM.Exec w pushChildren x y 207 ∧ WordRAM.Stack.Rep w base capacity (childWords x 0 ++ childWords x 1 ++ childWords x 2 ++ vs) (WordRAM.Data.comap registers y) ∧ WordRAM.Modifies (WordRAM.Stack.footprint base capacity) x.mem y.mem ∧ ∀ (i : Fin 128), 71 ≤ ↑i ∧ ↑i < 96 ∨ 109 ≤ ↑i → y.regs i = x.regs i

          All three child records are pushed by native instructions in reverse order. The resulting top-first stack contains first, second, third, followed by the original pending suffix.