Parma Polyhedra Library requirements
C++ pointset powerset queries

C++ pointset powerset queries

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-001399
PPL-SPEC-001399
Pointset-powerset empty and universe queries

is_empty shall return true exactly when every stored disjunct is empty, including the empty collection. is_universe shall return true exactly when a stored disjunct denotes universe; it may remove other disjuncts when such a disjunct is found. A union that covers the whole ambient space without a universe disjunct need not make this structural universe query true; geometric coverage shall be used for that semantic comparison.

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 structural top test is cheaper than deciding whether several proper disjuncts jointly cover universe.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check empty and redundant collections, a universe disjunct and two complementary half-spaces without a universe disjunct.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/empty1.cc; tests/Powerset/universe1.cc.

CPP
Public

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

bool is_empty() const;
bool is_universe() const;
SW_SPEC
2
PPL-SPEC-001400
PPL-SPEC-001400
Affine dimension of a pointset powerset

affine_dimension shall return the affine dimension of the smallest affine space containing the union, using the affine hull of each nonempty disjunct. Empty shall have affine dimension zero. Distinct zero-dimensional disjuncts may jointly have positive affine dimension. Base minimized equality constraints shall describe each disjunct's affine hull for this calculation.

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.

Taking the maximum of disjunct dimensions would miss dimensions introduced by distinct affine offsets.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check separated points, parallel affine subspaces, empty disjuncts and full dimension.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/affinedimension1.cc.

CPP
Public

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

dimension_type affine_dimension() const;
SW_SPEC
3
PPL-SPEC-001401
PPL-SPEC-001401
Pointset-powerset structural shape queries

Boundedness and discreteness shall hold exactly when they hold for all stored disjuncts. contains_integer_point shall hold when some disjunct contains one. is_topologically_closed shall reduce and report whether all remaining disjuncts are closed; false may be conservative when several nonclosed disjuncts jointly form a closed union. constrains(v) shall validate the variable, reduce, and report true for empty or when some remaining disjunct constrains v. It may conservatively report true for a union that is cylindrically unconstrained. Invalid v 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.

Finite unions preserve boundedness and discreteness, but closure and coordinate independence can emerge from a combined decomposition.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check finite separated points, unbounded members, open pieces covering a closed set, fractional grids and invalid variables.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/bounded1.cc; tests/Powerset/closed1.cc; tests/Powerset/containsintegerpoint1.cc; tests/Powerset/discrete1.cc.

CPP
Public

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

bool is_bounded() const; bool is_discrete() const;
bool is_topologically_closed() const;
bool constrains(Variable) const;
bool contains_integer_point() const;
SW_SPEC
4
PPL-SPEC-001402
PPL-SPEC-001402
Pointset-powerset structural set relations

contains(y) shall return true exactly when each stored y disjunct is contained in some receiver disjunct. strictly_contains(y) shall first reduce the receiver, then require each stored y disjunct to be strictly contained in some remaining receiver disjunct. The latter universal condition is true for an empty stored y collection, including an empty receiver. Neither result shall be substituted for strict geometric containment of represented unions. Dimension-incompatible operands shall throw std::invalid_argument.

is_disjoint_from(y) shall apply the selected base domain's disjointness predicate to each pair of retained receiver and source disjuncts. It shall return true exactly when every pair reports disjointness. For a base satisfying an exact disjointness contract, this shall decide whether the two represented unions have empty intersection, independently of their decomposition. An empty stored collection shall be disjoint from every dimension-compatible powerset. Stored bottom disjuncts and self-aliasing shall retain the base predicate's meaning. The query shall preserve the stored collections and represented values; logically const component queries may update their permitted caches. Incompatible ambient dimensions shall throw std::invalid_argument before pair visitation, including when both collections are empty.

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.

Containment uses disjunctwise matching and its stated strictness condition. Disjointness is the conjunction of base-domain disjointness over all pairs; it does not require the union-coverage algorithm used for geometric inclusion.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check split coverage, proper per-disjunct inclusion, equal decompositions, empty collections and dimension rejection. Check symmetric zero/positive- dimensional disjointness, strict endpoint contacts, one intersecting pair, self queries, retained empty components and rejected mismatched dimensions.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/contains1.cc; tests/Powerset/disjoint1.cc; tests/Powerset/argumentadmission1.cc.

