Documentation

Complexity.Algorithms.WordRAM.ExactTriangle.Chunks

Native query-chunk descriptors #

For one computed query class, the program writes consecutive triples (residue, pair pointer, pair count). It computes the last chunk's shorter length and advances over the actual two-word coordinate representation. The input query list is preserved.

This adapts the chunk loop in the pinned Theorem 17 chunk builder.

Main definitions #

Main results #

@[reducible, inline]

Query pair array base.

Instances For
    @[reducible, inline]

    Descriptor output base.

    Instances For
      @[reducible, inline]

      Actual number of query pairs.

      Instances For
        @[reducible, inline]

        Positive maximum pairs per chunk.

        Instances For
          @[reducible, inline]

          Class residue.

          Instances For
            @[reducible, inline]

            Consumed pair count.

            Instances For
              @[reducible, inline]

              Number of written chunks.

              Instances For
                @[reducible, inline]

                Constant one.

                Instances For
                  @[reducible, inline]

                  Number of words per descriptor.

                  Instances For
                    @[reducible, inline]

                    Current chunk length.

                    Instances For
                      @[reducible, inline]

                      Output address.

                      Instances For
                        @[reducible, inline]

                        Current pair pointer.

                        Instances For

                          Compute a nonempty chunk, write its descriptor and advance both counters.

                          Instances For

                            Initialize all loop state with charged instructions.

                            Instances For
                              theorem Cslib.Algorithms.WordRAM.ExactTriangle.Chunks.exec {w : ℕ} (x : WordRAM.Data 14) (hcap : 0 < x.regs capacity) (hfit : WordRAM.Fits w (x.regs dst + 3 * x.regs total + 3)) (hquery : WordRAM.Fits w (x.regs queries + 2 * x.regs total)) :
                              ∃ (y : WordRAM.Data 14), WordRAM.ExecWithin w program x y (17 * x.regs total + 7) ∧ y.regs count = x.regs total ⌈/⌉ x.regs capacity ∧ (∀ (i : Fin 14), ↑i < 5 → y.regs i = x.regs i) ∧ (∀ k < y.regs count, y.mem (x.regs dst + 3 * k) = x.regs residue ∧ y.mem (x.regs dst + 3 * k + 1) = x.regs queries + 2 * (k * x.regs capacity) ∧ y.mem (x.regs dst + 3 * k + 2) = min (x.regs capacity) (x.regs total - k * x.regs capacity)) ∧ ∀ (a : ℕ), ¬(x.regs dst ≤ a ∧ a < x.regs dst + 3 * y.regs count) → y.mem a = x.mem a

                              Write the exact nonempty chunks of one class. Descriptor k names the query slice beginning at pair k * capacity, with its final length truncated to the class size. All other memory is preserved, so placing the query array outside the descriptor block preserves its coordinates. The final halt is excluded from the 17 total + 7 bound.