C++ box widening, limiting constraints and narrowing
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000024 Convergence of interval and box widening (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
For compatible boxes of one fixed interval profile, let Y be the argument's entry value and X the receiver's entry value, with Y ⊆ X. The iterator overload of CC76_widening_assign shall apply the threshold interval rule of 🔗 1. Threshold interval widening and finite stabilization independently to every coordinate. It shall contain both input sets. An empty argument shall leave the receiver's represented set unchanged. Empty and universe in zero dimensions shall retain their distinct meanings. Self-aliasing shall preserve the represented set.
For nonempty operands, a finite lower boundary moving numerically down from the previous factor shall move to the greatest threshold not above the current boundary, or become unbounded when no such threshold exists. A finite upper boundary moving numerically up shall move to the least threshold not below it, or become unbounded when no such threshold exists. Exact threshold hits, other finite boundaries and already unbounded boundaries shall retain the current factor's boundary. A finite threshold replacement shall retain the current endpoint's openness.
The range shall use readable, multipass bidirectional iterators. It shall be finite, sorted in nondecreasing numerical order and stable throughout the call, with finite thresholds exactly representable in the boundary type. Empty ranges and duplicate values shall be admitted. The range shall not alias storage modified by the call. The numerical and policy conditions of 🔗 1. Threshold interval widening and finite stabilization shall apply.
For a fixed dimension, interval policy and finite threshold range, the ascending recurrence shall first enclose the preceding widened result and the next input, then widen that enclosure against the preceding widened result. This recurrence shall stabilize after finitely many changes: each coordinate has only finitely many threshold/carrier boundaries to visit, and endpoint membership can weaken only finitely often. All comparisons and assignments shall satisfy the selected arithmetic profile's prerequisites.
Unequal box dimensions shall throw std::invalid_argument before receiver modification, including empty and zero-dimensional cases. Containment of the previous argument in the current receiver shall remain a caller precondition. The box validity, lifetime, synchronization and numerical prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. A distinct argument and the threshold range shall retain their values. The enabled overload shall require the exact same Box<ITV> type and an implicit conversion from const ITV& to const Interval_Base&. Resource or numerical failures shall retain their underlying operation's guarantees; whole-operation rollback shall not be promised.
A Cartesian widening needs a sound coordinate rule and a finite endpoint progression under its actual operand order.
Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:
template <typename T, typename Iterator> requires (std::is_same_v<T, Box<ITV>> && std::is_convertible_v<const ITV&, const Interval_Base&>) void CC76_widening_assign(const T& y, Iterator first, Iterator last);
Independently enumerate nested products with strict/closed endpoints, rays, zero-dimensional values and classified/lazy emptiness. Compute predecessor/successor thresholds from mathematical sets, including exact hits, duplicate thresholds and empty ranges. Exercise pointer, vector and bidirectional-list iterators, self-aliasing, unchanged inputs and ranges, dimensional rejection and ascending recurrences. Inspect the finite-coordinate convergence argument separately from sample iterations.
BagnaraHZ08SCP | Section 2, Widening (PDF page index 4, zero-based).
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; src/Interval_defs.hh; src/Interval_templates.hh; tests/boxconvergencespec1.cc; tests/boxconvergenceoracle.hh; tests/boxsetoracle.hh; tests/boxconvergencepublic1.cc; tests/Box/cc76widening.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000024 Convergence of interval and box widening (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
CC76_widening_assign(y,tp) shall use the threshold rule of 🔗 1. Threshold box widening and finite stabilization with the fixed ordered values − 2, − 1, 0, 1, 2. The selected boundary type shall represent those values exactly. widening_assign(y,tp) shall have the same behavior. Receiver and argument shall have the same dimension, and the argument's entry set shall be contained in the receiver's entry set.
With a null token pointer or a zero counter, the receiver shall become the default threshold-widened value. With a positive counter, the receiver's represented set shall remain its entry set. The counter shall decrease by exactly one if the corresponding undelayed widening would strictly enlarge that set; otherwise it shall retain its value. Tokens shall not be consumed merely because the operation was called. The counter shall be a live, separately owned writable unsigned object, with access synchronized against other users.
A fixed finite initial token budget, without replenishment during the ascending recurrence, shall preserve the finite-stabilization guarantee of 🔗 1. Threshold box widening and finite stabilization. Each delayed precision loss can consume at most one available token; after exhaustion the ordinary widening shall apply. Calls whose undelayed result is exact shall not require a token.
Both entry sets, dimension checking, enabled interval type, source preservation, self-aliasing and exceptional-operation conditions shall follow 🔗 1. Threshold box widening and finite stabilization. Dimension mismatch shall be rejected before changing the receiver or counter. The result shall not depend on sharing default stop-point objects across callers. Underlying resource or numerical exceptions shall not imply a transaction over receiver and counter.
A delay budget should preserve precision when widening would lose it, while keeping the number of postponed losses finite.
Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:
template <typename T> requires (std::is_same_v<T, Box<ITV>> && std::is_convertible_v<const ITV&, const Interval_Base&>) void CC76_widening_assign(const T& y, unsigned* tp = nullptr); void widening_assign(const Box& y, unsigned* tp = nullptr);
Compare the default overload and wrapper with an independent five-threshold model. Check null, zero, one and larger budgets; exact versus strictly enlarging results; repeated calls; empty and zero-dimensional cases; self-aliasing and source preservation. Verify counter changes and ascending histories through budget exhaustion, including arbitrarily many exact calls. Check mismatch rejection before counter replacement.
BagnaraHRZ05SCP | Section 7, widening with tokens (PDF page index 29, zero-based).
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; src/Interval_defs.hh; src/Interval_templates.hh; tests/boxconvergencespec1.cc; tests/boxconvergenceoracle.hh; tests/boxsetoracle.hh; tests/boxconvergencepublic1.cc; tests/Box/cc76widening.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000024 Convergence of interval and box widening (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
limited_CC76_extrapolation_assign(y,cs,tp) shall require the previous argument's entry set Y to be contained in the receiver's entry set X. The boxes shall have equal ambient dimensions, and the constraint system's dimension shall not exceed them. Dimension errors shall throw std::invalid_argument before receiver or token modification, including on empty or zero-dimensional operands. Strict inequalities in the limiting system shall be admitted under the selected interval policy; their endpoint representation shall retain the outward-conversion rules below.
For nonempty positive-dimensional inputs, limiting constraints shall be selected from the entry receiver. A nontrivial constraint concerning only one coordinate shall be selected exactly when every point of X satisfies it. Constant constraints and constraints involving multiple coordinates shall be ignored. Redundant or differently scaled rows shall not change the mathematical selection rule.
Let L be the least box of the selected profile enclosing the conjunction of the selected coordinate constraints. Let W be the result of the default delayed widening specified by 🔗 2. Default box widening and precision-sensitive delay tokens, computed from the entry operands and counter. The result shall denote W∩L, under the same-profile intersection contract of 🔗 4. Cartesian box intersection. It shall contain X and Y and be contained in W. Under exact rational endpoint arithmetic, the selected constraints shall hold exactly. Under outward endpoint conversion, their box representation shall follow 🔗 1. Addition of optimally supported box constraints; original bounds need not all remain exact after that conversion.
An empty previous argument, empty receiver or zero-dimensional receiver shall retain the current represented set and leave the counter unchanged. A distinct box argument and the supplied constraint system shall retain their values. Self-aliasing of the box operands shall be admitted.
With a fixed finite limiting system, fixed profile and dimension, exact admitted comparisons/conversions and a finite token budget without replenishment, the prescribed ascending recurrence shall stabilize. Selected bounds can only be lost as the receiver grows; each coordinate can visit only the finite threshold/limiting boundary set, including open/closed membership, and its unbounded extents. Arbitrarily changing limiting systems shall have no general finite-convergence guarantee.
The validity, lifetime, synchronization, numeric and enabled interval-type prerequisites of 🔗 2. Default box widening and precision-sensitive delay tokens shall apply. Constraint descriptors and diagnostic reporting shall retain the initialized-context prerequisites of 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization. Numerical and resource exceptions may propagate without whole-operation rollback.
A fixed set of satisfied coordinate limits can recover precision discarded by widening while preserving both input sets.
Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:
void limited_CC76_extrapolation_assign(const Box& y, const Constraint_System& cs, unsigned* tp = nullptr);
Independently select satisfied unary constraints from exact entry products, construct their coordinate enclosure and intersect it with the independently modeled delayed widening. Include equalities, strict and non-strict bounds, scaled rows, ignored relational/constant constraints, violated limits, repeated limits, inexact endpoint conversions and token changes. Check fixed-limit ascending recurrences and the finite candidate-bound argument. Check input preservation, aliasing, classified/lazy empty states, zero dimensions and rejection of dimension errors before mutation. Create lazy empty factors without querying or copying the box before the call. Check strict bounds on empty and zero-dimensional inputs without changing the represented set or counter.
BagnaraHRZ05SCP | Section 7, fixed finite limiting constraints and convergence caveat (PDF page index 30, zero-based).
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; src/Interval_defs.hh; src/Interval_templates.hh; tests/boxconvergencespec1.cc; tests/boxconvergenceoracle.hh; tests/boxsetoracle.hh; tests/boxconvergencepublic1.cc; tests/Box/limitedcc76extrapolation1.cc.
- PPL-LLR-000022 Cartesian meaning of boxes (Specifies)
- PPL-LLR-000445 Narrowing and descending precision recovery (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
For equal-dimensional boxes, let X be the receiver's entry set and Y the previous argument's entry set, with X ⊆ Y. CC76_narrowing_assign(y) shall replace the receiver by a box Z with X ⊆ Z ⊆ Y.
For nonempty positive-dimensional inputs, each finite previous lower boundary shall be retained in the result, including its exact value and openness. A previous unbounded lower boundary shall leave the current lower boundary unchanged. The corresponding rule shall apply to upper boundaries. Where both current and previous boundaries are finite, the complete previous boundary shall be retained; endpoint membership shall not be copied from the current factor when it differs from that previous boundary.
An empty current set shall remain empty. If the previous set is empty, the containment precondition makes the current set empty as well. Zero-dimensional values shall retain their represented set. A distinct argument shall retain its set and dimension. Self-aliasing shall preserve the receiver's represented set.
For a fixed dimension and interval policy, a descending recurrence shall supply a current set contained in the preceding narrowed result and narrow it against that preceding result. This recurrence shall stabilize after finitely many changes: a previous finite boundary remains fixed, and a previous unbounded boundary can become finite at most once. Reaching the empty set shall terminate further set changes. The selected endpoint comparisons and assignments shall meet their numerical prerequisites.
Dimension mismatch shall throw std::invalid_argument before receiver modification, including empty and zero-dimensional cases. Nesting shall remain a caller precondition. The enabled overload shall require the exact same Box<ITV> type and an implicit conversion from const ITV& to const Interval_Base&. The validity, lifetime, synchronization and numerical conditions of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Diagnostic reporting shall retain its initialized-context prerequisites. Numerical or resource exceptions shall follow the underlying operation's guarantees without a general rollback promise.
Recovering a finite bound from a previously unbounded approximation must preserve the complete boundary of every already finite previous constraint.
Public header: <ppl.hh>; member excerpts for Box<ITV> in Parma_Polyhedra_Library:
template <typename T> requires (std::is_same_v<T, Box<ITV>> && std::is_convertible_v<const ITV&, const Interval_Base&>) void CC76_narrowing_assign(const T& y);
Independently choose complete boundary descriptors from nested rational products. Cover every open/closed equality case, strict and unequal finite endpoints, all combinations of unbounded sides, singleton factors, empty/lazy states, zero dimensions and self-aliasing. Check both inclusions, source preservation, dimension rejection before mutation, descending histories and finite-boundary stabilization. Reuse the open-endpoint regression histories as well as fresh independently enumerated cases.
src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; src/Interval_defs.hh; src/Interval_templates.hh; tests/boxconvergencespec1.cc; tests/boxconvergenceoracle.hh; tests/boxsetoracle.hh; tests/boxconvergencepublic1.cc; tests/Box/cc76narrowing1.cc.
CC76_Certificate shall record a finite remaining level for a nonempty Box<ITV> whose boundary type represents the ordered default stopping points T = { − 2, − 1, 0, 1, 2}. An unbounded endpoint shall contribute zero. A closed endpoint at a finite carrier extent shall also contribute zero; an open endpoint there shall contribute one. Any other finite lower endpoint at b shall contribute 2 + 2#{t ∈ T : t < b} + o, where o is one for an open endpoint and zero for a closed endpoint. A finite upper endpoint shall instead count stopping points strictly greater than its value. The certificate level shall be the sum over both endpoints of every coordinate.
Default construction shall describe the zero-dimensional universe. Copying and assignment shall preserve the stored level. Comparison shall return 1, 0 or -1 according as the receiver's level is greater than, equal to or less than the argument's level. Compare shall order larger levels first. Comparison with a box shall compute its certificate and use the same ordering. Equal levels shall not imply equal sets. Inclusion alone shall not promise a nonincreasing level: an endpoint moving inside a threshold cell may also open.
For a fixed dimension and interval policy, consider a nonempty previous box and a containing candidate, widened by the tokenless default CC76 overload of 🔗 2. Default box widening and precision-sensitive delay tokens. Each endpoint level shall be nonincreasing over that widened step, and every strict set increase shall strictly decrease the sum. The sum shall be between zero and 26 times the dimension, proving finite stabilization for this base widening and supplying the finite certificate required by 🔗 3. Certificate-based powerset widening. This compatibility shall not extend to arbitrary iterator-supplied stopping points, delayed widening or limited extrapolation without a separate argument.
Empty box construction shall throw std::invalid_argument. Unrepresentable stopping points shall retain the boundary conversion's exception, or throw std::invalid_argument if the converted values are not strictly ordered. A dimension for which 26 times the dimension would overflow dimension_type shall throw std::length_error. The box lifetime, initialization and numerical prerequisites of 🔗 1. Cartesian box values, coordinate identity and valid use shall apply. Queries may normalize lazy caches without changing the represented set.
If a finite endpoint moves outward, CC76 moves it to a stopping point beyond its previous value or extends it to the carrier extent. The threshold count or the finite-endpoint contribution then drops by at least one, dominating any one-bit openness increase. If the endpoint value does not move, containment permits only unchanged membership or closing an open endpoint. Summing these finite descending ranks supplies a certificate; affine dimension and facet count alone miss movement through stopping points.
Public header: <ppl.hh>; namespace Parma_Polyhedra_Library.
CC76_Certificate(); template <typename ITV> explicit CC76_Certificate(const Box<ITV>&); CC76_Certificate(const CC76_Certificate&); CC76_Certificate& operator=(const CC76_Certificate&); int compare(const CC76_Certificate&) const; template <typename ITV> int compare(const Box<ITV>&) const; struct Compare { bool operator()(const CC76_Certificate&, const CC76_Certificate&) const; };
Check defaults, copies, assignment and ordering. Distinguish threshold progress from unchanged H79 facets. Enumerate nested rational endpoint cases with strict and closed boundaries on both sides, including within-cell growth, exact hits and becoming unbounded. Include a bounded carrier without a special infinity representation and check extension to both carrier limits. Check a disjunctive ascending history that stabilizes under certified BHZ03 while ordinary joins keep growing, and reject empty construction. Inspect the finite-rank argument independently of these sample histories.
BagnaraHZ06STTT | Section 2.1, finite convergence certificates; Section 7, Definition 16 and Theorem 3, certificate-based powerset widening. BagnaraHZ06STTTerratum | Corrected figures for the preceding article.
src/CC76_Certificate_types.hh; src/CC76_Certificate_defs.hh; src/CC76_Certificate_inlines.hh; tests/cc76certificatespec1.cc; tests/Box/bhz03widening1.cc.