Parma Polyhedra Library requirements
Numerical foundations

Numerical foundations

UID:
VERSION:
CLASSIFICATION:
PREFIX:
Type
Level
MID
UID
REFS
Title
Statement
Rationale
Comment
BIBLIOGRAPHY
STATUS
COMPONENT
APPLICABILITY
VERIFICATION_METHODS
VERIFICATION_CRITERIA
SOURCE
LANGUAGE
VISIBILITY
INTERFACE
LLR
1
PPL-LLR-000001

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.

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

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.

APPROVED
NUMERICS
ALL
Test, Analysis

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.

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.

LLR
2
PPL-LLR-000002
PPL-LLR-000002
Detection of checked coefficient overflow

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.

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

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

APPROVED
NUMERICS
COEFF_CHECKED_I8, COEFF_CHECKED_I16, COEFF_CHECKED_I32, COEFF_CHECKED_I64
Test, Analysis

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.

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

LLR
3
PPL-LLR-000003

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.

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.

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.

APPROVED
NUMERICS
ALL
Test, Analysis

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.

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.

LLR
4
PPL-LLR-000004
PPL-LLR-000004
Meaning of numerical conversion outcomes

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.

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

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

APPROVED
NUMERICS
ALL
Test, Analysis

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.

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

LLR
5
PPL-LLR-000414
Integer quotient and remainder semantics

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.

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

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.

APPROVED
NUMERICS
ALL
Test, Analysis, Review

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.

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.

LLR
6
PPL-LLR-000415
Exact rational arithmetic

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.

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

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.

APPROVED
NUMERICS
SCALAR_MPQ
Test, Analysis, Review

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.

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.