Parma Polyhedra Library requirements
C++ box representations and mathematical queries
PPL-SPEC-001030
1. Exact extraction of individual box boundaries PPL-SPEC-001030

For a nonempty receiver and a variable var within its ambient dimension, has_lower_bound(var,n,d,closed) shall return true exactly when that factor has a finite lower boundary. On true, n ⁄ d shall be its exact infimum, with d > 0, coprime numerator and denominator, and denominator one when the numerator is zero. closed shall state whether that boundary belongs to the factor. has_upper_bound shall give the corresponding exact supremum and upper boundary inclusion. On false, all supplied output objects shall retain their values. Numerator and denominator outputs shall be distinct.

These calls shall require the stated nonempty and coordinate-validity preconditions; they shall not promise validation or a specified outcome outside them. The represented box and ambient dimension shall remain unchanged. The profile, numerical, lifetime and synchronization conditions of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Finite endpoint conversion and coefficient assignment shall retain the selected numerical policy's range and exception conditions; an exception shall not imply rollback of outputs already assigned. Valid use shall impose no additional initialization requirement beyond the selected numerical facilities.

PPL-SPEC-001031
2. Constraint and congruence exports of box values PPL-SPEC-001031

constraints() shall return an owned, dimension-preserving constraint system whose conjunction denotes exactly the receiver. Finite coordinate boundaries shall retain their exact values and strictness; unconstrained coordinates shall not introduce restrictions. Empty, including an unclassified empty factor, shall export an inconsistent conjunction. Zero-dimensional universe shall export the tautological conjunction and zero-dimensional empty an inconsistent one.

minimized_constraints() shall return an equivalent system, using one equality for a singleton factor and the necessary finite endpoint constraints for a nonsingleton factor. The interface shall not require a particular row order or syntactic scaling.

congruences() and minimized_congruences() shall return owned, dimension-preserving congruence systems containing every receiver point. For a nonempty box, they shall express exactly the affine equalities fixing its singleton coordinates and shall impose no periodic restriction on varying factors. Empty shall export an inconsistent system. The two forms shall have the same mathematical meaning; no extra proper congruence precision shall be inferred from minimization.

The box's set and dimension shall remain unchanged and returned systems shall be independent values. The validity, numerical, lifetime and synchronization conditions of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Construction of output descriptors shall retain the initialized library and thread context required by 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization. Coefficient representability, intermediate arithmetic and reported range failures shall follow the configured coefficient profile; resource or numerical exceptions shall not promise a returned partial system.

PPL-SPEC-001032
3. Affine boundedness, extrema and witnesses on boxes PPL-SPEC-001032

bounds_from_above(expr) and bounds_from_below(expr) shall decide exactly whether the affine expression's values over the receiver are bounded in the indicated direction. Empty shall be bounded in both directions. Zero coefficients shall not make an otherwise bounded objective unbounded because of unused coordinate factors.

maximize shall return true exactly when the receiver is nonempty and the objective is bounded above. On true, its numerator and positive denominator shall give the exact supremum as a reduced fraction, and maximum shall be true exactly when some receiver point attains it. minimize shall analogously report the exact infimum and attainment. A constant objective on any nonempty box shall be attained, including in zero dimensions. Ordinary false shall preserve every supplied output. Numerator and denominator outputs shall be distinct.

The generator overloads shall additionally return a point in the receiver when the extremum is attained, and a closure point in its topological closure when it is not attained. Its coordinates, including coordinates absent from the expression, shall satisfy the respective membership condition, and its objective value shall equal the reported extremum. Omitted generator coordinates shall have their declared zero-extension meaning. A witness shall not be accepted merely because it gives the correct objective value.

An expression's ambient dimension greater than the box dimension shall throw std::invalid_argument before changing outputs, including for an empty receiver or a constant expression with excess declared dimension. The represented box, its dimension and the supplied expression shall retain their values. The profile, numerical, lifetime and synchronization conditions of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Expressions and generators shall retain their descriptor prerequisites; creating output generators and reporting dimension errors shall retain the context of 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization. Numerical intermediate and output representability shall follow the selected coefficient profile. Reported allocation or numerical exceptions may leave outputs partly assigned; ordinary false-result preservation shall not imply exception rollback.

PPL-SPEC-001033
4. Detection of constant affine values and zero frequency PPL-SPEC-001033

frequency(expr,fn,fd,vn,vd) shall return true exactly when the receiver is nonempty and the expression has one value throughout it. On true, fn and fd shall be zero and one, respectively, while vn/vd shall be that exact value as a reduced fraction with positive denominator. A coordinate with zero expression coefficient shall not prevent constancy even when its factor varies or is unbounded. For boxes this success shall express a unique value, not a nonzero periodic frequency. Empty shall return false. Zero-dimensional universe shall return the expression's constant term with zero frequency.

Ordinary false shall preserve all four supplied output values. Those outputs shall be distinct. Greater expression ambient dimension shall throw std::invalid_argument before output replacement, including when the receiver is empty. The expression and the represented box and its ambient dimension shall retain their values.

The profile, numerical, lifetime and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Expression descriptors and dimension error reporting shall retain their initialized-context prerequisites. Coefficient intermediate and output representability and reported range failures shall follow the configured coefficient profile. Allocation or numerical exceptions may leave output values partly assigned; ordinary false-result preservation shall not imply exception rollback.