Parma Polyhedra Library requirements
C++ product queries

C++ product queries

PPL-SPEC-001443
1. Product constraint and congruence exports
UID: PPL-SPEC-001443
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Constraint and congruence exports shall reduce, combine the systems exported by both components and return owned systems. The systems shall soundly overapproximate the product; neither kind alone need express all information in the intersection. Minimized constraints shall minimize their combined polyhedron using NNC topology when strict rows occur; minimized congruences shall minimize the combined grid. Returned systems shall remain independent of later product mutation.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

RATIONALE:

Conjoining sound component exports preserves all product points, but can lose information unavailable in that descriptor language.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

Constraint_System constraints() const;
Constraint_System minimized_constraints() const;
Congruence_System congruences() const;
Congruence_System minimized_congruences() const;
VERIFICATION_CRITERIA:

Check distinct restrictions from both donors, duplicate/strict rows, independent returned values and modular information loss in constraints.

SOURCE:

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/congruences1.cc; tests/Partially_Reduced_Product/constraints1.cc.

PPL-SPEC-001444
2. Component-based product property tests
UID: PPL-SPEC-001444
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

After policy reduction, emptiness shall test whether either component is empty; boundedness and discreteness shall test whether either component has the property; topological closure shall test whether both do. Universe shall test whether both components are universe. Disjointness shall test whether corresponding first components or corresponding second components are disjoint. Directional bound tests and constrains shall use the logical OR of the two component results. Except for exact universe characterization, these shall retain their stated component scope: a negative emptiness, boundedness, discreteness or disjointness result shall not refute the corresponding concrete property of the intersection. Component dimension/variable admission shall apply; invalid dimensions shall throw std::invalid_argument.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

RATIONALE:

Component facts can establish properties of an intersection without deciding all facts jointly implied by both components.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

bool is_empty() const; bool is_universe() const;
bool is_topologically_closed() const;
bool is_discrete() const; bool is_bounded() const;
bool is_disjoint_from(const Partially_Reduced_Product&) const;
bool constrains(Variable) const;
bool bounds_from_above(const Linear_Expression&) const;
bool bounds_from_below(const Linear_Expression&) const;
VERIFICATION_CRITERIA:

Check truth tables, empty intersections with nonempty components, jointly bounded intersections, directional bounds and invalid variables.

SOURCE:

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/bounded1.cc; tests/Partially_Reduced_Product/bounds1.cc; tests/Partially_Reduced_Product/discrete1.cc; tests/Partially_Reduced_Product/disjoint1.cc; tests/Partially_Reduced_Product/isempty1.cc; tests/Partially_Reduced_Product/isuniverse1.cc; tests/Partially_Reduced_Product/topclosed1.cc.

PPL-SPEC-001445
3. Component-based product descriptor relations
UID: PPL-SPEC-001445
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Constraint and congruence relations shall reduce, then include each is_included, is_disjoint or saturates flag when either component reports it. They shall not infer strict intersection from component strict intersection. Generator subsumption shall require subsumption by both components. The flags shall retain the base descriptor meanings and may be incomplete for the full intersection. Descriptor dimension incompatibility shall throw std::invalid_argument.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

RATIONALE:

A property true of either superset component holds for the product, while a witness must satisfy both components.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

Poly_Con_Relation relation_with(const Constraint&) const;
Poly_Con_Relation relation_with(const Congruence&) const;
Poly_Gen_Relation relation_with(const Generator&) const;
VERIFICATION_CRITERIA:

Check each donor flag, mixed component relations, absent strict-intersection inference, generator agreement and dimension rejection.

SOURCE:

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/relations1.cc.

PPL-SPEC-001446
4. Component-selected product bounds and witnesses
UID: PPL-SPEC-001446
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Extremum queries shall reduce and return false if a component is empty or neither component provides a directional bound; outputs shall then remain unchanged. Otherwise maximization shall choose the smaller available component supremum and minimization the larger component infimum. Equal bounds shall prefer a component not attaining that bound. Success shall return its rational bound with positive denominator, attainment flag and, for witness overloads, its corresponding point or closure point. Neither success, attainment nor the witness shall establish nonemptiness or optimum attainment in the product intersection; the selected witness need not satisfy the other component. Comparison of representable component bounds shall be exact even when their cross-products exceed the configured coefficient range. Expression dimensions and independently writable outputs shall satisfy both component contracts.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

RATIONALE:

Intersecting components may improve their bounds jointly, so choosing the best individual bound need not solve optimization over the intersection.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

bool maximize(const Linear_Expression&, Coefficient&, Coefficient&, bool&) const;
bool maximize(const Linear_Expression&, Coefficient&, Coefficient&, bool&, Generator&) const;
bool minimize(const Linear_Expression&, Coefficient&, Coefficient&, bool&) const;
bool minimize(const Linear_Expression&, Coefficient&, Coefficient&, bool&, Generator&) const;
VERIFICATION_CRITERIA:

Check both donor directions, sole-bound donors, equal open/closed ties, rational comparison with cross-products exceeding the coefficient range, failure sentinels and witnesses outside the other component.

SOURCE:

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/maxmin1.cc.

PPL-SPEC-001447
5. Product component order and equality
UID: PPL-SPEC-001447
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Containment shall reduce both operands and require containment for both corresponding component pairs. Strict containment shall additionally require strictness for at least one pair. Equality shall require both component equalities after reduction; inequality shall negate it. These are component-order and equality tests, which may distinguish equal represented intersections. Componentwise strictness shall not prove strictness of concrete intersection inclusion. Dimension admission shall follow the component tests.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

RATIONALE:

The product representation can carry redundant restrictions distributed differently between components.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

bool contains(const Partially_Reduced_Product&) const;
bool strictly_contains(const Partially_Reduced_Product&) const;
template <typename D1, typename D2, typename R>
bool operator==(const Partially_Reduced_Product<D1,D2,R>&, const Partially_Reduced_Product<D1,D2,R>&);
// Inequality uses C++20 rewriting of operator==.
VERIFICATION_CRITERIA:

Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Check proper component inclusion, concrete-equal pairs with different components, self-comparison and dimension errors.

SOURCE:

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/contains1.cc; tests/Partially_Reduced_Product/equals1.cc.