Parma Polyhedra Library requirements
Internal interval boundary arithmetic
PPL-SPEC-001086
1. Outward endpoint addition and subtraction PPL-SPEC-001086

add_assign and sub_assign shall form outward selected endpoint candidates for the sum or difference of the two source entry values. Addition shall admit equal source sides; subtraction shall admit opposite source sides. The selected source/destination sides shall give the appropriate extremum: a natural infinite result shall have the receiving side's sign. The owning interval's additive endpoint selection shall retain 🔗 2. Ordinary interval addition and subtraction.

For finite operands, the exact candidate value shall be a + b or a − b; endpoint exclusion shall be required when either selected source endpoint is excluded. Numerical evaluation shall use the receiving side's outward direction and request sufficient relation information for membership under 🔗 1. Normalization of numerical results into boundary properties.

When a selected source is naturally infinite, the output shall be the appropriate natural infinity. It shall include that infinity exactly when an applicable naturally infinite source includes its infinity; all such source infinities excluded shall require exclusion. Natural-infinity classification and inclusion shall use 🔗 1. Boundary infinity and scalar-domain extremum interpretation and 🔗 2. Boundary openness and infinity membership interpretation. Indeterminate extended arithmetic shall be resolved by the owning interval before selecting this endpoint operation.

Selected destination properties shall meet the replacement or compatible composition conditions of 🔗 2. Same-side outward boundary conversion and retained properties. Result normalization, retained selected properties, unrelated/opposite-side metadata and cached interval claims shall obey 🔗 1. Normalization of numerical results into boundary properties. Exact representable values and supported membership distinctions shall yield the exact selected cut; other numerical outcomes shall give an outward receiving cut.

Active source payloads shall be initialized, valid and canonical where required. Metadata-encoded infinity shall not require evaluation of an inactive payload. Scalar types, numerical kernels, intermediate arithmetic, resource bounds, policy checks, shared-temporary synchronization and caller-owned FPU state shall meet the selected numerical contracts. Failures shall retain their underlying permitted partial states without an additional rollback guarantee. Separate sources shall remain unchanged; supported scalar/output and information aliases shall use source values and properties on entry. Borrowed references shall remain live. No extra library initialization shall be required.

PPL-SPEC-001087
2. Outward endpoint products and zero attainment PPL-SPEC-001087

mul_assign shall form an outward selected endpoint candidate with exact value ab for nonzero finite source entry values. Endpoint exclusion shall be required when either selected finite source endpoint is excluded. For a naturally infinite source and a nonzero partner, the receiving side shall match the mathematical product's infinity sign. The output shall be that natural infinity, included exactly when an applicable naturally infinite source includes its infinity. The owning interval's sign-sensitive endpoint selection shall retain 🔗 3. Ordinary interval multiplication.

mul_assign_z shall additionally admit zero endpoint values. Supplied first_sign and second_sign shall distinguish the actual entry zero and nonzero source values, including metadata infinity. With two nonzero sources it shall retain the product rule above. With exactly one zero source it shall produce a zero candidate, excluded exactly when the zero source endpoint is excluded. With two zero sources it shall produce zero, excluded exactly when both zero source endpoints are excluded. Thus an attained zero shall remain attainable even when the partner extremum is excluded or unbounded. No inactive infinite payload shall need to be read in a zero branch.

set_zero shall assign an outward representation of mathematical zero with the explicit exclusion request; exactly representable zero shall retain that request whenever the receiving profile supports it. The result shall be the normalized numerical assignment result. Nonzero multiplication and zero assignment shall use the receiving side's outward direction and membership-sensitive relation checking.

Selected destination properties shall meet the replacement or compatible composition conditions of 🔗 2. Same-side outward boundary conversion and retained properties. Result normalization, retained selected properties, unrelated/opposite-side metadata and cached interval claims shall obey 🔗 1. Normalization of numerical results into boundary properties. Exact representable values and supported membership distinctions shall yield the exact selected cut; other numerical outcomes shall give an outward receiving cut.

Active source payloads shall be initialized, valid and canonical where required. Metadata-encoded infinity shall not require evaluation of an inactive payload. Scalar types, numerical kernels, intermediate arithmetic, resource bounds, policy checks, shared-temporary synchronization and caller-owned FPU state shall meet the selected numerical contracts. Failures shall retain their underlying permitted partial states without an additional rollback guarantee. Separate sources shall remain unchanged; supported scalar/output and information aliases shall use source values and properties on entry. Borrowed references shall remain live. No extra library initialization shall be required.

PPL-SPEC-001088
3. Outward endpoint quotients and zero-limit candidates PPL-SPEC-001088

