Parma Polyhedra Library requirements
C++ Coupled constraint projection

C++ Coupled constraint projection

1. Exact equality-pivot elimination
UID: PPL-SPEC-001683
STATUS: APPROVED
COMPONENT: POLYHEDRA
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

With GMP coefficients, project_constraint_equality(rows, v, pivot) shall require owned valid rows of one ambient dimension, an in-range pivot index, an equality at that index and a nonzero pivot coefficient of v. For the pivot E = ax + r = 0 and another row C = bx + s▹0, a nonzero b shall be cancelled by (|a| ⁄ g)C − sgn(a)(b ⁄ g)E, where g = gcd(|a|, |b|). The relation kind shall be retained. Rows with zero coefficient shall be transferred unchanged; tautological results shall be omitted. The pivot shall be removed, every remaining coefficient of v shall be zero, and the result shall represent the exact existential elimination of that coordinate. Row count shall not increase.

The row vector shall retain its ambient coordinate numbering; physical coordinate compaction belongs to its caller. Temporaries shall own their data. Exceptions shall obey 🔗 1. Polyhedral values, coefficient profile and valid use without a rollback guarantee for this scratch vector. The receiver shall not be modified by scratch-vector failures before the caller's completed-result replacement.

RATIONALE:

The multiplier of the original relation is positive, so equality, weak and strict inequality meanings are preserved. On the pivot equality, subtracting its multiple preserves equivalence. The pivot determines the eliminated coordinate uniquely from every assignment satisfying the substituted rows; existential elimination is therefore exact. Dividing cancellation factors by their positive gcd reduces coefficient growth.

INTERFACE:

File-local helper in the unnamed namespace of src/Polyhedron_chdims.cc.

void project_constraint_equality(std::vector<Constraint>& rows,
                                 Variable v, size_t pivot);
VERIFICATION_CRITERIA:

Through public coordinate removal and the production projection selector, exercise both pivot signs, unit and nonunit coefficients, all relation kinds, gcd reduction, unchanged rows, tautological and contradictory results. Compare literal projections and an independently materialized generator route. Exercise allocation failures and verify valid receiver state.

BIBLIOGRAPHY:

Williams86 | Sections on elimination and Fourier's method (exact real projection). BagnaraHZ10CGTA | Sections 2.1–2.3 (NNC membership and strict boundaries).

SOURCE:

src/Polyhedron_chdims.cc; tests/Polyhedron/constraintprojection1.cc; tests/Polyhedron/constraintprojectionpolicy1.cc; tests/Polyhedron/coupledprojection1.cc; tests/Polyhedron/coupledprojectionpolicy1.cc; tests/Polyhedron/coupledprojectionfailure1.cc.

2. Bounded exact coupled constraint projection
UID: PPL-SPEC-001684
STATUS: APPROVED
COMPONENT: POLYHEDRA
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

try_coupled_equality_projection(vars) shall require an unmarked receiver with current constraints, no pending generators, ambient dimension at least five, at most 64 stored rows and a nonempty in-range selection. It shall attempt the exact projection 🔗 4. Exact polyhedral coordinate deletion, preserving topology and relative coordinate order. With bounded coefficients it shall reject. With GMP coefficients, selections above four coordinates shall delegate to 🔗 3. Exact one-dimensional continuous LP projection only for necessarily closed receivers, returning its result; other such selections shall reject.

For each equality record the support on selected coordinates in bounded stack metadata. Repeatedly select an equality whose support on remaining selected coordinates is exactly one coordinate, record that coordinate, and remove it from the remaining set. When peeling stops, inspect remaining selected coordinates in ascending order. If an equality has nonzero support on the coordinate being inspected, delegate to 🔗 1. Two-coordinate full-rank equality projection and return its result. Otherwise opposite signs shall delegate to 🔗 2. Bounded coupled two-coordinate pair projection and return its result. The structural planner itself uses only support/sign queries; the delegated preflights may use exact coefficient algebra. Absent selected columns shall impose no restriction.

After an admissible plan is found, copy the owned rows. For each planned coordinate choose an equality with nonzero coefficient and zero coefficients on all later planned and residual selected coordinates, preferring coefficient 1 or  − 1, and apply 🔗 1. Exact equality-pivot elimination. Such a pivot shall exist. After substitution discard rows involving any residual selected coordinate. Compact the retained rows, preserve their relations, and replace the receiver only by swapping in a completed same-topology polyhedron. On this structural equality/one-sided path, at most four substitution passes shall occur and row count shall not exceed its input bound. Delegated paths shall obey their respective contracts and work bounds. A false result shall preserve every receiver field and shall allocate no C++ storage. The delegated rank and sign preflights may perform GMP coefficient algebra before returning false. Exceptions shall obey 🔗 1. Polyhedral values, coefficient profile and valid use, without strengthening its guarantees to the false-result preservation guarantee.

RATIONALE:

A leaf pivot has zero coefficients on every other remaining selected coordinate. Substitution consequently multiplies those coefficients by a positive nonzero factor, preserving their supports. The static support plan remains valid, later pivots remain available and no pairwise row generation is necessary. Every pivot removes one row and possibly tautologies, bounding the work without building a generator description.

A residual coordinate has no equality coefficient and a globally consistent inequality sign. A chosen pivot has zero residual coefficients, so every substitution preserves those signs. For each assignment of retained coordinates satisfying unaffected rows, send all residual variables far enough in their permitted directions. Every row involving them then grows positively, also satisfying strict inequalities. Dropping these rows is therefore exact even with several coupled residual coordinates.

INTERFACE:

Private member of Parma_Polyhedra_Library::Polyhedron.

bool try_coupled_equality_projection(const Variables_Set& vars);
VERIFICATION_CRITERIA:

Compare literal results and an independent generator route on closed and NNC systems. Cover reversed elimination order, selected support patterns, signed/unit/nonunit pivots, redundant or inconsistent rows, noncontiguous dimensions, one through four selected coordinates and exact limits. Check singular-cycle, large-selection and bounded-profile rejection, complete unchanged ASCII state and zero C++ allocation on rejection. Exercise public cache histories, reload, random systems and allocation failures.

Cover no, partial and complete equality plans, positive/negative and absent residual columns, coupled residual strict and weak rows, and rejection of remaining equalities or opposite-sign inequalities. Independently verify their mathematical projections and unchanged state on every rejection.

BIBLIOGRAPHY:

Williams86 | Sections on elimination and Fourier's method (exact real projection). BagnaraHZ10CGTA | Sections 2.1–2.3 (NNC membership and strict boundaries).

SOURCE:

src/Polyhedron_defs.hh; src/Polyhedron_chdims.cc; tests/Polyhedron/coupledprojection1.cc; tests/Polyhedron/coupledprojectionpolicy1.cc; tests/Polyhedron/coupledprojectionfailure1.cc.