Parma Polyhedra Library requirements
C++ bounded-difference interval-form refinement and unary export

C++ bounded-difference interval-form refinement and unary export

PPL-SPEC-001133
1. Conservative interval-linear-form inequality refinement
UID: PPL-SPEC-001133
STATUS: APPROVED
COMPONENT: BOUNDED_DIFFERENCES
APPLICABILITY: IF_CPP, NATIVE_FP_AVAILABLE
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For a supported native floating boundary type T, let X be the receiver's entry set and let L(x) and R(x) be the real value sets of its dimension-compatible interval linear-form arguments. Coefficient and constant choices shall be independent, including when the same form object is supplied twice. After refine_with_linear_form_inequality, the receiver shall have the same ambient dimension and denote a set Y satisfying

{x ∈ X ∣ ∃l ∈ L(x),  r ∈ R(x) : l ≤ r} ⊆ Y ⊆ X.

Valid empty coefficient or constant intervals shall be admitted; their empty choice set contributes no satisfying valuations, so a general conservative refinement may leave the input unchanged.

The general operation may lose precision. Comparisons involving constants only, including cancellation to a constant comparison, may leave the input unchanged.

For closed nonempty constant intervals and forms having at most one nonzero variable coefficient each, all such coefficients being singleton  + 1 or  − 1, consider a nonconstant comparison reducible to one unary or coordinate-difference inequality. If the required constant endpoint subtraction and any normalization by 2 are exact in the selected boundary profile, the result shall equal the intersection of X with that closed inequality, using the lower constant endpoint on the left and upper constant endpoint on the right. Opposite unit coefficients on the same coordinate shall therefore use the corresponding normalized ±2xi cut. This precision clause shall not apply to opposite-sign coefficients on distinct coordinates or to a constant-only comparison.

Empty input shall remain empty. An argument form whose space dimension exceeds the receiver's shall throw std::invalid_argument before changing the represented set, including on empty input. Successful refinement shall preserve the source forms and leave a valid owned receiver.

The format shall satisfy its configured supported-format predicate. The interval coefficient representation and arithmetic shall satisfy 🔗 1. Interval-linear-form meaning and numerical prerequisites, including stored-value and endpoint-access prerequisites; coefficient and constant intervals shall be bounded. The caller shall provide and retain ownership of an upward FPU environment. For admitted inputs, the implementation shall respect the preconditions of its selected numerical policies when carrying out intermediate operations. Library calls shall not transfer ownership of the forms or change their coefficient values.

The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. Borrowed forms and interval storage shall remain live throughout the call. Recoverable numerical and resource exceptions may propagate; discarded owned temporaries shall be released and the receiver shall remain safely destructible, without a rollback promise.

RATIONALE:

A floating comparison filters existing correlated states; coefficient uncertainty and outward arithmetic must not discard a satisfying state.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.

template <typename Interval_Info>
void refine_with_linear_form_inequality(
    const Linear_Form<Interval<T, Interval_Info>>& left,
    const Linear_Form<Interval<T, Interval_Info>>& right);
VERIFICATION_CRITERIA:

Partition coordinate signs independently, derive exact rational minimum-left/maximum-right affine inequalities, intersect each with the input halfspaces, and check every resulting piece is contained while the result stays inside the input. Cover unit, same-coordinate opposite unit, uncertain-sign, nonunit and sparse multiple-variable forms; exact and genuinely inexact arithmetic; correlations, recession directions, source aliases, bottom, dimension errors and owned-resource failures.

BIBLIOGRAPHY:

BagnaraHZ09FMSD | Sections 3.2 and 7 (domain and floating arithmetic background). Mine04 | Sections 5 and 6.1, Tests (interval linear forms and relational guard abstraction).

SOURCE:

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; tests/bdshapefiltersspec1.cc; tests/bdshapefiltersfailure1.cc; tests/octagonalshapeintervalformspec1.cc; tests/bdshapefiltersoracle.hh; tests/boxallocationfixture.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/Concrete_Expression/bdshape2.cc; src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Interval_defs.hh; tests/BD_Shape/affineunboundedproducts1.cc.

