Parma Polyhedra Library requirements
C++ pointset powerset operations

C++ pointset powerset operations

PPL-SPEC-001407
1. Lifted constraint addition and refinement
UID: PPL-SPEC-001407
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Constraint addition and refinement shall apply the corresponding base operation to every disjunct, retaining union semantics and marking reduction unknown. Exact addition shall intersect each disjunct with the admitted constraint conjunction. Refinement shall preserve every point satisfying the input conjunction and satisfy the base precision guarantee, possibly ignoring unsupported restrictions. Topology and dimension rejection shall follow the base operation, including std::invalid_argument for incompatible inputs.

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:

Intersection with a conjunction distributes over disjunction, while refinement may approximate at base level.

INTERFACE:

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

void add_constraint(const Constraint&); void add_constraints(const Constraint_System&);
void refine_with_constraint(const Constraint&);
void refine_with_constraints(const Constraint_System&);
VERIFICATION_CRITERIA:

Check strict boundaries, equalities, contradictions, unsupported base rows, empty/nonempty collections and invalid arguments.

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/addconstraints1.cc; tests/Powerset/argumentadmission1.cc; tests/Powerset/gridprimaryoperations1.cc; tests/Powerset/refinewith1.cc.

PPL-SPEC-001408
2. Lifted congruence addition and refinement
UID: PPL-SPEC-001408
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Congruence addition and refinement shall apply the corresponding base operation to every disjunct, preserving union semantics and marking reduction unknown. Exact addition shall intersect with the admitted congruence conjunction; refinement shall be sound with the base precision guarantee. Proper modular restrictions shall not be converted into affine equalities. Dimension or unsupported exact-addition admission shall follow the base exception contract.

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:

Congruences represent residue classes, so interpreting a proper congruence as equality would discard valid points.

INTERFACE:

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

void add_congruence(const Congruence&); void add_congruences(const Congruence_System&);
void refine_with_congruence(const Congruence&);
void refine_with_congruences(const Congruence_System&);
VERIFICATION_CRITERIA:

Check residue classes, equality congruences, contradictory/tautological rows, approximate refinement and dimensional errors.

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/addcongruences1.cc; tests/Powerset/argumentadmission1.cc; tests/Powerset/gridprimaryoperations1.cc; tests/Powerset/refinewith1.cc.

PPL-SPEC-001409
3. Lifted cylindrification
UID: PPL-SPEC-001409
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

unconstrain shall cylindrify each disjunct in the selected coordinates while retaining ambient dimension and mark reduction unknown. The resulting union shall have the base operation's exactness and arithmetic guarantees. An empty variable set shall preserve the value. Out-of-range variables 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:

Existential projection followed by unconstrained embedding distributes over finite unions.

INTERFACE:

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

void unconstrain(Variable);
void unconstrain(const Variables_Set&);
VERIFICATION_CRITERIA:

Check relational disjuncts, scalar/set overload agreement, empty variable sets and invalid dimensions.

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

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

Intersection shall collect all pairwise base intersections of the reduced operands, discarding bottom results. It shall represent exact union intersection when the base intersection is exact and otherwise inherit its soundness and precision. Self-intersection shall be supported. Operands shall have the same ambient dimension; mismatch 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:

Every point in the intersection belongs to a pair of input disjuncts.

INTERFACE:

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

void intersection_assign(const Pointset_Powerset&);
VERIFICATION_CRITERIA:

Check cross-pair rather than positional overlap, empty operands, self-intersection and mismatched dimensions.

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

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

Difference shall subtract each subtrahend disjunct successively. For NNC polyhedra, exact polyhedral partitions shall represent exact set difference, including excluded boundaries. Other supported convex bases shall convert through NNC partitions and inherit conversion precision. Grid subtraction shall return exact finite-coset residues when representable and otherwise a sound finite overapproximation. Empty subtraction shall preserve the minuend; self-subtraction shall give empty. Ambient dimensions shall agree or std::invalid_argument shall be thrown.

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:

Finite disjunction can preserve nonconvex residues that a single convex base element cannot represent.

INTERFACE:

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

