Parma Polyhedra Library requirements
C++ box values and foundational queries
PPL-SPEC-000951
1. Cartesian box values, coordinate identity and valid use PPL-SPEC-000951

Box<ITV> shall represent a Cartesian product of its coordinate intervals over the ordinary real carrier. A point shall belong exactly when each coordinate belongs to its corresponding factor; distinct coordinates shall impose no additional relationships. An empty factor shall make the product empty. The ambient dimension shall remain part of the value even for an empty box. In dimension zero, universe shall contain the unique empty tuple and shall differ from empty. interval_type shall name ITV; Rational_Box shall select Rational_Interval factors.

Selected interval operations shall be well-formed and their information policy shall admit the required empty, universe and endpoint values. Active numerical payloads shall be initialized and rational payloads canonical. Clients shall retain the selected endpoint operation's finite-range, resource, shared-temporary and caller-owned FPU prerequisites. Basic construction, copying, exchange and valid-coordinate factor access shall require no additional PPL initialization. Reporting dimension-incompatible coordinate arguments shall retain an initialized library/thread context under 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization, including the live coefficient constants used by that reporting path. Other APIs using separately initialized descriptors or facilities shall retain their own prerequisites.

Boxes and borrowed arguments shall remain live throughout a call. Access shall be synchronized against mutation; logically const queries may update cached information and shall be synchronized where those updates could overlap. Cached status shall not change the represented product. Empty boxes may retain inactive coordinate storage; clients shall use the public empty-aware coordinate access contract rather than infer meaningful factors from internal empty storage.

PPL-SPEC-000952
2. Dimensioned empty and universe box construction PPL-SPEC-000952

Box(d,kind) shall construct a box of ambient dimension d: empty for EMPTY and the complete declared Cartesian carrier for UNIVERSE. Default construction shall give zero-dimensional universe. Each active universe factor shall have the selected interval's universe meaning; custom interval/information constructors shall retain their per-element state rather than be required to share copied identity.

max_space_dimension() shall return the dimension limit of this box profile. Construction above that limit shall throw std::length_error before attempting coordinate storage of that size. Dimensions within the limit shall remain subject to actual allocation/resource availability; the reported limit shall not promise successful allocation. Construction shall not require interpreting inactive interval payloads of an empty box.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

3. Owned box copying, assignment and cleanup PPL-SPEC-000953

Same-profile copying shall preserve ambient dimension and represented set while independently owning all mutable coordinate/metadata storage. The copy constructor's complexity argument shall not change that result. Assignment shall replace the receiving value even when dimensions differ and shall return the receiving object; self-assignment shall preserve its value. Destruction shall release owned resources without modifying other live values.

On successful return, subsequent mutation or destruction of either owner shall not change the other owner's represented value. Empty and lazy cached states shall retain correct mathematical meaning after copying/assignment.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

4. Upward box conversion between interval profiles PPL-SPEC-000954

Construction from Box<Other_ITV> shall preserve ambient dimension and enclose every source point under the receiving interval policies. An established empty source shall give empty. For other sources the conversion shall use receiving coordinate enclosures rather than trust cached facts whose validity can change through endpoint conversion. With exactly representable endpoints and supported membership, it shall preserve the represented set exactly. Otherwise endpoint conversion or relaxed openness may enlarge the product. The complexity argument shall not change this profile-conversion result. The separate source shall remain unchanged and the receiving value shall own independent coordinate storage.

Selected source/destination interval assignments shall be well-formed and satisfy their own admitted conversion prerequisites.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

PPL-SPEC-000955
5. Whole box exchange across different dimensions PPL-SPEC-000955

m_swap(y) and free swap(x,y) shall exchange complete box values, including dimensions, coordinate ownership and cached status. Different dimensions and empty/nonempty states shall be permitted. Self-exchange shall preserve the value. References into exchanged coordinate storage shall follow that storage's owner; callers shall not assume a reference continues to identify the original logical coordinate value. Exchange of the standard owned coordinate sequence/status shall not perform per-endpoint numerical conversions or require coefficient range operations.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

PPL-SPEC-000956
6. Ambient and affine box dimension queries PPL-SPEC-000956

