Documentation

CslibFrontier.Computability.PolyTime.CSP.Edge.Buffer

Finite occurrence-label buffers #

Shared positional buffer operations for native edge-CSP augmentation and forest search. The namespace is retained from the augmentation API so existing imports and public names remain available. Constraint and port positions are unary; original variable names are binary. Every scan uses actual lists, including global validity on arbitrary explicit tables.

@[reducible, inline]

Positional occurrence records use unary constraint and scope positions and a binary name. Both positions are framed; the name is the last field.

Instances For
    @[reducible, inline]

    Positional constraint index, scope index and original variable name.

    Instances For
      @[reducible, inline]

      A framed explicit-table CSP followed by its framed occurrence-bit buffer.

      Instances For

        Global position in the actual incidence list, with no dependence on the variable's value.

        Instances For

          Read a finite buffer at an actual typed occurrence's global incidence-list position. The default makes this total even for a short buffer.

          Instances For

            Read a positional record, defaulting to false outside the finite buffer.

            Instances For

              Test every constraint against the complete finite labeling buffer.

              Instances For

                Test for unequal buffer bits at two actual occurrences of the requested variable.

                Instances For

                  Flip precisely the selected global positions, preserving the buffer width.

                  Instances For
                    @[reducible, inline]

                    Work on bounded unary indices, with binary names unchanged.

                    Instances For
                      theorem Cslib.Complexity.CSP.EdgeAugmenting.length_flip (bits : List Bool) (indices : List ℕ) :
                      (flip bits indices).length = bits.length

                      Encoding a labeling as a positional buffer and reading it returns that labeling.

                      An exact-width occurrence buffer is recovered by materializing its positional labeling in incidence-list order. Width is the actual number of occurrences, not a declared arity.

                      Projection of an existing walk followed by positional decoding recovers its occurrences.