Parma Polyhedra Library requirements
C++ pointset powerset coordinates

C++ pointset powerset coordinates

PPL-SPEC-001420
1. Pointset-powerset coordinate growth
UID: PPL-SPEC-001420
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Embedding shall extend each disjunct with m unconstrained trailing coordinates, denoting S×Rm. Projecting growth shall extend with m zero coordinates, denoting S×{0}m. Empty shall retain empty meaning and acquire the new ambient dimension. Zero growth shall preserve the value. Growth exceeding the structural dimension limit shall throw std::length_error before extent-proportional allocation or dimension arithmetic overflow.

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:

Even an empty collection has an ambient dimension which must be updated and range-checked.

INTERFACE:

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

void add_space_dimensions_and_embed(dimension_type);
void add_space_dimensions_and_project(dimension_type);
VERIFICATION_CRITERIA:

Check free versus zero added coordinates, empty collections, zero growth and reserved/overflowing extents.

SOURCE:

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/gridprimaryoperations1.cc; tests/Powerset/spacedims1.cc.

PPL-SPEC-001421
2. Pointset-powerset projection and coordinate mapping
UID: PPL-SPEC-001421
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Removal shall existentially project out the selected coordinates of every disjunct and compact remaining indices in order. Higher removal shall retain exactly the requested prefix. Mapping shall use an injective partial map with in-range source dimensions and compact destination range, retaining mapped coordinates and existentially eliminating the others. Empty map shall produce dimension zero. Empty collections shall still acquire the correct result dimension. Invalid removal extents shall throw std::invalid_argument; mapping shall meet 🔗 1. Public partial coordinate-map type and valid use– 🔗 8. Coordinate-map diagnostic printing and output failures and the base map's stated preconditions.

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:

Projection is not setting removed coordinates to zero, and dimension bookkeeping cannot depend on stored nonempty disjuncts.

INTERFACE:

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

void remove_space_dimensions(const Variables_Set&);
void remove_higher_space_dimensions(dimension_type);
template <typename Partial_Function> void map_space_dimensions(const Partial_Function&);
VERIFICATION_CRITERIA:

Check sparse projection, permutation/partial/empty maps, fractional witnesses, empty collections and invalid extents.

SOURCE:

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/gridprimaryoperations1.cc; tests/Powerset/spacedims1.cc.

PPL-SPEC-001422
3. Pointset-powerset dimension expansion and folding
UID: PPL-SPEC-001422
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Expansion shall add m independent copies of the selected coordinate's base-domain restrictions using the base expansion operation. Folding shall merge selected coordinates into the retained destination by base folding and remove the folded coordinates. They shall lift per disjunct, update ambient dimension and inherit base soundness and precision. Variables shall be in range, fold destination shall be outside the folded set, and growth shall respect structural limits; invalid variables/sets shall throw std::invalid_argument and excessive growth std::length_error.

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:

Independent expansion differs from imposing equality between duplicate coordinates; folding may approximate unions of projections.

INTERFACE:

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

void expand_space_dimension(Variable, dimension_type);
void fold_space_dimensions(const Variables_Set&, Variable);
VERIFICATION_CRITERIA:

Check relational expansion, independent duplicate values, folding with retained indices, empty sets and invalid dimensions. Fold previously reduced incomparable disjuncts into identical universes, and compare the public universe result with an unreduced-entry control in closed/NNC polyhedra, bounded-difference, octagonal and rational-box powersets.

SOURCE:

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/spacedims1.cc.

PPL-SPEC-001423
4. Pointset-powerset concatenation
UID: PPL-SPEC-001423
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Concatenation shall collect base concatenations for every pair of reduced disjuncts in receiver-then-argument coordinate order, representing S×T when base concatenation is exact and otherwise its sound base approximation. Empty input shall give empty in the sum dimension. Self-concatenation shall be supported. The sum dimension shall be range-checked without unsigned wraparound; excessive extent shall throw std::length_error.

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:

Cartesian product distributes over both input unions and includes ambient dimensions of empty inputs.

INTERFACE:

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

void concatenate_assign(const Pointset_Powerset&);
VERIFICATION_CRITERIA:

Check cross-pair products, coordinate order, empty/self inputs and overflowing sums.

SOURCE:

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/cancellation1.cc; tests/powersetinterruptedproducts1.cc; tests/Powerset/concatenate1.cc.