space_dimension() shall return the ambient coordinate count, including for empty boxes. affine_dimension() shall return zero for empty boxes; otherwise it shall equal the number of nonsingleton coordinate factors over the ordinary real carrier. Both empty and universe in ambient dimension zero shall therefore have affine dimension zero. These queries shall not change the represented set or ambient dimension.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

7. Empty-aware borrowed coordinate interval access PPL-SPEC-000957

get_interval(v) shall return a const interval reference for an existing coordinate. For a nonempty box it shall denote that coordinate's factor. For an empty box it shall denote an empty interval, independently of any inactive internal coordinate payload. Different empty queries may share an internal interval; clients shall not infer distinct ownership or identity from those references.

An out-of-dimension variable shall throw std::invalid_argument before returning a reference, including on an empty box. A reference into an active factor shall require its owning coordinate storage to remain live and free of invalidating owner operations. A shared empty reference shall require its owning library/thread context to remain live. Clients shall not mutate through these const views.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

PPL-SPEC-000958
8. Explicit coordinate factor replacement PPL-SPEC-000958

For a nonempty box, set_interval(v,i) shall replace only the selected factor with the supplied interval's entry value, retaining ambient dimension and the other factors. A resulting empty factor shall make the box empty. The source interval shall remain unchanged; borrowing the same or another active factor as the source shall be permitted without changing its entry value during replacement.

For a one-dimensional empty box, replacing its sole factor shall establish that supplied one-dimensional interval, which may make the box nonempty. For an already empty box of dimension at least two, replacing one factor shall retain the empty box. An out-of-dimension variable shall throw std::invalid_argument without replacing factors. The operation shall update emptiness knowledge as needed so later queries reflect the resulting product.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

PPL-SPEC-000959
9. Exact ordinary box classification PPL-SPEC-000959

The following Boolean queries shall report exact properties of the represented ordinary real Cartesian set. is_empty() shall decide emptiness and is_universe() equality with the ambient universe. is_topologically_closed() shall decide topological closure; is_bounded() shall decide boundedness; is_discrete() shall be true exactly for empty boxes or products of singleton factors. contains_integer_point() shall be true exactly when the product contains an integer-coordinate point. In dimension zero the universe shall be nonempty, closed, bounded, discrete and contain the empty integer tuple; empty shall be closed, bounded, discrete and contain no integer point.

constrains(v) shall be true for empty boxes and, for a nonempty box, exactly when that coordinate's factor differs from universe. A variable outside the ambient dimension shall throw std::invalid_argument. Queries may establish cached facts without changing the mathematical set.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

PPL-SPEC-000960
10. Box set relations, dimension-sensitive equality and compatible hashes PPL-SPEC-000960

For equal ambient dimensions, contains(y) shall decide Y ⊆ X, strictly_contains(y) proper inclusion and is_disjoint_from(y) empty intersection. Empty sets and zero-dimensional sets shall follow their ordinary set meanings. These methods shall throw std::invalid_argument when ambient dimensions differ, including for empty operands.

Free equality shall be true exactly for boxes with equal dimensions and equal represented sets; different dimensions shall compare unequal without a dimension exception. Free inequality shall negate equality. Equal boxes shall have equal hash_code() values; collisions between unequal boxes shall be permitted. Relations and hashing shall leave mathematical values unchanged and shall not depend on distinct cached evaluation histories.

The validity, synchronization, numerical and runtime prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Underlying allocation or endpoint failure shall retain its own guarantees; no general rollback promise shall be inferred.

PPL-SPEC-001221
11. Explicit empty box assignment PPL-SPEC-001221

set_empty() shall replace the receiver's entry set X ⊆ Rn by ⌀ ⊆ Rn. It shall preserve the ambient dimension and shall be idempotent, including in dimension zero. Subsequent empty-aware queries and coordinate access shall observe the empty value under 🔗 7. Empty-aware borrowed coordinate interval access and 🔗 9. Exact ordinary box classification.

The operation shall retain the owned coordinate storage and the stored interval objects. Those factors shall become inactive; it shall not need to assign an empty value to each factor or query their numerical payloads. Borrowed references to retained factors shall retain their storage lifetime, but shall not independently denote the current box's factors while the box is empty. Independent copies shall remain unchanged.

The receiver shall have safely owned coordinate storage and externally synchronized access. The operation shall require no numerical arithmetic, no additional PPL initialization, no allocation and no interval-profile callback, and shall not change hardware rounding state.