div_assign shall form an outward selected endpoint candidate with exact value a ⁄ b for finite nonzero source entry values. Endpoint exclusion shall be required when either selected finite source endpoint is excluded. Numerical division shall use the receiving side's outward direction and membership-sensitive relation checking. The owning interval's divisor-sign selection and defined-quotient semantics shall retain 🔗 4. Ordinary interval division and zero-divisor abstraction.

For a naturally infinite numerator and a finite nonzero denominator, the receiving side shall match the quotient's infinity sign. The output shall be that natural infinity with the numerator's infinity membership. For a finite nonzero numerator and a naturally infinite denominator, the output shall be zero, excluded exactly when the denominator excludes its infinity. An indeterminate quotient of two infinite values shall be resolved by the owning interval before selecting this operation.

div_assign_z shall additionally admit zero endpoints and supplied zero/nonzero classifications consistent with the source entry values. For a nonzero numerator and zero denominator, it shall supply an open natural-infinity limit on the receiving side selected by the owning interval. For a zero numerator it shall supply a zero candidate. That zero shall be included when the numerator zero is included or the denominator is an included natural infinity; otherwise it shall be excluded. A finite zero denominator shall not itself make an excluded numerator zero attainable. These zero-limit branches shall use boundary assignment and shall not numerically divide by zero or evaluate an inactive infinite payload. With two nonzero sources the helper shall retain the quotient rule above.

Selected destination properties shall meet the replacement or compatible composition conditions of 🔗 2. Same-side outward boundary conversion and retained properties. Result normalization, retained selected properties, unrelated/opposite-side metadata and cached interval claims shall obey 🔗 1. Normalization of numerical results into boundary properties. Exact representable values and supported membership distinctions shall yield the exact selected cut; other numerical outcomes shall give an outward receiving cut.

Active source payloads shall be initialized, valid and canonical where required. Metadata-encoded infinity shall not require evaluation of an inactive payload. Scalar types, numerical kernels, intermediate arithmetic, resource bounds, policy checks, shared-temporary synchronization and caller-owned FPU state shall meet the selected numerical contracts. Failures shall retain their underlying permitted partial states without an additional rollback guarantee. Separate sources shall remain unchanged; supported scalar/output and information aliases shall use source values and properties on entry. Borrowed references shall remain live. No extra library initialization shall be required.

PPL-SPEC-001089
4. Outward endpoint residues modulo powers of two PPL-SPEC-001089

umod_2exp_assign and smod_2exp_assign shall form same-side outward endpoint candidates for the corresponding scalar residue. For a finite entry value a and m = 2e, the nonnegative candidate shall be u = a − m⌊a ⁄ m⌋, so 0 ≤ u < m. For the centered operation, the candidate shall be s = u when u < m ⁄ 2 and s = u − m otherwise, so  − m ⁄ 2 ≤ s < m ⁄ 2. Exponent zero shall mean m = 1 (and shall therefore give zero for integral source values). These scalar meanings shall retain 🔗 6. Exact rational operations with powers of two, 🔗 6. Exact centered and nonnegative unbounded integer residues, 🔗 3. Centered and nonnegative native integer dyadic residues, 🔗 3. Exact centered native residue modulo a power of two and 🔗 4. Rounded nonnegative native residue modulo a power of two.

The destination and source sides shall match. A finite candidate shall retain source endpoint exclusion, enlarged as needed for numerical outward rounding. Evaluation shall use the receiving side's outward direction and membership-sensitive relation checking. A naturally infinite source shall instead give the same-side natural-infinity boundary with its source membership, supporting the owning interval's unbounded residue fallback. The owning interval shall select the required endpoint cases and account for residue discontinuities under 🔗 2. Interval abstraction of wrapped integer images with refinement.

The exponent and every numerical intermediate shall meet the selected scalar operation's admission. A generic template signature shall not promise unavailable source/destination residue specializations.

Selected destination properties shall meet the replacement or compatible composition conditions of 🔗 2. Same-side outward boundary conversion and retained properties. Result normalization, retained selected properties, unrelated/opposite-side metadata and cached interval claims shall obey 🔗 1. Normalization of numerical results into boundary properties. Exact representable values and supported membership distinctions shall yield the exact selected cut; other numerical outcomes shall give an outward receiving cut.

Active source payloads shall be initialized, valid and canonical where required. Metadata-encoded infinity shall not require evaluation of an inactive payload. Scalar types, numerical kernels, intermediate arithmetic, resource bounds, policy checks, shared-temporary synchronization and caller-owned FPU state shall meet the selected numerical contracts. Failures shall retain their underlying permitted partial states without an additional rollback guarantee. Separate sources shall remain unchanged; supported scalar/output and information aliases shall use source values and properties on entry. Borrowed references shall remain live. No extra library initialization shall be required.