Parma Polyhedra Library requirements
C++ convex-polyhedron operations

C++ convex-polyhedron operations

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-001338
PPL-SPEC-001338
Polyhedral constraint addition and refinement

The rvalue add_constraints overload shall permit transferring owned rows through prepared insertion, with the compatibility and ownership guarantees of recycled insertion. Adding an admitted constraint or system shall compute its exact conjunction with the receiver. Closed addition shall reject strict rows with std::invalid_argument; NNC addition shall preserve their strictness. Refinement shall use the same conjunction for admitted topology-compatible rows. In a closed receiver, refinement by a strict inequality may relax it to the corresponding non-strict inequality; a false constant shall still yield empty. Trailing free dimensions shall be retained. Excess descriptor dimension shall throw std::invalid_argument. External const input shall be preserved. Recycled input may be consumed and need only remain safely destructible on return. Pending descriptions shall retain all previously added restrictions.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Closed polyhedra can conservatively relax a strict boundary during refinement, while exact addition must reject unrepresentable topology.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check pending and minimized histories, contradictions, strict topology admission/relaxation, zero dimensions, borrowed descriptor inputs and recycled ownership. Check strict zero contradictions separately from ordinary strict relaxation, with padded and unpadded dense/sparse rows, zero and positive dimensions, processed/pending histories, both refinement APIs and unchanged const inputs.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/addconstraint1.cc; tests/Polyhedron/addconstraints1.cc; tests/Polyhedron/addconstraints2.cc; tests/Polyhedron/refinewithconstraint1.cc; tests/Polyhedron/refinewithconstraints1.cc; tests/Polyhedron/recycledsystems1.cc. src/Constraint_System.cc; tests/systembulktransferspec1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

void add_constraint(const Constraint&);
void add_constraints(const Constraint_System&);
void add_constraints(Constraint_System&&);
void add_recycled_constraints(Constraint_System&);
void refine_with_constraint(const Constraint&);
void refine_with_constraints(const Constraint_System&);
SW_SPEC
2
PPL-SPEC-001339
Polyhedral congruence addition and conservative refinement

Addition shall conjoin equality congruences exactly, ignore tautologies, and set empty for contradictions. A proper congruence that is neither constant-true nor constant-false shall throw std::invalid_argument. Refinement shall conjoin equality congruences exactly and may ignore proper congruences. Bulk refinement shall recognize contradictory proper congruences; single refinement in positive ambient dimension may retain the receiver for a proper congruence, including a contradiction. In zero dimensions it shall use the congruence's truth value. Excess descriptor dimension shall throw std::invalid_argument. Const external inputs shall be preserved; recycled inputs need only remain destructible. The source and receiver may have lower and higher dimensions respectively, with trailing coordinates free.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Periodic restrictions are generally nonconvex. Exact addition rejects nonrepresentable rows, while refinement provides an explicit conservative approximation.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check equality, tautological and contradictory proper rows in single and bulk routes, rejected periodic additions, empty/zero dimensions and const/recycled input ownership.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/addcongruence1.cc; tests/Polyhedron/addcongruences1.cc; tests/Polyhedron/refinewithcongruence1.cc; tests/Polyhedron/refinewithcongruences1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

void add_congruence(const Congruence&);
void add_congruences(const Congruence_System&);
void add_recycled_congruences(Congruence_System&);
void refine_with_congruence(const Congruence&);
void refine_with_congruences(const Congruence_System&);
SW_SPEC
3
PPL-SPEC-001340
PPL-SPEC-001340
Polyhedral generator insertion

The rvalue add_generators overload shall permit transferring owned rows through prepared insertion, with the compatibility and ownership guarantees of recycled insertion. Generator insertion shall extend the receiver's generator description with the supplied generators and denote that combined description exactly. Inserting points shall form their polyhedral hull with the receiver; rays and lines shall extend recession directions and NNC closure points shall extend closure support without themselves acquiring membership. Empty input shall be a no-op. If the receiver is empty, a nonempty insertion shall contain an included point or throw std::invalid_argument. Closed receivers shall reject closure points; excess descriptor dimension shall be rejected, both by std::invalid_argument. Const external sources shall retain their values. Recycling may consume storage; its source need only remain destructible.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Generator addition changes the hull or recession cone rather than intersecting the pointset.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check latent empty receivers, all generator kinds, points supplied after directions, fractional coordinates, borrowed rows/systems, topology rejection and recycle ownership.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/addgenerator1.cc; tests/Polyhedron/addgenerator2.cc; tests/Polyhedron/addgenerators1.cc; tests/Polyhedron/addgenerators2.cc; tests/Polyhedron/recycledsystems1.cc; tests/systembulktransferspec1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

void add_generator(const Generator&);
void add_generators(const Generator_System&);
void add_generators(Generator_System&&);
void add_recycled_generators(Generator_System&);
SW_SPEC
4
PPL-SPEC-001341
PPL-SPEC-001341
Exact polyhedral intersection

For equal dimensions and compatible topologies, intersection shall replace the receiver by its exact intersection with the operand, including strict NNC boundaries. Self-intersection shall preserve the value. Empty shall be absorbing and universe neutral. Incompatible dimensions or topologies shall throw std::invalid_argument before mutation. A distinct operand shall retain its value.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Conjoining both systems of constraints is the meet of the selected polyhedral domain.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Compare against independently combined literal constraints, boundary-only contacts, latent emptiness, self aliasing, pending caches and mismatch rejection.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/intersection1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

