Parma Polyhedra Library requirements
Numerical foundations

Numerical foundations

1. Exact integral coefficient calculations
UID: PPL-LLR-000001
STATUS: APPROVED
COMPONENT: NUMERICS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

For each supported integer coefficient profile, successful addition, subtraction and multiplication shall produce the mathematical integer result whenever that result is representable in the profile.

RATIONALE:

Mathematical domain operations depend on coefficient arithmetic preserving meaning. Representability limits and resource failures remain distinct from successful calculation.

COMMENT:

Verification covers coefficient arithmetic and its exact-result and arithmetic-precondition contracts. Related obligations: 🔗 5. Integer quotient and remainder semantics, 🔗 6. Exact rational arithmetic, 🔗 1. Meaning of successful exact and approximate results.

VERIFICATION_CRITERIA:

Compare results with independently computed arbitrary-precision integer results for zero, positive and negative operands, cancellation and representable boundary cases. Exercise every supported coefficient profile; do not interpret unchecked overflow cases as evidence for exactness.

SOURCE:

README.configure.md: section 4, Enabling the Use of Alternative Coefficient Types. src/Coefficient_types.hh: coefficient profile and bounded-integer policy. configure.ac: coefficient selection.

PPL-LLR-000002
2. Detection of checked coefficient overflow
UID: PPL-LLR-000002
STATUS: APPROVED
COMPONENT: NUMERICS
APPLICABILITY: COEFF_CHECKED_I8, COEFF_CHECKED_I16, COEFF_CHECKED_I32, COEFF_CHECKED_I64
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

For coefficient profiles that promise overflow checking, a requested coefficient calculation whose integer result is outside the representable range shall report overflow rather than report a wrapped or truncated value as a successful exact result.

RATIONALE:

Checked bounded arithmetic is intended to permit bounded storage without silently corrupting the mathematical computation.

COMMENT:

Verification covers checked-coefficient overflow reporting and its observable failure outcomes. Related obligations: 🔗 1. Exact integral coefficient calculations, 🔗 5. Integer quotient and remainder semantics.

VERIFICATION_CRITERIA:

Use an independent unbounded-integer oracle to generate results immediately inside and outside both range limits. Confirm that representable results succeed and out-of-range results reach the documented failure outcome.

SOURCE:

README.configure.md: section 4, checked and unchecked coefficients. src/Coefficient_types.hh: Bounded_Integer_Coefficient_Policy. src/Coefficient_inlines.hh: overflow handling.

3. Conservative directed numerical bounds
UID: PPL-LLR-000003
STATUS: APPROVED
COMPONENT: NUMERICS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

When a supported numerical operation promises a downward or upward bound on a defined real result, a successful downward-bound result shall not exceed that result and a successful upward-bound result shall not be less than it.

RATIONALE:

Directed numerical bounds are the foundation of sound interval and weakly relational approximations. The guarantee is conditional on the operation and numeric policy supporting the requested direction.

COMMENT:

Verification covers directed arithmetic and bound-producing conversions, distinguishing their supported directions and profiles. Related obligations: 🔗 14. Directional bounds, extrema and attainment, 🔗 1. Meaning of successful exact and approximate results.

VERIFICATION_CRITERIA:

Compare directed results with exact rational or independently established high-precision results. Include inexact values, cancellation, subnormal values where supported, range boundaries and admitted infinite bounds. Check both directions separately.

SOURCE:

src/Rounding_Dir_defs.hh: rounding directions. src/checked_defs.hh: checked arithmetic and conversions. src/checked_float_inlines.hh: directed floating-point operations. src/WRD_coefficient_types_defs.hh: extended-number policies.

PPL-LLR-000004
4. Meaning of numerical conversion outcomes
UID: PPL-LLR-000004
STATUS: APPROVED
COMPONENT: NUMERICS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

When a supported numerical conversion distinguishes exact and inexact success, an exact-success outcome shall preserve the source value and an inexact-success outcome shall satisfy the conversion's stated approximation direction.

RATIONALE:

Conversion precision is part of the mathematical result and cannot be inferred merely from completion of the conversion.

COMMENT:

Verification covers numerical conversion values and precision outcomes. Related obligations: 🔗 6. Exact rational arithmetic, 🔗 1. Meaning of successful exact and approximate results.

VERIFICATION_CRITERIA:

Check conversions among supported integer, rational and floating-point profiles using values that are exactly representable, values between representable numbers and values at range limits. Independently verify both the converted value and the precision classification.

SOURCE:

src/Result_defs.hh: result classifications. src/checked_defs.hh: conversion contracts. src/checked_inlines.hh: conversion operations.

5. Integer quotient and remainder semantics
UID: PPL-LLR-000414
STATUS: APPROVED
COMPONENT: NUMERICS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis, Review
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

PPL shall provide integer quotient and remainder operations for its supported integer numeric profiles, with defined quotient-rounding and remainder-sign conventions. For valid operands within the selected arithmetic preconditions, completed operations shall satisfy their specified convention and the corresponding dividend-reconstruction identity.

RATIONALE:

Division and remainder conventions differ for negative operands. Exact coefficient addition and multiplication alone do not define these arithmetic foundations.

COMMENT:

Verification covers integer division and remainder operations, their rounding conventions, valid operand ranges and reported outcomes. Related obligations: 🔗 1. Exact integral coefficient calculations, 🔗 2. Detection of checked coefficient overflow, 🔗 1. Meaning of successful exact and approximate results.

VERIFICATION_CRITERIA:

Compare quotient and remainder pairs with independent integer calculations for every supported convention. Include every sign combination, exact and inexact division, zero dividends and representable range boundaries. Exclude a zero divisor and other documented invalid operand combinations from successful-result checks; assess any promised rejection or failure separately.

SOURCE:

src/checked_defs.hh: integer division and remainder operations. src/checked_int_inlines.hh: bounded integer quotient and remainder. src/checked_mpz_inlines.hh: unbounded integer operations.

6. Exact rational arithmetic
UID: PPL-LLR-000415
STATUS: APPROVED
COMPONENT: NUMERICS
APPLICABILITY: SCALAR_MPQ
VERIFICATION_METHODS: Test, Analysis, Review
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

For numeric profiles supporting exact rational values, PPL shall provide addition, subtraction, multiplication and division by a nonzero rational. For valid operands within the arithmetic and resource preconditions, successfully completed operations shall produce the exact mathematical rational result.

RATIONALE:

Exact rational arithmetic supports domain bounds, optimization results and independent numerical reasoning. A rational-valued operation is distinct from an integer coefficient profile.

COMMENT:

The scalar facet selects rational-valued use contexts; it does not introduce a global rational coefficient configuration.

Verification covers rational numeric value types and exact rational arithmetic operations. Related obligations: 🔗 1. Exact integral coefficient calculations, 🔗 4. Meaning of numerical conversion outcomes, 🔗 1. Meaning of successful exact and approximate results.

VERIFICATION_CRITERIA:

Compare results with independently reduced numerator-and-denominator calculations. Include negative values, cancellation, nonintegral quotients, equivalent unreduced fractions and large representable operands. Check that canonicalization preserves rational value and treat zero-denominator requests according to their separate preconditions and failure contracts.

SOURCE:

src/checked_mpq_inlines.hh: exact rational operations and normalization. src/Checked_Number_defs.hh: supported rational values and arithmetic. src/Result_defs.hh: arithmetic outcome classifications.