void difference_assign(const Pointset_Powerset&);
VERIFICATION_CRITERIA:

Check interior holes, boundary subtraction, multiple subtrahends, grid finite/infinite residue cases and self-subtraction.

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/difference1.cc; tests/Powerset/gridpartition1.cc.

PPL-SPEC-001412
6. Meet-preserving powerset context simplification
UID: PPL-SPEC-001412
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Context simplification shall preserve the represented intersection with y and leave no more disjuncts than the reduced original receiver. Disjuncts disjoint from the context may be removed; the result need not contain the original union outside that context. A false return shall establish empty intersection, while true need not establish nonemptiness for approximate base simplification. Empty receiver or context shall produce a false return. Dimension mismatch 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:

Preservation inside a context allows dropping irrelevant disjuncts and relaxing relevant ones.

INTERFACE:

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

bool simplify_using_context_assign(const Pointset_Powerset&);
VERIFICATION_CRITERIA:

Check singleton and multiple contexts, empty intersections, cardinality, and independent before/after intersection equality. Include late overlaps after unchanged disjoint prefixes, accumulated simplifications reaching a fixed point, restoring source bounds needed by a later context, empty effective contexts, aliases, and preservation of distinct contexts. Inject allocation failures after a disjunct has been enlarged and check ownership and invalidation of stale reduction certificates. Include an unreduced original pair whose later disjunct strictly contains its predecessor, checking raw result size against the separately reduced original before any result query can canonicalize it.

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/simplifyusingcontext1.cc; tests/powersetcontextfailure1.cc.

PPL-SPEC-001424
7. Powerset topological closure and time elapse
UID: PPL-SPEC-001424
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Topological closure shall close every disjunct; for a finite collection of exact base closures the result shall be the exact closure of the union. Time elapse shall collect all pairwise base time-elapse results, denoting the corresponding union of p + tv for admitted states, velocities and t ≥ 0, with the base precision contract. Empty state or velocity collections shall follow the base time-elapse semantics. Dimension-incompatible time 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.

RATIONALE:

Closure distributes over finite unions, while velocities require a cross-product lifting.

INTERFACE:

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

void topological_closure_assign();
void time_elapse_assign(const Pointset_Powerset&);
VERIFICATION_CRITERIA:

Check open boundary closure, zero/nonzero velocities, separated disjunct pairs, empty inputs and base approximation. Close an initially reduced antichain whose new boundary makes a disjunct redundant, then request omega-reduction and compare the remaining geometry. Exercise NNC polyhedra and open rational boxes, shared-source preservation, empty and zero-dimensional collections, and exact identity closure for closed polyhedra, grids, BD/octagonal shapes and interval boxes without openness.

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

PPL-SPEC-001425
8. Powerset integer restriction and wrapping
UID: PPL-SPEC-001425
STATUS: APPROVED
COMPONENT: DOMAIN_COMBINATIONS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Integer restriction shall apply the selected base tightening to each disjunct, preserve all points integral in the selected coordinates and retain a subset of the old union; no optimality shall be promised. Wrapping shall apply the base bounded-integer conversion to every disjunct with the supplied width, representation, overflow mode, optional constraints and precision controls. It shall inherit 🔗 1. Mathematical interpretation of bounded-integer wrapping attributes and base wrapping semantics, including sound overflow behavior and variable/constraint admission. Reduction shall become unknown after either operation.

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:

Disjunction must retain all selected integral states and all admitted wrapped outcomes.

INTERFACE:

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

void drop_some_non_integer_points(Complexity_Class=ANY_COMPLEXITY);
void drop_some_non_integer_points(const Variables_Set&, Complexity_Class=ANY_COMPLEXITY);
void wrap_assign(const Variables_Set&, Bounded_Integer_Type_Width,
                 Bounded_Integer_Type_Representation, Bounded_Integer_Type_Overflow,
                 const Constraint_System* = nullptr, unsigned=16, bool=true);
VERIFICATION_CRITERIA:

Check fractional disjuncts, selected versus all coordinates and small-width modular/undefined/impossible overflow controls.

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