Parma Polyhedra Library requirements
Native coefficient lifetime and scalar support adapters
PPL-SPEC-001639
1. Native integral checked-number value move PPL-SPEC-001639

For an admitted native integral storage type T, move construction of Checked_Number<T, Policy> shall copy the source's stored integer value and preserve the source. It shall be a trivial, nonthrowing constructor and shall invoke neither a conversion operation nor Policy::handle_result. The wrapper shall have a trivial destructor and one native integral data member; it shall be an implicit-lifetime class under C++20. Its size and alignment shall equal those of T. These properties shall not imply that the wrapper is trivially copyable. The copy constructor and copy assignment shall retain their separately specified behavior.

This constructor shall be available only when Is_Native<T>::value is nonzero and std::is_integral_v<T> is true. GMP and floating-point storage shall retain the existing copy-from-rvalue behavior. The source shall be a live initialized object with an admitted stored representation; no library initialization, rounding setup, allocation or policy callback shall be required.

PPL-SPEC-001640
2. Consuming coefficient relocation PPL-SPEC-001640

For the configured coefficient type, relocate_coefficient(to,from) shall transfer the entry source value to a distinct destination slot. relocate_coefficients(to,from,count) shall transfer the ordered sequence of count source values between disjoint ranges. relocate_coefficients_right(from,count,shift) shall transfer that sequence to the range beginning shift slots later in the same allocation; overlapping, touching and disjoint ranges, zero count and zero shift shall be admitted. Overlap shall preserve the entry sequence, as if its values were first retained before writing the destination.

Source slots shall contain live initialized coefficients. Destination-only slots shall be suitably aligned uninitialized or previously consumed storage. All pointers shall designate valid storage even when count is zero; the source and destination extents and byte-size products shall be representable and fit their allocations. After relocation the destination range shall hold live coefficients with the entry source values and ownership. Source-only slots shall be consumed: their old values shall neither be accessed nor destroyed; they may be reconstructed or their storage released without coefficient destruction. Overlap slots belonging to the destination shall remain live. No coefficient-owned resource shall be duplicated or lost.

The helpers shall be nonthrowing, allocate no storage and invoke no numerical conversion, policy handler or rounding control. They shall require no library initialization. Native integral coefficient relocation shall preserve each integer representation using the implicit-lifetime wrapper property of 🔗 1. Native integral checked-number value move.

  • 3. Conservative directed numerical bounds 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.

    • PPL-HLR-000001
      1. Numerical and geometric foundations PPL-HLR-000001

      PPL shall provide numerical values and finite-dimensional geometric descriptors with defined mathematical meanings, so that clients can describe numerical problems consistently across the library.

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

    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.

    • PPL-HLR-000001
      1. Numerical and geometric foundations PPL-HLR-000001

      PPL shall provide numerical values and finite-dimensional geometric descriptors with defined mathematical meanings, so that clients can describe numerical problems consistently across the library.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 14. Directional bounds, extrema and attainment PPL-LLR-000432

    PPL shall provide directional-bound and extremum queries for the documented supported pointset domains. Under the arithmetic preconditions, a reported upper bound shall bound all admitted objective values from above and a lower bound shall bound them from below. The per-domain result contract shall distinguish a conservative bound from an established supremum or infimum and shall identify whether success, attainment and any witness concern the represented set or only a supplying component.

    • PPL-HLR-000002
      2. Primitive numerical abstractions PPL-HLR-000002

      PPL shall provide intervals and boxes, closed and not necessarily closed convex polyhedra, grids, bounded difference shapes, and octagonal shapes, together with operations whose semantic effects and precision guarantees are defined for each abstraction.

    • PPL-HLR-000003
      3. Disjunctions and combinations of numerical abstractions PPL-HLR-000003

      PPL shall support finite disjunctions and combinations of numerical abstractions, with a defined relationship between the represented set and the meanings of the constituent domain elements.

PPL-SPEC-001641
3. Weakly relational extended-number policies PPL-SPEC-001641

Both WRD_Extended_Number_Policy and Debug_WRD_Extended_Number_Policy shall enable overflow checks, NaN and infinity representations, and requested FPU inexact checks. The production policy shall disable checks for opposite-infinity addition, same-infinity subtraction, infinity-times-zero, division by zero, infinity division, infinite remainder, negative square root and extra FPU NaN-result detection. The debugging policy shall enable all those checks.

