Parma Polyhedra Library requirements
C++ same-storage native integer Bezout coefficients

C++ same-storage native integer Bezout coefficients

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
SW_SPEC
1
PPL-SPEC-000843
Bounded native integer Bezout assignment

For finite native integer source entry values a and b, gcdext_assign_r shall assign a nonnegative greatest common divisor g and integer coefficients s, t satisfying as + bt = g. For two zero sources, g shall be zero. No unique coefficient pair shall be required, including for zero, equal or opposite sources. The operation shall return V_EQ for each valid rounding request, including strict and exactness requests.

All arguments shall have the same one of the eleven native integer storage types I. The three outputs shall either all be raw I or all have the same admitted Checked_Number<I, Policy> type; either source may be raw I or that checked type. Source values shall be finite for their own policies and in the output policy's finite interval. The output interval and raw destination policy shall follow 🔗 1. Exact same-storage native integer arithmetic.

Both source absolute values, each evaluated Euclidean quotient, coefficient, product and difference, and the final outputs shall be finite and representable in the selected output interval. These conditions shall apply even when overflow checking is enabled: native intermediate expressions shall not promise a checked-overflow result. Unsigned storage shall admit only computations whose coefficients and evaluated intermediates remain nonnegative and representable. Existence of some mathematical Bezout pair alone shall not imply these bounded computation prerequisites. Configured coefficient convenience operations shall retain 🔗 5. Extended integral greatest common divisor; unbounded integer forms shall retain 🔗 2. Exact unbounded integer Bezout coefficients.

The three outputs shall be pairwise distinct and distinct from both sources. The sources may be the same object and shall remain unchanged. No other aliasing shall be admitted. Calls shall require no rounding default or result handler and shall not invoke a handler. Live-object, synchronization, initialization and hardware-direction prerequisites shall follow 🔗 1. Exact same-storage native integer arithmetic.

The Bezout identity gives a portable numerical guarantee without selecting one backend's coefficients. Multiple outputs and native intermediate expressions require explicit separation and representability conditions.

APPROVED
NUMERICS
IF_CPP
Test, Analysis, Inspection

Check nonnegative gcd and Bezout reconstruction with independent unbounded integer arithmetic, without requiring the oracle's coefficient pair. Include zero, equal and opposite sources, both source orders, coprime and noncoprime inputs, signed endpoint magnitudes, small exhaustive signed operands and admitted unsigned cases. Check exact intermediate representability before bounded calls, all eight requests, distinct and shared sources, raw/checked forms, source preservation, no handler calls and hardware-direction preservation without initialization.

src/Checked_Number_defs.hh; src/Checked_Number_inlines.hh; src/checked_int_inlines.hh; src/checked_inlines.hh; src/checked_ext_inlines.hh; tests/nativeintegerbezoutspec1.cc.

CPP
Public

Public header: <ppl.hh>; effective instantiations in Parma_Polyhedra_Library for the admitted argument types:

Result gcdext_assign_r(To& g, To& s, To& t,
                       const X& x, const Y& y, Rounding_Dir dir);