CPP
Public

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

bool contains(const Pointset_Powerset&) const;
bool strictly_contains(const Pointset_Powerset&) const;
bool is_disjoint_from(const Pointset_Powerset&) const;
SW_SPEC
5
PPL-SPEC-001403
PPL-SPEC-001403
Geometric powerset coverage and equality

geometrically_covers(y) shall decide whether the receiver union contains the y union. geometrically_equals shall decide mutual geometric coverage, independently of decomposition or redundant storage. check_containment(p,ps) shall decide whether the union ps contains p. NNC polyhedra shall use exact polyhedral partitioning; supported convex base domains shall use exact conversion to NNC polyhedra. Grids shall use their specialized finite-coset coverage procedure. Arithmetic preconditions shall hold throughout all partitions. Ambient dimensions shall agree; incompatible operands 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.

A single target disjunct may be covered by several source disjuncts without any one covering it.

BagnaraHZ06STTT | Section 3 (union concretization and semantic equivalence).

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check split and overlapping decompositions, holes and excluded boundaries, residue-class unions and invalid dimensions.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/argumentadmission1.cc; tests/Powerset/contains1.cc; tests/Powerset/equals1.cc; tests/Powerset/gridpartition1.cc.

CPP
Public

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

bool geometrically_covers(const Pointset_Powerset&) const;
bool geometrically_equals(const Pointset_Powerset&) const;
bool check_containment(const NNC_Polyhedron&, const Pointset_Powerset<NNC_Polyhedron>&);
bool check_containment(const Grid&, const Pointset_Powerset<Grid>&);
template <typename PSET>
bool check_containment(const PSET&, const Pointset_Powerset<PSET>&);
SW_SPEC
6
PPL-SPEC-001404
PPL-SPEC-001404
Pointset-powerset directional bound tests

Directional bound tests shall reduce, then return true exactly when every remaining disjunct bounds the expression in that direction. Empty shall be bounded in either direction. For nonempty collections, the expression's ambient dimension shall be admitted by every disjunct; 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.

A finite union has a finite directional bound exactly when every nonempty member has one.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check all-bounded, one-unbounded, empty and single-direction cases with fractional expressions.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/argumentadmission1.cc; tests/Powerset/bounds1.cc.

CPP
Public

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

bool bounds_from_above(const Linear_Expression&) const;
bool bounds_from_below(const Linear_Expression&) const;
SW_SPEC
7
PPL-SPEC-001405
PPL-SPEC-001405
Pointset-powerset extrema and witnesses

Maximization and minimization shall fail for empty or directionally unbounded unions, leaving all outputs unchanged on a false return. Otherwise they shall return the greatest disjunct supremum or least disjunct infimum as an exact rational with positive denominator. The attainment flag shall be true when at least one disjunct attaining the selected bound includes its optimum. A witness overload shall select an included point when the union attains the bound and otherwise a closure point of a contributing disjunct. The witness shall attain the returned bound in the corresponding union or its closure. Expression dimension admission and arithmetic shall follow the base extrema members; independently writable output objects shall be required.

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.

Taking an extremum over a finite union requires selecting across all disjuncts, including attainment ties.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check separated bounds, rational ties with both attainment flags, witnesses, empty/unbounded failure sentinels and output independence.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/argumentadmission1.cc; tests/Powerset/maxmin1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Pointset_Powerset 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;
SW_SPEC
8
PPL-SPEC-001406
PPL-SPEC-001406
Pointset-powerset descriptor relations

Constraint and congruence relations shall combine disjunct relations: inclusion, disjointness and saturation shall each require that flag from every disjunct. Strict intersection shall be reported when a disjunct strictly intersects or when nonempty included and disjoint disjuncts occur. Empty disjuncts shall not supply a strict-intersection witness. Generator subsumption shall be reported when at least one disjunct subsumes it, using base generator semantics. Empty collections shall give the vacuous inclusion, disjointness and saturation flags and no generator subsumption. Invalid descriptor 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.

Relations over a union aggregate universal set properties and existential witnesses differently.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check each relation flag, mixed included/disjoint disjuncts, redundant empties, points/directions and dimension rejection.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/argumentadmission1.cc; tests/Powerset/relationwith1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Pointset_Powerset 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;