C++ ordinary interval constraints and endpoint extension
Interval_Constraint_Source<T> shall have the truth value of std::is_convertible_v<const T&, const I_Constraint_Base&>. Constraint members shall use that classification, retaining implicit conversions and excluding inaccessible, ambiguous and explicit-only conversions.
build() shall initialize the receiver as its universe. build(c) shall replace it with an outward interval enclosure of the values satisfying the supplied ordinary real constraint. Under exact boundary conversion and supported openness, an ordinary equality or ordered inequality shall give the exact interval predicate. Disequality shall give the interval hull of its punctured carrier, which may be universe. Unsupported endpoint strictness or inexact conversion may enlarge that enclosure.
For this ordinary real carrier, V_LGE, V_GT_MINUS_INFINITY and V_LT_PLUS_INFINITY shall build universe without inspecting a cutoff; V_EMPTY and V_NAN shall build empty without inspecting a cutoff. Their unused cutoff storage need not be initialized or bound. The ordinary finite relations shall be V_LT, V_LE, V_GT, V_GE, V_EQ and V_NE. An included-infinity carrier shall not be inferred from these ordinary-real special-relation rules.
build(c1,c2) shall intersect the single-constraint interval enclosures. With exact endpoint conversion, supported openness and interval-valued individual predicates, the result shall denote their exact conjunction. Otherwise it shall enclose the conjunction; taking a hull of a disequality before intersection may retain its removed point. A V_LGE constraint shall be neutral, and either V_NAN constraint shall give empty without reading its cutoff. Separate constraint objects and cutoff values shall remain unchanged.
Arguments shall be live and valid constraints under 🔗 4. Interval constraints retain relation and cutoff ownership; borrowed cutoffs shall remain live and retain stable values throughout the operation. Active finite rational cutoffs shall be canonical. Receiving boundary/information policies shall admit the result, including empty values where possible. Numerical conversion, policy, finite-range, resource, shared-temporary and caller-owned FPU prerequisites shall follow the selected endpoint operations. Access shall be synchronized against modification. No additional library initialization shall be required. Underlying numerical or allocation failure shall retain the underlying operation's guarantees. Returned I_Result values shall have the logical shape/status meanings of 🔗 1. Interval result possibilities and status-flag set operations; only established claims shall be reported.
Constructing an interval from a predicate must distinguish exact interval predicates from a disconnected disequality abstraction and ignore irrelevant cutoff storage.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Interval<Boundary, Info>:
template <typename T> concept Interval_Constraint_Source = std::is_convertible_v<const T&, const I_Constraint_Base&>; I_Result build(); template <Interval_Constraint_Source C> I_Result build(const C& c); template <Interval_Constraint_Source C1, Interval_Constraint_Source C2> I_Result build(const C1& c1,const C2& c2);
Compare all ordinary relations and ordered pairs of finite constraints with independent endpoint-and-cell predicate hulls. Check universe/empty logical relations using cutoffs that fail if read, neutral/contradictory paired relations, stable separate sources, exact open endpoints and inexact rational-to-integer conversion.
src/Interval_defs.hh; src/Interval_templates.hh; tests/intervalvaluesspec1.cc; tests/intervalconstructionspec1.cc; tests/intervalresultsspec1.cc.
- PPL-LLR-000021 Interval boundary membership (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-000421 Constraint and congruence refinement (Specifies)
add_constraint(c) shall replace receiving entry set A by an outward interval enclosure of its intersection with the interval abstraction of c described by 🔗 1. Interval construction from ordinary real constraints. The represented result shall retain every input value satisfying c and shall introduce no value outside A.
With exact conversion, supported openness and an interval-valued constraint, the result shall be the exact set intersection. A disequality shall first be replaced by its interval hull; this refinement shall not promise removal of the excluded point when that hull fills the puncture. An unconstrained constraint shall preserve A; a false constraint shall give empty. The receiver shall be initialized and valid, and the ordinary-real carrier and admitted relation set shall follow 🔗 1. Interval construction from ordinary real constraints. Separate constraint/cutoff objects shall remain unchanged.
Arguments shall be live and valid constraints under 🔗 4. Interval constraints retain relation and cutoff ownership; borrowed cutoffs shall remain live and retain stable values throughout the operation. Active finite rational cutoffs shall be canonical. Receiving boundary/information policies shall admit the result, including empty values where possible. Numerical conversion, policy, finite-range, resource, shared-temporary and caller-owned FPU prerequisites shall follow the selected endpoint operations. Access shall be synchronized against modification. No additional library initialization shall be required. Underlying numerical or allocation failure shall retain the underlying operation's guarantees. Returned I_Result values shall have the logical shape/status meanings of 🔗 1. Interval result possibilities and status-flag set operations; only established claims shall be reported.
Intersecting with a sound interval abstraction gives conservative refinement while making its disequality precision explicit.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Interval<Boundary, Info>:
template <Interval_Constraint_Source C> I_Result add_constraint(const C& c);
For all finite endpoint orders/topologies, compare refinement with the intersection of the original literal set and the independent constraint hull. Include empty and universe receivers, tautology, contradiction, equality, disequality, open boundaries and preserved cutoffs. Confirm satisfying-value inclusion and absence of points outside the entry interval.
src/Interval_defs.hh; src/Interval_templates.hh; tests/intervalconstructionspec1.cc.
- PPL-LLR-000021 Interval boundary membership (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-000024 Convergence of interval and box widening (Specifies)
For a nonempty initialized valid receiver, lower_extend() shall replace its lower endpoint by the lower extent of the receiving carrier, and upper_extend() shall analogously replace its upper endpoint by the upper extent. The other endpoint shall remain unchanged. The result shall contain the entry interval and remain valid under its information policy.
lower_extend(c) shall admit finite relations V_GT, V_GE and V_EQ. It shall replace the lower endpoint by the lesser of its entry endpoint and the cutoff, taking an open cutoff for V_GT and a closed cutoff otherwise. upper_extend(c) shall analogously admit V_LT, V_LE and V_EQ and take the greater endpoint, with an open cutoff for V_LT and a closed cutoff otherwise. Equal limits shall be included when either alternative includes them. Conversion shall be outward when the selected scalar cannot store a cutoff exactly.
For either constrained overload, V_LGE shall perform the corresponding unconstrained extension without reading a cutoff; V_NAN shall preserve the receiver without reading a cutoff. Those unused cutoff values need not be initialized or bound. The ignored V_NAN overload shall also admit an empty valid receiver and preserve it. It shall return I_ANY | I_EXACT | I_UNCHANGED without certifying nonemptiness. The other admitted constrained operations shall require a nonempty receiver. Other relations shall lie outside these endpoint-extension overloads' admitted protocol. Separate cutoff sources shall remain unchanged. Endpoint metadata shall preserve unbounded extent meaning independently of an inactive payload.
Arguments shall be live and valid constraints under 🔗 4. Interval constraints retain relation and cutoff ownership; borrowed cutoffs shall remain live and retain stable values throughout the operation. Active finite rational cutoffs shall be canonical. Receiving boundary/information policies shall admit the result, including empty values where possible. Numerical conversion, policy, finite-range, resource, shared-temporary and caller-owned FPU prerequisites shall follow the selected endpoint operations. Access shall be synchronized against modification. No additional library initialization shall be required. Underlying numerical or allocation failure shall retain the underlying operation's guarantees. Returned I_Result values shall have the logical shape/status meanings of 🔗 1. Interval result possibilities and status-flag set operations; only established claims shall be reported.
Endpoint extension must enlarge one side without disturbing the other. Ignoring a descriptor preserves the represented set, including an empty set, without establishing that set's shape.
Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Interval<Boundary, Info>:
I_Result lower_extend(); I_Result upper_extend(); template <Interval_Constraint_Source C> I_Result lower_extend(const C& c); template <Interval_Constraint_Source C> I_Result upper_extend(const C& c);
Check each admitted finite relation against independent minimum/maximum endpoint formulas, including already unbounded sides, inward/no-op cutoffs, equal open/closed limits and both signs. Check unchanged opposite endpoints, nonempty-receiver prerequisites for active extensions, source preservation and unconstrained/no-op relations with unreadable cutoffs. Check ignored descriptors on empty, singleton, proper and universe receivers; verify exact/unchanged claims and defer uncertain emptiness to the actual representation.
src/Interval_defs.hh; src/Interval_templates.hh; tests/intervalconstructionspec1.cc; tests/intervalresultsspec1.cc.