Parma Polyhedra Library requirements
C++ product reductions

C++ product reductions

UID:
VERSION:
CLASSIFICATION:
PREFIX:
Type
Level
MID
UID
REFS
Title
Statement
Rationale
Comment
BIBLIOGRAPHY
STATUS
COMPONENT
APPLICABILITY
VERIFICATION_METHODS
VERIFICATION_CRITERIA
SOURCE
LANGUAGE
VISIBILITY
INTERFACE
SW_SPEC
1
PPL-SPEC-001438
PPL-SPEC-001438
Direct and smash reduction policies

No_Reduction shall leave both components unchanged. Smash_Reduction shall set both components empty when either is empty, otherwise preserve them. Both policies shall preserve common dimension and the represented intersection. Policy objects shall be stateless, default-constructible and destructible. Direct policy application shall require valid same-dimensional components.

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.

Propagating known emptiness is exact and does not require exchanging numerical constraints.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check both empty-component directions, both empty and both nonempty, including different component types.

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/contractvalues1.cc; tests/Partially_Reduced_Product/directproduct1.cc; tests/Partially_Reduced_Product/smashproduct1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library.

template <typename D1, typename D2> class No_Reduction {
public: No_Reduction(); ~No_Reduction(); void product_reduce(D1&,D2&);
};
template <typename D1, typename D2> class Smash_Reduction {
public: Smash_Reduction(); ~Smash_Reduction(); void product_reduce(D1&,D2&);
};
SW_SPEC
2
PPL-SPEC-001439
PPL-SPEC-001439
Constraint-sharing product reduction

Constraint reduction shall propagate known emptiness, then refine the first component with the second's minimized constraints and the second with the resulting first component's minimized constraints. A newly detected empty component shall make both empty. Every shared constraint shall be implied by its donor and refinement shall preserve all points satisfying it, so the represented intersection and dimension shall be preserved. Application shall not promise a full reduced-product fixed point or exact concrete emptiness. Policy construction and destruction shall have no mathematical effect.

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.

Adding a donor consequence to the other component preserves intersection even if information exchange remains incomplete.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check both donor directions, new equalities, detected contradictions and repeated application without assuming a fixed point.

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/constraintsproduct1.cc; tests/Partially_Reduced_Product/contractvalues1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library.

template <typename D1, typename D2> class Constraints_Reduction {
public: Constraints_Reduction(); ~Constraints_Reduction();
  void product_reduce(D1&,D2&);
};
SW_SPEC
3
PPL-SPEC-001440
PPL-SPEC-001440
Congruence-sharing product reduction

Congruence reduction shall propagate known emptiness and process the minimized congruences of each donor component. Equality congruences shall refine the other component. For a proper congruence e ∈ mZ, finite bounds from the other component shall identify admitted hyperplanes e = km. If no such hyperplane can intersect, both shall become empty; if exactly one can intersect, its equality shall refine both. Otherwise the procedure may leave them unchanged. Strict endpoint exclusion and signed remainders shall be respected. The represented intersection and common dimension shall be preserved; complete reduction shall not be promised. Donors shall provide minimized valid congruences, and bound arithmetic shall meet all intermediate coefficient conditions.

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.

A congruence restricts an affine expression to spaced hyperplanes; finite bounds can isolate none or one without enumerating all points.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Independently enumerate small signed/rational intervals and residue classes, with open/closed endpoints and zero/one/many admitted hyperplanes in both component orders.

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/congruencesproduct1.cc; tests/Partially_Reduced_Product/contractvalues1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library.

template <typename D1, typename D2> class Congruences_Reduction {
public: Congruences_Reduction(); ~Congruences_Reduction();
  void product_reduce(D1&,D2&);
};
SW_SPEC
4
PPL-SPEC-001441
PPL-SPEC-001441
Shape-preserving product reduction

Shape-preserving reduction shall first perform congruence reduction, then use frequencies from one component to tighten the other's inequality bounds to admitted affine-expression values, in both directions. It shall share resulting equalities using constraint reduction. Each tightening shall be implied by the other component, preserving the represented intersection. Except for equalities introduced by congruence reduction and subsequent constraint sharing, tightening shall retain inequality directions and adjust bounds. A strict inequality whose boundary is an admitted discrete level shall advance by one full positive period even when its closest residue is zero. A strict inequality with a constant zero image shall exclude the whole intersection. Unsupported frequency queries may leave restrictions unchanged. Common dimension and all intermediate arithmetic preconditions shall hold.

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.

Frequency information can move a bound to the next admitted value without changing the represented intersection.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check rational frequencies, positive/negative offsets, strict inequalities, equality discovery and independent intersection preservation.

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/contractvalues1.cc; tests/Partially_Reduced_Product/shapepreservingproduct1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library.

template <typename D1, typename D2> class Shape_Preserving_Reduction {
public: Shape_Preserving_Reduction(); ~Shape_Preserving_Reduction();
  void product_reduce(D1&,D2&);
};
SW_SPEC
5
PPL-SPEC-001442
PPL-SPEC-001442
Lazy product reduction and component views

reduce() shall apply a default-constructed policy object when reduction is unknown, mark the pair as reduced and return true; when already marked it shall return false without invoking the policy. That flag shall record policy application rather than a mathematical fixed-point proof. domain1 and domain2 shall first reduce and return borrowed const component references. A caller shall not retain a component coefficient or representation view across another operation that can reduce, mutate or replace the component, except the explicitly supported entry-denominator borrowing in the affine wrappers.

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.

Lazy information exchange may change component representations while preserving the product intersection.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Use a counting reduction policy to check flag transitions, repeat queries, mutation followed by reduction and borrowed-view lifetime.

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/contractvalues1.cc; tests/Partially_Reduced_Product/directproduct1.cc.

CPP
Public

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

bool reduce() const;
const D1& domain1() const;
const D2& domain2() const;