Parma Polyhedra Library requirements
C++ modeled floating-format errors and finite-value inclusion

C++ modeled floating-format errors and finite-value inclusion

1. Descriptor absolute-error interval
UID: PPL-SPEC-001012
STATUS: APPROVED
COMPONENT: EXPRESSION_ANALYSIS
APPLICABILITY: IF_CPP, NATIVE_FP_AVAILABLE
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

The public static absolute_error field shall initially contain an interval enclosing [ − ω, ω], where the radius is the larger of the analyzed absolute error and the analyzer boundary type's smallest positive subnormal. Built-in IEEE binary descriptors shall use their smallest positive subnormal; normalized IBM short and long hexadecimal descriptors shall use 16 − 65, including underflow to zero with the exponent-underflow interruption disabled. Custom three-field descriptors shall use BASE1 −  EXPONENT_BIAS − MANTISSA_BITS. The descriptor shall meet the radix, precision and exponent-range prerequisites of 🔗 1. Owned floating-expression protocol and lifetime. The stored radius shall enclose the mathematical value even when it is not exactly representable in the analyzer.

The field shall be owned by its I, Format specialization and by its thread when PPL thread support selects thread-local storage. It shall remain publicly mutable; callers changing it shall preserve a sound nonempty error interval for their analysis. Subsequent rounded-node evaluation shall use the current field. Selected arithmetic and runtime prerequisites of 🔗 1. Owned floating-expression protocol and lifetime shall apply.

RATIONALE:

A separate absolute term bounds underflow even when the relative term vanishes, and analyzer storage must not shrink that bound.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to the indicated class templates.

// Public static member of Floating_Point_Expression<I, Format>:
static PPL_TLS I absolute_error;
VERIFICATION_CRITERIA:

Compare exact rational radii for all built-in descriptors and custom radix powers, analyzer-subnormal clamping, specialization/thread lifetime and a sound temporary public-field override with restoration.

SOURCE:

src/Float_defs.hh; src/Float_templates.hh; src/Floating_Point_Expression_defs.hh; src/Floating_Point_Expression_templates.hh; tests/ownedexpressionspec1.cc; tests/ownedexpressionthreads1.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/ownedexpressionpublic1.cc.

2. Enumeration-based cached absolute error
UID: PPL-SPEC-001013
STATUS: APPROVED
COMPONENT: EXPRESSION_ANALYSIS
APPLICABILITY: IF_CPP, NATIVE_FP_AVAILABLE
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

compute_absolute_error<I>() shall return a stable const reference to the cached absolute-error interval for IEEE754_HALF, IEEE754_SINGLE, IEEE754_DOUBLE, IEEE754_QUAD, INTEL_DOUBLE_EXTENDED or IBM_SINGLE. Its radius shall enclose the corresponding analyzed absolute error and the analyzer's smallest positive subnormal, with binary and IBM meanings from 🔗 1. Descriptor absolute-error interval. Distinct supported formats shall retain their own cached values. Repeated calls shall not change a previously returned interval. Unsupported format selections, including IBM_DOUBLE, shall throw std::invalid_argument.

References shall belong to the selected template specialization and thread when configured thread-local, and shall not be deleted or modified by the caller. Native boundary arithmetic and runtime prerequisites shall be met; metadata support alone shall not establish this helper's support.

RATIONALE:

A cached immutable reference gives repeated analyses the same error bound while retaining an explicit unsupported-format outcome.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to the indicated class templates.

template <typename I>
const I& compute_absolute_error(Floating_Point_Format analyzed_format);
VERIFICATION_CRITERIA:

Check all six supported format/radius pairs using exact rationals, stable reference addresses, preserved values after intervening queries and explicit IBM_DOUBLE rejection.

SOURCE:

src/Float_defs.hh; src/Float_templates.hh; tests/ownedexpressionspec1.cc; tests/ownedexpressionthreads1.cc; tests/Concrete_Expression/floatingcontracts1.cc; tests/ownedexpressionpublic1.cc.

PPL-SPEC-001014
3. Finite floating-format value inclusion
UID: PPL-SPEC-001014
STATUS: APPROVED
COMPONENT: EXPRESSION_ANALYSIS
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For the seven named floating-format identifiers, is_less_precise_than(first, second) shall return false exactly when every finite mathematical value representable in second is also representable in first. It shall compare modeled value sets, including precision and exponent/subnormal range, independently of the analyzer's native formats. Equal formats shall return false. Incomparable value sets shall return true in both directions; the predicate shall not establish a total ranking. Distinctions between signed zeros or special NaN/infinity encodings shall not alter this finite mathematical-value relation.

The query shall require no PPL initialization, FPU setup or native floating-point availability. Arguments shall be the seven named identifiers specified by 🔗 2. Modeled floating-point format identity.

RATIONALE:

A cast can omit extra rounding only when finite source values fit the destination value set; a single precision number is insufficient for incomparable formats.

INTERFACE:

Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member excerpts apply to the indicated class templates.

bool is_less_precise_than(Floating_Point_Format first,
                          Floating_Point_Format second);
VERIFICATION_CRITERIA:

Check every one of the 49 ordered pairs against independently characterized binade ranges and dyadic coefficient grids, including both incomparable IEEE/IBM pairs, in native and no-native-FP configurations without initialization.

SOURCE:

src/Float_defs.hh; src/Float_inlines.hh; tests/floatingformatsspec1.cc; tests/float1.cc; tests/ownedexpressionpublic1.cc.