C++ box geometric relations and set operations
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Parents:
|
|
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. |
Logical relation assertions distinguish exclusion, implication, partial intersection and boundary equality, including vacuous truths on the empty set. |
|
|
|
|
|
Compare the full assertion set with independently derived exact rational affine ranges, signs and endpoint attainment. Include constants, equality and both inequalities, one and several nonzero coefficients, open bounds, unbounded coordinates, zero dimensions, lazy emptiness, dimension mismatch and unchanged mathematical inputs. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/relations1.cc; tests/Box/relations2.cc; tests/Box/relations3.cc. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: Poly_Con_Relation relation_with(const Constraint& c) const; |
|
|
SW_SPEC
|
2 |
|
|
Parents:
|
|
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. |
Congruence relations require actual lattice intersections with the affine range; a rounded bound or an excluded lattice endpoint is insufficient. |
|
|
|
|
|
Use independent integer divisibility and rational affine-image bounds. Check positive moduli, equality congruences, both coefficient signs, constants, open and closed endpoints at lattice values, fractional bounds, unbounded ranges, singleton images, coefficient endpoints, lazy/marked emptiness, zero dimensions and mismatches. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/relations1.cc; tests/Box/relations4.cc. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: Poly_Con_Relation relation_with(const Congruence& cg) const; |
|
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
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. |
Points, closure points and recession directions express different geometric obligations and must retain their distinct boundary semantics. |
|
|
|
|
|
Check exact rational point coordinates, divisors, omitted zero coordinates, open/closed finite bounds and closure points on excluded boundaries. Exercise both ray signs, lines, mixed zero/nonzero directions, unbounded coordinates, empty and zero-dimensional boxes, dimension errors and donor preservation. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/relations1.cc; tests/Box/relations2.cc; tests/Box/relations3.cc. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: Poly_Gen_Relation relation_with(const Generator& g) const; |
|
|
SW_SPEC
|
4 |
|
|
Parents:
|
Incoming link from:
3. Box extrapolation with selected limiting constraints
1 |
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. |
Exact coordinate intersections implement the meet of Cartesian boxes without introducing correlations or losing endpoint openness. |
|
|
|
|
|
Derive coordinate intersections independently for all supported endpoint combinations. Include touching open/closed bounds, unbounded factors, empty coordinates in different positions, lazy/marked states, zero dimensions, self-aliasing, donor preservation and mismatched dimensions. Check each configured binding alias with finite rational range crossings, outward enclosure, independent equal-box intersection and empty-box join. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/intersection1.cc. tests/interfacedboxpolicies1.cc: Check each configured binding alias with finite rational range crossings, outward enclosure, independent equal-box intersection and empty-box join. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: void intersection_assign(const Box& y); |
|
|
SW_SPEC
|
5 |
|
|
Parents:
|
|
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. |
The least enclosing Cartesian product may fill gaps or introduce combinations absent from the disjunctive union. |
|
|
|
|
|
Compare independent coordinate hulls and openness with both input sets, including crossing coordinate choices, contained operands, separated intervals, equal extrema, empty/universe, zero dimensions, lazy state, self-aliasing, preserved donors and mismatches. Check each configured binding alias with finite rational range crossings, outward enclosure, independent equal-box intersection and empty-box join. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/upperbound1.cc. tests/interfacedboxpolicies1.cc: Check each configured binding alias with finite rational range crossings, outward enclosure, independent equal-box intersection and empty-box join. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: void upper_bound_assign(const Box& y); |
|
|
SW_SPEC
|
6 |
|
|
Parents:
|
|
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. |
An exact-union query must distinguish a true disjunction from the potentially larger product of its coordinate hulls. |
|
|
|
|
|
Independently decide union equality with the Cartesian hull, including one-axis changes, opposite containment directions across axes, separated and touching factors with all openness choices, contained/empty/equal/zero-dimensional states, every rejection position, false-result preservation and self histories. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/upperboundifexact1.cc. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: bool upper_bound_assign_if_exact(const Box& y); |
|
|
SW_SPEC
|
7 |
|
|
Parents:
|
|
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. |
Differences of Cartesian products can be disconnected; their box abstraction must state its precision instead of implying set-theoretic exactness. |
|
|
|
|
|
Independently derive exact differences and their coordinate projections for zero, one and several dimensions. Cover equality, containment, disjointness, a single non-contained factor, multiple exclusion alternatives, removed open/closed boundaries, interior holes, empty/lazy states, self-subtraction, donor preservation and mismatch. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/difference1.cc. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: void difference_assign(const Box& y); |
|
|
SW_SPEC
|
8 |
|
|
Parents:
|
|
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. |
Bounds may be removed outside the relevant context while the original constrained intersection and primitive-domain enlargement are preserved. |
|
|
|
|
|
Check input inclusion and equality of the original/result intersections with an independent product model. Include redundant bounds, disjoint factors at every position, empty and universe contexts, empty receiver, open endpoints, unbounded factors, zero dimensions, self-context and mismatch. Interpret the Boolean using its stated one-sided guarantee. |
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxsetoperationsspec1.cc; tests/boxsetoracle.hh; tests/boxpublic1.cc; tests/Box/simplifyusingcontext1.cc. |
|
|
Public header: <ppl.hh>; member excerpt for Box<ITV> in Parma_Polyhedra_Library: bool simplify_using_context_assign(const Box& y); |