Parma Polyhedra Library requirements
C++ box constraint and congruence refinement

C++ box constraint and congruence refinement

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-001016

add_constraint(c) shall admit a dimension-compatible linear constraint with at most one nonzero homogeneous coefficient. A nonconstant strict inequality shall additionally require a profile supporting open endpoints. The successful result shall enclose the intersection of the entry box and the constraint and remain contained in the entry box. With exact admitted endpoints and openness, that intersection shall be represented exactly; otherwise the affected factor shall use its least supported outward interval enclosure. Constant truth or falsity shall leave the value unchanged or make it empty, including the zero-dimensional cases.

A constraint of greater ambient dimension, a non-interval constraint, or an unsupported nonconstant strict inequality shall throw std::invalid_argument. The support checks shall still apply to an empty receiver. add_constraints(cs) shall apply the same obligations to the conjunction of all supplied constraints; a support error may follow earlier successful additions, so the system form shall not promise rollback. System ambient dimension, including unused trailing coordinates, shall be checked before refinement. Const descriptors shall retain their values.

add_recycled_constraints(cs) shall have the same mathematical result and shall leave the supplied mutable system safely destructible on ordinary or exceptional return. can_recycle_constraint_systems() shall return false. No right to reuse a recycled system's prior contents shall be inferred from this capability value.

The valid-profile, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Allocation and endpoint exceptions shall retain their delegated guarantees without a general rollback promise.

Separable constraints can be enforced directly; unsupported relational information must be distinguished from an accepted conservative refinement.

APPROVED
INTERVALS_BOXES
IF_CPP
Test, Analysis, Inspection

Derive exact intersections for constant and one-coordinate constraints, both coefficient signs, fractional boundaries and all admitted strictness. Check closed-only profiles, non-interval rejection even on empty receivers, unused system dimensions, bulk partial failure, returned capability, recycled lifetime, preserved const donors and resource failure.

src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxrefinementspec1.cc; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxpublic1.cc.

CPP
Public

Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:

void add_constraint(const Constraint& c);
void add_constraints(const Constraint_System& cs);
void add_recycled_constraints(Constraint_System& cs);
static bool can_recycle_constraint_systems();
SW_SPEC
2
PPL-SPEC-001017
PPL-SPEC-001017
Addition of optimally supported box congruences

add_congruence(cg) shall admit a dimension-compatible equality congruence with at most one nonzero homogeneous coefficient, and constant tautological or inconsistent proper congruences. An equality shall have the same numerical enclosure as addition of its equivalent linear equality under 🔗 1. Addition of optimally supported box constraints. A tautology shall leave the receiver unchanged; an inconsistency shall make it empty. A nontrivial proper congruence or a relational equality shall throw std::invalid_argument, including when the receiver is already empty.

add_congruences(cgs) shall apply these obligations to the conjunction of its entries. The whole system's ambient dimension shall be checked before addition, even if its nonzero coefficients use fewer dimensions. Any input of greater ambient dimension shall throw std::invalid_argument. A bulk support error may follow earlier changes; no rollback shall be promised. Const congruences and systems shall retain their values.

add_recycled_congruences(cgs) shall give the same mathematical result and leave its supplied mutable system safely destructible on success or exception. can_recycle_congruence_systems() shall return false; the caller shall not rely on a recycled input retaining its prior contents.

The valid-profile, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Allocation and endpoint exceptions shall retain their delegated guarantees without a general rollback promise.

An interval product can enforce separable equalities directly but cannot generally express a periodic lattice constraint.

APPROVED
INTERVALS_BOXES
IF_CPP
Test, Analysis, Inspection

Compare supported equalities with exact rational singleton intersections. Exercise true and false constant proper congruences, relational equalities, positive-modulus nontrivial rejection, both coefficient signs, empty/zero-dimensional boxes, system dimension and partial failures, recycled lifetime and const-source preservation.

src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxrefinementspec1.cc; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxpublic1.cc.

CPP
Public

Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:

void add_congruence(const Congruence& cg);
void add_congruences(const Congruence_System& cgs);
void add_recycled_congruences(Congruence_System& cgs);
static bool can_recycle_congruence_systems();
SW_SPEC
3
PPL-SPEC-001018
Conservative box refinement by linear constraints

For a dimension-compatible constraint c, refine_with_constraint(c) shall produce a box X’ satisfying X∩{x : c(x)} ⊆ X’ ⊆ X, where X is the receiver's entry set. Unlike optimal addition, refinement shall admit relational constraints and strict constraints under closed-only profiles, using outward supported bounds where necessary. It shall not reject a constraint solely because its exact intersection is not a box.

A constant inconsistency shall make the box empty; a constant tautology shall preserve it. A separable constraint shall refine its affected factor; relational constraints shall propagate necessary coordinate bounds and need not yield the least box enclosure. Empty shall remain empty. refine_with_constraints(cs) shall perform at most one refinement step per constraint in one traversal, stopping early on detected emptiness. The result may depend on traversal order; no fixed-point or least-enclosure guarantee shall be inferred.