Neither policy shall define convertible or any of the five ROUND_DEFAULT_* members. Operations needing them shall require an explicitly suitable policy instead of silently selecting a default. handle_result(r) shall forward exactly results whose class is VC_NAN to throw_result_exception(r) and propagate the resulting exception. Every normal or infinity result shall be accepted without an exception, including normal-class results carrying overflow or unrepresentable flags. The policies shall require no library initialization or rounding-mode change. Arithmetic using these policies shall retain its own numerical prerequisites; disabled checks shall not authorize undefined mathematical operations.

  • 1. Interval boundary membership PPL-LLR-000021

    An interval shall denote the values of its declared number carrier that satisfy its represented bounds and supported openness conditions. An unbounded boundary shall be distinguished from an included infinite value, and supported empty and singleton intervals shall retain their distinct meanings.

    • PPL-HLR-000002
      2. Primitive numerical abstractions PPL-HLR-000002

      PPL shall provide intervals and boxes, closed and not necessarily closed convex polyhedra, grids, bounded difference shapes, and octagonal shapes, together with operations whose semantic effects and precision guarantees are defined for each abstraction.

  • 3. Conservative directed numerical bounds 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.

    • PPL-HLR-000001
      1. Numerical and geometric foundations PPL-HLR-000001

      PPL shall provide numerical values and finite-dimensional geometric descriptors with defined mathematical meanings, so that clients can describe numerical problems consistently across the library.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 4. Explicit numerical operation contracts PPL-LLR-000442

    Each supported numerical operation shall have an explicit contract identifying its concrete meaning, the conditions of its numerical guarantees, and the meaning of its exact, approximate, inconclusive and failure outcomes, as applicable. The contract shall identify its applicable domain, numerical profile and interface contexts; restrictions on availability or precision shall be consistent with the required facility and selected configuration.

    • PPL-HLR-000011
      11. Sound and explicit numerical guarantees PPL-HLR-000011

      PPL shall distinguish exact numerical results, conservative approximations and inconclusive outcomes, and shall make the assumptions and precision guarantees of each numerical operation explicit.

PPL-SPEC-001642
4. Interval and scalar view adapters PPL-SPEC-001642

For a live initialized interval, f_is_empty, f_is_singleton and infinity_sign shall return the corresponding member query. In Interval_NS, f_lower, f_upper and f_info shall return const references to the interval's owned boundaries and metadata, preserving reference identity and the access conditions of 🔗 2. Interval endpoint and metadata references.

For an admitted singleton scalar x, the two boundary adapters shall return const references to x itself. Its metadata adapter shall return a shared immutable null-information object admitting empty values and infinity, with inexact checking disabled. The overload with bool open shall return independent null-information metadata whose two boundaries have that openness. The scalar empty predicate shall return exactly is_not_a_number(x); its singleton predicate shall negate that result.

is_singleton_integer(x) shall return true exactly when the interval or scalar is a singleton and its lower value is integral. It shall not read a lower payload after a false singleton result. check_empty_arg(x) shall return the empty predicate when the metadata admits emptiness; otherwise the caller shall supply a nonempty argument and the helper shall return false. These adapters shall preserve their arguments and add no allocation, initialization or rounding prerequisites to the selected scalar/member query.

PPL-SPEC-001643
5. Borrowed or converted distance operands PPL-SPEC-001643

maybe_assign(top,tmp,from,dir) shall select its behavior from the exact source and destination C++ types. If they are identical, it shall set top to the address of from, leave tmp unchanged and return V_EQ; it shall perform no numerical conversion or allocation. Otherwise it shall set top to the address of tmp, perform assign_r(tmp,from,dir) and return that operation's result. Its dispatch structs shall have the same behavior.

The operands shall remain live; temporary storage shall be initialized as required by the selected assignment. For differing types, the assignment's admitted values, rounding direction, aliasing, initialization, resource and exception conditions shall apply. If assignment throws, top shall already designate tmp and the assignment's destination guarantee shall apply. Borrowing shall not extend the source lifetime. A returned pointer shall not be used after its referent is destroyed or invalidated.

PPL-SPEC-001644
6. Common dimension validation and domain limit PPL-SPEC-001644

check_space_dimension_overflow(dim,max,domain,method,reason) shall return dim unchanged when dim ≤ max. Otherwise it shall throw std::length_error with a message formed from domain, method, ":", a newline, reason and "." in that order. The string arguments shall point to live null-terminated character sequences. The accepted path shall allocate no storage; message construction failures shall propagate. It shall require no library initialization.

The free max_space_dimension() shall return the minimum of the limits for Variable, both polyhedron topologies, Grid, Rational_Box, Box<Integer_Interval> and the BD/octagonal shapes instantiated with each of int8_t, int16_t, int32_t, int64_t, float, double, long double, mpz_class and mpq_class. Repeated calls shall return the same limit. A custom box interval type shall retain its own limit; the common value shall not promise successful allocation or a limit for every user-defined domain. First-use cache access shall follow the configured thread-local/global storage model and be synchronized accordingly.