Documentation

Complexity.Algorithms.WordRAM.FusionTree.Boundary

Checked correction boundaries #

After finding the highest differing position, fusion-node correction replaces the query's suffix by a sibling-subtree extreme. Both extremes and the original query bit are computed without constructing the overflowing word 2^w.

Main definitions #

Main results #

References #

@[reducible, inline]

Original query, preserved.

Instances For
    @[reducible, inline]

    Highest differing bit position, preserved.

    Instances For
      @[reducible, inline]

      Constant one.

      Instances For
        @[reducible, inline]

        Position immediately above the differing bit.

        Instances For
          @[reducible, inline]

          The differing bit's power of two.

          Instances For
            @[reducible, inline]

            Mask below the differing bit.

            Instances For
              @[reducible, inline]

              Common stem followed by zeros.

              Instances For
                @[reducible, inline]

                All-ones extreme in the lower sibling subtree.

                Instances For
                  @[reducible, inline]

                  All-zeros extreme in the upper sibling subtree.

                  Instances For
                    @[reducible, inline]

                    Zero or one according to the query's differing bit.

                    Instances For

                      Compute both extremes and the bit selecting the correction convention.

                      Instances For

                        The precise output state, including all scratch registers.

                        Instances For
                          theorem Cslib.Algorithms.WordRAM.FusionTree.BoundaryProgram.exec {w q p : ℕ} (x : WordRAM.Data 10) (hq : WordRAM.Fits w q) (hp : p < w) (hxq : x.regs query = q) (hxp : x.regs position = p) :

                          Ten checked instructions compute both sibling extremes and the selecting bit. The position may be w-1; the program never materializes 2^w. Query, position, and memory are preserved. Finding the differing position is a separate operation.