Dimension mismatch, including excess system ambient dimension, shall throw std::invalid_argument before replacement. The receiver's ambient dimension and the supplied const descriptors shall remain unchanged.

The valid-profile, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Allocation and endpoint exceptions shall retain their delegated guarantees without a general rollback promise.

Sound coordinate refinement can use relational information without pretending that a Cartesian box represents its full conjunction exactly.

APPROVED
INTERVALS_BOXES
IF_CPP
Test, Analysis, Inspection

Check exact satisfying rational valuations remain enclosed and that results stay within the entry box. Include equality and both inequalities, zero/nonzero coefficient signs, open and closed-only profiles, constants, unbounded factors, empty/lazy states, single-pass systems and order-sensitive examples, preserved descriptors and dimension errors.

src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxrefinementspec1.cc; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxpublic1.cc; tests/Box/refinewithconstraints2.cc.

CPP
Public

Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:

void refine_with_constraint(const Constraint& c);
void refine_with_constraints(const Constraint_System& cs);
SW_SPEC
4
PPL-SPEC-001019
PPL-SPEC-001019
Conservative box refinement by linear congruences

For a dimension-compatible congruence g, refine_with_congruence(g) shall produce X’ with X∩{x : g(x)} ⊆ X’ ⊆ X. An equality congruence shall use the linear-constraint refinement in 🔗 3. Conservative box refinement by linear constraints. A constant inconsistent proper congruence shall make the receiver empty. Other proper congruences may leave its box unchanged, retaining soundness without claiming an explicit lattice representation or periodic endpoint tightening.

refine_with_congruences(cgs) shall refine the conjunction by applying the supported per-entry refinement and may stop when emptiness is detected. It shall not require a fixed point or least box enclosure. Empty shall remain empty and zero-dimensional constants shall retain their logical meaning. Input congruences and systems shall remain unchanged. An input or system ambient dimension larger than the box dimension shall throw std::invalid_argument before replacement; the receiver dimension shall remain unchanged.

The valid-profile, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Allocation and endpoint exceptions shall retain their delegated guarantees without a general rollback promise.

A sound periodic-constraint refinement can retain the original interval product when a stronger periodic representation is unavailable.

APPROVED
INTERVALS_BOXES
IF_CPP
Test, Analysis, Inspection

Check exact equality refinements, constant proper truths/falsities, nontrivial periodic constraints whose satisfying samples are retained, negative affine terms, bulk equalities and periodic combinations, empty/zero-dimensional cases, unused system dimensions and source preservation.

src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxrefinementspec1.cc; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxpublic1.cc.

CPP
Public

Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:

void refine_with_congruence(const Congruence& cg);
void refine_with_congruences(const Congruence_System& cgs);
SW_SPEC
5
PPL-SPEC-001020
PPL-SPEC-001020
Controlled box constraint propagation

For dimension-compatible linear constraints, propagation shall tighten coordinate bounds without deleting any entry point satisfying the supplied constraint or conjunction, and without enlarging the entry box. It shall accept equality and strict or nonstrict inequality constraints under the selected supported numerical profile, retaining required outward rounding and any openness the profile can represent. Constant contradictions shall make the box empty; tautologies and empty inputs shall retain their set meanings.

propagate_constraint(c) shall perform one propagation step for the constraint. propagate_constraints(cs, max_iterations) shall make at most max_iterations passes when that argument is positive, using each constraint at most once per pass unless emptiness is detected first. A pass leaving every interval unchanged shall terminate propagation early. A finite pass limit shall permit later calls to continue tightening the current box.

Zero, including the default argument, shall mean no pass limit and may lead to nontermination. Even reaching an unchanged pass shall not establish a least box enclosure of the conjunction. Traversal and intermediate rounding may affect the final precision. Greater constraint or system ambient dimension shall throw std::invalid_argument before replacement. The box dimension and const input descriptors shall remain unchanged.

The valid-profile, numerical, lifetime, initialization and synchronization prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Allocation and endpoint exceptions shall retain their delegated guarantees without a general rollback promise.

Propagation must retain sound bounds while giving callers an explicit finite-work control for recurrences that need not stabilize.

APPROVED
INTERVALS_BOXES
IF_CPP
Test, Analysis, Inspection

Use independent exact rational satisfying valuations and coordinate limits, all coefficient signs, fractional arithmetic, strict/open bounds, unbounded terms, constants, empty/lazy states and mismatches. Exercise one versus several finite passes, continuation, early stability and empty-system termination. Test unlimited mode only on proven terminating examples; analyze its absence of a general convergence promise. Exercise finite native operands whose intermediate arithmetic overflows to infinity. Check that discarding an unusable infinite candidate retains a sound entry enclosure, including strict and nonstrict numerical result relations.

src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxrefinementspec1.cc; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxpublic1.cc. tests/Box/propagateconstraints1.cc; tests/Box/propagateconstraints2.cc; tests/Box/refinewithconstraints2.cc.

CPP
Public

Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:

void propagate_constraint(const Constraint& c);
void propagate_constraints(const Constraint_System& cs,
                           dimension_type max_iterations=0);