Parma Polyhedra Library requirements
C++ polyhedral envelope and weak join

C++ polyhedral envelope and weak join

UID:
VERSION:
CLASSIFICATION:
PREFIX:
Type
Level
MID
UID
REFS
Title
Statement
Rationale
Comment
BIBLIOGRAPHY
STATUS
COMPONENT
APPLICABILITY
VERIFICATION_METHODS
VERIFICATION_CRITERIA
SOURCE
LANGUAGE
VISIBILITY
INTERFACE
SW_SPEC
1
PPL-SPEC-001672
PPL-SPEC-001672
Polyhedral envelope from entry constraint descriptions

envelope_assign(y) shall capture the constraint descriptions of the entry receiver P and source Q, as obtained by constraints() without an additional minimization request. Each equality shall supply both opposite non-strict inequalities. The completed receiver shall denote exactly the intersection of those candidate inequalities satisfied by both operands. Included or excluded NNC boundaries shall retain their inequality meaning. Ambient dimension and topology shall be preserved.

Descriptions shall be captured before support queries can normalize their caches. Precision may depend on redundant inequalities or the descriptions materialized at entry. No particular minimal output description is required. Empty shall be neutral, self-aliasing shall preserve the value, and a distinct source shall preserve its represented value. Incompatible dimensions or topologies shall raise std::invalid_argument before querying or normalizing either operand.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions of 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Logical cache normalization may change materialized descriptions while preserving represented values. Resource and arithmetic exceptions shall obey that common contract.

Every retained half-space contains both entry sets, so their intersection contains the polyhedral hull. Equality splitting permits retention of one valid side when the other side excludes an operand. A candidate description can include additional valid directions through redundant inequalities, which explains its precision dependence.

BemporadFT01 | Section 3, equation (3) (envelope definition); Section 4, Algorithm 4.1, steps 1–2. BagnaraHZ10CGTA | Sections 2.1–2.3 (NNC boundary semantics).

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check literal boxes, points, rays and lines, alternate affine descriptions and a redundant diagonal cut. Check all scalar endpoint-openness combinations both with generator queries and in higher-dimensional LP cylinders. Exercise unknown empty sets, including strict systems whose closure is nonempty; compatibility rejection before empty shortcuts; aliasing, pending descriptions, source-value preservation, reload and assessed allocation failures.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralenvelope1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. The member is inherited by C_Polyhedron and NNC_Polyhedron.

void Polyhedron::envelope_assign(const Polyhedron& y);
SW_SPEC
2
PPL-SPEC-001673
PPL-SPEC-001673
Captured inequality candidates for polyhedral approximations

For a valid constraint system, polyhedron_join_inequalities shall return owned candidate rows equivalent to its non-tautological inequalities, replacing each equality by its two opposite non-strict inequalities. Rows equivalent under the normalized constraint ordering shall occur once. The input shall be preserved. The ordering predicate shall agree with the sign of compare(x,y). Capturing the returned rows shall not request polyhedral minimization. Arithmetic-profile conditions shall include constructing both equality orientations.

Owned snapshots keep candidate selection independent of later cache updates. Opposite inequalities preserve equality meaning while allowing different validity outcomes on the other operand.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Directly check tautologies, inconsistent constants, equality orientations, strict and non-strict rows, duplicates, ordering and source independence. Check their public envelope effects on descriptions that minimization would otherwise replace.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralenvelope1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Internal

Translation unit: src/Polyhedron_joins.cc; anonymous namespace.

struct Polyhedron_Join_Less {
  bool operator()(const Constraint& x, const Constraint& y) const;
};
using Polyhedron_Join_Rows
  = std::set<Constraint, Polyhedron_Join_Less>;
Polyhedron_Join_Rows
polyhedron_join_inequalities(const Constraint_System& cs);
SW_SPEC
3
PPL-SPEC-001674
PPL-SPEC-001674
Exact support queries for polyhedral approximations

Polyhedron_Join_Support shall borrow its source polyhedron and own any temporary LP. With generator mode selected, it shall use the existing exact polyhedral queries. Otherwise it shall build and reuse a continuous MIP model of the system obtained by weakening strict inequalities. It shall establish original-set emptiness: an infeasible weakened system is empty; a feasible weakened system with strict rows shall additionally be checked by exact feasibility of the original system.

