Parma Polyhedra Library requirements
C++ box geometric relations and set operations
PPL-SPEC-000973
1. Box relations with linear constraints PPL-SPEC-000973

For a dimension-compatible constraint with affine expression e(x) and relation e(x) ⋈ 0, relation_with(c) shall report exactly the applicable assertions: is_disjoint() when no represented point satisfies the constraint; is_included() when every represented point satisfies it; strictly_intersects() when some but not all represented points satisfy it; and saturates() when every represented point has e(x) = 0. Saturation shall be independent of whether the inequality is strict.

An empty box shall therefore report disjoint, included and saturating, without strict intersection. A nonempty box lying on an excluded strict boundary shall report disjoint and saturating. The zero-dimensional universe shall use its unique empty tuple, and omitted coefficients shall be zero. A constraint of greater ambient dimension shall throw std::invalid_argument without changing the represented box.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

PPL-SPEC-000974
2. Box relations with linear congruences PPL-SPEC-000974

For a dimension-compatible congruence with affine expression e(x) and modulus m, relation_with(cg) shall interpret m = 0 as the equality e(x) = 0, and positive m as membership of e(x) in mℤ. It shall report disjointness, inclusion or strict intersection by the corresponding quantified assertions over the represented box. On a nonempty box, saturates() shall hold when its affine image is a single value satisfying the congruence. An empty box shall report disjoint, included and saturating. The unique zero-dimensional point shall be tested against the constant congruence.

Excluded finite endpoints shall not establish a congruence witness. The first eligible lattice value and all affine-range intermediates shall not be restricted to the configured coefficient range. A congruence whose ambient dimension exceeds the box dimension shall throw std::invalid_argument without changing the represented box.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

PPL-SPEC-000975
3. Box subsumption of geometric generators PPL-SPEC-000975

For a dimension-compatible geometric generator, relation_with(g) shall return Poly_Gen_Relation::subsumes() exactly when the generator is subsumed, and nothing() otherwise. A point shall be subsumed exactly when its rational coordinates belong to the box. A closure point shall use membership in the topological closure of a nonempty box. Coordinates omitted from the generator shall be zero, including all trailing box coordinates.

A ray shall be subsumed exactly when translating any box point by every nonnegative multiple of its direction remains in the box; a line shall use every real multiple. Zero direction components shall impose no condition; a positive or negative ray component shall require the corresponding upper or lower absence of a finite bound, and a nonzero line component shall require an unconstrained factor. An empty box shall subsume no generator. The zero-dimensional universe shall subsume every admitted zero-dimensional generator. A generator with greater dimension shall throw std::invalid_argument without changing the represented box.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

4. Cartesian box intersection PPL-SPEC-000976

For same-profile boxes of equal ambient dimension, intersection_assign(y) shall replace the receiver by the exact set intersection of the two entry values, preserving their ambient dimension. Each nonempty result factor shall be the corresponding interval intersection. Empty and universe shall obey the ordinary set identities, including dimension zero. The operation shall admit self-intersection and shall preserve a distinct donor's represented value. Any empty factor shall make the result empty regardless of cached classification.

Dimension mismatch shall throw std::invalid_argument before replacing the receiver's represented value.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

PPL-SPEC-000977
5. Least same-profile box upper bound PPL-SPEC-000977

For same-profile boxes of equal ambient dimension, upper_bound_assign(y) shall replace the receiver by the least box of that profile containing both entry sets. For nonempty operands this shall use the coordinate-wise least interval hulls; endpoint inclusion shall retain every admitted input point. An empty operand shall be neutral, including a lazily empty operand, and the zero-dimensional cases shall retain empty/universe meaning.

The operation shall admit a donor identical to the receiver, preserve the represented value of a distinct donor and keep ambient dimension. Dimension mismatch shall throw std::invalid_argument before replacing the receiver's represented value. The result need not equal the union.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

PPL-SPEC-000978
6. Conditional exact union of boxes PPL-SPEC-000978

For same-profile boxes of equal dimension, upper_bound_assign_if_exact(y) shall return true exactly when their set-theoretic entry union is representable as a box of that profile. On true it shall replace the receiver by that union. On false the receiver's represented value shall remain unchanged; a partial coordinate hull shall not escape as a failed result. A distinct donor shall remain unchanged in either case.

Exactness shall account for gaps and excluded touching endpoints within a factor, and for incompatible alternatives in different coordinates. Mere intersection or exactness of every separate coordinate hull shall not establish exactness of the Cartesian union. Empty, equal, contained, zero-dimensional and self-aliased operands shall use their set meanings. Dimension mismatch shall throw std::invalid_argument before replacement.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

PPL-SPEC-000979
7. Same-profile abstract box difference PPL-SPEC-000979

For same-profile boxes of equal ambient dimension, difference_assign(y) shall replace the receiver by the least box of that profile containing the set-theoretic difference of the two entry values. It may retain removed points when the difference is not itself representable as a box. With exact rational endpoints and supported openness this shall be the Cartesian interval hull of the exact difference.

Empty subtraction, subtraction from empty, self-subtraction, coverage and zero-dimensional cases shall follow their set meanings. Removal of a boundary shall preserve the remaining endpoint's required openness where representable. A difference split into separate pieces shall use their least same-profile enclosure. A distinct donor shall retain its represented value, self-aliasing shall be admitted and ambient dimension shall remain. Dimension mismatch shall throw std::invalid_argument before replacement.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.

PPL-SPEC-000980
8. Context-preserving box simplification PPL-SPEC-000980

For same-profile boxes of equal ambient dimension, let X and Y be the receiver and context entry sets. simplify_using_context_assign(y) shall produce a box X’ with X ⊆ X’ and X’∩Y = X∩Y, keeping ambient dimension. The operation may discard bounds made redundant by the context. It shall not promise a unique or maximally enlarged result.

A false return shall establish X∩Y = ⌀; a true return shall retain the intersection-preservation guarantee without an additional exact nonemptiness claim. Empty contexts and receivers and zero-dimensional values shall follow these set obligations. A distinct context's represented value shall remain unchanged. With the receiver also used as context, entry-value semantics shall still apply. Dimension mismatch shall throw std::invalid_argument before replacement.

The valid-profile, entry-state, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Mathematical observations may refresh internal caches without changing a represented set. Allocation and endpoint-operation exceptions shall retain their delegated guarantees; no general rollback guarantee shall be inferred.