C++ target-adapted floating expression linearization
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Parents:
|
Incoming links from:
2. Floating constant linearization
3. Unary and unsupported operator dispatch
4. Rounding-aware addition linearization
5. Rounding-aware subtraction linearization
6. Interval-scalar multiplication linearization
7. Nonzero interval-divisor linearization
8. Floating and integer cast linearization
9. Reference association and symbolic-store lookup
8 |
For a well-formed floating-point expression and sound composite abstract store, linearize() shall return true only with a linear form enclosing every modeled expression value consistent with the entry inputs, including the analyzed operations' rounding error. Target nodes and the oracle shall meet 🔗 4. Target-specific concrete-expression adapter protocol, 🔗 6. Oracle interval and expression-value queries and 🔗 7. Oracle reference-to-coordinate associations. Each stored affine binding shall already enclose the corresponding coordinate in that same modeled state. Correlations shall use consistent coordinate identities. C shall have a supported native floating-point boundary type and sound interval operations under its initialized arithmetic/FPU prerequisites. Modeled metadata shall not itself establish numerical format support. The selected relative/absolute-error helpers shall support every format for which the operation needs an error bound. Allocation, callback and selected arithmetic operations shall satisfy their documented preconditions. On false return, the output shall not establish a complete enclosure; no preservation of its prior value shall be promised. Documented callback, resource and unsupported-operation exceptions may propagate. Output owners shall remain safely destructible and reusable after such failure. Analysis shall use input entry values even when result designates a store binding; only the designated output may then change, and other input bindings and target nodes shall remain unchanged. No node or oracle ownership shall be acquired. |
A successful result is a numerical enclosure promise for the original modeled state, rather than a claim about real arithmetic alone. |
Mine04 | Section 5, Theorem 1 and the discussion of failed linearization (PDF page index 7, zero-based). |
|
|
|
|
Use exact rational modeled arithmetic and independently rounded binary32 samples, retained input snapshots, refusal/recovery, supported native boundary profiles and entry-value alias histories; compare every successful affine enclosure at explicit valuations. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool linearize( const Concrete_Expression<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
2 |
|
|
Parents:
|
|
For a floating-constant node, linearize() shall query the oracle for that constant. Refusal shall return false. Success shall replace result with a dimension-zero form whose constant is the returned interval and whose homogeneous coefficients are zero. This leaf shall add no operation-rounding error beyond the oracle's enclosure. A valid unbounded oracle interval shall remain an admitted constant result; true at this leaf shall not by itself certify finite coefficients. The common prerequisites and failure/lifetime rules of 🔗 1. Target-adapted floating expression evaluation shall apply. |
Constant interpretation belongs to the oracle; constructing its affine enclosure must not reinterpret it as an additional arithmetic operation. |
Mine04 | Section 5, constant and variable linearization rules (PDF page index 6, zero-based). |
|
|
|
|
Check exact and non-dyadic rational payloads, dimension replacement, unbounded constant intervals, oracle refusal and recovery, without introducing coordinate queries. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool linearize( const Concrete_Expression<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
For unary UPLUS, linearize() shall return the operand's linearization without an additional rounding term. For UMINUS, it shall propagate operand refusal; on success it shall negate every coefficient interval, preserving the operand form's dimension. Unary BNOT shall report unsupported evaluation by throwing std::runtime_error. Binary REM, BAND, BOR, BXOR, LSHIFT and RSHIFT shall return false without claiming a result. ADD, SUB, MUL and DIV shall dispatch to their matching helper contracts. Unknown kind/operator codes inconsistent with the target protocol shall be outside the admitted interface. The common prerequisites and failure/lifetime rules of 🔗 1. Target-adapted floating expression evaluation shall apply. |
Expression syntax must distinguish supported arithmetic, exact sign changes and explicit unsupported outcomes. |
Mine04 | Section 5, interval linear forms and coefficient-wise arithmetic (PDF page index 6, zero-based). |
|
|
|
|
Check both unary signs on constant and symbolic forms, nested refusal, every named unsupported binary operator and the unary exception, with independent child-query counters and preserved inputs. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool linearize( const Concrete_Expression<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
4 |
|
|
Parents:
|
|
add_linearize() shall require an ADD node and linearize both operands in the same entry store. When either operand refuses, it shall return false. A successful child form with an unbounded coefficient shall also cause refusal before its relative-error form is constructed; later children need not be evaluated after this refusal. Let L1, L2 be their forms, Rf the selected format's relative-error form from 🔗 21. Format-specific relative-error linear form, and Af the interval returned by compute_absolute_error<C>(f). The output shall soundly enclose the coefficient-wise combination L1 + L2 + Rf(L1) + Rf(L2) + Af, retaining symbolic coordinate terms. It shall return false if the resulting coefficients are unbounded, and true otherwise. 🔗 1. Target-adapted floating expression evaluation shall govern runtime, entry-value, exception and ownership semantics. |
Addition requires both operand-sensitive relative error and an absolute error allowance while retaining useful affine dependence. A rounded parent needs finite coefficient magnitudes even when a constant leaf can soundly represent an unbounded value. |
Mine04 | Section 5, addition linearization and relative-error definitions (PDF page index 6, zero-based). |
|
|
|
|
Compare exact rational affine coefficients and independently rounded binary32 sums at explicit valuations, including half-ulp ties, cancellation, unequal dimensions and operand refusal; distinguish removal of each error component. Check unbounded constant leaves in either child position, refusal before relative-error construction, first-child short-circuiting and successful bounded recovery. Keep source/store entry-value and alias controls. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool add_linearize( const Binary_Operator<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
5 |
|
|
Parents:
|
|
sub_linearize() shall require a SUB node and linearize both operands in the same entry store. Operand refusal shall return false. A successful child form with an unbounded coefficient shall also cause refusal before its relative-error form is constructed; later children need not be evaluated after this refusal. Using L1, L2, Rf, Af as in 🔗 4. Rounding-aware addition linearization, the output shall soundly enclose L1 − L2 + Rf(L1) + Rf(L2) + Af, using coefficient-wise interval operations and preserving the operands' coordinate identities. It shall return false if any resulting coefficient is unbounded, and true otherwise. 🔗 1. Target-adapted floating expression evaluation shall govern common prerequisites and failure effects. |
Subtraction must preserve cancellation relationships while accounting for both operands in its rounding bound. Finite coefficient magnitudes make the two relative-error components well-defined; an admitted unbounded leaf can therefore cause parent refusal. |
Mine04 | Section 5, subtraction linearization and relative-error definitions (PDF page index 6, zero-based). |
|
|
|
|
Use independently rounded subtraction samples, cancellation and nontrivial signs, different symbolic dimensions and refusal at either operand; compare rational coefficient bounds and input snapshots. Check unbounded constant leaves on both sides, first-child short-circuiting, safe refusal and bounded recovery without changing operand signs or input entry values. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool sub_linearize( const Binary_Operator<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
6 |
|
|
Parents:
|
|
mul_linearize() shall require a MUL node, obtain both operand forms and intervalize both through the oracle. Failure of any required linearization or coordinate query shall return false. It shall select a bounded intervalized operand for scalar multiplication; if neither operand has a bounded interval enclosure it shall return false. If the retained form has an unbounded coefficient, an exactly zero selected scalar shall yield a dimension-zero form containing the absolute-error interval without constructing relative error; a nonzero selected scalar shall cause refusal. Width estimates may choose either bounded operand and shall not promise optimal precision. For a bounded retained form, if I1 is selected, the result shall soundly enclose I1L2 + I1Rf(L2) + Af; if I2 is selected it shall soundly enclose I2L1 + I2Rf(L1) + Af. Scalar multiplication shall preserve the other operand's symbolic coordinates. It shall return false for an unbounded result coefficient, and true otherwise. Common notation and prerequisites shall follow 🔗 4. Rounding-aware addition linearization and 🔗 1. Target-adapted floating expression evaluation. |
One operand is enclosed as a scalar interval so that the remaining affine dependence can be retained without introducing nonlinear terms. An exact zero scalar annihilates every real coefficient without requiring a finite magnitude for the retained form. A nonzero scalar still requires finite retained coefficients for relative-error construction. |
Mine04 | Section 5, multiplication and intervalization rules (PDF page indices 6–7, zero-based). |
|
|
|
|
Use independent rational products and binary32 rounding, opposite width choices, signed intervals, ties, one/two unbounded enclosures and refusal at each required query; ensure the unselected symbolic dependence remains represented. Check an unbounded constant times exact zero in both selected orientations, requiring only the absolute-error constant and dimension zero. Nonzero bounded scalars with unbounded retained coefficients shall refuse. Retain successful unbounded oracle values with bounded coefficient forms. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool mul_linearize( const Binary_Operator<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
7 |
|
|
Parents:
|
|
div_linearize() shall require a DIV node and first obtain the denominator's linear form and oracle-based interval enclosure. Required query refusal shall return false. If the closed hull of the denominator interval reaches zero it shall return false, including a zero endpoint excluded by openness. Thus a successful division shall not rely on an unproved nonzero denominator. A one-sided unbounded denominator whose closed hull excludes zero shall remain admitted when the selected interval arithmetic supports it. It shall then linearize the numerator, propagating refusal. An unbounded numerator coefficient shall cause refusal before its relative-error form is constructed. For numerator form L1 and denominator enclosure I2, it shall soundly enclose L1 ⁄ I2 + Rf(L1) ⁄ I2 + Af, retaining numerator coordinates. An unbounded result coefficient shall return false; a bounded result shall return true. Common prerequisites and notation shall follow 🔗 1. Target-adapted floating expression evaluation and 🔗 4. Rounding-aware addition linearization. |
Division requires established separation from zero before applying a reciprocal scalar enclosure and its rounding allowance. A sign-separated unbounded divisor can have a bounded reciprocal, while relative rounding of the numerator requires finite coefficient magnitudes. |
Mine04 | Section 5, division and intervalization rules (PDF page indices 6–7, zero-based). |
|
|
|
|
Check positive/negative and one-sided unbounded denominators, interior/closed/open-endpoint zero exclusions, denominator-first refusal and successful retry; compare exact rational quotient and independently rounded binary32 samples. Check unbounded numerator refusal after denominator validation, preserving denominator-first queries. Retain bounded numerator controls with positive and negative sign-separated unbounded denominator intervals. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool div_linearize( const Binary_Operator<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
8 |
|
|
Parents:
|
|
cast_linearize() shall require a floating-result cast node. For a floating argument it shall linearize that argument, propagating refusal. When the destination format contains every finite value representable by the source format, it shall retain the resulting form without added cast error. A constant enclosure certified by 🔗 11. Constant affine enclosures closed under destination rounding shall also require no added cast error. For an integer argument it shall obtain a sound interval through get_integer_expr_value(), returning false on refusal. If the destination contains every finite value of the analyzer boundary format, it shall close any excluded finite endpoints of that interval and retain the resulting constant form without a further error term. Equality of formats shall satisfy this inclusion condition. Other integer enclosures certified by 🔗 11. Constant affine enclosures closed under destination rounding shall remain unchanged without an error term. Value-set inclusion shall use is_less_precise_than(): the destination contains the analyzer exactly when !is_less_precise_than(destination, analyzer). The converse difference predicate shall not establish inclusion for incomparable formats. In the remaining cases it shall add destination-format relative and absolute error enclosures. An unbounded input coefficient shall cause refusal before relative error is constructed. Unbounded resulting coefficients shall return false and bounded coefficients true. Error-free casts may retain admitted unbounded enclosures; success alone shall not certify finite coefficients. Common numerical and entry-value rules shall follow 🔗 1. Target-adapted floating expression evaluation; unsupported selected error helpers may report their documented exceptions. |
Format value sets form a partial order. Lacking some destination values does not establish that every analyzer value belongs to the destination. Monotone rounding fixes representable finite enclosure endpoints, but may produce a previously excluded endpoint. Closing those endpoints preserves soundness of integer conversions. A closed constant enclosure with exact finite endpoints already contains every rounded result, even when not every interior value is exactly representable. |
Mine04 | Section 5, floating-point cast linearization rule (PDF page index 6, zero-based). |
|
|
|
|
Check same-format, widening and narrowing casts, zero/one and other exact constants, padded zero dimensions and genuine symbolic forms. Compare integer and floating casts with independent exact-rational destination lattices. Include signed modeled128-bit integers without native128 arithmetic, oracle refusal/recovery, input/output store aliases and unsupported selected error helpers. Check binary32 analyzer enclosures of integers converted to IBM single, including an enclosure containing no destination value. Check integer casts whose open native endpoints can become rounded results, both for equal and wider destinations. Distinguish certified constant rays and universe from unbounded enclosures requiring an error term. Check open finite endpoints and nonrepresentable finite endpoints against directed rounding neighbors. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/castcontracts1.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool cast_linearize( const Cast_Operator<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
9 |
|
|
Parents:
|
|
For an approximable reference, linearize() shall obtain its possible coordinate identities from the oracle. Refusal or an empty association set shall return false. For a single associated coordinate, an existing store binding shall be copied into the result; an unbounded copied form shall return false. If that key is absent, the result shall be the exact unit variable form for that coordinate, with dimension equal to its index plus one. This symbolic fallback shall not require a numerical coordinate query. For multiple possible coordinates it shall query every required coordinate interval and return false on refusal. Otherwise it shall form their interval hull as a dimension-zero constant form, returning true exactly when its coefficient is bounded. It shall not arbitrarily select one possible identity or combine alternatives as a conjunction. Coordinate validity, entry-value copying and common lifetime/numerical rules shall follow 🔗 7. Oracle reference-to-coordinate associations and 🔗 1. Target-adapted floating expression evaluation. |
A known identity permits affine substitution; several possible identities require a conservative numerical union. |
Mine04 | Section 5, Linear Form Propagation (PDF page index 7, zero-based). |
|
|
|
|
Check absent/present single keys, independent copies, high valid indices, unbounded stored forms, multiple coordinate hulls, empty/refused sets and failure at first/middle/last value query followed by recovery. |
src/linearize.hh; src/Float_defs.hh; src/Float_inlines.hh; src/Float_templates.hh; tests/expressionlinearizationspec1.cc; tests/expressionprotocolfixture.hh; tests/Concrete_Expression/linearize.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/Concrete_Expression/ibmroundoff1.cc; tests/expressionpublic1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. template <typename Target, typename C> bool linearize( const Concrete_Expression<Target>& expression, const FP_Oracle<Target, C>& oracle, const std::map<dimension_type, Linear_Form<C>>& store, Linear_Form<C>& result); |
|
|
SW_SPEC
|
10 |
|
|
Incoming link from:
11. Constant affine enclosures closed under destination rounding
1 |
For a configured supported native binary floating type Boundary and one of the seven modeled Floating_Point_Format values, cast_value_is_exact() shall return true exactly when the native value is finite and exactly representable in that modeled format. Both signs of zero shall be representable. Nonfinite native values shall return false. Binary format membership shall include normal and subnormal values within the finite range of binary16, binary32, binary64, binary128 and x87 extended. IBM single and double membership shall use their normalized radix-16 value sets, including zero, their finite exponent ranges and their respective significand precisions. Membership shall be symmetric under sign reversal. The checker shall require no dynamic storage and shall preserve the active rounding direction. |
Exact destination-value membership permits an enclosure endpoint to be a fixed point of rounding. Classification through exact native scaling avoids rounding through the very destination format being examined. Equality with an integer-rounded value tests integrality in any rounding direction. |
|
|
|
|
|
Compare classifications with independent integer/rational lattice tests for every format. Include signed zero, both signs, subnormal and normal boundaries, exponent boundaries, exact and inexact significands, finite extremes, infinities and NaN. Exercise native precision both below and above the destination precision, including cases requiring no significand scaling. Check classification and direction preservation in all four IEEE rounding directions, including exact values and halfway/inexact significands. Exercise actual native significand precisions both up to 64 bits and above 64 bits; inspect the compiled precision selection and the retained wide-format path. |
src/linearize.hh; tests/Concrete_Expression/castcontracts1.cc. |
|
|
Header: <ppl.hh>; namespace Parma_Polyhedra_Library::Implementation. template <typename Boundary> bool cast_value_is_exact(Boundary value, Floating_Point_Format format); |
||
|
SW_SPEC
|
11 |
|
|
Incoming links from:
8. Floating and integer cast linearization
8. Floating and integer cast linearization
2 |
For a linear form over admitted real intervals with a configured supported native floating boundary type and a known modeled destination format, cast_interval_is_rounding_closed() shall return true exactly when all homogeneous coefficients are zero and the constant interval is nonempty, topologically closed, and has exactly representable finite endpoints as defined by 🔗 10. Native value membership in modeled floating formats. Infinite abstract bounds shall impose no additional representability condition. Retained zero dimensions shall not prevent certification. A true result shall certify that rounding any admitted finite concrete value from the enclosure to a finite destination value remains in that enclosure. It shall not claim that every interior real value is exactly representable. False shall provide no such certificate. The checker shall preserve the represented form, its space dimension and the active rounding direction, and shall require no dynamic storage. |
Monotone rounding fixes exactly representable finite endpoints. Therefore rounding maps a closed interval into itself. The same argument applies when one or both abstract bounds are infinite. A nonzero homogeneous coefficient prevents treating an affine form as a constant enclosure. |
|
|
|
|
|
Check exact and halfway singleton neighbors at each smaller destination precision, including x87 precision when the native boundary is binary128. Check scalar and zero-padded forms, nonzero homogeneous coefficients at several coordinates, empty intervals, finite open endpoints, closed bounded intervals, both half-lines and universe. Distinguish inexact lower and upper endpoints and singleton endpoints. Exercise certification through public integer and floating cast calls as well as directly. Check preserved values, dimensions and rounding direction. |
src/linearize.hh; tests/Concrete_Expression/castcontracts1.cc. |
|
|
Header: <ppl.hh>; namespace Parma_Polyhedra_Library::Implementation. template <typename Interval> bool cast_interval_is_rounding_closed( const Linear_Form<Interval>& form, Floating_Point_Format format); |