Documentation

CslibFrontier.Computability.PolyTime.CSP.Edge.Solver.Walk

Native binary-position walk operations #

Finite operations on the existing EdgeAugmenting.WalkCode. Public positions and original names stay binary; prefix counts and scope/constraint coordinates use list-funded unary work encodings. Out-of-range binary lookups saturate at actual list lengths. No operation expands a binary position or name into an unbounded unary loop.

Both binary global positions of each step, in traversal order.

Instances For

    Flip a binary-position set in an actual finite buffer. Duplicate positions flip once.

    Instances For

      Keep the first actual n steps. The work prefix count is unary.

      Instances For

        Remove n actual steps, starting at the preceding prefix's actual endpoint.

        Instances For

          Reverse actual step order and swap the two positional ports in each step.

          Instances For

            Append one actual incidence pair to a code.

            Instances For

              Original binary variable names selected by a cycle, with duplicates erased.

              Instances For

                Native prefix arm at one actual step.

                Instances For

                  Native reversed-suffix arm at one actual step.

                  Instances For

                    Native access to the existing binary walk-code representation.

                    A predicate's first matching position is a unary, list-funded scan. The Boolean map and existing idxOf machine implement findIdx exactly, including its length default.

                    Prefix extraction preserves every actual incidence position exactly.

                    Native reversal has exactly the source's traversal and starting variable.

                    Native suffix extraction has the exact preceding-prefix endpoint and actual suffix.

                    Appending an actual positional pair preserves its exact binary occurrence positions.

                    theorem Cslib.Complexity.CSP.EdgeSolver.NativeWalk.flip_eq (bits : List Bool) (positions : List ℕ) :
                    flip bits positions = EdgeAugmenting.flip bits positions

                    The raw flip has exactly the existing mathematical set-flip behavior.

                    Actual walk-code edges retain exactly the original incidence-list positions.

                    Native selected names are exactly the source's actual internal variables, with the same duplicate-retention convention.

                    Materialized set flips agree exactly with the original occurrence-labeling operation, for every finite positional set, including duplicate positions.

                    Flipping a materialized actual walk is exact, with no model or validity premises.