Documentation

CslibFrontier.Computability.PolyTime.CSP.CyclicDifference.Program

Executable checked cyclic-difference compiler #

The input is the original list CSP and a supplied ordered numerical rotation certificate. Original variable names and certificate entries remain binary. Edge variables are dense actual occurrence positions. Every enumeration is funded by actual constraint/scope/occurrence lists. Static accepted-tuple and cyclic-difference tables depend only on the fixed language, with no uniform language-preprocessing claim. In particular, no solver or recognizer is a parameter.

Black constraints use the ordered cyclic-difference tables. White scopes are the complete orbits of B⁻¹ A⁻¹, enumerated by bounded scans in increasing edge-position order; their parity does not depend on the starting point or direction. Long white scopes use a width-three parity chain. Auxiliary blocks are consecutive and start immediately after the original occurrence positions. Nullaries have no edge variables: true nullaries are omitted, and false nullaries are rejected by the static relation-nonemptiness test. All malformed guards reject to two incompatible pins.

This is a numerical supplied-certificate implementation of the forward direction in [DK15], Section 3, Lemma 5/Corollary 4/Theorem 2, printed pp. 439–440. It asserts no geometric embedding construction, bare recognition, reverse reduction or solver. The bounded scans, parity-chain expansion and binary encoding implementation are original.

Main definitions #

def Cslib.Complexity.CSP.CyclicCompiler.sourceRows {Rel : Type} (arity : Rel → ℕ) (sem : Rel → List Bool → Bool) (r : Rel) :

The fixed accepted source truth table, including the exact declared arity.

Instances For
    def Cslib.Complexity.CSP.CyclicCompiler.nonemptySymbol {Rel : Type} (arity : Rel → ℕ) (sem : Rel → List Bool → Bool) (r : Rel) :

    Whether the canonical fixed relation has an accepted tuple. Empty symbols are rejected only when they actually occur in the instance.

    Instances For

      Constraint-side cyclic successor table, indexed by actual edge positions.

      Instances For

        White face successor B⁻¹ A⁻¹: invert the supplied variable rotation by scanning its actual list, then invert the actual cyclic argument successor list. Missing entries are total.

        Instances For

          Complete boundary of one candidate white orbit, in increasing edge-position order. Repeated source vertices remain separate positions; parity is invariant under this enumeration.

          Instances For

            Keep exactly the least position of each white orbit, including singleton orbits.

            Instances For

              Original cyclic scope order, with every argument replaced by its dense edge position.

              Instances For

                One static difference table per positive actual constraint position. True nullaries are handled by the outer nonemptiness guard and contribute no black dart orbit.

                Instances For

                  Fresh block prefix length. Only actual white boundary lists fund the allocated names.

                  Instances For

                    Each white face gets exactly its own consecutive auxiliary block.

                    Instances For

                      Output body after the input guards. No interpretation of a quotient or choice is executed.

                      Instances For

                        Actual total compiler. Bad arity, invalid rotations and occurring empty relations reject honestly to an unsatisfiable edge instance whose two relations are even delta-matroids.

                        Instances For
                          theorem Cslib.Complexity.CSP.CyclicCompiler.nonemptySymbol_eq_true_iff {Rel : Type} (arity : Rel → ℕ) (sem : Rel → List Bool → Bool) (r : Rel) :

                          The static nonemptiness test is exactly nonemptiness of the canonical relation.

                          Every listed white boundary is distinct and bounded by the actual occurrence count, including for malformed certificates.

                          No raw boundary scan emits more candidate white faces than original edges.