Finite buffers for the two-phase edge-CSP augmentation #
The input contains the existing explicit-table CSP, two occurrence bit buffers, and an excluded starting variable. Positions retain constraint and scope order. All scans traverse actual lists; no loop is paid for by a binary variable name or a table's declared arity.
This module compiles the two phases of Lemma 31 of [KKR18], arXiv v6,
Section 6.1, printed p. 15. The improving comparison is supplied as input; this routine does not
find it or solve the CSP. Walk codes represent the existing CSP.Walk, without introducing
another trail predicate.
Main definitions #
Input: the complete explicit-table input, with two finite occurrence label buffers.WalkCode,code,decode: the representation bridge to the existing incidence walks.run: the total finite implementation, rejecting incorrect buffer widths.
Main results #
computableInPolyTime_run: uniform ordinary native polynomial time in the full framed input.run_eq: exact agreement withEdgeInstance.augmentingWalk, without semantic assumptions.run_spec: decoded augmentation and the combined exchange bound for a valid improvement.
Complete augmentation input, with bits in constraint-then-scope occurrence order.
- body : Logic.PL.CSP Logic.PL.CSP.Table ℕ
The original CSP, with explicit table relations and binary variable names.
Original occurrence labels.
Supplied improving comparison, in the same positional order.
- excluded : ℕ
Variable excluded only as the start, not as the terminal variable.
Instances For
Instances For
Instances For
Project the existing walk to global occurrence indices.
Instances For
Read an actual incidence record at a global position, defaulting to (0, 0, 0) when
that position is outside the finite original occurrence list.
Instances For
Total finite implementation of the two phases. Both buffers must have exactly the actual occurrence count; malformed widths reject before either phase.
Instances For
Work representation: the binary start is framed, and bounded occurrence positions are
unary. This internal representation is converted to the binary encWalkCode on output.
Instances For
Uniform native polynomial time on complete framed inputs, without validity, edge-instance, even-delta-matroid or improvement assumptions. Width errors reject; all other data are processed by list scans and occurrence clocks.
Decode global positions into the existing dependent occurrence type. Out-of-range indices reject. This is a representation bridge, with no additional mathematical walk predicate.
Instances For
The walk representation is lossless, including empty walks and repeated constraint visits.
Looking up the binary position of an actual occurrence recovers its exact positional record, including both original local coordinates and its original variable name.
Exact compilation of the mathematical two-phase routine, including its deterministic scan order, both Hamming clocks and failure cases. Only the two exact buffer-width guards are needed.
A valid improving comparison yields an actual augmenting walk, decoded into the existing model. The start alone avoids the excluded variable; the exchange bound is the original one.
Repair flips bits without changing the comparison buffer's width, on every input.
The width guard rejects either short or long original/comparison buffers.