For a nonempty source and an in-dimension expression, minimum shall return finite == false exactly when the expression is unbounded below. A finite result shall have a positive denominator and its numerator/denominator shall equal the source infimum. For the corresponding finite result, attained shall return true exactly when the original source contains an infimizing point. The LP route shall decide this by feasibility of the original system intersected with the equality face; systems without strict rows shall attain every finite infimum. The presence of strict rows shall be determined once during construction.

includes shall accept a non-strict or strict candidate inequality and return true exactly when every source point satisfies it. Its source shall be nonempty. For a strict row, a zero infimum shall imply validity exactly when that infimum is unattained.

Source objects shall remain alive while queries are issued, and their represented values shall be preserved. The LP route shall borrow an unchanged original description. Generator queries may normalize caches. After the final query, destruction shall release only owned LP state, without querying the borrowed source. Non-finite numerical fields and the LP-side cached attainment field are unspecified. The common conditions of 🔗 1. Polyhedral values, coefficient profile and valid use shall apply.

For a nonempty finite linear system, weakening strict rows gives its closure: convex combinations with an original feasible point approach every point of the weakened system while satisfying all original strict rows. Infima therefore agree. Original feasibility must be established separately because weakening can turn an empty strict system into a nonempty closed one. Equality-face feasibility exactly characterizes attainment. Changing an LP objective preserves feasibility, so a completed solve is either optimized or downward unbounded.

BagnaraHZ10CGTA | Sections 2.1–2.3 (closed and NNC polyhedra and membership).

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Compare both backends with literal rational infima, attained and unattained boundaries, unbounded expressions and all validity sign cases. Include contradictory closed systems and strict-empty systems with feasible and infeasible closures. Verify temporary ownership, source-value preservation, repeated objective changes and cleanup under assessed allocation failures.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralenvelope1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Internal

Translation unit: src/Polyhedron_joins.cc; anonymous namespace.

struct Polyhedron_Join_Bound {
  bool finite;
  Coefficient numerator;
  Coefficient denominator;
  bool attained;
};
class Polyhedron_Join_Support {
public:
  Polyhedron_Join_Support(const Polyhedron& p, bool use_generators);
  bool empty() const;
  Polyhedron_Join_Bound minimum(const Linear_Expression& e);
  bool attained(const Linear_Expression& e,
                const Polyhedron_Join_Bound& bound) const;
  bool includes(const Constraint& c);
};
SW_SPEC
4
PPL-SPEC-001675
PPL-SPEC-001675
Support backend selection for polyhedral approximations

For a valid polyhedron and the number of captured nontrivial candidate inequalities, use_generator_support_for_join shall return true when the ambient dimension reaches the MIP dimension ceiling, when generators are current with no pending constraints and at most 64 stored generator rows, or when the dimension is at most four and there are at most eight candidates. Otherwise it shall return false. The query shall preserve the object and shall not materialize either representation. The dimension-ceiling route shall avoid an unavailable additional LP slack coordinate.

Small descriptions and small current generator systems avoid LP setup. Larger H-descriptions avoid vertex enumeration; larger current generator systems avoid repeated long scans. The decision changes cost rather than the bound semantics.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check both sides of the candidate-count, dimension and generator-count thresholds, with pending constraints and current versus stale generators. Review the capacity-boundary route separately where materializing the necessary dimension is not feasible. Compare operation results across backend choices.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralenvelope1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Internal

Private Polyhedron member in src/Polyhedron_defs.hh.

bool use_generator_support_for_join(size_t candidates) const;
SW_SPEC
5
PPL-SPEC-001676
PPL-SPEC-001676
Homogeneous directions for weak polyhedral join

Given candidate rows captured from two nonempty operands after tautology removal and equality splitting, polyhedron_join_directions shall return one normalized non-strict zero-constant row for every distinct positive-scaling class of their homogeneous parts. Orientations shall be preserved. Inputs shall be preserved. Each input row shall have a nonzero homogeneous part under these preconditions.