PPL-SPEC-001134
2. Generalized interval-linear-form comparisons
UID: PPL-SPEC-001134
STATUS: APPROVED
COMPONENT: BOUNDED_DIFFERENCES
APPLICABILITY: IF_CPP, NATIVE_FP_AVAILABLE
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For the form value sets and numerical admission of 🔗 1. Conservative interval-linear-form inequality refinement, generalized_refine_with_linear_form_inequality shall preserve the ambient dimension and denote an enclosure of the input states satisfying its relation, without introducing states outside the input. The two sides shall use independent coefficient choices.

LESS_OR_EQUAL shall apply the left-to-right inequality refinement; GREATER_OR_EQUAL shall apply the reversed refinement. LESS_THAN and GREATER_THAN may use those same closed relaxations of the strict comparisons. EQUAL shall apply both non-strict orientations, retaining all states for which the two form value intervals overlap. NOT_EQUAL shall leave the represented set unchanged. No general least-result claim shall follow from these dispatch rules.

Both arguments shall undergo the documented dimension validation for every named relation, including NOT_EQUAL and empty receivers. Incompatibility shall throw std::invalid_argument before changing the represented set. A Relation_Symbol having the unnamed language-admissible value 0 or 7 shall throw std::runtime_error before mutation. Values outside the C++ enum's valid representation range are outside valid language use. Empty input and source-form values shall be preserved.

The format shall satisfy its configured supported-format predicate. The interval coefficient representation and arithmetic shall satisfy 🔗 1. Interval-linear-form meaning and numerical prerequisites, including stored-value and endpoint-access prerequisites; coefficient and constant intervals shall be bounded. The caller shall provide and retain ownership of an upward FPU environment. For admitted inputs, the implementation shall respect the preconditions of its selected numerical policies when carrying out intermediate operations. Library calls shall not transfer ownership of the forms or change their coefficient values.

The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. Borrowed forms and interval storage shall remain live throughout the call. Recoverable numerical and resource exceptions may propagate; discarded owned temporaries shall be released and the receiver shall remain safely destructible, without a rollback promise.

RATIONALE:

The relation selects the comparison orientation and its admissible closed relaxation; validation must not depend on the selected dispatch shortcut.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.

template <typename Interval_Info>
void generalized_refine_with_linear_form_inequality(
    const Linear_Form<Interval<T, Interval_Info>>& left,
    const Linear_Form<Interval<T, Interval_Info>>& right,
    Relation_Symbol relsym);
VERIFICATION_CRITERIA:

Use the independent sign-partition guard oracle for all six named relations, equality overlap, strict boundary witnesses, shared form objects and disequality identity. Check dispatch against the appropriate basic orientations, source preservation, dimensions on every branch, valid unnamed enum rejection and failure channels.

BIBLIOGRAPHY:

Mine04 | Sections 5 and 6.1, Tests (interval-coefficient guard abstractions).

SOURCE:

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; tests/bdshapefiltersspec1.cc; tests/bdshapefiltersfailure1.cc; tests/octagonalshapeintervalformspec1.cc; tests/bdshapefiltersoracle.hh; tests/boxallocationfixture.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/Concrete_Expression/bdshape2.cc; src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Interval_defs.hh;

PPL-SPEC-001135
3. Refinement of a floating interval abstract store
UID: PPL-SPEC-001135
STATUS: APPROVED
COMPONENT: BOUNDED_DIFFERENCES
APPLICABILITY: IF_CPP, NATIVE_FP_AVAILABLE
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For a supported native floating boundary type T and a valid Box<Interval<T,Interval_Info>> store of the same ambient dimension, refine_fp_interval_abstract_store(store) shall intersect the store with the outward Cartesian enclosure of the receiver supplied by the box conversion of 🔗 4. Box conversion from bounded-difference shapes. It shall retain every point of the entry store lying in the source shape and shall introduce no point outside the entry store. The source represented set and both ambient dimensions shall remain unchanged; logically const source closure may refresh caches.

Empty source or empty store shall yield an empty store. Zero-dimensional empty and universe cases shall preserve their distinct meanings. When the source closure and target endpoint arithmetic satisfy the exactness conditions of 🔗 4. Box conversion from bounded-difference shapes, the result shall equal the store's intersection with the least Cartesian enclosure of the source; otherwise outward approximation may retain additional points. Incompatible dimensions shall throw std::invalid_argument without changing the store's represented set.