void intersection_assign(const Polyhedron&);
SW_SPEC
5
PPL-SPEC-001342
PPL-SPEC-001342
Polyhedral hull and exact-union recognition

Hull assignment shall return the least polyhedron of the receiver's topology containing both operands; upper_bound_assign shall be equivalent. The closed hull may add limiting boundary points that the convex hull excludes. The same-type *_if_exact variants shall return true and assign the hull exactly when the set union is already representable as one polyhedron of that topology. On false they shall preserve the receiver's set. Dimension/topology mismatches shall throw std::invalid_argument. A distinct operand shall retain its value; self-hull shall preserve the receiver.

Ordinary hull assignment shall leave the existing caches intact for a self join or for operands that have matching complete current descriptions of the same kind. Matching shall compare ordered stored rows and the pending boundary. A current description is complete when the opposite description has no pending rows.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Convexification can fill gaps and topology can add limits; exact-union recognition must distinguish both effects.

BagnaraHZ10CGTA | Sections 2.1–2.2 (polyhedral hull); Sections 3.1–3.2, Theorems 3.2 and 3.6 (exact-union recognition).

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check overlapping, disjoint and facet-touching sets, open and closed boundary contacts, nonclosed convex hull examples, false-result preservation and self aliasing. Compare stored descriptions after joins with copies in both topologies. Check that different pending constraints or generators still take part in hull computation when the opposite cached descriptions agree.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/polyhull1.cc; tests/Polyhedron/polyhull2.cc; tests/Polyhedron/polyhullifexact1.cc; tests/Polyhedron/polyhullifexact2.cc; tests/Polyhedron/facetcontacthulls1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

void poly_hull_assign(const Polyhedron&);
void upper_bound_assign(const Polyhedron&);
// Same-type members, for both concrete polyhedron classes:
bool poly_hull_assign_if_exact(const C_Polyhedron&);
bool upper_bound_assign_if_exact(const C_Polyhedron&);
bool poly_hull_assign_if_exact(const NNC_Polyhedron&);
bool upper_bound_assign_if_exact(const NNC_Polyhedron&);
SW_SPEC
6
PPL-SPEC-001343
PPL-SPEC-001343
Polyhedral enclosure of set difference

Difference assignment shall return the smallest polyhedron of the receiver's topology containing the set-theoretic difference of the entry receiver and operand. The closed variant shall close the convex polyhedral difference where needed. It shall not claim that the result excludes every operand point. Empty difference shall return empty. difference_assign shall be equivalent to poly_difference_assign. Dimension/topology mismatch shall throw std::invalid_argument; a distinct operand shall preserve its value.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Set difference can be nonconvex or nonclosed, so representability determines the required hull and closure.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check interval subtraction, holes whose convex hull restores removed points, endpoint exclusions, self difference, empty/universe and mismatch rejection. Check closed and NNC difference against literal halfspace complements and restored convex hulls, with dense/sparse systems, different dimensions and pending or minimized caches. After operand destruction, verify the result, invariants, alias entry point, independent copies and self difference.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/polydifference1.cc; tests/Polyhedron/polydifference2.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

void poly_difference_assign(const Polyhedron&);
void difference_assign(const Polyhedron&);
SW_SPEC
7
PPL-SPEC-001344
PPL-SPEC-001344
Polyhedral context-preserving simplification

For compatible operands, simplification shall return a polyhedron containing the entry receiver and having the same intersection with the context. A false result shall certify that this intersection is empty; true shall not alone establish nonemptiness. The context shall preserve its value. The operation need not preserve the receiver outside the context or return a unique simplification. Dimension/topology mismatch shall throw std::invalid_argument.

The initialization, lifetime, synchronization, coefficient-profile and failure conditions in 🔗 1. Polyhedral values, coefficient profile and valid use shall apply, including intermediate calculations. Unless dimension-changing behavior is specified, ambient dimension and the receiver's closed or NNC topology shall be preserved. Logically const queries may normalize caches while preserving the represented set; borrowed views shall follow 🔗 2. Equivalent borrowed polyhedral descriptions.

Constraints irrelevant under the context can be removed without changing states that matter within it.

APPROVED
POLYHEDRA
IF_CPP
Test, Analysis, Inspection

Check independent intersections before/after, implication and disjoint contexts, true/false outcomes, self context and pending representations.

src/Polyhedron_defs.hh; src/Polyhedron_inlines.hh; src/Polyhedron_public.cc; src/Polyhedron_nonpublic.cc; src/Polyhedron_templates.hh; src/C_Polyhedron_defs.hh; src/C_Polyhedron_inlines.hh; src/C_Polyhedron.cc; src/NNC_Polyhedron_defs.hh; src/NNC_Polyhedron_inlines.hh; src/NNC_Polyhedron.cc; tests/Polyhedron/simplifyusingcontext1.cc; tests/Polyhedron/simplifyusingcontext2.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members belong to Polyhedron and are inherited by both concrete classes unless a concrete class or free function is shown.

bool simplify_using_context_assign(const Polyhedron&);