Documentation

Complexity.Algorithms.WordRAM.ExactTriangle.InstancePair

Native matrix pairs and instance records #

One call writes a six-word record (rho,piece,queries,count,X,Y) and the actual raw unsigned zero/one matrices X : n×D and Y : D×n immediately after it. Both matrices reuse WriteMatrices.program; all pointer arithmetic, argument delivery and record stores are charged. The query words remain in the earlier computed catalogue and are shared by reference.

setup, writeHeader, deliverLeft, deliverRight and matrix are internal program stages. They are exposed so that the complete catalogue controller can reuse the same fixed program.

Main definitions #

Main results #

@[reducible, inline]

Computed A–C residue-array pointer.

Instances For
    @[reducible, inline]

    Computed B–C residue-array pointer.

    Instances For
      @[reducible, inline]

      First word of the instance record.

      Instances For
        @[reducible, inline]

        Outer matrix dimension.

        Instances For
          @[reducible, inline]

          Padded middle matrix dimension.

          Instances For
            @[reducible, inline]

            Positive residue modulus.

            Instances For
              @[reducible, inline]

              First original vertex in the piece.

              Instances For
                @[reducible, inline]

                Actual number of vertices in the piece.

                Instances For
                  @[reducible, inline]

                  Query residue.

                  Instances For
                    @[reducible, inline]

                    Actual query-pair pointer.

                    Instances For
                      @[reducible, inline]

                      Actual number of query pairs.

                      Instances For
                        @[reducible, inline]

                        Index of the original piece.

                        Instances For
                          @[reducible, inline]

                          Constant one, preserved by both matrix calls.

                          Instances For
                            @[reducible, inline]

                            Header cursor.

                            Instances For
                              @[reducible, inline]

                              Number of words in one matrix.

                              Instances For

                                Existing left-matrix arguments, with its output following the six-word record.

                                Instances For

                                  Existing right-matrix arguments, immediately following the left matrix.

                                  Instances For

                                    Compute the left output pointer and matrix area with native arithmetic.

                                    Instances For

                                      Write the actual query reference and both computed matrix pointers.

                                      Instances For

                                        Deliver the seven remaining left-matrix arguments; its destination is already computed.

                                        Instances For

                                          The left writer preserves its argument registers, so only the source and output pointer change for the right call.

                                          Instances For

                                            Reuse either native matrix writer in the lower seventeen registers.

                                            Instances For

                                              Complete record and matrix-pair construction.

                                              Instances For

                                                Finite code independent of every runtime dimension and physical width.

                                                Six raw unsigned record words: residue, piece index, shared query pointer/count, then the two computed matrix pointers. Matrix entries themselves are raw zero/one words.

                                                Instances For
                                                  theorem Cslib.Algorithms.WordRAM.ExactTriangle.InstancePair.exec {w : ℕ} (x : WordRAM.Data 32) (L R : ℕ → ℕ) (hrho : x.regs rho < x.regs modulus) (hpiece : x.regs first + x.regs length ≤ x.regs size) (hL : ∀ i < x.regs size * x.regs size, L i < x.regs modulus) (hR : ∀ i < x.regs size * x.regs size, R i < x.regs modulus) (hleft : ∀ i < x.regs size * x.regs size, x.mem (x.regs srcLeft + i) = L i) (hright : ∀ i < x.regs size * x.regs size, x.mem (x.regs srcRight + i) = R i) (hsL : x.regs srcLeft + x.regs size * x.regs size ≤ x.regs base) (hsR : x.regs srcRight + x.regs size * x.regs size ≤ x.regs base) (hfit : WordRAM.Fits w (x.regs base + 6 + 2 * (x.regs size * x.regs dimension) + x.regs srcLeft + x.regs srcRight + 2 * (x.regs size * x.regs size) + 2 * x.regs modulus + 7)) :
                                                  ∃ (y : WordRAM.Data 32), WordRAM.ExecWithin w program x y (40 * (x.regs size * x.regs dimension) + 38) ∧ { base := x.regs base, length := 6 }.Realizes y.mem (recordWords x) ∧ ({ base := (leftArgs x).dst, length := x.regs size * x.regs dimension }.Realizes y.mem fun (i : Fin { base := (leftArgs x).dst, length := x.regs size * x.regs dimension }.length) => WriteMatrices.entry false (leftArgs x) L ↑i) ∧ ({ base := (rightArgs x).dst, length := x.regs size * x.regs dimension }.Realizes y.mem fun (i : Fin { base := (rightArgs x).dst, length := x.regs size * x.regs dimension }.length) => WriteMatrices.entry true (rightArgs x) R ↑i) ∧ ∀ (a : ℕ), ¬(x.regs base ≤ a ∧ a < x.regs base + 6 + 2 * (x.regs size * x.regs dimension)) → y.mem a = x.mem a

                                                  Write both actual matrices and their shared-query instance record. The source arrays are ordinary residue words before the output region. Existing WriteMatrices.entry supplies the semantics; no adjacency array, execution or time contract is an input. Halt is excluded.