A non-tautological constant row is inconsistent, so it cannot occur in a nonempty operand. A second zero-vector scan is unnecessary under the stated preconditions. Zeroing constants and using normalized inequality ordering identifies equal directions without identifying opposite orientations.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check positive scalings, opposite orientations from equalities, repeated directions with different constants and independence of input rows. Check their effects on literal weak joins with and without an additional redundant direction.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralweakjoin1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Internal

Translation unit: src/Polyhedron_joins.cc; anonymous namespace.

Polyhedron_Join_Rows polyhedron_join_directions(
    const Polyhedron_Join_Rows& xs, const Polyhedron_Join_Rows& ys);
SW_SPEC
6
PPL-SPEC-001677
PPL-SPEC-001677
Weak join with exact directional bounds and NNC attainment

weak_join_assign(y) shall capture the constraint descriptions of the entry receiver P and source Q through constraints() without an additional minimization request. Split equalities into both opposite inequalities, and let D contain their distinct nonzero homogeneous directions. For nonempty operands, for each a ∈ D bounded below on both sets, let ma = min(infp ∈ Pa⋅p, infq ∈ Qa⋅q). The completed receiver shall denote the intersection of a⋅x ≥ ma, omitting unbounded directions. In NNC topology the inequality shall be strict exactly when no point of either operand attains ma.

Candidates shall be captured before support queries can normalize their caches. Precision may depend on redundant directions and materialized descriptions; no minimal output description is required. The result shall contain the polyhedral hull and be contained in the envelope for the same entry descriptions. Empty shall be neutral, self-aliasing shall preserve the value, and a distinct source shall preserve its represented value. Ambient dimension and topology shall be preserved. Incompatible dimensions or topologies shall raise std::invalid_argument before querying or normalizing either operand.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions of 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Logical cache normalization may change materialized descriptions while preserving represented values. Resource and arithmetic exceptions shall obey that common contract.

Each directional bound is the strongest half-space of that orientation containing both operands. Its infimum value and attainment determine whether the limiting boundary is included. Every retained envelope inequality is implied by the corresponding tight bound, proving the ordering between hull, weak join and envelope. The conference definition specifies this construction for closed polyhedra; the journal reference supplies NNC membership semantics for the stated attainment extension.

SankaranarayananCSM06 | Section 3, Definition 5 (weak join and equality splitting). BagnaraHZ10CGTA | Sections 2.1–2.3 (NNC semantics).

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check literal scalar endpoint combinations, rational bounds and independently derived multidimensional examples with distinct directions. Exercise both bound orderings, equal and unequal denominators, sign changes, ties with one or both minima attained, unbounded directions, incompatible operands, aliasing, unknown empty sets, pending/cache histories, reload, source-value preservation and assessed allocation failures. Compare independent generator support oracles with the LP path.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralweakjoin1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. The member is inherited by C_Polyhedron and NNC_Polyhedron.

void Polyhedron::weak_join_assign(const Polyhedron& y);
SW_SPEC
7
PPL-SPEC-001678
PPL-SPEC-001678
Comparison of finite rational support bounds

For finite bounds with positive denominators, polyhedron_join_compare_bounds shall return a negative, zero or positive integer exactly when the first quotient is smaller than, equal to or greater than the second. Equal denominators shall compare numerators without products; unequal numerator signs shall compare signs without products. Otherwise cross-products shall be compared under the selected coefficient profile's intermediate-range conditions. Inputs shall be preserved.

Common integral bounds and equal-denominator rational endpoints need no cross-products. Sign differences also determine order directly. Avoiding those products removes allocations for large GMP values and avoids unnecessary bounded-integer overflow.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Compare with independent arbitrary-precision rational ordering over equal and unequal positive denominators and every numerator-sign pairing. Include zero, equal quotients and bounded-coefficient endpoint cases where the avoided products would overflow.

src/Polyhedron_defs.hh; src/Polyhedron_joins.cc; tests/Polyhedron/polyhedralweakjoin1.cc; tests/Polyhedron/joinfailure1.cc; tests/Polyhedron/joinsupport1_impl.cc.

CPP
Internal

Translation unit: src/Polyhedron_joins.cc; anonymous namespace.

int polyhedron_join_compare_bounds(const Polyhedron_Join_Bound& x,
                                  const Polyhedron_Join_Bound& y);