The selected native format shall satisfy its configured supported-format predicate. The box and interval representation shall retain 🔗 1. Cartesian box values, coordinate identity and valid use and 🔗 4. Box conversion from bounded-difference shapes. Unbounded valid store coordinates are admitted. The initialized numerical runtime and all intermediate policy prerequisites shall hold; the caller shall provide and retain ownership of an upward FPU environment.

The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. The borrowed store and its live coordinate objects shall remain valid throughout the call. Recoverable numerical and resource exceptions may leave a partially refined store in the state permitted by its operations; discarded owned temporaries shall be released.

RATIONALE:

A relational state can strengthen a separate interval store without discarding a valuation common to both approximations.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.

template <typename Interval_Info>
void refine_fp_interval_abstract_store(
    Box<Interval<T, Interval_Info>>& store) const;
VERIFICATION_CRITERIA:

Derive coordinate extrema by exact rational projection of correlated halfspaces, combine them with independently specified input intervals, and compare containment/contraction; check exact Cartesian intersections where 🔗 4. Box conversion from bounded-difference shapes guarantees them. Cover empty and zero-dimensional states, unbounded coordinates, open store boundaries, inexact native bounds, mismatched dimensions, source preservation and allocation failure.

SOURCE:

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; tests/bdshapefiltersspec1.cc; tests/bdshapefiltersfailure1.cc; tests/bdshapefiltersoracle.hh; tests/boxallocationfixture.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/Concrete_Expression/bdshape2.cc; src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Interval_defs.hh;

PPL-SPEC-001136
4. Export of unary constraints through a destination protocol
UID: PPL-SPEC-001136
STATUS: APPROVED
COMPONENT: BOUNDED_DIFFERENCES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For a destination whose dimension is at least the source dimension, export_interval_constraints(dest) shall restrict the corresponding coordinates using the receiver's unary lower and upper consequences. The destination's remaining coordinates and ambient dimension shall be preserved. Source closure may expose implied unary constraints but shall preserve its represented set.

If D is the entry destination set and H(X) the Cartesian hull of the source's entry set, the completed destination shall contain D∩(H(X)×Rm − n) and be contained in D, where n and m are the source and destination dimensions. When source closure arithmetic and destination restrictions are exact, including exact unbounded rational bounds, the result shall equal that intersection. Rounded closure or destination arithmetic may lose precision; no best-unary-bound promise shall follow in those profiles.

An empty source shall call the destination's emptying operation. A zero-dimensional universe shall contribute no restrictions. Unbounded coordinate sides shall contribute no finite restriction. Each restriction callback shall return false exactly when its destination is empty; a false result shall terminate further restriction calls. No fixed callback count or coordinate order is promised. A destination of smaller dimension shall cause std::invalid_argument before any restrictive callback.

The destination protocol shall implement the indicated conjunctions and preserve coordinates not selected by a callback. Its callbacks shall not invalidate borrowed objects or modify the source being traversed. Callback exceptions may leave a partially restricted destination, with the states and ownership guaranteed by that destination's operations.

The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. The destination and its callback environment shall remain live for the call. Discarded owned temporaries shall be released on reported failure.

RATIONALE:

The callback protocol supports destinations larger than a same-type box and exposes unary information independently of the native floating-store adapter.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.

template <typename U>
void export_interval_constraints(U& dest) const;

// Required destination capabilities:
dimension_type U::space_dimension() const;
void U::set_empty();
bool U::restrict_lower(dimension_type dim, const T& lower);
bool U::restrict_upper(dimension_type dim, const T& upper);
VERIFICATION_CRITERIA:

Use independent rational coordinate projections and a destination implementation with literal interval semantics. Verify larger dimensions and preserved extra coordinates, implied correlated bounds, empty/zero-dimensional sources, ignored infinite sides, too-small rejection, callback short-circuiting and throwing callbacks without imposing rollback or incidental call order. Include exact rational, rounded native/integer and actual no-FPU configurations.

SOURCE:

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; tests/bdshapefiltersspec1.cc; tests/bdshapefiltersfailure1.cc; tests/bdshapefiltersoracle.hh; tests/boxallocationfixture.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/Concrete_Expression/bdshape2.cc; src/Linear_Form_defs.hh; src/Linear_Form_inlines.hh; src/Interval_defs.hh;