Parma Polyhedra Library requirements
C++ convex-polyhedron queries
PPL-SPEC-001326
1. Polyhedron ambient and affine dimensions PPL-SPEC-001326

space_dimension() shall return the ambient dimension without changing the represented value. affine_dimension() shall return zero for empty and otherwise the dimension of the smallest affine space containing the receiver. It shall count excluded closure points only through the affine hull they share with included points, and shall preserve the represented set.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001327
2. Equivalent borrowed polyhedral descriptions PPL-SPEC-001327

Borrowed-description accessors shall require an lvalue receiver, with corresponding const && overloads deleted. Returned descriptions shall not extend the receiver's lifetime.

Constraint and generator accessors shall return receiver-owned const views whose descriptions denote exactly the receiver, including pending changes, latent emptiness, equalities and excluded NNC boundaries. Minimized accessors shall additionally remove redundant visible descriptors; they shall not promise a particular row order, coefficient scale or unique minimal representation.

A returned view, its iterators, rows and coefficient references shall be used only while the receiver lives and before an operation replaces or normalizes that representation. Logically const access to the opposite representation may invalidate them. Inputs explicitly permitted to borrow receiver coefficients shall be consumed according to the operation's entry-value contract before such invalidation. External copied descriptions shall own independent values.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001328
3. Polyhedral equality-congruence extraction PPL-SPEC-001328

congruences() shall return an independently owned system of equality congruences satisfied by every receiver point. minimized_congruences() shall return a nonredundant equality system defining exactly the receiver's affine hull, or an inconsistent system for empty. A nonminimized extraction need not expose equalities implied only by inequalities. Dimension shall be retained; proper periodic congruences shall not be introduced.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001329
4. Exact elementary polyhedral predicates PPL-SPEC-001329

The predicates shall decide, respectively, emptiness, equality with the ambient universe, topological closedness as a real pointset, discreteness and boundedness. Discreteness shall mean affine dimension zero; thus empty and singletons shall be discrete. Empty shall be bounded and closed. NNC storage shall not itself imply that the set is nonclosed. Pending or nonminimal descriptions shall not change these decisions.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001330
5. Exact integer-point existence in polyhedra PPL-SPEC-001330

contains_integer_point() shall return true exactly when the receiver contains a tuple integral in every coordinate. Empty shall return false and zero-dimensional universe true. Excluded boundary points of an NNC polyhedron shall not count. The decision shall preserve the receiver's represented set.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001331
6. Polyhedral set comparison and hashing PPL-SPEC-001331

For equal dimensions and compatible topologies, containment, strict containment, equality and disjointness shall decide the corresponding exact set relations. Containment shall include equality; strict containment shall exclude it. Empty-set relations shall follow set theory. Incompatible dimensions or topologies shall throw std::invalid_argument for the binary member queries; equality shall return false for unequal dimensions or topologies. Inequality expressions shall negate equality. Equal values shall have equal hashes; hash collisions shall not establish equality. Representation history shall not affect these results.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001332
7. Exact polyhedron relation with a constraint PPL-SPEC-001332

relation_with(c) shall classify the exact intersection with the set satisfying c. It shall include is_included() exactly when every receiver point satisfies c, is_disjoint() exactly when none does, and strictly_intersects() when some satisfy it and some do not. It shall include saturates() exactly when every receiver point satisfies the boundary equality of c. Empty shall therefore be included, disjoint and saturating. Excess descriptor dimension shall throw std::invalid_argument.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001333
8. Exact polyhedron relation with a generator PPL-SPEC-001333

relation_with(g) shall return subsumes() exactly when an included point belongs to the receiver, a closure point belongs to its closure, a ray is a recession direction, or a line is a two-sided recession direction, according to g's kind. Otherwise it shall return nothing(). Empty shall subsume no generator. Excess dimension shall throw std::invalid_argument; shorter generators shall use zero trailing coordinates.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001334
9. Exact polyhedron relation with a congruence PPL-SPEC-001334

Equality congruences shall use the constraint relation in 🔗 7. Exact polyhedron relation with a constraint. For a proper congruence, is_included() shall mean that every point satisfies it, is_disjoint() that none does, and strictly_intersects() that some but not all do. A nonempty polyhedron with a nonconstant congruence expression can be included only when the expression is constant at an admitted residue; that case shall also be saturates(). An excluded closure point shall not establish an intersection. Empty shall be included, disjoint and saturating. Constant congruences shall retain their arithmetic truth value. Excess dimension shall throw std::invalid_argument.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001335
10. Polyhedral coordinate and expression boundedness PPL-SPEC-001335

For a nonempty receiver, constrains(v) shall return true exactly when it differs from its cylindrification in coordinate v. Empty shall return true for an admitted coordinate. bounds_from_above(e) and bounds_from_below(e) shall decide existence of finite upper and lower bounds for the affine expression; both shall return true for empty. A constant expression shall be bounded on every receiver. An invalid coordinate or excess expression dimension shall throw std::invalid_argument.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001336
11. Exact rational polyhedral extrema and witnesses PPL-SPEC-001336

Maximization and minimization shall return true exactly when the receiver is nonempty and the expression has a finite supremum or infimum. On true, numerator and positive denominator shall represent that exact rational bound; the attainment flag shall say whether it belongs to the expression's image. The witness overload shall return an included point attaining the bound when attained, otherwise a closure point of the receiver attaining that bound. On false all scalar, flag and witness outputs shall remain unchanged. An excess expression dimension shall throw std::invalid_argument. The receiver's set and external expression shall be preserved. Bounded-coefficient generator scalar products and extremum comparisons shall use exact working arithmetic until the final translated rational extremum is reduced. Comparison-only values and unreduced numerators shall not require coefficient admission; the returned numerator and denominator shall.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

PPL-SPEC-001337
12. Constant affine-expression frequency in polyhedra PPL-SPEC-001337

frequency(e,...) shall return true exactly when the receiver is nonempty and the expression takes a single value on it. On true, frequency shall be 0/1 and the value outputs shall represent that exact rational value with positive denominator. On false all four outputs shall remain unchanged. Excess expression dimension shall throw std::invalid_argument. A nonconstant expression on a convex set shall not be reported as a positive discrete frequency.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.