Parma Polyhedra Library requirements
Geometric descriptors
1. Coordinate identity and ambient dimension UID: PPL-LLR-000011 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

Geometric descriptors shall identify coordinates within a finite-dimensional ambient vector space and shall preserve coordinate identity when their declared dimension is increased without an explicit coordinate transformation.

RATIONALE:

An ambient dimension describes available coordinates and is distinct from the affine dimension of a represented set.

COMMENT:

Verification covers descriptor dimensions and coordinate identity. Related obligations: 🔗 1. Coordinate removal and existential projection, 🔗 2. Distinguished coordinate extensions, 🔗 3. Coordinate remapping semantics.

VERIFICATION_CRITERIA:

Check zero-dimensional descriptors, descriptors containing unused coordinates and extension by trailing unused coordinates. Confirm that extension does not change the values of expressions on the original coordinates.

SOURCE:

doc/definitions.dox: Basic Geometric Descriptors; Space Dimensions and Dimension Compatibility. src/Variable_defs.hh: coordinate identity. src/Variables_Set_defs.hh: coordinate sets. src/Linear_Expression_defs.hh: space dimension.

  • PPL-SPEC-001524
    2. C affine expression values and updates UID: PPL-SPEC-001524 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Expression construction shall produce independent zero, dimensioned, copied or descriptor-derived native affine expressions. Assignment, coefficient additions, constant additions, expression addition/subtraction and scaling shall have the corresponding native affine meaning and retain native dimension/admission rules. Source handles shall remain valid during operations; owned results shall be independently deletable. Mutations shall not alter an independent source copy.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    C expression operations must preserve affine algebra and dimensions.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Linear_Expression(ppl_Linear_Expression_t *ple);
    int ppl_new_Linear_Expression_with_dimension(ppl_Linear_Expression_t *ple,
                                                 ppl_dimension_type d);
    int ppl_new_Linear_Expression_from_Linear_Expression(
        ppl_Linear_Expression_t *ple, ppl_const_Linear_Expression_t le);
    int ppl_new_Linear_Expression_from_Constraint(ppl_Linear_Expression_t *ple,
                                                  ppl_const_Constraint_t c);
    int ppl_new_Linear_Expression_from_Generator(ppl_Linear_Expression_t *ple,
                                                 ppl_const_Generator_t g);
    int ppl_new_Linear_Expression_from_Congruence(ppl_Linear_Expression_t *ple,
                                                  ppl_const_Congruence_t c);
    int ppl_new_Linear_Expression_from_Grid_Generator(ppl_Linear_Expression_t *ple,
                                                      ppl_const_Grid_Generator_t g);
    int ppl_assign_Linear_Expression_from_Linear_Expression(
        ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src);
    int ppl_delete_Linear_Expression(ppl_const_Linear_Expression_t le);
    int ppl_Linear_Expression_all_homogeneous_terms_are_zero(
        ppl_const_Linear_Expression_t le);
    int ppl_Linear_Expression_add_to_coefficient(ppl_Linear_Expression_t le,
                                                 ppl_dimension_type var,
                                                 ppl_const_Coefficient_t n);
    int ppl_Linear_Expression_add_to_inhomogeneous(ppl_Linear_Expression_t le,
                                                   ppl_const_Coefficient_t n);
    int ppl_add_Linear_Expression_to_Linear_Expression(
        ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src);
    int ppl_subtract_Linear_Expression_from_Linear_Expression(
        ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src);
    
    VERIFICATION_CRITERIA:

    Compare literal coefficient vectors and constants after each constructor and arithmetic update, including cancellation, zero scaling, borrowed input conversion and rejected dimensions.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001525
    3. C affine expression queries UID: PPL-SPEC-001525 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Expression dimension and coefficient queries shall assign the corresponding native extent, selected coefficient or constant. Zero tests and validity tests shall return boolean results. Query outputs shall be live writable coefficient objects rather than newly allocated handles. Indexed access shall observe native index admission and virtual zero coefficients where provided.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Queries distinguish assigning an existing coefficient from creating another owned object.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_Linear_Expression_space_dimension(ppl_const_Linear_Expression_t le,
                                              ppl_dimension_type *m);
    int ppl_Linear_Expression_coefficient(ppl_const_Linear_Expression_t le,
                                          ppl_dimension_type var,
                                          ppl_Coefficient_t n);
    int ppl_Linear_Expression_inhomogeneous_term(ppl_const_Linear_Expression_t le,
                                                 ppl_Coefficient_t n);
    int ppl_Linear_Expression_OK(ppl_const_Linear_Expression_t le);
    int ppl_Linear_Expression_is_zero(ppl_const_Linear_Expression_t le);
    
    VERIFICATION_CRITERIA:

    Check exact coefficients/constants, zero expressions, padded dimensions, range admission and query-output reuse.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • 1. Affine congruence meaning and valid numerical use UID: PPL-SPEC-000141 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For dimension d, integer coefficient expression E(x) = b + ∑d − 1i = 0aixi and nonnegative modulus m, a Congruence shall denote the rational valuations satisfying E(x) = 0 when m = 0, and E(x) ⁄ m ∈ ℤ when m > 0. Coordinates themselves need not be integral. is_equality() and is_proper_congruence() shall distinguish these cases exactly. is_tautological() shall report whether all rational valuations satisfy the relation; is_inconsistent() shall report whether none do. With a nonzero homogeneous coefficient neither predicate shall hold. For a constant expression, the first shall equal its equality/divisibility truth and the second its negation.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization; the caller shall synchronize access overlapping modification of an object. Both dense and sparse storage shall be supported, with default_representation equal to SPARSE. Computed construction, arithmetic, normalization, comparison and transformation guarantees shall require every evaluated coefficient step and result to be representable in the selected numerical profile. Unchecked completion shall not prove this precondition. Allocation and configured numerical exceptions may propagate. Failed construction shall release its owned resources; distinct unchanged sources shall survive failures, while modified destinations shall remain destructible without a universal rollback guarantee.

    RATIONALE:

    Congruence divisibility applies to the affine result, including rational coordinate values, rather than forcing each coordinate to be an integer.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Congruence;
    static constexpr Representation Congruence::default_representation = SPARSE;
    bool Congruence::is_equality() const;
    bool Congruence::is_proper_congruence() const;
    bool Congruence::is_tautological() const;
    bool Congruence::is_inconsistent() const;
    
    VERIFICATION_CRITERIA:

    Evaluate exact rational affine results and test equality or integral quotient independently. Include fractional satisfying and nonsatisfying coordinates, zero dimension, constants and trailing unused coordinates in both storage choices.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000142
    2. Default congruence and shared zero-dimensional values UID: PPL-SPEC-000142 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Default construction shall produce a dimension-zero equality with expression zero and use the requested representation. zero_dim_false() shall return a borrowed dimension-zero inconsistent equality. zero_dim_integrality() shall return a borrowed dimension-zero tautological proper congruence with modulus one. Shared constants shall remain usable until their initialized owning thread is finalized; owned copies shall be independent values.

    RATIONALE:

    Zero coordinates still admit true and false modular conditions. The shared integrality constant is a proper congruence even though it is tautological.

    INTERFACE:
    explicit Congruence(Representation r = default_representation);
    static const Congruence& Congruence::zero_dim_false();
    static const Congruence& Congruence::zero_dim_integrality();
    
    VERIFICATION_CRITERIA:

    Check zero expression/modulus, requested storage, shared classifications and dimensions, and owned copies within balanced initialization.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000143
    3. Congruence creation from affine operand differences UID: PPL-SPEC-000143 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    create and operator%= shall construct modulus-one congruences relating their operand expressions. The satisfying condition shall be E(x) − F(x) ∈ ℤ; a scalar operand shall denote a constant. The result dimension shall be the maximum operand dimension, including trailing zero coordinates. Sources shall be preserved. create shall use the requested representation; operator%= shall use default_representation. Reversing operands shall preserve the satisfying set, without requiring the same coefficient signs. The recycle-input constructor shall transfer an expression's coefficient value and representation, use its nonnegative modulus argument's entry value, and leave the transferred expression valid and independently destructible. A modulus borrowed from that expression shall be admitted. Numerical prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    The congruence construction symbol creates a descriptor rather than assigning to the affine operand.

    INTERFACE:
    static Congruence Congruence::create(const Linear_Expression& e1,
      const Linear_Expression& e2, Representation r = default_representation);
    static Congruence Congruence::create(const Linear_Expression& e,
      Coefficient_traits::const_reference n, Representation r = default_representation);
    static Congruence Congruence::create(Coefficient_traits::const_reference n,
      const Linear_Expression& e, Representation r = default_representation);
    Congruence operator%=(const Linear_Expression& e1, const Linear_Expression& e2);
    Congruence operator%=(const Linear_Expression& e, Coefficient_traits::const_reference n);
    Congruence(Linear_Expression& le, Coefficient_traits::const_reference m, Recycle_Input);
    
    VERIFICATION_CRITERIA:

    Compare all create/operator forms with independent rational operand differences, unequal dimensions, constants and variable conversions. Check modulus one, selected/default representation and unchanged sources.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000144
    4. Equality-constraint conversion and explicit modulus construction UID: PPL-SPEC-000144 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from an equality Constraint shall produce a modulus-zero congruence with the same satisfying valuations and dimension, using requested storage. A dimensioned overload shall apply coefficient truncation or zero extension as specified by 🔗 6. Congruence dimensions and coefficient-coordinate transformations. Inequality constraints shall be rejected with std::invalid_argument.

    operator/(c,m) for an equality constraint and nonnegative modulus m shall construct the congruence formed from that equality expression with modulus m. In particular a positive supplied modulus shall produce a proper congruence, while zero shall preserve equality. It shall preserve its source and use the default representation. Numerical prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    An equality can be viewed modulo zero or used as the coefficient source for a periodic condition with an explicitly selected modulus.

    INTERFACE:
    explicit Congruence(const Constraint& c,
                        Representation r = default_representation);
    Congruence(const Constraint& c, dimension_type new_space_dimension,
               Representation r = default_representation);
    Congruence operator/(const Constraint& c, Coefficient_traits::const_reference m);
    
    VERIFICATION_CRITERIA:

    Convert equalities in both representations, compare rational truth, resize during conversion and reject each inequality kind. Check explicit modulus zero and positive moduli independently, ensuring a positive modulus is not silently retained as equality.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000145
    5. Owned congruence values and representation conversion UID: PPL-SPEC-000145 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall preserve expression, modulus, dimension and source representation; the explicit-storage overload shall select its requested storage. Assignment shall copy the source's entry value and representation, return the target reference, preserve a distinct source and support self-assignment. Rvalue inputs shall admit those copy forms and preserve source value without requiring a distinct move operation. Distinct copies shall survive later source mutation or destruction.

    m_swap and PPL swap shall exchange complete values, dimensions and storage; self-swap shall preserve the value. representation() shall report current storage. Successful set_representation(r) shall change only storage, preserving exact exposed coefficients, modulus and dimension. Destruction shall release owned storage. Copy assignment or representation conversion failing while constructing a replacement shall preserve the target.

    RATIONALE:

    Modulus and expression form one owning value; changing coefficient storage does not normalize or reinterpret the relation.

    INTERFACE:
    Congruence(const Congruence& cg);
    Congruence(const Congruence& cg, Representation r);
    Congruence& Congruence::operator=(const Congruence& y);
    Congruence::~Congruence();
    Representation Congruence::representation() const;
    void Congruence::set_representation(Representation r);
    void Congruence::m_swap(Congruence& y);
    void swap(Congruence& x, Congruence& y);
    
    VERIFICATION_CRITERIA:

    Check owned copies, return identity, self/rvalue assignment, destruction independence, cross-storage conversions and swaps, exact field preservation and replacement-copy/conversion failures.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • 6. Congruence dimensions and coefficient-coordinate transformations UID: PPL-SPEC-000146 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall return the expression dimension limit and space_dimension() the public ambient dimension. Dimension arguments and results shall lie within the limit. Dimensioned copies and set_space_dimension(n) shall retain the constant and lower-index coefficients, zero-extend new coordinates or discard removed trailing coefficients, while preserving modulus. Copies without explicit storage shall retain source storage.

    swap_space_dimensions shall exchange two in-dimension coefficients. permute_space_dimensions shall require distinct in-dimension variables and move each cycle coefficient to the following coordinate, wrapping the last to the first. Empty/singleton cycles shall preserve the value. shift_space_dimensions(v,n) shall require v.id() <= space_dimension(), insert n zero coefficients before that position and increase dimension by n. These transformations shall retain modulus, constant term and representation. Discarding coefficients shall not mean existential projection of the original solution set.

    RATIONALE:

    Descriptor coordinates transform coefficient positions, independently of the arithmetic progression selected by the modulus.

    INTERFACE:
    static dimension_type Congruence::max_space_dimension();
    dimension_type Congruence::space_dimension() const;
    Congruence(const Congruence& cg, dimension_type new_space_dimension);
    Congruence(const Congruence& cg, dimension_type new_space_dimension, Representation r);
    void Congruence::set_space_dimension(dimension_type n);
    void Congruence::swap_space_dimensions(Variable x, Variable y);
    void Congruence::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Congruence::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Transform independent coefficient vectors and compare rational divisibility, including zero dimension, shrink/extend, nonzero discarded coefficients and front/interior/end insertion. Check constant, modulus and representation preservation.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000147
    7. Borrowed congruence coefficients, modulus and expression view UID: PPL-SPEC-000147 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    coefficient(v) shall return the indicated homogeneous coefficient when v.id() < space_dimension() and otherwise throw std::invalid_argument. inhomogeneous_term() and modulus() shall return the current constant and modulus. Configured reference returns shall borrow their owner until modification or destruction.

    expression() shall return a read-only borrowed adapter exposing the public affine expression with the same dimension, coefficients and constant. Uses covered here shall require the owner to remain alive and unchanged. Materializing the view as a Linear_Expression shall make an independent value. Queries shall preserve the congruence.

    RATIONALE:

    A congruence separates its affine expression from its modulus; neither returned view transfers ownership.

    INTERFACE:
    Coefficient_traits::const_reference Congruence::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Congruence::inhomogeneous_term() const &;
    Coefficient_traits::const_reference Congruence::modulus() const;
    typedef Expression_Adapter_Transparent<Linear_Expression> Congruence::expr_type;
    Congruence::expr_type Congruence::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check every exposed term, first/later rejected coordinates including dimension zero, copied borrowed values and independent materialized views after source mutation.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000148
    8. Explicit modulus replacement and multiplicative modulus syntax UID: PPL-SPEC-000148 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For nonnegative m, set_modulus(m) shall replace only the modulus with its input entry value, admitting a borrowed coefficient from the same congruence. Zero shall select equality. It shall preserve dimension and representation.

    For coefficient factor k, operator/=(k) shall multiply the entry modulus by |k|, preserving all affine coefficients and return the target reference. The factor may reference the modulus or a coefficient in the same object; its entry value shall be used. Nonmutating operator/ shall apply that operation to an independent copy, preserving the source. Multiplication by zero shall yield modulus zero; an existing zero modulus shall remain zero for any factor. These operations shall not divide the coefficients. Every computed absolute value/product shall satisfy 🔗 1. Affine congruence meaning and valid numerical use's arithmetic prerequisites.

    RATIONALE:

    The slash notation selects or multiplies a modulus, rather than performing affine division. Entry-value rules make borrowed scalar inputs unambiguous.

    INTERFACE:
    void Congruence::set_modulus(Coefficient_traits::const_reference m);
    Congruence& Congruence::operator/=(Coefficient_traits::const_reference k);
    Congruence operator/(const Congruence& cg, Coefficient_traits::const_reference k);
    
    VERIFICATION_CRITERIA:

    Check zero/positive modulus replacement, positive/negative/zero factors, chained factors, equality preservation, source independence and return identity. Exercise modulus self-alias, expression-coefficient factors and borrowed constant replacement within representable ranges.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000149
    9. Scaling expression and modulus together UID: PPL-SPEC-000149 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a nonnegative factor k, scale(k) shall multiply every homogeneous coefficient, the constant and modulus by the factor's entry value. Positive factors shall preserve the satisfying set. A zero factor shall produce the tautological equality with the same dimension. Dimension and representation shall be preserved.

    The factor shall not borrow a coefficient of the affine expression being modified. Borrowing the modulus shall be admitted and shall use its entry value consistently for expression and modulus. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Positive common scaling is a representation change; zero scaling deliberately collapses the condition to a tautology.

    INTERFACE:
    void Congruence::scale(Coefficient_traits::const_reference factor);
    
    VERIFICATION_CRITERIA:

    Compare all coefficient and modulus products independently for zero, one and larger positive factors. Check rational satisfaction preservation for positive factors, dimension retention for zero and self-modulus borrowing.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000150
    10. Sign, constant-residue and common-factor normalization UID: PPL-SPEC-000150 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    sign_normalize() shall negate the affine expression exactly when its first nonzero homogeneous coefficient is negative, preserving modulus. An expression without nonzero homogeneous coefficients shall retain its sign. normalize() shall apply that sign rule, then, for positive modulus m, replace the constant with its unique residue in [0, m). Zero-modulus normalization shall not reduce the constant by a modulus.

    strong_normalize() shall additionally divide the expression and modulus by their nonnegative common greatest divisor when that divisor exceeds one. The zero expression with positive modulus shall reduce to modulus one. Each operation shall preserve the satisfying set, dimension and representation and shall be idempotent. They may change the affine expression value while preserving the modular relation. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Canonical residue and scale conventions concern congruence meaning, not preservation of the unqualified affine expression value.

    INTERFACE:
    void Congruence::sign_normalize();
    void Congruence::normalize();
    void Congruence::strong_normalize();
    
    VERIFICATION_CRITERIA:

    Check first-nonzero signs, constant-only inputs, negative constants, zero modulus, common factors and zero expressions. Derive residues/GCDs independently and compare rational satisfaction before/after each normalization, with repeated application.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000151
    11. Congruence semantic equivalence UID: PPL-SPEC-000151 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Congruence operator== shall report whether equal-dimension operands admit the same rational valuations, independently of storage and equivalent common scales, signs or constant residues. Different public dimensions shall compare unequal. Tautologies of the same dimension shall compare equivalent, including zero-modulus and positive-modulus forms. The same shall hold for inconsistent congruences even when their moduli differ. operator!= shall negate that result. Both shall preserve operands. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Canonical coefficient comparison must still account for relations that denote the entire space or the empty set.

    INTERFACE:
    bool operator==(const Congruence& x, const Congruence& y);
    bool operator!=(const Congruence& x, const Congruence& y);
    
    VERIFICATION_CRITERIA:

    Check positive/common and negative expression scales, added modulus multiples in constants, non-equivalent periodic spacings, different dimensions and representations, and all constant tautology/inconsistency classes against independent rational predicates.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000152
    12. Rational affine substitution preimage of a congruence UID: PPL-SPEC-000152 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For an in-dimension variable v, an independent affine expression e of dimension at most the target dimension, and positive denominator q, affine_preimage(v,e,q) shall replace the congruence by the condition obtained by substituting xv = e(x) ⁄ q into its entry relation. The result shall retain the original public dimension and representation. If the entry coefficient of v is zero the congruence shall be unchanged. Otherwise its new modulus shall be qm; the new affine expression shall be q(E(x) − avvx) + ave(x). A bounded profile shall retain this storage formula whenever its completed values fit. If they do not fit, it may store an equivalent primitive row using a proper constant residue and positive common-factor cancellation, admitting only completed reduced values. The source expression shall be preserved. The denominator shall not borrow from the target's affine expression; borrowing its modulus shall be admitted using entry values. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Multiplying both substituted expression and modulus by the positive denominator represents rational substitution using integer coefficients.

    INTERFACE:
    void Congruence::affine_preimage(Variable v, const Linear_Expression& e,
                                   Coefficient_traits::const_reference denominator);
    
    VERIFICATION_CRITERIA:

    Evaluate the original congruence at independently substituted rational points and compare the result. Include zero/nonzero selected coefficients, source dimensions below/equal to target, constant/noninvertible substitutions, negative coefficients, equality/proper moduli and borrowed modulus denominator. Check the literal stored scale and signed constant for an admitted result with a nontrivial common factor, in both representations.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000153
    13. Reloadable congruence representation UID: PPL-SPEC-000153 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall write the full affine coefficient expression followed by the token m and its nonnegative modulus; ascii_dump() shall use std::cerr. Export shall preserve its source. For a complete compatible export with representable coefficients, ascii_load(s) shall return true and replace the target with those coefficients, dimension and modulus, retaining destination storage.

    Malformed or truncated expressions, missing/invalid modulus tokens, negative moduli and structurally invalid coefficient counts shall return false. If expression loading fails, ascii_load(s) shall return false without reading the modulus marker or value. Trailing input shall remain available. A failed load may modify the target; it shall remain destructible and admit complete valid replacement. No rollback or cross-version wire-format stability is promised. Allocation and configured numerical exceptions may propagate.

    RATIONALE:

    Expression syntax and modulus both need validation before a loaded object can be interpreted as a congruence.

    INTERFACE:
    void Congruence::ascii_dump(std::ostream& s) const;
    void Congruence::ascii_dump() const;
    bool Congruence::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip equality/proper, constant, gapped and trailing-zero forms across storage choices. Check exact coefficient/modulus preservation, rational meaning and trailing input; reject malformed/truncated expressions, negative modulus and invalid counts, and replace destinations after failures. Reject invalid expression prefixes followed by otherwise valid modulus suffixes, checking that those suffixes remain unread. Reject representable negative moduli through false with assertions enabled or disabled. Replace failed targets completely across storage representations, retaining modulus-zero equality and trailing input.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000156
    16. Congruence-system meaning and construction UID: PPL-SPEC-000156 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Congruence_System shall denote the conjunction of its retained congruences over rational coordinates. An empty conjunction shall be true. Default construction shall have dimension zero and no rows; the dimensioned empty constructor shall retain its supplied admitted dimension. A singleton constructor from a congruence shall copy that relation and its dimension. Construction from an equality constraint shall make its modulus-zero singleton; inequalities shall throw std::invalid_argument. Construction from a constraint system shall extract its equality rows and retain its ambient dimension, omitting inequalities.

    All constructors shall use requested storage, with default_representation equal to SPARSE. zero_dim_empty() shall borrow a dimension-zero inconsistent singleton, not an empty conjunction, until owning-thread finalization. Initialization, synchronization and numerical/failure preconditions shall follow 🔗 1. Affine congruence meaning and valid numerical use.

    RATIONALE:

    A system's conjunction and ambient space remain meaningful even without nontrivial rows. Equality extraction deliberately omits ordered inequalities.

    INTERFACE:
    class Congruence_System;
    static constexpr Representation Congruence_System::default_representation = SPARSE;
    explicit Congruence_System(Representation r = default_representation);
    explicit Congruence_System(dimension_type d, Representation r = default_representation);
    explicit Congruence_System(const Congruence& cg, Representation r = default_representation);
    explicit Congruence_System(const Constraint& c, Representation r = default_representation);
    explicit Congruence_System(const Constraint_System& cs, Representation r = default_representation);
    static const Congruence_System& Congruence_System::zero_dim_empty();
    
    VERIFICATION_CRITERIA:

    Check empty/singleton/shared inconsistent systems, positive-dimensional empty construction, equality/inequality conversion and extraction from mixed constraint systems using independent rational conjunctions.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000157
    17. Owned congruence systems, storage conversion and descriptor equality UID: PPL-SPEC-000157 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction and assignment shall preserve the system's row sequence, conjunction and declared dimension; ordinary copies and assignment shall retain source representation, while an explicit-storage copy shall use its argument. Assignment shall return the target, preserve a distinct source, support self-assignment and retain the source when using rvalue copy forms. Copies shall remain independent after source modification or destruction. Swaps shall exchange complete values, dimensions and storage, including self-swap. Successful representation conversion shall select requested dense or sparse storage for all rows without changing their conjunction or dimension. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Affine congruence meaning and valid numerical use.

    is_equal_to and system operator== shall test equal declared dimensions and matching retained row counts/order, comparing corresponding congruences semantically. They shall not decide whether differently ordered or redundant systems denote the same conjunction. Storage choice shall not change this comparison. Destruction shall release owned rows.

    RATIONALE:

    Owned row-sequence comparison is distinct from semantic equality of conjunctions, but ambient dimension remains part of an exact descriptor comparison.

    INTERFACE:
    Congruence_System(const Congruence_System& cgs);
    Congruence_System(const Congruence_System& cgs, Representation r);
    Congruence_System& Congruence_System::operator=(const Congruence_System& y);
    Congruence_System::~Congruence_System();
    Representation Congruence_System::representation() const;
    void Congruence_System::set_representation(Representation r);
    void Congruence_System::m_swap(Congruence_System& y);
    void swap(Congruence_System& x, Congruence_System& y);
    bool Congruence_System::is_equal_to(const Congruence_System& y) const;
    bool operator==(const Congruence_System& x, const Congruence_System& y);
    
    VERIFICATION_CRITERIA:

    Check copy/self/rvalue operations, swaps, storage conversion and independence. Compare matching sequences across storage, changed/reordered rows, different row counts, and empty systems whose declared dimensions differ.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000158
    18. System insertion, ownership transfer and coordinate changes UID: PPL-SPEC-000158 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion of a congruence, equality constraint or congruence system shall conjoin copies, preserving sources and target representation. Inequality constraints shall throw std::invalid_argument. Single congruence and constraint insertion shall strongly normalize the inserted copy. Result dimension shall be the maximum input dimension, zero-extending shorter rows. Ordinary self-system insertion and insertion of a borrowed row from the target shall be admitted using entry values.

    Rvalue insertion shall conjoin transferred relations, requiring a source distinct from the target system and not borrowing one of its rows. Transferred inputs shall remain destructible. Successful recycled-system insertion shall clear the source to a dimension-zero empty system. clear() shall likewise remove all rows and reset dimension zero while retaining storage.

    space_dimension() shall report ambient dimension, and max_space_dimension() the congruence limit. Successful set_space_dimension(n) shall resize all row coefficients by truncation or zero extension and retain moduli. Swapping/permuting system coordinates shall apply 🔗 6. Congruence dimensions and coefficient-coordinate transformations to every row. Dimension and variable arguments shall satisfy that contract's bounds. These are coefficient transformations rather than existential projection.

    Const row sources, including const rvalues, shall use preserving insertion. Const system sources shall likewise use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Copying and recycling have different source-ownership consequences, while their resulting conjunction and coordinate alignment must agree.

    INTERFACE:
    void Congruence_System::insert(const Congruence& cg);
    void Congruence_System::insert(Congruence&& cg);
    void Congruence_System::insert(const Constraint& c);
    void Congruence_System::insert(const Congruence_System& y);
    void Congruence_System::insert(Congruence_System&& y);
    void Congruence_System::clear();
    static dimension_type Congruence_System::max_space_dimension();
    dimension_type Congruence_System::space_dimension() const;
    void Congruence_System::set_space_dimension(dimension_type n);
    void Congruence_System::swap_space_dimensions(Variable x, Variable y);
    void Congruence_System::permute_space_dimensions(const std::vector<Variable>& cycle);
    
    VERIFICATION_CRITERIA:

    Check mixed dimensions, duplicates, borrowed-row and self-system ordinary insertion, recycled rows/systems, rejected inequalities, clear/reuse and coordinate transformations against independently evaluated conjunctions. Check source preservation for copy forms and source clearing for successful recycled systems.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000159
    19. Filtered system iteration, emptiness and retained row counts UID: PPL-SPEC-000159 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    begin() and end() shall delimit retained nontautological rows. empty() shall report that this range is empty and shall not decide satisfiability of a nonempty conjunction. Exposed rows shall share the system's declared dimension. has_linear_equalities(), num_equalities() and num_proper_congruences() shall inspect/count retained stored rows, including tautologies omitted by public iteration.

    The forward iterator shall borrow its system, expose row references/pointers, and support copied or assigned independent positions. Prefix increment shall return the advanced iterator; postfix shall return its entry-position copy. Comparison shall require positions in the same unchanged system. Default iterators shall admit copying, assignment and destruction before being assigned a valid position. Mutation/destruction shall invalidate iterators and borrowed rows.

    RATIONALE:

    Public iteration suppresses tautologies, whereas retained row-kind counts describe stored rows rather than the mathematical rank or minimum description.

    INTERFACE:
    class Congruence_System::const_iterator;
    Congruence_System::const_iterator Congruence_System::begin() const;
    Congruence_System::const_iterator Congruence_System::end() const;
    bool Congruence_System::empty() const;
    bool Congruence_System::has_linear_equalities() const;
    dimension_type Congruence_System::num_equalities() const;
    dimension_type Congruence_System::num_proper_congruences() const;
    
    Congruence_System::const_iterator::const_iterator();
    Congruence_System::const_iterator::const_iterator(const const_iterator& y);
    Congruence_System::const_iterator::~const_iterator();
    Congruence_System::const_iterator& Congruence_System::const_iterator::operator=(const const_iterator& y);
    const Congruence& Congruence_System::const_iterator::operator*() const;
    const Congruence* Congruence_System::const_iterator::operator->() const;
    Congruence_System::const_iterator& Congruence_System::const_iterator::operator++();
    Congruence_System::const_iterator Congruence_System::const_iterator::operator++(int);
    bool Congruence_System::const_iterator::operator==(const const_iterator& y) const;
    bool Congruence_System::const_iterator::operator!=(const const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty, tautology-only, mixed and inconsistent systems; verify retained counts separately from public-range length. Exercise prefix/postfix, copied/default-assigned positions, borrowed pointer identity and shared row dimensions.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000160
    20. Reloadable congruence-system representation UID: PPL-SPEC-000160 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export stored row count, public dimension, representation choice and every full congruence row; ascii_dump() shall write that representation on std::cerr. Export shall preserve the source. A complete compatible export with representable coefficients shall load with true, replacing the target conjunction, dimension, stored rows and encoded representation choice.

    Malformed/truncated headers or rows, invalid modulus or coefficient structure, and inconsistent encoded row dimensions shall return false rather than be accepted as a valid system. Trailing input shall remain available. Failure may modify a destination but shall leave it destructible and replaceable by a complete valid load. No rollback or cross-version format stability is promised. Allocation and configured numerical exceptions may propagate. The decoded row count shall be nonnegative and fit the row container. The decoded header dimension shall be nonnegative and shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    Reloading must retain the system's ambient coordinate context as well as its modular rows.

    INTERFACE:
    void Congruence_System::ascii_dump(std::ostream& s) const;
    void Congruence_System::ascii_dump() const;
    bool Congruence_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimension, equality/proper and duplicate/tautology-containing systems through initial destination storage choices. Check encoded representation, dimensions and independent rational truth; reject malformed/truncated headers and rows and incompatible row dimensions. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • 1. Constraint relation meaning and numerical prerequisites UID: PPL-SPEC-000101 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Constraint of dimension d shall describe one relation on rational valuations x ∈ ℚd. With its exposed expression E(x) = b + ∑d − 1i = 0aixi, its three types shall mean E(x) = 0, E(x) ≥ 0 and E(x) > 0, respectively. A coefficient belonging to an internal strictness representation shall not be exposed as a coordinate of this relation.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization. The caller shall synchronize any access overlapping modification of the same object. Both DENSE and SPARSE storage shall be supported and default_representation shall be SPARSE. Computed construction, conversion, normalization, dimension transformation and comparison guarantees shall require representability of every evaluated coefficient arithmetic step in the selected coefficient profile. Unchecked completion shall not establish this precondition. Allocation and configured numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete constraint. Distinct, unchanged sources shall survive a reported failure; otherwise a modified destination shall remain destructible, without a universal unchanged-state guarantee.

    RATIONALE:

    Constraint meaning concerns the admitted valuations, rather than a particular coefficient scale or hidden strictness column.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Constraint;
    enum Constraint::Type { EQUALITY, NONSTRICT_INEQUALITY, STRICT_INEQUALITY };
    static constexpr Representation Constraint::default_representation = SPARSE;
    
    VERIFICATION_CRITERIA:

    Evaluate exposed affine expressions with independent rational arithmetic, testing equality, strict boundaries and nonstrict boundaries. Include zero-dimensional relations and trailing unused coordinates in both representations. Check numerical-profile preconditions separately from relation truth.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000102
    2. Relational construction from affine operands UID: PPL-SPEC-000102 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The relational operators ==, >=, <=, > and < applied to affine operands shall construct constraints denoting those mathematical relations. They shall accept two expressions, two variables, or an expression and a coefficient in either order. Variables shall denote coordinate functions and coefficients shall denote constants. The result dimension shall be the maximum operand dimension, including unused trailing coordinates. Equality shall have type EQUALITY; the ordered operators shall select the corresponding strict or nonstrict inequality type. Operands shall be preserved. Results shall use Constraint::default_representation.

    Coefficient normalization may rescale the relation without changing its truth. For equalities and closed nonstrict inequalities produced directly by these operators, coefficients and the constant term shall have common divisor one unless all are zero. Equality's first nonzero homogeneous coefficient shall be positive; inequality orientation shall be preserved. These conventions shall not imply that every later strict constraint has a primitive exposed coefficient vector. The prerequisites of 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    Relational operators construct geometric descriptors; expression equality here does not return a boolean expression-value comparison.

    INTERFACE:

    For Linear_Expression operands e and f, Variable operands x and y, and Coefficient operand n, the following forms shall be admitted in a C++ function using PPL names:

    Constraint ee_equal(e == f), vv_equal(x == y), en_equal(e == n), ne_equal(n == e);
    Constraint ee_ge(e >= f), vv_ge(x >= y), en_ge(e >= n), ne_ge(n >= e);
    Constraint ee_le(e <= f), vv_le(x <= y), en_le(e <= n), ne_le(n <= e);
    Constraint ee_gt(e > f), vv_gt(x > y), en_gt(e > n), ne_gt(n > e);
    Constraint ee_lt(e < f), vv_lt(x < y), en_lt(e < n), ne_lt(n < e);
    
    VERIFICATION_CRITERIA:

    Compare all overloads with independently evaluated operand relations at rational points on and around boundaries. Include unequal dimensions in both orders, common coefficient factors, equal operands, constants of both signs and unchanged sources. Check relation type, declared dimensions and the stated normalization conventions.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000103
    3. Default and shared zero-dimensional constraints UID: PPL-SPEC-000103 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Default construction with optional representation shall yield a dimension-zero nonstrict tautology with expression zero. The requested representation shall be used. zero_dim_false() shall return a borrowed dimension-zero inconsistent equality; zero_dim_positivity() shall return a borrowed dimension-zero nonstrict tautology with a positive constant term. Shared objects shall remain usable until their owning initialized thread is finalized. Copying a shared object shall create an independently owned value.

    RATIONALE:

    An empty coordinate space still admits true and false relations, with lifetime distinct from a client-owned copy.

    INTERFACE:
    explicit Constraint(Representation r = default_representation);
    static const Constraint& Constraint::zero_dim_false();
    static const Constraint& Constraint::zero_dim_positivity();
    
    VERIFICATION_CRITERIA:

    Check default type, value and requested representation; classify both shared constants independently; copy them into owned objects and exercise copies during a balanced initialized lifetime.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000104
    4. Owned constraint copying, assignment and swapping UID: PPL-SPEC-000104 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Ordinary copy construction shall preserve relation type, exposed coefficients, constant term, dimension and representation. Explicit-representation copying shall use the requested representation. Copy assignment shall replace the target with the source's entry value and representation, preserve a distinct source and return the target reference. Self-assignment shall preserve the constraint. Rvalue arguments shall admit these copy forms without requiring a distinct move operation; the source shall retain its value.

    Distinct copies shall remain independent of later mutation and destruction. m_swap and the PPL swap overload shall exchange complete constraint values, including dimensions and representation. Self-swap shall preserve the value. Destruction shall release owned storage. Failure while constructing a replacement for copy assignment shall leave the target unchanged.

    RATIONALE:

    Constraint values own their storage even when constructed from borrowed expression views or shared constants.

    INTERFACE:
    Constraint(const Constraint& c);
    Constraint(const Constraint& c, Representation r);
    Constraint& Constraint::operator=(const Constraint& c);
    Constraint::~Constraint();
    void Constraint::m_swap(Constraint& y);
    void swap(Constraint& x, Constraint& y);
    
    VERIFICATION_CRITERIA:

    Check all relation types, dense/sparse copy combinations, return identity, self-assignment, rvalue copies, mutation independence, retained copies after source destruction, both swap forms and replacement-copy failures.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000105
    5. Constraint representation conversion UID: PPL-SPEC-000105 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report the current coefficient storage. For r equal to DENSE or SPARSE, successful set_representation(r) shall preserve relation type, every exposed coefficient, constant term and dimension, and select r. Repeating the current choice shall preserve the object. A failed replacement allocation shall leave the original representation and value unchanged.

    RATIONALE:

    Storage conversion must preserve the complete descriptor rather than only its satisfying set.

    INTERFACE:
    Representation Constraint::representation() const;
    void Constraint::set_representation(Representation r);
    
    VERIFICATION_CRITERIA:

    Convert equality, nonstrict and strict constraints both ways, including zero-dimensional and trailing-zero cases. Check exact coefficients and independent satisfaction before and after conversion; inject conversion allocation failures.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • 6. Constraint dimensions and explicit coordinate transformations UID: PPL-SPEC-000106 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall report the expression dimension limit and space_dimension() shall report the constraint's public ambient dimension. Dimension arguments and resulting dimensions shall not exceed that limit; all referenced existing coordinates shall lie within the current dimension.

    Dimensioned copy construction and set_space_dimension(n) shall retain coordinates below the lesser dimension and the constant term, insert zero coefficients on extension, and discard removed trailing coefficients on shrinking. Normalization may rescale retained coefficients without changing the transformed relation. Dimensioned copies without an explicit storage choice shall retain source representation. remove_space_dimensions(vars) shall discard selected coefficients, compact surviving coordinates in their original order, and return true. Removing none or all shall be admitted.

    swap_space_dimensions shall exchange the designated coefficients; permute_space_dimensions shall require a cycle of distinct coordinates and move each listed coefficient to the next listed coordinate, wrapping the last to the first. Cycles of fewer than two entries shall preserve the value. shift_space_dimensions(v,n) shall insert n zero coordinate coefficients before v.id(), where v.id() <= space_dimension(), shifting the suffix and increasing the public dimension by n. A zero shift shall preserve value. These operations shall preserve relation type and representation. They shall describe coefficient transformation rather than existential projection of satisfying points. Arithmetic prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    Descriptor coordinate removal substitutes zero for removed terms before reindexing; it does not eliminate variables existentially.

    INTERFACE:
    static dimension_type Constraint::max_space_dimension();
    dimension_type Constraint::space_dimension() const;
    Constraint(const Constraint& c, dimension_type space_dim);
    Constraint(const Constraint& c, dimension_type space_dim, Representation r);
    void Constraint::set_space_dimension(dimension_type n);
    bool Constraint::remove_space_dimensions(const Variables_Set& vars);
    void Constraint::swap_space_dimensions(Variable x, Variable y);
    void Constraint::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Constraint::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Transform independent coefficient vectors and compare relation truth at rational valuations. Include strict constraints so hidden strictness storage cannot be exposed or lost; test shrinking, extending, empty/all removals, inverse swaps/cycles and insertion at front/interior/end.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000107
    7. Constraint kind, coefficients and borrowed expression access UID: PPL-SPEC-000107 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    type() and the four kind predicates shall identify equality, either inequality, nonstrict inequality and strict inequality exactly. coefficient(v) shall return the corresponding homogeneous coefficient when v.id() < space_dimension() and otherwise throw std::invalid_argument. inhomogeneous_term() shall return the public constant term. A configured reference return shall remain borrowed until modification or destruction of its owning constraint.

    expression() shall return a read-only borrowed adapter exposing precisely the affine expression in 🔗 1. Constraint relation meaning and numerical prerequisites, with the same public dimension, homogeneous coefficients and constant term and without a hidden strictness coordinate. The view shall require its owning constraint to remain alive and unchanged for the uses covered here. Materializing it as a Linear_Expression shall produce an independent value. Queries shall preserve their source.

    RATIONALE:

    Public affine coefficients have geometric meaning independently of internal representation columns.

    INTERFACE:
    Constraint::Type Constraint::type() const;
    bool Constraint::is_equality() const;
    bool Constraint::is_inequality() const;
    bool Constraint::is_nonstrict_inequality() const;
    bool Constraint::is_strict_inequality() const;
    Coefficient_traits::const_reference Constraint::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Constraint::inhomogeneous_term() const &;
    typedef Expression_Hide_Last<Linear_Expression> Constraint::expr_type;
    Constraint::expr_type Constraint::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check all type/predicate combinations and in-range coefficients for each relation type. Reject the first and a later out-of-range coordinate, including dimension zero. Copy each view to a standalone expression and verify dimensions/coefficients and independence after source mutation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000108
    8. Exact tautology and inconsistency classification UID: PPL-SPEC-000108 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_tautological() shall hold exactly when every rational valuation in the declared ambient dimension satisfies the constraint. is_inconsistent() shall hold exactly when none does. An expression with a nonzero public homogeneous coefficient shall satisfy neither predicate. For constant b, equality shall be tautological exactly at b = 0 and inconsistent otherwise; nonstrict inequality shall be tautological at b ≥ 0 and inconsistent at b < 0; strict inequality shall be tautological at b > 0 and inconsistent at b ≤ 0. These queries shall preserve the object.

    RATIONALE:

    A single affine relation can be classified completely from its coefficients; a system of nontrivial constraints requires separate satisfiability analysis.

    INTERFACE:
    bool Constraint::is_tautological() const;
    bool Constraint::is_inconsistent() const;
    
    VERIFICATION_CRITERIA:

    Exhaust constant signs for every relation type at zero and positive dimensions. Check nonconstant constraints with independent witnesses satisfying and violating the relation, including strict boundaries and both storage choices.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000109
    9. Semantic equivalence and exact descriptor identity UID: PPL-SPEC-000109 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_equivalent_to(y) and constraint operator== shall report equality of the satisfying sets when the public dimensions agree, independently of storage and internal strictness topology. Different public dimensions shall compare nonequivalent. Tautologies of the same dimension shall be equivalent even if their types or constant forms differ; the same shall hold for inconsistent constraints. Nontrivial equivalence shall respect relation type, positive rescaling of inequalities, and arbitrary nonzero rescaling of equalities. Inequality expressions shall negate semantic equivalence.

    is_equal_to(y) shall report complete identity of the stored normalized descriptor, including internal topology, relation kind, coefficient sequence and dimension, independently of dense/sparse storage. A positive identity result shall imply semantic equivalence; a negative result shall not establish nonequivalence. Queries shall preserve operands. Numerical prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    Mathematical equivalence and stored identity support different client decisions, especially for strict constraints and constant relations.

    INTERFACE:
    bool Constraint::is_equivalent_to(const Constraint& y) const;
    bool Constraint::is_equal_to(const Constraint& y) const;
    bool operator==(const Constraint& x, const Constraint& y);
    // Inequality uses C++20 rewriting of operator==.
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Check equivalent positive/negative equality scales, positive inequality scales, different relations and dimensions, cross-representation copies, all tautology/inconsistency forms and public nonstrict constraints obtained through NNC systems. Validate equivalence expectations with independent rational truth conditions, rather than using the query as its own oracle.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • 10. Conversion of equality congruences to constraints UID: PPL-SPEC-000110 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from a zero-modulus Congruence shall yield an equality constraint with the same public dimension and satisfying valuations, using the requested representation. Normalization may rescale its coefficients. The source shall remain unchanged. A proper congruence with nonzero modulus shall be rejected with std::invalid_argument and shall not yield a constraint. Numerical prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    A congruence with nonzero modulus denotes a periodic condition and cannot be silently reinterpreted as equality.

    INTERFACE:
    explicit Constraint(const Congruence& cg,
                        Representation r = default_representation);
    
    VERIFICATION_CRITERIA:

    Convert zero-modulus congruences with both coefficient signs, constants and trailing zeros in both representations. Compare rational equality truth independently. Reject positive-modulus proper congruences and check source preservation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000111
    11. Reloadable constraint representation UID: PPL-SPEC-000111 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export all fields needed to reload the constraint: its full stored coefficient expression, relation token and topology token. ascii_dump() shall use std::cerr. Export shall preserve its source. For compatible complete exported data with representable coefficients, ascii_load(s) shall return true and replace the destination's stored relation, dimension and coefficients, retaining the destination storage choice. It shall preserve the source relation's satisfying set and public kind.

    Malformed expression, relation or topology tokens, missing coefficient slots, truncated input, violations of the checked row invariants and inconsistent encoded relation/type combinations shall return false. The expression slot count shall include the constant and any required internal strictness slot; invalid counts shall not be accepted as valid relations. If expression loading fails, ascii_load(s) shall return false without reading the relation or topology suffix. Trailing input shall remain available to the caller. A failed load may change the destination; it shall remain destructible and admit replacement by a subsequent complete valid load. No rollback or cross-version format stability is promised. Allocation and configured numerical exceptions may propagate.

    RATIONALE:

    A reloadable constraint must retain strictness and public dimensions rather than merely a printed inequality.

    INTERFACE:
    void Constraint::ascii_dump(std::ostream& s) const;
    void Constraint::ascii_dump() const;
    bool Constraint::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip every relation type, constants, sparse gaps and trailing dimensions through both producer/destination representations. Compare exposed coefficients, kind and rational truth. Test malformed/truncated expressions and relation/topology fields, invalid counts, trailing-input preservation and complete replacement after reported failure. Reject invalid expression prefixes followed by otherwise valid relation/topology suffixes, checking that those suffixes remain unread. Reject missing NNC epsilon storage and nonzero equality epsilon across source/destination representations. Preserve the exported internal epsilon bounds, including positive epsilon inequalities. Exercise both inequality strictness signs, trailing input and complete valid replacement after false.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • 14. Constraint-system conjunction, construction and shared contradiction UID: PPL-SPEC-000114 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Constraint_System shall denote the conjunction of its constraints over its declared rational coordinate space. An empty conjunction shall be true. An empty public range shall not mean an inconsistent set. Conversely, zero_dim_empty() shall return a borrowed, dimension-zero system containing an inconsistent equality and denoting the empty set of valuations. That shared system shall remain alive until its owning initialized thread is finalized.

    Default construction shall create a dimension-zero system with no constraints. Construction from one constraint shall create its singleton conjunction and use that constraint's public dimension. Both shall use the requested representation; default_representation shall be SPARSE. Construction shall own its stored values independently of the source. Use shall satisfy 🔗 1. Constraint relation meaning and numerical prerequisites's initialization, synchronization, arithmetic and failure prerequisites.

    RATIONALE:

    The empty constraint list denotes the universe, whereas an inconsistent singleton denotes no points; the word empty has distinct container and geometric uses.

    INTERFACE:
    class Constraint_System;
    static constexpr Representation Constraint_System::default_representation = SPARSE;
    explicit Constraint_System(Representation r = default_representation);
    explicit Constraint_System(const Constraint& c,
                               Representation r = default_representation);
    static const Constraint_System& Constraint_System::zero_dim_empty();
    
    VERIFICATION_CRITERIA:

    Evaluate default, singleton and shared inconsistent systems independently at rational points. Check dimensions, requested representations, source independence and the distinction between no constraints and no satisfying valuation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000115
    15. Constraint-system owned values and representation conversion UID: PPL-SPEC-000115 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    System copy construction shall preserve the conjunction, dimension and representation; the explicit-representation overload shall use its requested storage. Copy assignment shall replace the target with an independent copy of the source's entry value and representation, preserve a distinct source and return the target reference. Self-assignment shall preserve the system. Rvalue arguments shall admit the copy forms without requiring a distinct move operation, retaining source value. Copies shall survive later source modification or destruction.

    m_swap and the PPL swap overload shall exchange entire system values, dimensions and representations. Self-swap shall preserve the system. representation() shall report current storage. Successful set_representation(r) for DENSE or SPARSE shall select that storage for the system and its rows while preserving conjunction and dimension. Destruction shall release owned storage. Copy-assignment replacement failure shall preserve the target. Other failure guarantees shall follow 🔗 1. Constraint relation meaning and numerical prerequisites.

    RATIONALE:

    Systems are owning values whose storage may change without altering the conjunction they denote.

    INTERFACE:
    Constraint_System(const Constraint_System& cs);
    Constraint_System(const Constraint_System& cs, Representation r);
    Constraint_System& Constraint_System::operator=(const Constraint_System& y);
    Constraint_System::~Constraint_System();
    Representation Constraint_System::representation() const;
    void Constraint_System::set_representation(Representation r);
    void Constraint_System::m_swap(Constraint_System& y);
    void swap(Constraint_System& x, Constraint_System& y);
    
    VERIFICATION_CRITERIA:

    Check both storage choices and conversions for empty, equality, inequality and mixed strict systems. Check copy independence, retained copies after destruction, assignment return identity, self/rvalue use, swaps and unchanged conjunction under conversion using independent rational evaluation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000116
    16. System insertion, dimension adjustment and clearing UID: PPL-SPEC-000116 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    insert(const Constraint&) shall conjoin a copy of its source with the system's existing meaning, preserve the source constraint and retain system representation. The resulting dimension shall be the maximum of old system and inserted constraint dimensions. Rows with fewer coordinates shall be extended with zero coefficients. Inserting duplicates or tautologies shall preserve the corresponding conjunction; insertion of an inconsistent constraint shall make it unsatisfiable. Retrievable rows need only describe an equivalent conjunction and need not preserve insertion order or duplicate multiplicity.

    Rvalue insertion shall have the same mathematical, coordinate and topology semantics while permitting reuse of source storage. The source shall not borrow a row of the receiving system and shall remain destructible and assignable, with no unchanged-value guarantee. Const sources, including const rvalues, shall use preserving insertion.

    max_space_dimension() shall return the constraint dimension limit. space_dimension() shall return the declared system dimension. set_space_dimension(n) shall require an admitted result dimension and apply the constraint coordinate-resizing semantics in 🔗 6. Constraint dimensions and explicit coordinate transformations to its rows; an empty system may retain a positive dimension. clear() shall remove all constraints and reset dimension zero, retaining representation. These are descriptor transformations and do not promise existential projection when nonzero coefficients are discarded. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Insertion must align coordinates and distinguish preserving inputs from explicitly consumed sources. Declared dimensions also matter for empty systems.

    INTERFACE:
    void Constraint_System::insert(const Constraint& c);
    void Constraint_System::insert(Constraint&& c);
    static dimension_type Constraint_System::max_space_dimension();
    dimension_type Constraint_System::space_dimension() const;
    void Constraint_System::set_space_dimension(dimension_type n);
    void Constraint_System::clear();
    
    VERIFICATION_CRITERIA:

    Insert different-dimension equality, nonstrict and strict constraints in multiple orders, duplicates, tautologies and contradictions. Compare conjunction truth over independent valuations. Check source preservation, empty-system extension, nonzero coefficient truncation, clear and reuse. Check const and borrowed row insertion into both representations, matching and differing topology, and smaller/equal/larger declared row dimensions; verify NNC epsilon placement, independent conjunction and source preservation.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000117
    17. System emptiness and retained constraint-kind queries UID: PPL-SPEC-000117 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    empty() shall return whether the public iterator range has no nontrivial constraints. Tautological stored rows shall be omitted from that range, so a system containing only tautologies shall be empty under this query. The query shall not determine whether a nonempty conjunction is satisfiable.

    has_equalities() shall report whether a retained stored row is an equality, including a tautological equality omitted by public iteration. has_strict_inequalities() shall report whether a retained row is a nontautological strict inequality; tautological strict rows and internal strictness bounds shall not make it true. These properties shall concern the retained descriptor representation and shall not claim a minimal equivalent system. Queries shall preserve conjunction and dimensions.

    RATIONALE:

    Container emptiness and stored relation kinds differ from the satisfiability of a conjunction, and public iteration deliberately omits tautologies.

    INTERFACE:
    bool Constraint_System::empty() const;
    bool Constraint_System::has_equalities() const;
    bool Constraint_System::has_strict_inequalities() const;
    
    VERIFICATION_CRITERIA:

    Check truly empty and tautology-only systems, tautological equality rows, strict tautologies, nontrivial strict rows and inconsistent rows. Use a contradictory pair of individually nontrivial inequalities to establish that nonempty is not a satisfiability decision.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000118
    18. Read-only forward iteration over nontrivial constraints UID: PPL-SPEC-000118 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    begin() and end() shall delimit the system's retained, non-tautological constraints. Each exposed row shall have the system's declared public dimension. Iteration order shall not be a semantic ordering guarantee. Dereference and member selection at a non-end position shall borrow its constraint. Prefix increment shall advance and return the iterator; postfix increment shall return an independent copy of its entry position.

    Iterator copy construction and assignment shall preserve the borrowed system and position while allowing subsequent navigation of independent copies. Iterators shall be compared only within the same unchanged system. Default iterators shall admit copying, assignment and destruction; they shall not be dereferenced or advanced until assigned a valid position. Modification or destruction of the system shall invalidate its iterators and borrowed row references.

    RATIONALE:

    Read-only iteration exposes an equivalent conjunction while preserving ownership in the system and filtering tautologies.

    INTERFACE:
    typedef Constraint_System_const_iterator Constraint_System::const_iterator;
    Constraint_System::const_iterator Constraint_System::begin() const;
    Constraint_System::const_iterator Constraint_System::end() const;
    Constraint_System_const_iterator();
    Constraint_System_const_iterator(const Constraint_System_const_iterator& y);
    Constraint_System_const_iterator::~Constraint_System_const_iterator();
    Constraint_System_const_iterator&
    Constraint_System_const_iterator::operator=(const Constraint_System_const_iterator& y);
    const Constraint& Constraint_System_const_iterator::operator*() const;
    const Constraint* Constraint_System_const_iterator::operator->() const;
    Constraint_System_const_iterator& Constraint_System_const_iterator::operator++();
    Constraint_System_const_iterator Constraint_System_const_iterator::operator++(int);
    bool Constraint_System_const_iterator::operator==(const Constraint_System_const_iterator& y) const;
    bool Constraint_System_const_iterator::operator!=(const Constraint_System_const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty and tautology-filtered ranges and mixed relation kinds; compare the iterated conjunction with an independent oracle. Check copied/default-assigned positions, prefix return identity, postfix entry position, pointer/reference identity and row dimensions.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000119
    19. Reloadable constraint-system representation UID: PPL-SPEC-000119 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export the system's complete stored coefficient rows, public dimension, topology, representation choice and row-state fields needed for compatible reloading. ascii_dump() shall use std::cerr. Export shall preserve the source.

    Loading a complete compatible export with representable coefficients shall return true and replace the destination with the encoded system, retaining its conjunction, public dimension and encoded representation choice. Malformed or truncated headers, row data, relation/topology fields and inconsistent encoded dimensions or row-state fields shall be reported by false rather than accepted as a valid system. Trailing input after the representation shall remain available. Failure may change the destination; it shall remain destructible and admit complete valid replacement. No rollback or cross-version format stability is promised. Allocation and configured numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    System reload preserves its conjunction and coordinate context, including fields that a human-readable list does not encode.

    INTERFACE:
    void Constraint_System::ascii_dump(std::ostream& s) const;
    void Constraint_System::ascii_dump() const;
    bool Constraint_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimension, singleton, duplicate/tautology-containing and mixed strict systems across initial destination choices. Compare dimensions, encoded representation and independent rational conjunction truth. Check malformed/truncated headers and rows, inconsistent counts/dimensions/state and replacement after failure. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000120
    20. Extracting equality constraints from a congruence system UID: PPL-SPEC-000120 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from a Congruence_System shall produce the conjunction of its zero-modulus equality rows converted according to 🔗 10. Conversion of equality congruences to constraints. Proper congruences shall be omitted rather than converted to equalities or used as periodic constraints. The result shall retain the congruence system's declared public dimension even when no equality survives, use the requested representation, and preserve its source. Arithmetic prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    The conversion extracts only the affine equality part of a congruence system; the result is not a representation of its periodic conditions.

    INTERFACE:
    explicit Constraint_System(const Congruence_System& cgs,
                               Representation r = default_representation);
    
    VERIFICATION_CRITERIA:

    Use mixed equality/proper-congruence systems, proper-only systems and empty systems with positive dimension. Compare the resulting equality conjunction independently over rational points, verify retained dimension/representation and unchanged source.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-001645
    1. Descriptor collection identity and affine comparison UID: PPL-SPEC-001645 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For live valid constraint systems or generator systems, free equality shall compare their retained internal row sequences under 🔗 22. Internal sequence equality and bookkeeping scope: ambient dimension, row count, pending boundary and corresponding row values shall agree. Storage representation, capacity and sorted certificates shall not affect the result. Inequality shall negate equality. These predicates shall preserve their operands. Equality shall not minimize, reorder, remove duplicate rows or decide geometric equivalence of the represented conjunctions or hulls. Row-empty systems shall follow the underlying dimension/boundary rule without an additional topology comparison.

    The free compare(x,y) for linear expressions shall forward the zero-extended affine ordering of 🔗 5. Backend equality, comparison and common-variable queries. It shall return -2 or 2 at the first differing homogeneous coefficient, -1 or 1 for a constant-only difference, and zero when all zero-extended coefficients agree. Equal affine values with different declared dimensions may therefore compare as zero. Initialization, coefficient arithmetic, lifetimes and synchronized access shall follow the selected descriptor or expression query.

    RATIONALE:

    Stored descriptor sequence identity and zero-extended affine ordering are useful implementation queries with meanings distinct from geometric set equivalence.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library unless stated otherwise.

    bool operator==(const Constraint_System&, const Constraint_System&);
    bool operator!=(const Constraint_System&, const Constraint_System&);
    bool operator==(const Generator_System&, const Generator_System&);
    bool operator!=(const Generator_System&, const Generator_System&);
    int compare(const Linear_Expression&, const Linear_Expression&);
    
    VERIFICATION_CRITERIA:

    Check copied and differently stored collections, differing dimensions, row order/count, duplicate rows and unchanged operands. Compare signed affine vectors, constant-only differences, unequal zero tails and both argument orders against literal expected return codes.

    SOURCE:

    src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; src/Linear_Expression_inlines.hh; tests/descriptorequalityspec1.cc.

  • 1. Internal affine value, coefficient storage and dispatch prerequisites UID: PPL-SPEC-001622 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For Row equal to Dense_Row or Sparse_Row, a live Linear_Expression_Impl<Row> of dimension d shall own d + 1 coefficient slots. Slot zero shall contain the constant; slot i + 1 shall contain the coefficient of Variable(i). Dense storage shall retain zero slots; valid sparse expression storage shall contain no explicit zero entries. Trailing zero coordinates shall retain the ambient dimension. representation() shall return DENSE or SPARSE accordingly, and max_space_dimension() shall equal Row::max_size()-1.

    Calls shall satisfy the initialization, synchronization, coefficient-range and resource conditions of 🔗 1. Affine value, numerical prerequisites and shared zero. Raw slot indices shall be in [0, d + 1) and half-open windows shall satisfy 0 ≤ s ≤ e ≤ d + 1. A new dimension shall fit the selected backend's maximum; its increment for the constant slot shall be representable. Internal coordinate transformations shall receive in-dimension variables, valid distinct permutation cycles, and growth within that maximum.

    An argument dispatched through Linear_Expression_Interface shall have one of these two concrete backend types. Dispatch shall preserve the operation's meaning for every dense/sparse pairing. Setters and dimension transformations shall implement the coefficient effects of 🔗 5. Ambient dimension queries and trailing-coordinate resizing, 🔗 6. Coefficient access, replacement and zero predicates and 🔗 12. Explicit coefficient-coordinate transformations on these admitted inputs. A const access shall borrow its coefficient according to the selected traits; reads beyond the homogeneous dimension through coefficient(v) shall return zero. Mutations shall invalidate borrowed positions according to their storage.

    The internal row_data() accessor shall borrow the complete read-only row only from a live lvalue expression. Mutable and const temporary expression owners shall be rejected. A row borrow shall not outlive its owner or a mutation that invalidates the underlying coefficient storage.

    coefficient_is_owned(n) shall identify a reference to a stored coefficient in assertion builds when coefficient arguments use reference traits, without changing the expression. With value traits or assertions disabled it shall return false. Internal scalar-independence preconditions shall apply in every build mode; that diagnostic predicate shall not replace them.

    RATIONALE:

    Raw coefficient indices and variable identifiers have different meanings. Internal callers supply the validated dimensions and storage assumptions used by the public interface.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    template <typename Row> class Linear_Expression_Impl;
    static dimension_type max_space_dimension();
    const Row& row_data() const &;
    const Row& row_data() const && = delete;
    Representation representation() const;
    dimension_type space_dimension() const;
    void set_space_dimension(dimension_type);
    Coefficient_traits::const_reference coefficient(Variable) const;
    Coefficient_traits::const_reference inhomogeneous_term() const;
    void set_coefficient(Variable, Coefficient_traits::const_reference);
    void set_inhomogeneous_term(Coefficient_traits::const_reference);
    void swap_space_dimensions(Variable, Variable);
    void shift_space_dimensions(Variable, dimension_type);
    void remove_space_dimensions(const Variables_Set&);
    void permute_space_dimensions(const std::vector<Variable>&);
    // Private diagnostic helper:
    bool coefficient_is_owned(const Coefficient&) const;
    
    VERIFICATION_CRITERIA:

    Check both concrete backends, constant-slot mapping, zero reads beyond the dimension, coordinate transformations and trait-dependent borrowing. Inspect interface dispatch and scalar guards; compare public and backend effects on admitted inputs. Admit read-only row borrows from mutable and const lvalues of both backend types, and reject temporary owners.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001623
    2. Independent backend construction, copying and affine arithmetic UID: PPL-SPEC-001623 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Default construction shall create the zero expression of dimension zero; coefficient and variable construction shall implement 🔗 2. Zero, constant, variable and dimensioned construction. The sizing constructor's Boolean argument shall distinguish its overload and shall not alter its meaning: it shall create the zero expression of the admitted requested dimension. Ordinary, cross-storage and interface-based copy construction shall produce independent coefficients. A dimensioned copy shall retain the selected prefix and zero-extend as necessary. Private construct helpers shall establish those same copied values. Destruction shall release the owned row without changing a distinct source.

    Backend affine additions, subtractions, multiplication, truncating division, negation, normalization and coordinate updates shall implement the value rules of 🔗 7. Affine addition, subtraction and negation, 🔗 8. Integral scalar multiplication and coefficient-wise division, 🔗 9. Explicit scaled accumulation, combination and elimination and 🔗 10. Coefficient normalization and sign normalization. Expression addition and subtraction shall admit self operands. Whole-expression combinations and scaled accumulations shall receive a distinct source; their scalar arguments shall be independent of modified target coefficients. Multiplication and division factors shall likewise be independent of the target. Division shall receive a nonzero divisor. Scaled variable accumulation shall retain the variable's dimension even for a zero factor; zero-factor scaled expression accumulation shall preserve the target's current dimension and value.

    The prerequisites of 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites shall apply. Each operation that returns a backend reference shall return its target. Distinct sources shall retain their values and dimensions.

    RATIONALE:

    Concrete storage and dynamic dispatch must preserve the public affine value while retaining the stronger internal operand-independence conditions.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    Linear_Expression_Impl();
    explicit Linear_Expression_Impl(Coefficient_traits::const_reference);
    Linear_Expression_Impl(Variable);
    Linear_Expression_Impl(dimension_type, bool);
    Linear_Expression_Impl(const Linear_Expression_Impl&);
    template <typename Other>
    Linear_Expression_Impl(const Linear_Expression_Impl<Other>&);
    Linear_Expression_Impl(const Linear_Expression_Interface&);
    Linear_Expression_Impl(const Linear_Expression_Interface&, dimension_type);
    ~Linear_Expression_Impl();
    Linear_Expression_Impl& operator+=(Coefficient_traits::const_reference);
    Linear_Expression_Impl& operator-=(Coefficient_traits::const_reference);
    Linear_Expression_Impl& operator+=(Variable);
    Linear_Expression_Impl& operator-=(Variable);
    Linear_Expression_Impl& operator+=(const Linear_Expression_Interface&);
    Linear_Expression_Impl& operator-=(const Linear_Expression_Interface&);
    Linear_Expression_Impl& operator*=(Coefficient_traits::const_reference);
    Linear_Expression_Impl& operator/=(Coefficient_traits::const_reference);
    void negate();
    void normalize();
    void sign_normalize();
    Linear_Expression_Impl& add_mul_assign(Coefficient_traits::const_reference, Variable);
    Linear_Expression_Impl& sub_mul_assign(Coefficient_traits::const_reference, Variable);
    void add_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Interface&);
    void sub_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Interface&);
    // Typed source overloads and private construct helpers:
    template <typename Other>
    Linear_Expression_Impl& operator+=(const Linear_Expression_Impl<Other>&);
    template <typename Other>
    Linear_Expression_Impl& operator-=(const Linear_Expression_Impl<Other>&);
    template <typename Other>
    void add_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Impl<Other>&);
    template <typename Other>
    void sub_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Impl<Other>&);
    template <typename Other> void construct(const Linear_Expression_Impl<Other>&);
    template <typename Other>
    void construct(const Linear_Expression_Impl<Other>&, dimension_type);
    
    VERIFICATION_CRITERIA:

    Compare copied, truncated and extended values across all storage pairings; mutate copies independently. Check exact coefficient-vector arithmetic, self addition/subtraction, zero factors and returned-target identity using existing public and direct-backend histories.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001624
    3. Raw coefficient access, zero ranges, gcd and support filtering UID: PPL-SPEC-001624 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, get(i) shall return the raw coefficient ai; set(i,n) shall replace it by the entry value of n, removing a sparse entry when zero. is_zero() shall test every slot; all_homogeneous_terms_are_zero() shall exclude slot zero.

    For an admitted window [s, e), all_zeroes shall test every slot, num_zeroes shall count zero slots, and gcd shall return the nonnegative greatest common divisor of those coefficients. An empty or all-zero window shall have gcd zero. The positive gcd shall be representable in the selected coefficient type. first_nonzero(s,e) and last_nonzero(s,e) shall return the least and greatest nonzero slot, respectively, or e if none exists. No-argument last_nonzero() shall return the greatest nonzero slot, or zero for the all-zero vector.

    all_zeroes(vars) shall test precisely the selected homogeneous coefficients. all_zeroes_except(vars,s,e) shall test the window after excluding the selected variable coefficients; slot zero shall never be excluded by a variable set. Empty windows shall satisfy both universal predicates. has_a_free_dimension_helper(indices) shall retain exactly those input raw indices whose coefficients are zero, inserting no new indices. Variable sets and raw indices shall be within the respective admitted extent. All queries shall preserve the expression.

    RATIONALE:

    Internal algebra uses raw coefficient windows, including the constant, and needs consistent empty-window results and absence sentinels.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    Coefficient_traits::const_reference get(dimension_type) const;
    void set(dimension_type, Coefficient_traits::const_reference);
    bool is_zero() const;
    bool all_homogeneous_terms_are_zero() const;
    bool all_zeroes(dimension_type start, dimension_type end) const;
    dimension_type num_zeroes(dimension_type start, dimension_type end) const;
    Coefficient gcd(dimension_type start, dimension_type end) const;
    dimension_type first_nonzero(dimension_type first, dimension_type last) const;
    dimension_type last_nonzero(dimension_type first, dimension_type last) const;
    dimension_type last_nonzero() const;
    bool all_zeroes(const Variables_Set&) const;
    bool all_zeroes_except(const Variables_Set&, dimension_type, dimension_type) const;
    void has_a_free_dimension_helper(std::set<dimension_type>&) const;
    
    VERIFICATION_CRITERIA:

    Compare every window of literal vectors with independent counts, gcds and nonzero positions. Enumerate variable masks and raw-index subsets; include nonzero constants, zero-dimensional expressions, empty windows, negative inputs and both storage types.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001625
    4. Range scaling and exact affine elimination UID: PPL-SPEC-001625 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, mul_assign(c,s,e) shall multiply exactly the raw slots in [s, e) by c; zero shall clear that window. exact_div_assign(c,s,e) shall divide those slots exactly by a nonzero c that divides every selected coefficient. negate(s,e) shall negate precisely those slots. Every operation shall retain dimension and all coefficients outside its window.

    For distinct target x and source y, range linear_combine shall assign xi :  = c1xi + c2yi from entry values for s ≤ i < e, with nonzero scalars. linear_combine_lax shall admit zero scalars as well. Both windows shall fit their respective expressions. Whole-expression forms shall use the maximum input dimension and zero-extend absent coordinates. Scalar arguments shall be live and independent of modified target coefficients. The source shall retain its value and dimension. Empty windows shall preserve the target; valid sparse results shall contain no explicit zeros.

    The raw-index elimination overload shall require equal dimensions, a distinct source and nonzero pivot coefficients xk, yk. With g = gcd(|xk|, |yk|) > 0, it shall replace every target coefficient by (yk ⁄ g)xi − (xk ⁄ g)yi. The selected pivot shall become zero. The variable overload shall use raw index v.space_dimension(). All evaluated coefficient arithmetic, including normalization factors, shall meet the selected profile's representability conditions.

    RATIONALE:

    Elimination is an exact integer combination with reduced factors. Windowed operations must preserve independent prefix and suffix coefficients across storage pairings.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    void mul_assign(Coefficient_traits::const_reference, dimension_type, dimension_type);
    void exact_div_assign(Coefficient_traits::const_reference, dimension_type, dimension_type);
    void negate(dimension_type, dimension_type);
    void linear_combine(const Linear_Expression_Interface&, Variable);
    void linear_combine(const Linear_Expression_Interface&, dimension_type);
    void linear_combine(const Linear_Expression_Interface&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    void linear_combine_lax(const Linear_Expression_Interface&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    void linear_combine(const Linear_Expression_Interface&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                        dimension_type, dimension_type);
    void linear_combine_lax(const Linear_Expression_Interface&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                            dimension_type, dimension_type);
    // Each linear-combination form also has a typed source overload:
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&, dimension_type);
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&, Variable);
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    template <typename Other>
    void linear_combine_lax(const Linear_Expression_Impl<Other>&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                        dimension_type, dimension_type);
    template <typename Other>
    void linear_combine_lax(const Linear_Expression_Impl<Other>&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                            dimension_type, dimension_type);
    
    VERIFICATION_CRITERIA:

    Use independent integer vectors for all four storage pairings, every admitted small window and signed/zero/unit factors. Check direct and interface-dispatched paths, outside-window preservation, source independence, exact-divisibility cases and the reduced pivot formula.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • 5. Backend equality, comparison and common-variable queries UID: PPL-SPEC-001626 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, full is_equal_to(y) shall require equal dimensions and equal raw coefficient vectors. Range equality shall compare only the admitted common window. Scaled range equality shall test c1xi = c2yi at every selected slot, including when either scalar is zero. Each evaluated scaled product shall be representable. Empty-window equality shall hold.

    compare(y) shall compare homogeneous coefficients in increasing variable order, treating absent trailing coefficients as zero, and compare the constant only if all homogeneous coefficients agree. It shall return -2 or 2 for the first homogeneous difference, -1 or 1 for a constant-only difference, and zero for equal zero-extended affine values. Consequently, different declared dimensions containing only additional zero coefficients may compare as zero while failing full dimension-sensitive equality.

    have_a_common_variable(y,first,last) shall hold exactly when some variable in the admitted half-open variable range has nonzero coefficients in both operands. Constants shall be irrelevant. All queries shall preserve their operands and shall have the same meaning through typed and interface dispatch.

    RATIONALE:

    Dimension-sensitive identity and affine-value ordering serve different internal purposes. Sparse support and dispatch must not change either result.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    bool is_equal_to(const Linear_Expression_Interface&) const;
    bool is_equal_to(const Linear_Expression_Interface&, dimension_type, dimension_type) const;
    bool is_equal_to(const Linear_Expression_Interface&,
                     Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                     dimension_type, dimension_type) const;
    int compare(const Linear_Expression_Interface&) const;
    bool have_a_common_variable(const Linear_Expression_Interface&, Variable, Variable) const;
    template <typename Other> bool is_equal_to(const Linear_Expression_Impl<Other>&) const;
    template <typename Other>
    bool is_equal_to(const Linear_Expression_Impl<Other>&, dimension_type, dimension_type) const;
    template <typename Other>
    bool is_equal_to(const Linear_Expression_Impl<Other>&,
                     Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                     dimension_type, dimension_type) const;
    template <typename Other> int compare(const Linear_Expression_Impl<Other>&) const;
    template <typename Other>
    bool have_a_common_variable(const Linear_Expression_Impl<Other>&, Variable, Variable) const;
    
    VERIFICATION_CRITERIA:

    Compare signed literal vectors and zero-extended unequal dimensions in all storage pairings. Enumerate every common window, zero/nonzero scale pair and common-variable interval, checking direct and dispatched calls and source preservation.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001627
    6. Owned raw iterator handles and borrowed coefficient positions UID: PPL-SPEC-001627 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, begin() and end() shall allocate independent polymorphic iterator handles delimiting the nonzero homogeneous coefficients in increasing variable order. lower_bound(v) shall allocate a handle at the first such variable at least v, or at end. The search variable shall be within the dimension or its one-past position. The caller shall delete each allocated handle through its virtual interface. The handles shall borrow the live expression's row without owning it.

    Direct nested-iterator construction shall require a row of at least one slot and a starting raw index 1 ≤ i ≤ row.size(). It shall borrow that row at the first nonzero slot at or after i, or at end. The row shall outlive every such handle.

    clone() shall allocate an independent handle at the same borrowed position. Advancing or destroying one handle shall preserve another handle's position and the coefficients. Dereference, variable() and index() shall require a live non-end position; index shall be variable().id()+1. Increment shall move to the next nonzero homogeneous coefficient, admitting arrival at end. Decrement shall require a preceding nonzero homogeneous coefficient and shall move to it, including from end. Constant slot zero shall be excluded.

    Equality shall compare positions in the same row and concrete iterator type. Expression mutation shall invalidate borrowed positions as declared for the row; the caller shall obtain new handles afterward. Allocation failures shall propagate without changing the expression or existing handles. The internal zero-skipping helpers shall implement this traversal without changing values.

    RATIONALE:

    Raw polymorphic iterator handles have caller-owned allocation and a separately borrowed coefficient lifetime. Copying a handle must preserve independent traversal state.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    using iterator_interface = Linear_Expression_Interface::const_iterator_interface;
    iterator_interface* begin() const;
    iterator_interface* end() const;
    iterator_interface* lower_bound(Variable) const;
    // Members of Linear_Expression_Impl<Row>::const_iterator:
    explicit const_iterator(const Row&, dimension_type);
    iterator_interface* clone() const;
    void operator++();
    void operator--();
    Coefficient_traits::const_reference operator*() const;
    Variable variable() const;
    dimension_type index() const;
    bool operator==(const iterator_interface&) const;
    // Private traversal helpers:
    void skip_zeroes_forward();
    void skip_zeroes_backward();
    
    VERIFICATION_CRITERIA:

    Exercise forward and reverse paths, constants and trailing zero slots, every lower bound, clone independence and deletion through the base interface in both backends. Check empty traversal and allocation failures without using invalidated handles.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001628
    7. Backend row export, serialization, diagnostics and accounting UID: PPL-SPEC-001628 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, get_row(r) shall replace a dense or sparse output with an independent copy of the complete raw coefficient vector. The copy shall include its logical extent, all constant and trailing zero slots, and shall not borrow the backend's coefficient storage.

    ascii_dump(stream) shall emit size, the raw slot count, and every coefficient in slot order, using the producer grammar of 🔗 13. Reloadable ASCII export and replacement loading. ascii_load(stream) shall implement that raw grammar: require its exact size keyword and a nonzero raw count, replace the row and read exactly that many coefficients. Normal malformed or truncated extraction shall return false; resource and stream exceptions shall propagate. A rejected or throwing load may leave a partially replaced row; only destruction shall be required until the caller restores a valid value. A following token shall remain available after a complete record. The selected coefficient input grammar, stream formatting and exception masks shall retain their ordinary behavior.

    print(stream) and the free stream insertion shall implement the affine format and variable formatter dispatch of 🔗 14. Human-readable affine output and formatter dispatch; insertion shall return its stream. Source values shall be preserved by export and print. OK() shall return false for a row of size zero, and sparse OK() shall also reject any explicit stored zero, with its documented diagnostic to std::cerr. This local check shall not inspect unrelated domain state. external_memory_in_bytes() shall report the owned row's external storage; total_memory_in_bytes() shall add sizeof(*this).

    RATIONALE:

    A raw backend export must preserve both the affine coefficient vector and its owning storage, while failed loading has a deliberately limited lifetime guarantee.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    void get_row(Dense_Row&) const;
    void get_row(Sparse_Row&) const;
    void ascii_dump(std::ostream&) const;
    bool ascii_load(std::istream&);
    void print(std::ostream&) const;
    bool OK() const;
    memory_size_type external_memory_in_bytes() const;
    memory_size_type total_memory_in_bytes() const;
    template <typename Row>
    std::ostream& operator<<(std::ostream&, const Linear_Expression_Impl<Row>&);
    
    VERIFICATION_CRITERIA:

    Overwrite differently sized prepopulated rows, then mutate source and outputs independently. Check exact dumps, valid reloads, malformed/truncated input, suffix retention, ordinary stream failures, formatting and accounting identities in both backends.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • 1. Generator kinds and numerical prerequisites UID: PPL-SPEC-000181 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Generator shall describe one of four geometric objects in a declared ambient dimension: an included rational point, a rational closure point, a ray direction or a line direction. For homogeneous integer coefficients ai and positive divisor d, point and closure-point coordinates shall be ai ⁄ d. A line shall admit arbitrary real multiples of its nonzero direction; a ray shall admit nonnegative real multiples. Closure points shall retain their distinct kind and shall not assert boundary inclusion. Internal divisor/strictness fields shall not become public coordinates.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization and require caller synchronization for overlapping modification of an object. Dense and sparse storage shall be supported, with default_representation equal to SPARSE. Computed construction, normalization, transformation and comparison guarantees shall require representability of every evaluated coefficient step/result in the selected profile. Unchecked completion shall not prove those preconditions. Allocation and numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete generator; distinct unchanged sources shall survive failures, while modified destinations shall remain destructible without universal rollback.

    RATIONALE:

    Point inclusion, closure and directional reachability have different geometric meanings even when their coordinate coefficients coincide.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Generator;
    enum Generator::Type { LINE, RAY, POINT, CLOSURE_POINT };
    static constexpr Representation Generator::default_representation = SPARSE;
    
    VERIFICATION_CRITERIA:

    Use independent exact rational point coordinates and direction-proportionality checks; distinguish positive ray scales from signed line scales and included points from closure points. Exercise all supported storage choices and trailing coordinates.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • 2. Construction of nonzero lines and rays UID: PPL-SPEC-000182 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    line(e) and ray(e) shall use the expression's homogeneous coefficients as their respective direction, ignore its constant term and retain its declared dimension. They shall use requested storage. A zero homogeneous direction, including a nonzero constant expression, shall throw std::invalid_argument. Results shall have primitive homogeneous coefficients; lines shall orient their first nonzero coefficient positively, while rays shall preserve orientation. Source expressions shall remain unchanged. Numerical prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    The zero vector is not a direction; nonzero expression constants do not change the represented line or ray.

    INTERFACE:
    static Generator Generator::line(const Linear_Expression& e,
      Representation r = default_representation);
    static Generator Generator::ray(const Linear_Expression& e,
      Representation r = default_representation);
    Generator line(const Linear_Expression& e, Representation r = Generator::default_representation);
    Generator ray(const Linear_Expression& e, Representation r = Generator::default_representation);
    
    VERIFICATION_CRITERIA:

    Check static/free forms, both direction signs, common factors, leading/trailing zeros, ignored constants and zero-direction rejection with unchanged sources.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000183
    3. Construction of rational points and closure points UID: PPL-SPEC-000183 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    point(e,d) and closure_point(e,d) shall respectively construct an included or closure point whose coordinates are the homogeneous coefficients of e divided by the entry value of nonzero d. They shall ignore the expression constant, retain its dimension and use requested storage. A negative divisor shall be accepted by reversing all coordinate numerators and making the stored divisor positive, preserving rational coordinates. The stored numerator/divisor tuple shall be primitive. Zero divisor shall throw std::invalid_argument and preserve sources.

    Omitted expressions shall denote the dimension-zero origin; omitted divisors shall be one. Representation-only overloads shall make that origin, and expression/representation overloads shall use divisor one. A divisor borrowed from the unchanged input expression shall be admitted using its entry value. The numerical prerequisites of 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    A numerator coefficient is not itself a point coordinate when the positive divisor differs from one.

    INTERFACE:
    static Generator Generator::point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Generator Generator::point(Representation r);
    static Generator Generator::point(const Linear_Expression& e, Representation r);
    static Generator Generator::closure_point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Generator Generator::closure_point(Representation r);
    static Generator Generator::closure_point(const Linear_Expression& e, Representation r);
    
    Generator point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Generator::default_representation);
    Generator point(Representation r);
    Generator point(const Linear_Expression& e, Representation r);
    Generator closure_point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Generator::default_representation);
    Generator closure_point(Representation r);
    Generator closure_point(const Linear_Expression& e, Representation r);
    
    VERIFICATION_CRITERIA:

    Compare exact rational coordinates for all static/free overloads, positive/negative divisors, common factors, origin/default arguments, borrowed divisor and ignored constants. Check retained dimensions, point/closure kind and zero-divisor rejection.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000184
    4. Default generator and shared zero-dimensional origins UID: PPL-SPEC-000184 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Default construction shall create the dimension-zero included origin using requested storage. zero_dim_point() and zero_dim_closure_point() shall return borrowed dimension-zero origins of their respective distinct types, with positive divisor. Shared values shall remain alive until owning-thread finalization. Owned copies shall retain their values independently.

    RATIONALE:

    The origin exists in dimension zero, but included-origin and closure-origin descriptors still have distinct topological roles.

    INTERFACE:
    explicit Generator(Representation r = default_representation);
    static const Generator& Generator::zero_dim_point();
    static const Generator& Generator::zero_dim_closure_point();
    
    VERIFICATION_CRITERIA:

    Check requested/default storage, kinds, dimensions and positive divisors for defaults/shared values and independent copies during balanced initialization.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000185
    5. Owned generator copying, assignment and swapping UID: PPL-SPEC-000185 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Ordinary copying shall preserve kind, dimension, exposed coefficients, divisor when applicable and source representation. Explicit-storage copying shall use requested storage. Assignment shall copy the complete entry value and source storage, return the target reference, preserve a distinct source and support self-assignment. Rvalue arguments shall admit the copy forms, retaining source value without requiring a distinct move operation. Copies shall survive later source mutation or destruction.

    Both swap forms shall exchange full values, dimension and storage; self-swap shall preserve the generator. Destruction shall release owned storage. Failure while constructing copy assignment's replacement shall leave the target unchanged.

    RATIONALE:

    Owning geometric descriptors must remain independent even when their values originated from shared constants or expression views.

    INTERFACE:
    Generator(const Generator& g);
    Generator(const Generator& g, Representation r);
    Generator& Generator::operator=(const Generator& g);
    Generator::~Generator();
    void Generator::m_swap(Generator& y);
    void swap(Generator& x, Generator& y);
    
    VERIFICATION_CRITERIA:

    Check every kind across both storage choices, assignment identity/self/rvalue forms, source destruction, mutation independence, swaps and replacement-copy allocation failures.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000186
    6. Generator representation conversion UID: PPL-SPEC-000186 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report current coefficient storage. Successful set_representation(r) for dense or sparse storage shall preserve kind, public dimension, exposed coefficients and applicable divisor while selecting r. Repeating current storage shall preserve the object. Failed replacement allocation shall leave its value and representation unchanged.

    RATIONALE:

    Storage conversion changes neither rational coordinates nor direction orientation or topological kind.

    INTERFACE:
    Representation Generator::representation() const;
    void Generator::set_representation(Representation r);
    
    VERIFICATION_CRITERIA:

    Convert all four kinds both directions, including rational coordinates and unused dimensions, comparing exact fields and independent geometric values. Check repeated conversion and replacement allocation failures.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000187
    7. Generator dimensions and dimensioned copying UID: PPL-SPEC-000187 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    space_dimension() shall report public ambient dimension and max_space_dimension() the expression dimension limit. Requested/result sizes shall not exceed that limit. Dimensioned copies and set_space_dimension(n) shall retain lower-index coordinates, zero-extend new coordinates or discard removed trailing coordinates. Normalization may rescale an equivalent direction or numerator/divisor tuple. Kind and storage shall remain unchanged. Resizing a line or ray shall require a nonzero retained direction; removal that can collapse a direction shall instead follow 🔗 9. Removing generator coordinates and collapsed directions. Dimensioned copies without explicit storage shall retain source storage.

    RATIONALE:

    Dimensioned generator copies transform coordinate tuples, while a zero direction cannot remain a valid line or ray.

    INTERFACE:
    static dimension_type Generator::max_space_dimension();
    dimension_type Generator::space_dimension() const;
    Generator(const Generator& g, dimension_type space_dim);
    Generator(const Generator& g, dimension_type space_dim, Representation r);
    void Generator::set_space_dimension(dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check point/closure shrink/extend to and from dimension zero, direction resizing that retains nonzero coefficients, trailing zeros, and equivalent rational coordinates/directions after normalization.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000188
    8. Generator coordinate permutation and zero insertion UID: PPL-SPEC-000188 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Swapping two in-dimension coordinates shall exchange their coefficients. A cycle of distinct in-dimension variables shall move each coefficient to the following listed coordinate, wrapping last to first; empty/singleton cycles shall preserve the generator. shift_space_dimensions(v,n) shall require v.id() <= space_dimension() and an admitted result dimension; it shall insert n zero coordinate slots before that position and increase dimension by n. A zero shift shall preserve value.

    These operations shall preserve kind and storage, and preserve applicable rational point coordinates or direction values according to their stated coordinate correspondence. Equivalent normalization may change stored scales. Divisor and internal strictness fields shall not become coordinates.

    RATIONALE:

    Coordinate rearrangement must respect topological and rational scaling information stored alongside the homogeneous tuple.

    INTERFACE:
    void Generator::swap_space_dimensions(Variable x, Variable y);
    void Generator::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Generator::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check every kind with inverse/self swaps, longer and empty cycles, leading zeros and front/interior/end insertion against independent tuple transformations.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000189
    9. Removing generator coordinates and collapsed directions UID: PPL-SPEC-000189 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    remove_space_dimensions(vars) shall require selected indices within the public dimension, discard those coefficients and compact surviving coordinates in their original order. Points and closure points shall retain their kind and rational remaining coordinates and return true. A line or ray whose retained direction is nonzero shall retain its geometric direction kind and return true. If its entire direction is removed, it shall become the included origin in the remaining coordinate space and return false. Removing no coordinates shall be admitted. Storage shall be retained and normalization may rescale equivalent tuples.

    RATIONALE:

    A removed direction contributes no displacement; the return status distinguishes that collapse from a surviving directional descriptor.

    INTERFACE:
    bool Generator::remove_space_dimensions(const Variables_Set& vars);
    
    VERIFICATION_CRITERIA:

    Remove none, interior, trailing and all coordinates from every kind. Check normalized remaining rational tuples, surviving directions, and the origin/type/false result when every nonzero direction component disappears.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000190
    10. Generator type, coefficients, divisor and borrowed expression UID: PPL-SPEC-000190 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    The kind predicates and type() shall identify the four public kinds exactly; is_line_or_ray() shall identify the two directional kinds. coefficient(v) shall expose a homogeneous numerator/direction coefficient for an in-dimension variable and otherwise throw std::invalid_argument. divisor() shall return a positive divisor for a point or closure point and otherwise throw std::invalid_argument.

    expression() shall borrow a read-only affine adapter with the public dimension and homogeneous coefficients, constant term zero, and no hidden strictness coordinate. It shall not encode the point divisor as a constant. The owner shall remain alive and unchanged for uses covered here. Copying that view to a Linear_Expression shall make an independent value. Configured coefficient references shall borrow their owner until mutation or destruction. Queries shall preserve source value.

    RATIONALE:

    A public expression view gives numerators/directions, while obtaining a rational point still requires the separate divisor.

    INTERFACE:
    Generator::Type Generator::type() const;
    bool Generator::is_line() const;
    bool Generator::is_ray() const;
    bool Generator::is_line_or_ray() const;
    bool Generator::is_point() const;
    bool Generator::is_closure_point() const;
    Coefficient_traits::const_reference Generator::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Generator::divisor() const &;
    typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression>> Generator::expr_type;
    Generator::expr_type Generator::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check predicate tables, in-range values, rejected first/later coordinates and rejected directional divisor access. Materialize views for every kind and verify zero constant, hidden-column exclusion and independence after source modification.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000191
    11. Geometric equivalence and stored generator identity UID: PPL-SPEC-000191 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_equivalent_to and generator equality shall compare equal-dimension, equal-kind geometric objects independently of storage and internal topology. Point and closure-point comparisons shall use exact rational coordinates and keep their kinds distinct. Ray directions shall compare equivalent exactly for positive proportionality; line directions shall admit either nonzero proportionality sign. Different dimensions or kinds shall compare unequal. Inequality expressions shall negate equivalence.

    is_equal_to shall compare the complete stored normalized descriptor, including topology and fields, independently of dense/sparse storage. Positive identity shall imply equivalence; negative identity shall not imply geometric inequality. Queries shall preserve operands. Arithmetic prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    Normalizing numerators without their divisor can change point coordinates, and positive versus signed proportionality distinguishes rays from lines.

    INTERFACE:
    bool Generator::is_equivalent_to(const Generator& y) const;
    bool Generator::is_equal_to(const Generator& y) const;
    bool operator==(const Generator& x, const Generator& y);
    // Inequality uses C++20 rewriting of operator==.
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Compare exact rational points with common/different scales, same/opposite ray and line directions, kind differences and trailing dimensions. Include equivalent/different included points and directions promoted through NNC generator systems, preserving divisor information.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000192
    12. Reloadable generator representation UID: PPL-SPEC-000192 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export the full stored coefficient expression, public kind token and topology token; ascii_dump() shall use std::cerr. Export shall preserve the source. A complete compatible representation with representable coefficients shall load with true, replacing kind, coefficients, divisor and public dimension while retaining destination storage.

    Malformed/truncated expression, kind or topology fields, missing required coefficient slots, invalid directional zero vectors, nonpositive point divisors, violations of the checked row invariants and inconsistent kind/topology combinations shall return false rather than be accepted as valid generators. If expression loading fails, ascii_load(s) shall return false without reading the kind or topology suffix. Trailing input shall remain available. Failure may modify the target but shall leave it destructible and replaceable by a complete valid load. No rollback or cross-version format stability is promised; allocation and numerical exceptions may propagate.

    RATIONALE:

    A reloaded generator needs valid rational scaling, nonzero directional data and correct topological kind, in addition to syntactically complete input.

    INTERFACE:
    void Generator::ascii_dump(std::ostream& s) const;
    void Generator::ascii_dump() const;
    bool Generator::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip all kinds, rational points, gaps and trailing dimensions across destination storage. Compare independent geometric values and exact fields; reject malformed/truncated fields, missing slots, zero directions and invalid divisors/kinds, then exercise complete replacement. Reject invalid expression prefixes followed by otherwise valid kind/topology suffixes, checking that those suffixes remain unread. Reject complete zero line/ray records, nonpositive point divisors, missing NNC epsilon storage and inconsistent epsilon fields with assertions enabled or disabled, across destination storage. After false, perform only complete valid replacement before querying the target; preserve trailing input.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • 15. Generator-system hull meaning and construction UID: PPL-SPEC-000195 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Generator_System with lines L, rays R, included points P and closure points C shall generate exactly the real vectors

     ∑p ∈ Pλpp +  ∑c ∈ Cγcc +  ∑r ∈ Rρrr +  ∑l ∈ Lτll, 

    where λp, γc, ρr ≥ 0, τl ∈ ℝ, ∑pλp + ∑cγc = 1 and ∑pλp > 0. Thus a system without an included supporting point shall generate the empty set, even when directions or closure points are stored. Its meaning shall be a generated hull, not a conjunction of point membership conditions.

    Default construction shall have dimension zero and no rows. Singleton construction shall own a copy of its generator and adopt its dimension. Requested storage shall be used, with default SPARSE. zero_dim_univ() shall borrow the singleton included origin generating the universe of the zero-dimensional space until owning-thread finalization. Use/failure prerequisites shall follow 🔗 1. Generator kinds and numerical prerequisites.

    RATIONALE:

    Positive total weight on included points distinguishes an NNC hull from the closed convex hull of closure points alone.

    INTERFACE:
    class Generator_System;
    static constexpr Representation Generator_System::default_representation = SPARSE;
    Generator_System(Representation r = default_representation);
    explicit Generator_System(const Generator& g, Representation r = default_representation);
    static const Generator_System& Generator_System::zero_dim_univ();
    
    VERIFICATION_CRITERIA:

    Check empty, direction-only, closure-only and supported systems with independent low-dimensional generated sets. Include a closed segment, an open segment with interior supporting point, a ray and a line through an offset point; distinguish zero-dimensional empty and universal systems.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000196
    16. Owned generator systems and storage conversion UID: PPL-SPEC-000196 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall preserve generated hull, public dimension and source storage; an explicit-storage overload shall use its argument. Assignment shall copy the source entry value and representation, return the target reference, preserve a distinct source and support self-assignment. Rvalue copy forms shall retain source value without requiring a distinct move operation. Copies shall remain independent of later source modification/destruction.

    Swaps shall exchange complete system values, dimension and storage, including self-swap. Successful representation conversion shall select dense or sparse storage for all rows while preserving the generated hull and dimension. Destruction shall release owned rows. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Generator kinds and numerical prerequisites.

    RATIONALE:

    An owning generator system may change row storage without changing the geometry or inclusion of its generated boundary.

    INTERFACE:
    Generator_System(const Generator_System& gs);
    Generator_System(const Generator_System& gs, Representation r);
    Generator_System& Generator_System::operator=(const Generator_System& y);
    Generator_System::~Generator_System();
    Representation Generator_System::representation() const;
    void Generator_System::set_representation(Representation r);
    void Generator_System::m_swap(Generator_System& y);
    void swap(Generator_System& x, Generator_System& y);
    
    VERIFICATION_CRITERIA:

    Check empty and all-kind systems across copies/conversions, self/rvalue assignment, return identity, swaps and source destruction, comparing independent geometric tuples and generated-set examples.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000197
    17. Generator insertion and coefficient ownership transfer UID: PPL-SPEC-000197 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion shall add a copy of the generator to the system's geometric generator collection, preserving the source and target storage. Result dimension shall be the maximum input dimension; shorter tuples shall be zero-extended. Inserting a closure point shall retain its topological role; any necessary internal conversion shall preserve the public coordinates and kind of existing generators. Duplicates or redundant generators may be reordered/removed provided the generated hull is preserved. Publicly retrieved rows need not reproduce insertion order or multiplicity.

    Rvalue insertion shall transfer a generator not borrowed from the target, producing the same generated hull as copying it. The source shall remain destructible; no unchanged-value guarantee shall apply to it. Ordinary insertion of a borrowed row from the same target shall use its entry value. Numerical/failure prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply.

    Const row sources, including const rvalues, shall use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Adding a generator expands a geometric description and can require NNC representation, without conjoining a new constraint.

    INTERFACE:
    void Generator_System::insert(const Generator& g);
    void Generator_System::insert(Generator&& g);
    
    VERIFICATION_CRITERIA:

    Check mixed dimensions, borrowed-row insertion, duplicate/closure/ray/line insertion and recycled ownership. Verify unchanged copied sources and preserved existing rational coordinates when closure-point insertion promotes a closed system.

    SOURCE:

    tests/consuminginsertions1.cc; src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000198
    18. System dimensions, coordinate truncation and container emptiness UID: PPL-SPEC-000198 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall report the generator limit and space_dimension() the declared ambient dimension. For admitted dimension n, resizing shall zero-extend new coordinates or discard removed trailing coordinates in every generator. Points/closure points shall retain the corresponding remaining rational coordinates; lines/rays whose directions collapse to zero shall be removed. The resulting generated hull shall have the corresponding coordinate image, including when no supporting point was present. Representation shall be retained.

    empty() shall report absence of stored generators, not geometric emptiness of a direction-only or closure-only generated hull. clear() shall remove all generators and reset dimension zero while retaining storage. An empty system may be resized to positive ambient dimension.

    RATIONALE:

    Generator coordinate projection drops collapsed directions, while container emptiness remains distinct from the need for a supporting included point.

    INTERFACE:
    static dimension_type Generator_System::max_space_dimension();
    dimension_type Generator_System::space_dimension() const;
    void Generator_System::set_space_dimension(dimension_type n);
    bool Generator_System::empty() const;
    void Generator_System::clear();
    
    VERIFICATION_CRITERIA:

    Check positive-dimensional empty systems, every-kind resizing, collapsed directions removed during shrinking, zero-dimensional projections, clear/reuse and direction-only systems that are nonempty containers but generate no points.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000199
    19. Read-only forward iteration over public generators UID: PPL-SPEC-000199 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    begin() and end() shall delimit a generator collection with the system's public dimension and the same generated hull. It may suppress a closure point immediately followed by an included point at the same rational coordinates. No public iteration order or duplicate multiplicity shall be promised. Dereference/member access shall borrow a retained generator.

    Iterator copy/assignment shall preserve borrowed system and position with independent later navigation. Prefix increment shall return the advanced iterator; postfix shall return its entry-position copy. Comparison shall require iterators into the same unchanged system. Defaults shall admit copying, assignment and destruction before valid-position assignment. Modification/destruction shall invalidate iterators and borrowed rows.

    RATIONALE:

    Equivalent included and closure-point companions need not both be exposed, while remaining generators must preserve the same hull.

    INTERFACE:
    typedef Generator_System_const_iterator Generator_System::const_iterator;
    Generator_System::const_iterator Generator_System::begin() const;
    Generator_System::const_iterator Generator_System::end() const;
    Generator_System_const_iterator();
    Generator_System_const_iterator(const Generator_System_const_iterator& y);
    Generator_System_const_iterator::~Generator_System_const_iterator();
    Generator_System_const_iterator& Generator_System_const_iterator::operator=(const Generator_System_const_iterator& y);
    const Generator& Generator_System_const_iterator::operator*() const;
    const Generator* Generator_System_const_iterator::operator->() const;
    Generator_System_const_iterator& Generator_System_const_iterator::operator++();
    Generator_System_const_iterator Generator_System_const_iterator::operator++(int);
    bool Generator_System_const_iterator::operator==(const Generator_System_const_iterator& y) const;
    bool Generator_System_const_iterator::operator!=(const Generator_System_const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty, mixed and matching-companion ranges, exact rational coordinates and public dimensions. Exercise copied/default-assigned positions, prefix/postfix return semantics and borrowed pointer/reference identity.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000200
    20. Reloadable generator-system representation UID: PPL-SPEC-000200 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export full stored rows, dimension, topology, representation and required row-state fields; ascii_dump() shall use std::cerr. Export shall preserve source value. A complete compatible export with representable coefficients shall load with true, replacing the target with the encoded generated hull, public dimension and encoded storage choice.

    Malformed/truncated headers or rows, invalid generator fields and inconsistent encoded dimensions or row-state fields shall return false rather than be accepted as valid systems. Trailing input shall remain available. Failure may modify a destination but shall leave it destructible and replaceable by a complete valid load. No rollback/cross-version format stability is promised; allocation and configured numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    A generator-system reload must retain supporting-point inclusion and closure data as well as rational coordinate scaling.

    INTERFACE:
    void Generator_System::ascii_dump(std::ostream& s) const;
    void Generator_System::ascii_dump() const;
    bool Generator_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimensional, direction-only, point/closure and all-kind systems across initial destination storage choices. Compare encoded dimensions/storage and independent generated-set examples; reject malformed/truncated rows and inconsistent structural fields. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • 1. Grid-generator values and integer versus continuous displacement UID: PPL-SPEC-000221 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Grid_Generator shall describe a rational included point, a rational parameter displacement vector, or a continuous line direction, in its public ambient dimension. For a point or parameter with numerators ai and positive divisor d, coordinates shall be ai ⁄ d. Parameters shall retain their exact rational step, including sign and magnitude; integer multiples of that step shall contribute to a generated grid. Lines shall contribute arbitrary real multiples of their direction. Hidden divisor fields shall not be public coordinates.

    Both storage representations shall be supported; default_representation shall be SPARSE. Initialization and synchronization shall follow 🔗 3. Thread initialization, default state and finalization. Computed construction, transformation, scaling and comparison guarantees shall require all evaluated coefficient steps/results to be representable in the selected profile; unchecked completion shall not prove that condition. Allocation/numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete grid generator; distinct unchanged sources shall survive failures, while modified targets shall remain destructible without universal rollback.

    RATIONALE:

    A parameter is a sized displacement vector rather than a scale-free direction. Its exact value is separate from the integer span it contributes to a grid.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Grid_Generator;
    enum Grid_Generator::Type { LINE, PARAMETER, POINT };
    static constexpr Representation Grid_Generator::default_representation = SPARSE;
    
    VERIFICATION_CRITERIA:

    Compare independent rational point/parameter vectors and line proportionality. Distinguish rational/integral displacements, scaled and opposite parameters, continuous lines and integer steps.

    BIBLIOGRAPHY:

    BagnaraHZ08SCP | Section 2.4, equation (1) and parameter representation BagnaraDHMZ07 | Section 3, The Generator Representation

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000222
    2. Construction of nonzero grid-line directions UID: PPL-SPEC-000222 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    grid_line(e,r) shall construct a line from homogeneous coefficients, ignore the constant, retain declared dimension and use requested storage. It shall produce a primitive direction with first nonzero coefficient positive. A zero homogeneous direction, including a nonzero constant expression, shall throw std::invalid_argument without modifying its source. Static and free forms shall agree geometrically. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Continuous direction is unchanged by nonzero common scaling and cannot be constructed from the zero vector.

    INTERFACE:
    static Grid_Generator Grid_Generator::grid_line(const Linear_Expression& e,
      Representation r = default_representation);
    Grid_Generator grid_line(const Linear_Expression& e,
      Representation r = Grid_Generator::default_representation);
    
    VERIFICATION_CRITERIA:

    Check static/free factories, both signs, common factors, ignored constants, gaps, trailing dimensions and zero-direction rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000223
    3. Exact rational parameter construction including zero steps UID: PPL-SPEC-000223 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    parameter(e,d,r) shall create the rational displacement with coordinates ai ⁄ d from the homogeneous input coefficients, ignoring the constant, retaining dimension and using requested storage. Nonzero negative divisors shall be accepted by reversing numerator/divisor signs to make stored divisor positive while preserving the exact signed step. The parameter's magnitude shall not be normalized as a line direction. Zero displacement shall be admitted and retain its dimension. Zero divisor shall throw std::invalid_argument and preserve sources.

    Defaults shall use dimension-zero zero expression, divisor one and default storage. Representation-only and expression/representation forms shall use divisor one. A divisor borrowed from the unchanged input expression shall be admitted using its entry value. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Dividing a parameter vector without its divisor changes its periodic step. Zero is a valid redundant displacement descriptor.

    INTERFACE:
    static Grid_Generator Grid_Generator::parameter(
      const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Grid_Generator Grid_Generator::parameter(Representation r);
    static Grid_Generator Grid_Generator::parameter(const Linear_Expression& e, Representation r);
    Grid_Generator parameter(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Grid_Generator::default_representation);
    Grid_Generator parameter(Representation r);
    Grid_Generator parameter(const Linear_Expression& e, Representation r);
    
    VERIFICATION_CRITERIA:

    Check every static/free/default form, signed/nonunit divisors, common factors, exact doubled/opposite steps, zero parameters with positive dimension, borrowed divisor and zero-divisor rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000224
    4. Rational grid-point construction, defaults and shared origin UID: PPL-SPEC-000224 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    grid_point(e,d,r) shall construct the rational point with coordinates ai ⁄ d, ignoring the expression constant, retaining dimension and using requested storage. A negative nonzero divisor shall reverse numerator signs and become positive; common factors may be removed while preserving rational coordinates. Zero divisor shall throw std::invalid_argument. A divisor borrowed from the unchanged input expression shall use its entry value.

    Omitted expression/divisor arguments shall denote the dimension-zero origin and divisor one. Representation-only and expression/representation forms shall use divisor one. Default construction shall produce that origin using requested storage. zero_dim_point() shall borrow the zero-dimensional origin until owning-thread finalization; owned copies shall be independent.

    RATIONALE:

    A rational supporting point fixes a grid offset and differs from a periodic parameter at the same coordinate vector.

    INTERFACE:
    static Grid_Generator Grid_Generator::grid_point(
      const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Grid_Generator Grid_Generator::grid_point(Representation r);
    static Grid_Generator Grid_Generator::grid_point(const Linear_Expression& e, Representation r);
    Grid_Generator grid_point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Grid_Generator::default_representation);
    Grid_Generator grid_point(Representation r);
    Grid_Generator grid_point(const Linear_Expression& e, Representation r);
    explicit Grid_Generator(Representation r = default_representation);
    static const Grid_Generator& Grid_Generator::zero_dim_point();
    
    VERIFICATION_CRITERIA:

    Check all static/free/default forms, positive/negative divisors, origins in different dimensions, exact rational coordinates and shared lifetime, input aliases and zero-divisor rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000225
    5. Owned grid-generator copying, assignment and swaps UID: PPL-SPEC-000225 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall preserve exact fields, kind, dimension and source representation; explicit-storage copies shall select their argument. Assignment shall copy complete entry value/storage, preserve distinct sources, return the target and admit self-assignment. Rvalue inputs shall admit copy forms retaining source value without requiring a distinct move operation. Copies shall remain independent of source mutation/destruction. Swaps shall exchange complete values, dimension and storage; self-swap shall preserve them. Destruction shall release owned storage. Failure during copy assignment's replacement construction shall preserve the target.

    RATIONALE:

    Each grid-generator object owns its expression and divisor fields independently.

    INTERFACE:
    Grid_Generator(const Grid_Generator& g);
    Grid_Generator(const Grid_Generator& g, Representation r);
    Grid_Generator& Grid_Generator::operator=(const Grid_Generator& g);
    Grid_Generator::~Grid_Generator();
    void Grid_Generator::m_swap(Grid_Generator& y);
    void swap(Grid_Generator& x, Grid_Generator& y);
    
    VERIFICATION_CRITERIA:

    Check all kinds, exact rational parameter/point fields, representation choices, return identity, self/rvalue forms, surviving copies, swaps and replacement-copy failures.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000226
    6. Grid-generator storage conversion UID: PPL-SPEC-000226 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report storage. Successful conversion to dense or sparse representation shall select requested storage and preserve exact coefficients, divisor when applicable, kind and dimension. Repeating the current choice shall preserve the object. Failed replacement allocation shall leave its original value and storage unchanged.

    RATIONALE:

    Representation conversion must preserve parameter magnitude as well as point coordinates and line orientation.

    INTERFACE:
    Representation Grid_Generator::representation() const;
    void Grid_Generator::set_representation(Representation r);
    
    VERIFICATION_CRITERIA:

    Convert every kind in both directions, including unnormalized numerator/divisor tuples and zero parameters, checking exact fields and allocation-failure preservation.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000227
    7. Grid-generator dimensions and coordinate removal UID: PPL-SPEC-000227 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall equal the linear-expression limit minus one, reserving the internal divisor coordinate. space_dimension() shall report public dimension. Dimensioned copies and resizing shall require admitted result dimensions, retain lower-index coordinates and zero-extend or discard trailing coordinates. Explicit-storage copies shall use their argument; other copies shall retain source storage.

    remove_space_dimensions(vars) shall require in-dimension selected indices, discard those coordinate coefficients, compact retained coordinates in their original order and return true. Removing none/all shall be admitted. Kind, storage and applicable rational remaining coordinates shall be retained. A transformed zero parameter or zero line direction shall contribute no displacement, without supplying a supporting point.

    RATIONALE:

    A reserved divisor field must follow dimension changes without being mistaken for a coordinate; collapsed steps contribute zero displacement.

    INTERFACE:
    static dimension_type Grid_Generator::max_space_dimension();
    dimension_type Grid_Generator::space_dimension() const;
    Grid_Generator(const Grid_Generator& g, dimension_type space_dim);
    Grid_Generator(const Grid_Generator& g, dimension_type space_dim, Representation r);
    void Grid_Generator::set_space_dimension(dimension_type n);
    bool Grid_Generator::remove_space_dimensions(const Variables_Set& vars);
    
    VERIFICATION_CRITERIA:

    Check dimensioned copies, zero/trailing dimensions, shrink/extend and none/interior/all removals for all kinds. Compare exact rational vectors or retained line spans, preserving divisor and kind while excluding hidden columns.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000228
    8. Grid-generator coordinate permutation and zero insertion UID: PPL-SPEC-000228 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Swapping in-dimension variables shall exchange their coordinate coefficients. A cycle shall require distinct in-dimension variables and move each listed coefficient to the following listed position, wrapping last to first. Empty and singleton cycles shall preserve the object. Inserting zero coordinates before v.id() <= space_dimension() shall shift the suffix and increase dimension by the requested admitted amount; a zero shift shall preserve value. Kinds, storage and applicable rational point/parameter values shall follow that coordinate correspondence. A line may be reoriented by equivalent sign normalization; a parameter's sign and exact step shall be preserved.

    RATIONALE:

    Sign normalization valid for continuous lines would change an explicitly directed parameter vector.

    INTERFACE:
    void Grid_Generator::swap_space_dimensions(Variable x, Variable y);
    void Grid_Generator::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Grid_Generator::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Use independent tuple swaps/cycles and front/interior/end zero insertion, including negative-leading parameters, zero parameters and rational points with nonunit divisors.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000229
    9. Grid-generator kind, coefficient, divisor and expression queries UID: PPL-SPEC-000229 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    Kind predicates and type() shall identify line, parameter and point; is_line_or_parameter() and is_parameter_or_point() shall identify their named unions. coefficient(v) shall expose a public coordinate numerator or direction coefficient, rejecting v.id() >= space_dimension() with std::invalid_argument. divisor() shall return a positive divisor for parameters/points and reject lines with std::invalid_argument. all_homogeneous_terms_are_zero() shall inspect only public homogeneous coordinates, excluding divisor fields.

    expression() shall borrow a read-only view of the public homogeneous coefficients, with public dimension and constant zero, hiding divisor fields. The owner shall remain alive and unchanged for covered view uses. Materializing the view shall yield an independent Linear_Expression. Configured returned references shall borrow until owner mutation/destruction. Queries shall preserve source values.

    RATIONALE:

    Public homogeneous queries exclude both the point divisor and the parameter's separate internal divisor coordinate.

    INTERFACE:
    Grid_Generator::Type Grid_Generator::type() const;
    bool Grid_Generator::is_line() const;
    bool Grid_Generator::is_parameter() const;
    bool Grid_Generator::is_point() const;
    bool Grid_Generator::is_line_or_parameter() const;
    bool Grid_Generator::is_parameter_or_point() const;
    Coefficient_traits::const_reference Grid_Generator::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Grid_Generator::divisor() const &;
    bool Grid_Generator::all_homogeneous_terms_are_zero() const;
    typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression>> Grid_Generator::expr_type;
    Grid_Generator::expr_type Grid_Generator::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check every predicate combination, exact coefficients/divisors, zero tests, first/later out-of-range access and line-divisor rejection. Materialize views and verify hidden-column exclusion and independence.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000230
    10. Explicit replacement of a rational generator divisor UID: PPL-SPEC-000230 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a point or parameter and positive input d, set_divisor(d) shall replace only its divisor using the input entry value, preserving coordinate numerators, dimension, kind and storage. It shall therefore change the rational vector when the divisor changes. A divisor borrowed from the same object shall be admitted. Calling it on a line shall throw std::invalid_argument without changing that line.

    RATIONALE:

    Replacing a divisor changes rational coordinates; it is different from scaling a representation to an equivalent divisor.

    INTERFACE:
    void Grid_Generator::set_divisor(Coefficient_traits::const_reference d);
    
    VERIFICATION_CRITERIA:

    Check point/parameter divisor replacement, self-divisor and positive borrowed-coordinate inputs with unchanged numerators. Compare changed rational vectors and verify documented line rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000231
    11. Value-preserving scaling to a common positive divisor UID: PPL-SPEC-000231 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a point or parameter, scale_to_divisor(d) shall require a positive d that is an exact multiple of the current positive divisor. It shall set the divisor to d and multiply all public numerators by the same positive ratio, preserving exact rational vector, kind, dimension and storage. Reusing the current divisor shall preserve exact fields. Borrowed inputs from the same object shall use their entry values. For a line and any admitted positive d it shall do nothing. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Common-denominator maintenance preserves an exact parameter step, unlike plain divisor replacement.

    INTERFACE:
    void Grid_Generator::scale_to_divisor(Coefficient_traits::const_reference d);
    
    VERIFICATION_CRITERIA:

    Check exact multiples, unchanged divisor, point/parameter rational preservation, borrowed divisor and positive coefficient multiples, line no-op and representable product boundaries.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000232
    12. Grid-generator equivalence and stored identity UID: PPL-SPEC-000232 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_equivalent_to and equality shall compare equal-kind, equal-dimension generators independently of storage. Points and parameters shall compare their exact rational vectors, including parameter sign and magnitude. Opposite parameter vectors may generate the same integer span but shall remain distinct parameter values. Lines shall compare their real direction spans, admitting opposite nonzero scales. Different dimensions/kinds shall compare unequal. Inequality shall negate equivalence.

    is_equal_to shall compare complete stored fields and kind independently of storage. Positive identity shall imply equivalence; a negative identity shall not prove different geometric values. Queries shall preserve sources. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Exact parameter vectors and the grids generated by their integer spans support different equivalence questions.

    INTERFACE:
    bool Grid_Generator::is_equivalent_to(const Grid_Generator& y) const;
    bool Grid_Generator::is_equal_to(const Grid_Generator& y) const;
    bool operator==(const Grid_Generator& x, const Grid_Generator& y);
    // Inequality uses C++20 rewriting of operator==.
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Compare independently equal rational tuples with unreduced common factors, changed point/parameter magnitudes and opposite signs, line scales/signs, dimensions and representations. Include transformed lines whose leading nonzero sign changes after removal.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000233
    13. Reloadable grid-generator representation UID: PPL-SPEC-000233 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export all stored coefficient/divisor fields and the public kind token; the no-argument form shall use std::cerr. Export shall preserve the source. Compatible complete exported data with representable coefficients shall load with true, replacing the generator's fields and public dimension while retaining destination storage.

    Malformed/truncated expression or kind fields, missing internal divisor slots, nonpositive point/parameter divisors and encoded kind/field mismatches shall return false rather than be accepted as valid generators. Trailing input shall remain available. A failed target shall remain destructible and admit complete valid replacement, without rollback or cross-version format promises. Allocation and numerical exceptions may propagate.

    RATIONALE:

    A declared point token must not silently load as a parameter merely because its coefficient fields encode that different kind.

    INTERFACE:
    void Grid_Generator::ascii_dump(std::ostream& s) const;
    void Grid_Generator::ascii_dump() const;
    bool Grid_Generator::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip all kinds, zero/nonzero parameters, rational and unreduced tuples across destination choices. Check exact kind/divisor/coordinate fields and reject malformed/truncated expressions, kind mismatches, invalid counts/divisors and unsupported structure. Reject missing hidden divisor storage, nonpositive parameter/point divisors and inconsistent point/line fields through false rather than assertion failure. Exercise dense/sparse destination replacement and preserve positive-divisor zero parameters and valid line records retaining hidden divisor metadata.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000235
    15. Grid-generator-system integer-affine span and construction UID: PPL-SPEC-000235 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For lines L, parameters Q and included points P, a Grid_Generator_System shall generate the real vectors

     ∑l ∈ Lτll +  ∑q ∈ Qkqq +  ∑p ∈ Pzpp,   τl ∈ ℝ,  kq, zp ∈ ℤ,   ∑p ∈ Pzp = 1.

    Without a point the generated grid shall be empty, even with stored nonzero lines/parameters. Integer affine combinations of multiple points shall not be replaced by convex combinations. Default construction shall make a zero-dimensional system with no rows; an explicit dimension constructor shall retain its supplied admitted dimension. Singleton construction shall copy its generator and dimension, including a zero parameter. Ordinary insertion shall separately follow 🔗 17. Grid-generator insertion, zero steps and ownership transfer. Requested storage shall be used, with default SPARSE. zero_dim_univ() shall borrow the singleton zero-dimensional origin until owning-thread finalization. Numerical/use/failure prerequisites shall follow 🔗 1. Grid-generator values and integer versus continuous displacement.

    RATIONALE:

    Grid generation combines integer affine offsets and integer parameter steps with continuous line spans; a convex hull would admit incorrect fractional displacements.

    INTERFACE:
    class Grid_Generator_System;
    static constexpr Representation Grid_Generator_System::default_representation = SPARSE;
    explicit Grid_Generator_System(Representation r = default_representation);
    explicit Grid_Generator_System(dimension_type dim, Representation r = default_representation);
    explicit Grid_Generator_System(const Grid_Generator& g, Representation r = default_representation);
    static const Grid_Generator_System& Grid_Generator_System::zero_dim_univ();
    
    VERIFICATION_CRITERIA:

    Check supporting-point absence, rational offsets, half-integer steps, points at zero and two generating even integers, continuous line directions and zero-dimensional empty/universal systems against independent lattice equations.

    BIBLIOGRAPHY:

    BagnaraHZ08SCP | Section 2.4, equation (1) and parameter representation BagnaraDHMZ07 | Section 3, The Generator Representation

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000236
    16. Owned grid-generator systems and representation comparison UID: PPL-SPEC-000236 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copies/assignment shall preserve generated grid, declared dimension and retained row sequence. Ordinary copies and assignment shall retain source storage, while explicit-storage copies shall use their argument. Assignment shall return the target, preserve distinct sources, admit self-assignment and retain source value under rvalue copy forms. Copies shall survive source mutation/destruction. Swaps shall exchange full values, dimensions and storage, including self-swap. Successful representation conversion shall select dense or sparse row storage and preserve the generated grid and dimension. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Grid-generator values and integer versus continuous displacement.

    is_equal_to and system equality shall compare declared dimensions and retained row sequence using equivalent corresponding generators, not decide equality of arbitrarily reordered or redundant generated grids. Comparison shall ignore dense/sparse choice. Destruction shall release owned storage.

    RATIONALE:

    Owning row-sequence comparison remains distinct from equality of the lattice or continuous affine set generated by a system.

    INTERFACE:
    Grid_Generator_System(const Grid_Generator_System& gs);
    Grid_Generator_System(const Grid_Generator_System& gs, Representation r);
    Grid_Generator_System& Grid_Generator_System::operator=(const Grid_Generator_System& y);
    Grid_Generator_System::~Grid_Generator_System();
    Representation Grid_Generator_System::representation() const;
    void Grid_Generator_System::set_representation(Representation r);
    void Grid_Generator_System::m_swap(Grid_Generator_System& y);
    void swap(Grid_Generator_System& x, Grid_Generator_System& y);
    bool Grid_Generator_System::is_equal_to(const Grid_Generator_System& y) const;
    bool operator==(const Grid_Generator_System& x, const Grid_Generator_System& y);
    
    VERIFICATION_CRITERIA:

    Check copy/self/rvalue forms, swaps/conversions and destruction independence for empty and mixed systems. Compare matching sequences across storage, different dimensions/counts and changed rows without inferring a general grid-equivalence decision.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • 17. Grid-generator insertion, zero steps and ownership transfer UID: PPL-SPEC-000237 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion shall add a copy of a grid generator to the generating collection, preserve its source and retain target storage. Result dimension shall be the maximum input dimension, zero-extending shorter rows. A zero parameter shall add no row but shall still extend ambient dimension as needed; it shall not supply a supporting point. Copy insertion of a borrowed target row shall use its entry value. Duplicates/redundant generators may be removed or reordered while preserving the generated grid.

    Rvalue row insertion shall transfer a source not borrowed from the target, with the same generated-grid effect as copying; the source shall remain destructible. Consuming-system insertion shall require distinct systems, combine their generating collections in aligned dimensions, and clear the source to a dimension-zero empty system on success. No unchanged-value guarantee shall apply to transferred inputs. Numerical/failure prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    Const row sources, including const rvalues, shall use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Zero displacement is redundant yet still carries ambient dimension. Ownership transfer must not accidentally add a supporting point or change a parameter period.

    INTERFACE:
    void Grid_Generator_System::insert(const Grid_Generator& g);
    void Grid_Generator_System::insert(Grid_Generator&& g);
    void Grid_Generator_System::insert(Grid_Generator_System&& gs);
    
    VERIFICATION_CRITERIA:

    Check dimension alignment, zero-parameter discarding, borrowed-row insertion, copied-source preservation and recycled row/system ownership. Compare independent generated-grid examples before/after adding points, lines and rational parameters.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000238
    18. System dimensions, row-kind counts and read-only iteration UID: PPL-SPEC-000238 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall return Grid_Generator::max_space_dimension() - 1 and space_dimension() the public ambient dimension. empty() shall mean no stored rows, independently of whether the generated grid lacks a supporting point. num_rows(), num_parameters() and num_lines() shall count retained stored generators of their named scope; has_points() shall report a retained point. clear() shall remove all rows and reset dimension zero while retaining storage.

    begin()/end() shall expose retained generators sharing system dimension, without promising geometric sorted order or duplicate multiplicity. Forward iterators shall borrow rows, support independent copied/assigned positions, return the advanced iterator from prefix increment and entry-position copy from postfix increment. Comparison shall require one unchanged system. Defaults shall admit copying/assignment/destruction before valid-position assignment. System mutation/destruction shall invalidate iterators and rows.

    RATIONALE:

    Container counts, presence of a supporting point and geometric generated-grid emptiness answer different questions.

    INTERFACE:
    static dimension_type Grid_Generator_System::max_space_dimension();
    dimension_type Grid_Generator_System::space_dimension() const;
    bool Grid_Generator_System::empty() const;
    dimension_type Grid_Generator_System::num_rows() const;
    dimension_type Grid_Generator_System::num_parameters() const;
    dimension_type Grid_Generator_System::num_lines() const;
    bool Grid_Generator_System::has_points() const;
    void Grid_Generator_System::clear();
    class Grid_Generator_System::const_iterator;
    Grid_Generator_System::const_iterator Grid_Generator_System::begin() const;
    Grid_Generator_System::const_iterator Grid_Generator_System::end() const;
    Grid_Generator_System::const_iterator::const_iterator();
    Grid_Generator_System::const_iterator::const_iterator(const const_iterator& y);
    Grid_Generator_System::const_iterator::~const_iterator();
    Grid_Generator_System::const_iterator& Grid_Generator_System::const_iterator::operator=(const const_iterator& y);
    const Grid_Generator& Grid_Generator_System::const_iterator::operator*() const;
    const Grid_Generator* Grid_Generator_System::const_iterator::operator->() const;
    Grid_Generator_System::const_iterator& Grid_Generator_System::const_iterator::operator++();
    Grid_Generator_System::const_iterator Grid_Generator_System::const_iterator::operator++(int);
    bool Grid_Generator_System::const_iterator::operator==(const const_iterator& y) const;
    bool Grid_Generator_System::const_iterator::operator!=(const const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty, zero-parameter-only and all-kind systems, exact row/kind counts and supporting-point presence. Check shared dimensions, copied/default-assigned iterator positions, prefix/postfix return semantics and borrowed pointer identity.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000240
    20. Reloadable grid-generator-system representation UID: PPL-SPEC-000240 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export stored rows, public dimension, storage and required system-state fields; the no-argument form shall use std::cerr. Export shall preserve source value. Compatible complete exports with representable coefficients shall load with true, replacing the target's generated grid, dimension, retained rows and encoded storage.

    Malformed/truncated headers/rows, invalid divisor or kind structure, and inconsistent encoded dimensions/state fields shall return false rather than be accepted as valid systems. Trailing input shall remain available. Failed targets shall remain destructible and admit complete valid replacement, without rollback or cross-version format promises. Allocation/numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    Reload must preserve parameter periods and supporting-point offsets together with ambient dimension.

    INTERFACE:
    void Grid_Generator_System::ascii_dump(std::ostream& s) const;
    void Grid_Generator_System::ascii_dump() const;
    bool Grid_Generator_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimensional, no-supporting-point and mixed rational-point/parameter/line systems across destination choices. Check encoded storage, dimensions and independent lattice membership; reject malformed/truncated structural fields and row-kind/divisor inconsistencies. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • 1. Affine value, numerical prerequisites and shared zero UID: PPL-SPEC-000071 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A live Linear_Expression of space dimension d, with homogeneous coefficients ai and inhomogeneous term b, shall denote the function E(x) = b + ∑d − 1i = 0aixi on rational valuations. The constant term shall not occupy a coordinate. Trailing zero coefficients shall remain part of the declared ambient dimension.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization. The caller shall synchronize access to an object while another operation modifies it. The valid representations shall be DENSE and SPARSE; default_representation shall be SPARSE. zero() shall return a borrowed, constant expression of dimension zero and value zero. The returned object shall remain alive until its owning initialized thread is finalized.

    The computed arithmetic guarantees of 🔗 7. Affine addition, subtraction and negation, 🔗 8. Integral scalar multiplication and coefficient-wise division, 🔗 9. Explicit scaled accumulation, combination and elimination and 🔗 10. Coefficient normalization and sign normalization shall require every evaluated coefficient arithmetic step and result to be representable in the selected coefficient profile. Checked arithmetic may report overflow; unchecked completion shall not prove that this precondition held. Allocation failures may propagate. Failed construction shall release resources owned by the incomplete expression. Distinct, unchanged operands shall remain valid after a reported failure. Other modified objects shall be destructible; no universal rollback is promised.

    RATIONALE:

    An expression has an affine value independently of its storage or any constraint later formed from it. Shared numerical prerequisites delimit arithmetic guarantees without weakening that value meaning.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Linear_Expression;
    enum Representation { DENSE, SPARSE };
    static constexpr Representation Linear_Expression::default_representation = SPARSE;
    static const Linear_Expression& Linear_Expression::zero();
    
    VERIFICATION_CRITERIA:

    Evaluate explicit coefficient vectors independently over rational valuations, including dimension zero and trailing zeros. Check the shared zero during a balanced initialized lifetime and verify both supported representations. Inspect construction cleanup and failure paths without inferring unpromised rollback.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc.

  • 2. Zero, constant, variable and dimensioned construction UID: PPL-SPEC-000072 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Expression_Adapter_Source<T> shall have the truth value of std::is_convertible_v<const T&, const Expression_Adapter_Base&>. The four adapter-copy constructors shall use this predicate as their type constraint, including implicit base-reference conversions and excluding inaccessible or ambiguous base conversions. Their optional trailing void* parameter shall retain its default null value and shall be ignored.

    Construction with only an optional representation shall produce dimension zero and value zero. Construction from a coefficient shall produce dimension zero and that constant value. Construction from Variable v shall produce dimension v.space_dimension(), coefficient one at v.id(), and zero elsewhere, including the constant term.

    A variable whose dimension exceeds max_space_dimension() shall cause std::length_error. A requested representation shall be used. The ordinary copy constructor shall copy all coefficients and the declared dimension and retain the source representation. The overload accepting a representation shall use that representation. The overloads accepting space_dim shall copy the retained coefficients, discard coefficients of removed trailing coordinates when shrinking, and insert zero coefficients when extending. Their caller shall supply space_dim <= max_space_dimension(). All copies shall own independent values.

    The four corresponding copy forms shall also accept a supported, live expression adapter, including the borrowed expression views exposed by constraints and congruences. They shall copy the adapter's visible coefficients, constant and declared dimension. Copying a view shall not introduce a descriptor's hidden representation columns. Omitting the representation shall retain the adapter's representation; an explicit representation shall select that representation. Dimensioned copies shall apply the same truncation and zero-extension rules as ordinary copies.

    RATIONALE:

    Constructor dimensions are observable and must not be inferred from the last nonzero term. Explicit dimensioned copying is a semantic truncation when removed coefficients are nonzero. Named constraints expose source admission while the implementation argument alias preserves the established constructor linkage.

    INTERFACE:
    template <typename T>
    concept Expression_Adapter_Source =
      std::is_convertible_v<const T&, const Expression_Adapter_Base&>;
    
    explicit Linear_Expression(Representation r = default_representation);
    explicit Linear_Expression(Coefficient_traits::const_reference n,
                              Representation r = default_representation);
    Linear_Expression(Variable v, Representation r = default_representation);
    Linear_Expression(const Linear_Expression& e);
    Linear_Expression(const Linear_Expression& e, Representation r);
    Linear_Expression(const Linear_Expression& e, dimension_type space_dim);
    Linear_Expression(const Linear_Expression& e, dimension_type space_dim,
                      Representation r);
    

    For a supported expression adapter v, representation r and valid space dimension d, these effective constructor calls shall be admitted:

    Linear_Expression a(v);
    Linear_Expression b(v, r);
    Linear_Expression c(v, d);
    Linear_Expression e(v, d, r);
    
    VERIFICATION_CRITERIA:

    Check both representations, constants of each sign, variables including a nonleading coordinate, zero-sized and trailing-zero copies, shrink/extend operations, independent later mutations and variable-limit rejection. Evaluate copies over rational points against a separately transformed coefficient vector. Check all four adapter-copy forms with constraint and congruence expression views, including hidden strictness, shrinking, extending and later independent mutations.

    SOURCE:

    src/Expression_Adapter_defs.hh; tests/commonhelpersspec1.cc; src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc; tests/linearexpressionbranches1.cc.

  • PPL-SPEC-000073
    3. Independent assignment, destruction and swapping UID: PPL-SPEC-000073 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy assignment shall replace the target coefficients, dimension and representation with those of the source at entry, return a reference to the target, and preserve a distinct source. Self-assignment shall preserve the value, dimension and representation. Construction or assignment from an rvalue shall admit the copy forms and retain the source value; no distinct move operation is required. A separately owned copy shall remain usable after mutation or destruction of the original.

    m_swap and the PPL swap overload shall exchange complete values, dimensions and representations; swapping an object with itself shall preserve it. Destruction shall release the object's owned representation. Assignment shall leave the target unchanged if creating its replacement copy fails.

    RATIONALE:

    Owning value semantics separate expression lifetime from borrowed coefficient references. Swapping the owned representation must also exchange its representation choice.

    INTERFACE:
    Linear_Expression& Linear_Expression::operator=(const Linear_Expression& e);
    Linear_Expression::~Linear_Expression();
    void Linear_Expression::m_swap(Linear_Expression& y);
    void swap(Linear_Expression& x, Linear_Expression& y);
    
    VERIFICATION_CRITERIA:

    Check return identity, self-assignment, rvalue copy behavior, cross-representation assignment and both swap forms. Destroy originals while retaining copies. Inject failure while copying a replacement and check unchanged target and source.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc.

  • PPL-SPEC-000074
    4. Value-preserving representation selection and conversion UID: PPL-SPEC-000074 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report the expression's current storage choice. For r equal to DENSE or SPARSE, successful set_representation(r) shall select r while preserving every coefficient, the constant term and declared space dimension. Repeating the current choice shall preserve the expression. Explicit-representation copy construction shall make the same coefficient-preservation guarantee for a distinct result. If creating a converted representation fails, set_representation shall leave the original unchanged.

    RATIONALE:

    Dense and sparse storage encode the same affine function; changing storage is not coefficient normalization.

    INTERFACE:
    Representation Linear_Expression::representation() const;
    void Linear_Expression::set_representation(Representation r);
    Linear_Expression(const Linear_Expression& e, Representation r);
    
    VERIFICATION_CRITERIA:

    Convert both directions and repeat the existing representation, including zero, constants, sparse gaps and unused trailing coordinates. Compare coefficient vectors and independent rational evaluations. Inject conversion allocation failures and check unchanged state.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc.

  • 5. Ambient dimension queries and trailing-coordinate resizing UID: PPL-SPEC-000075 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall return the common maximum supported expression dimension. space_dimension() shall return the declared ambient dimension, including unused trailing coordinates. For n <= max_space_dimension(), successful set_space_dimension(n) shall retain the constant term and coefficients with indices below the lesser of the old and new dimensions. Extension shall give all new coordinates zero coefficients. Shrinking shall discard removed coefficients. Resizing to the current dimension shall preserve all coefficients. These operations shall retain the representation.

    RATIONALE:

    Expression resizing erases coefficient slots rather than performing existential projection of a pointset.

    INTERFACE:
    static dimension_type Linear_Expression::max_space_dimension();
    dimension_type Linear_Expression::space_dimension() const;
    void Linear_Expression::set_space_dimension(dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check zero-dimensional extension, unchanged size, nonzero trailing-coordinate truncation, all-coordinate removal and subsequent extension. Compare coefficients and evaluations with an independent vector resize, for dense and sparse storage.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 6. Coefficient access, replacement and zero predicates UID: PPL-SPEC-000076 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Coefficient accessors shall require an lvalue receiver, with the corresponding const && overloads deleted in every coefficient profile. References shall not outlive their owning expression.

    coefficient(v) shall return the stored homogeneous coefficient when v.id() is within the declared dimension, and zero otherwise. inhomogeneous_term() shall return the constant term. Returned references, where the configured trait returns references, shall be borrowed until the expression is modified or destroyed.

    For a variable within the declared dimension, set_coefficient(v,n) shall replace only that coefficient. set_inhomogeneous_term(n) shall replace only the constant term. Both shall preserve dimension and representation. Scalar inputs may be borrowed from the expression being modified; their entry values shall be used.

    is_zero() shall hold exactly when every homogeneous coefficient and the constant term are zero. all_homogeneous_terms_are_zero() shall disregard the constant term. For a Variables_Set whose indices are within the expression dimension, all_zeroes(vars) shall hold exactly when every selected homogeneous coefficient is zero. An empty selection shall satisfy that predicate. is_equal_to(other) shall hold exactly when the declared space dimensions, constant terms and all homogeneous coefficients are equal, independently of representation. It shall not test equality of zero sets; expressions differing by a nonunit scale shall generally compare unequal.

    RATIONALE:

    A missing homogeneous coefficient is zero, while overwriting a term must not silently extend the ambient dimension. Constant and homogeneous zero tests answer different questions.

    INTERFACE:
    Coefficient_traits::const_reference
    Linear_Expression::coefficient(Variable v) const &;
    Coefficient_traits::const_reference
    Linear_Expression::inhomogeneous_term() const &;
    void Linear_Expression::set_coefficient(Variable v,
                                          Coefficient_traits::const_reference n);
    void Linear_Expression::set_inhomogeneous_term(
      Coefficient_traits::const_reference n);
    bool Linear_Expression::is_zero() const;
    bool Linear_Expression::all_homogeneous_terms_are_zero() const;
    bool Linear_Expression::all_zeroes(const Variables_Set& vars) const;
    bool Linear_Expression::is_equal_to(const Linear_Expression& other) const;
    
    VERIFICATION_CRITERIA:

    Check sparse absent terms and out-of-dimension reads, replacement by zero and nonzero values, untouched coefficients and dimensions, constant-only and total zero, empty and mixed selected zero sets. Copy borrowed values before mutation.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 7. Affine addition, subtraction and negation UID: PPL-SPEC-000077 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For operands denoting E and F, expression addition and subtraction shall produce E + F and E − F, using zero coefficients for missing trailing coordinates and the maximum input dimension. Mixed variable forms shall treat a variable as its coordinate function. Mixed coefficient forms shall treat a coefficient as a dimension-zero constant. Unary plus shall return an independent copy; unary minus and neg_assign shall negate every coefficient, including the constant, without changing dimension.

    Compound addition and subtraction shall update the target from entry values, return a reference to it, retain its representation, and permit the target as the expression source. Distinct sources shall remain unchanged. Zero cancellation shall retain the computed maximum dimension. An operation adding or subtracting a variable beyond the supported expression dimension shall throw std::length_error before modifying the target. The numerical prerequisites of 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Affine equality is stronger than equality of the zero sets of expressions. Independent evaluation detects unintended scaling or sign changes.

    INTERFACE:

    For Linear_Expression operands e and f, Variable operands v and w, and Coefficient operand n, these forms shall be available in a C++ function using PPL names:

    Linear_Expression sum(e + f), difference(e - f);
    Linear_Expression vv_sum(v + w), vv_difference(v - w);
    Linear_Expression ev_sum(e + v), ve_sum(v + e);
    Linear_Expression ev_difference(e - v), ve_difference(v - e);
    Linear_Expression en_sum(e + n), ne_sum(n + e);
    Linear_Expression en_difference(e - n), ne_difference(n - e);
    Linear_Expression positive(+e), negative(-e);
    Linear_Expression& expression_sum = (e += f);
    Linear_Expression& expression_difference = (e -= f);
    Linear_Expression& variable_sum = (e += v);
    Linear_Expression& variable_difference = (e -= v);
    Linear_Expression& constant_sum = (e += n);
    Linear_Expression& constant_difference = (e -= n);
    neg_assign(e);
    
    VERIFICATION_CRITERIA:

    Compare all overloads against independent affine sums and differences over rational valuations. Include unequal dimensions in both orders, dense/sparse combinations, self-addition/subtraction, constant changes, zero cancellation, return identity, source preservation and oversized variable rejection.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 8. Integral scalar multiplication and coefficient-wise division UID: PPL-SPEC-000078 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Multiplication by a coefficient c shall multiply every stored coefficient and the constant term by c, producing the affine function cE. Multiplication by zero shall retain the expression's dimension. operator*= shall update and return the target and retain its representation. Both scalar operand orders shall be available for a new result.

    For nonzero divisor c, operator/= shall replace each homogeneous coefficient and the constant term separately by its integral quotient rounded towards zero. It shall retain dimension and representation and return the target. This shall denote affine division E ⁄ c when all coefficients are divisible by c; otherwise it shall denote the expression formed from those truncated coefficients. No rational-coefficient result is implied. The scalar passed to a mutating operation shall not reference a coefficient owned by that target. The numerical prerequisites of 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Integer-coefficient division can change an affine function by truncating its coefficients. Exact scalar division is a special case that must not be confused with the general operation.

    INTERFACE:
    Linear_Expression operator*(const Linear_Expression& e,
                                Coefficient_traits::const_reference n);
    Linear_Expression operator*(Coefficient_traits::const_reference n,
                                const Linear_Expression& e);
    Linear_Expression& operator*=(Linear_Expression& e,
                                  Coefficient_traits::const_reference n);
    Linear_Expression& operator/=(Linear_Expression& e,
                                  Coefficient_traits::const_reference n);
    
    VERIFICATION_CRITERIA:

    Check both signs and zero multipliers, exact and inexact division with positive and negative divisors, constant terms and trailing dimensions. Compare quotient coefficients with an independent GMP truncating-division oracle and evaluate the resulting affine functions at rational points.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 9. Explicit scaled accumulation, combination and elimination UID: PPL-SPEC-000079 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Variable accumulation shall add or subtract cxv to the target, extending its dimension when needed. Expression accumulation shall add or subtract cF and use the maximum input dimension. linear_combine(y,c1,c2) shall assign c1E + c2F and require both multipliers nonzero. linear_combine_lax shall have that same meaning while admitting zero multipliers. Both shall retain the maximum input dimension, even when its coefficient cancels, and retain the target representation.

    For equal-dimension distinct expressions with nonzero coefficients a and b at v, linear_combine(y,v) shall assign (b ⁄ g)E − (a ⁄ g)F, where g = gcd(|a|, |b|). The chosen coordinate coefficient shall therefore be zero. The variable shall lie in that dimension.

    Expression sources shall be distinct from the target. Scalar multipliers shall not reference a coefficient owned by the target. Distinct sources shall be preserved. Numerical prerequisites in 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Eliminating a coefficient requires a specified scaled combination, not merely an expression that happens to have zero in that slot.

    INTERFACE:
    Linear_Expression& add_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, Variable v);
    Linear_Expression& sub_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, Variable v);
    void add_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, const Linear_Expression& y);
    void sub_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, const Linear_Expression& y);
    void Linear_Expression::linear_combine(const Linear_Expression& y,
      Coefficient_traits::const_reference c1,
      Coefficient_traits::const_reference c2);
    void Linear_Expression::linear_combine_lax(const Linear_Expression& y,
      Coefficient_traits::const_reference c1,
      Coefficient_traits::const_reference c2);
    void Linear_Expression::linear_combine(const Linear_Expression& y, Variable v);
    
    VERIFICATION_CRITERIA:

    Use dense/sparse cross products and unequal dimensions, positive and negative factors, zero factors for lax combinations, variable extension and accumulation return identity. Independently compute all coefficient vectors and rational evaluations. For elimination include shared factors and all coefficient-sign pairs.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 10. Coefficient normalization and sign normalization UID: PPL-SPEC-000080 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    normalize() shall divide all homogeneous coefficients and the constant term by their common nonnegative greatest common divisor when it is nonzero. The all-zero expression shall remain zero. sign_normalize() shall negate all coefficients and the constant term exactly when the first nonzero homogeneous coefficient, in increasing variable order, is negative. An expression having no nonzero homogeneous coefficient shall be unchanged by sign normalization, including a negative constant.

    Both operations shall retain dimension and representation and be idempotent. Normalization can scale the affine value; sign normalization can negate it. Neither operation shall promise affine-value preservation merely because its result has the same zero set. The numerical prerequisites of 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Primitive coefficients and a chosen leading sign are useful descriptor conventions, but they change affine values unless the chosen scale is one.

    INTERFACE:
    void Linear_Expression::normalize();
    void Linear_Expression::sign_normalize();
    
    VERIFICATION_CRITERIA:

    Check all-zero, positive and negative constants, coprime coefficients, a shared divisor, leading zero gaps, each sign of the first nonzero coefficient and unused trailing coordinates. Compare exact expected coefficients and rational evaluation scaling, and repeat each operation to establish idempotence.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • PPL-SPEC-000081
    11. Ordered iteration of nonzero homogeneous coefficients UID: PPL-SPEC-000081 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The owning expression's iterator-position accessors shall require an lvalue receiver, with the corresponding const && overloads deleted. Iterators shall not extend the owning expression's lifetime.

    begin() and end() shall delimit homogeneous nonzero coefficients in increasing coordinate order; the constant term and zero coefficients shall not occur. end() shall be the past-the-end position. lower_bound(v) shall return the first such coefficient whose variable identifier is at least v.id(), or end() when none exists; callers shall supply v.id() <= space_dimension(), including the past-the-end coordinate.

    Dereferencing a valid non-end iterator shall return its coefficient; variable() shall return its coordinate and index() shall return that coordinate's identifier plus one. Prefix increment/decrement shall navigate the sequence and return the changed iterator. Decrement shall require a preceding element; decrementing a nonempty sequence's end shall yield its last element. Iterator copies and assignment shall own independent positions, while borrowing the same expression. Iterators shall be compared only within the same unchanged expression. Mutating or destroying the expression shall invalidate them. A default iterator shall admit destruction or replacement; copying, dereferencing or navigating it is not required.

    visit_nonzero_coefficients(visitor) const & shall invoke the callback exactly once with a concrete borrowed, bidirectional range of the same ordered nonzero homogeneous terms. The callback shall accept dense and sparse ranges and return the same type for both. Representation shall be selected once; constructing, traversing and copying range iterators shall not allocate. Range begin and end access shall take constant time; locating their positions may be performed when constructing the view. The callback result and exceptions shall propagate unchanged. Owner rvalues shall be rejected. A range or iterator returned by the callback shall borrow the expression and shall obey the same invalidation rules. Adapter visitors shall honor the visible dimension and omit hidden descriptor coordinates.

    RATIONALE:

    Logical nonzero iteration hides storage differences. The public iterator index also includes the constant-slot offset, unlike a Variable identifier.

    INTERFACE:
    template <typename Visitor>
    decltype(auto) Linear_Expression::visit_nonzero_coefficients(Visitor&&) const &;
    class Linear_Expression::const_iterator;
    Linear_Expression::const_iterator Linear_Expression::begin() const &;
    Linear_Expression::const_iterator Linear_Expression::end() const &;
    Linear_Expression::const_iterator Linear_Expression::lower_bound(Variable v) const &;
    
    explicit Linear_Expression::const_iterator::const_iterator();
    Linear_Expression::const_iterator::const_iterator(const const_iterator& i);
    Linear_Expression::const_iterator::~const_iterator();
    Linear_Expression::const_iterator&
    Linear_Expression::const_iterator::operator=(const const_iterator& i);
    Linear_Expression::const_iterator& Linear_Expression::const_iterator::operator++();
    Linear_Expression::const_iterator& Linear_Expression::const_iterator::operator--();
    Linear_Expression::const_iterator::reference
    Linear_Expression::const_iterator::operator*() const;
    Variable Linear_Expression::const_iterator::variable() const;
    dimension_type Linear_Expression::const_iterator::index() const;
    bool Linear_Expression::const_iterator::operator==(const const_iterator& i) const;
    bool Linear_Expression::const_iterator::operator!=(const const_iterator& i) const;
    void Linear_Expression::const_iterator::m_swap(const_iterator& i);
    
    VERIFICATION_CRITERIA:

    Compare forward and reverse sequences with independently listed indices and coefficients for empty, constant, gapped and trailing-zero expressions in both representations. Check lower bounds at and between supported positions, copied/assigned iterator independence, return identity, member swap and replacement of a default iterator. Check the concrete visitor against independent coefficient lists, prefix visibility, exception propagation, rvalue rejection and an armed allocation failure.

    SOURCE:

    src/Linear_Expression_Coefficients.hh; src/Linear_Expression_templates.hh; src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 12. Explicit coefficient-coordinate transformations UID: PPL-SPEC-000082 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For variables within the expression dimension, swap_space_dimensions shall exchange exactly their coefficients and retain the constant term. permute_space_dimensions(cycle) shall require distinct, in-dimension variables. It shall move each listed coordinate coefficient to the following listed coordinate, and the last to the first. Empty and singleton cycles shall preserve the expression.

    remove_space_dimensions(vars) shall require in-dimension indices, discard their coefficients, and compact retained coordinates in their original order. Removing none shall preserve the expression; removing all shall retain only the constant term. shift_space_dimensions(v,n) shall require v.id() <= space_dimension() and a resulting dimension not exceeding max_space_dimension(). It shall insert n zero coefficients immediately before v, shift subsequent coefficients by n, and increase the dimension accordingly. Insertion at the old dimension shall append zeros. A zero shift shall preserve the expression.

    These transformations shall preserve the inhomogeneous term and representation. They shall implement the stated coefficient rearrangement, with no claim that discarding a nonzero coefficient preserves the original affine value.

    RATIONALE:

    Descriptor coefficient transformation is distinct from existential pointset projection. Explicit placement makes the resulting affine meaning unambiguous.

    INTERFACE:
    void Linear_Expression::swap_space_dimensions(Variable v1, Variable v2);
    void Linear_Expression::permute_space_dimensions(
      const std::vector<Variable>& cycle);
    void Linear_Expression::remove_space_dimensions(const Variables_Set& vars);
    void Linear_Expression::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Use independently permuted, filtered and shifted coefficient vectors. Check self-swaps, empty/singleton and longer cycles, zero and nonzero moved coefficients, removal of no/all/interior coordinates, zero shifts, insertion at front/interior/end and preserved constant terms in both representations.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 13. Reloadable ASCII export and replacement loading UID: PPL-SPEC-000083 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall write a reloadable representation consisting of the word size, the number of coefficient slots d + 1, and then the constant term followed by all homogeneous coefficients in increasing variable order. Whitespace shall separate tokens. ascii_dump() shall write the same representation to std::cerr. Export shall preserve the expression.

    Given a compatible complete representation with representable coefficient values and a positive slot count not exceeding the supported storage limit, ascii_load(s) shall return true and replace the expression with the encoded coefficients and dimension, retaining its destination representation. The slot count shall include the constant slot, so zero shall be rejected with false before resizing, preserving the destination expression. A missing or incorrect size token, missing count, malformed coefficient or truncated coefficient sequence shall yield false. Trailing input after the indicated coefficient count shall remain available to the caller. The contract shall not promise a stable cross-version wire format.

    Other reported load failures may change the destination. It shall remain destructible and may be replaced by a subsequent complete valid load; no rollback is promised. Allocation and configured numerical failures may propagate through their documented exception channels.

    RATIONALE:

    A reloadable expression carries its ambient dimension and constant term, while storage choice belongs to the destination. An empty coefficient sequence cannot encode an affine expression.

    INTERFACE:
    void Linear_Expression::ascii_dump(std::ostream& s) const;
    void Linear_Expression::ascii_dump() const;
    bool Linear_Expression::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip constants, gaps, trailing zeros and modified expressions through all dense/sparse producer and consumer pairs. Compare literal coefficient vectors and rational evaluations. Check exact token order, trailing-input preservation, malformed headers/counts/coefficients and truncation. Verify that zero-slot rejection preserves coefficients, dimension and representation. After other failures exercise destruction and complete replacement, without assuming unchanged state.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • PPL-SPEC-001644
    6. Common dimension validation and domain limit UID: PPL-SPEC-001644 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    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.

    RATIONALE:

    Dimension rejection must precede impossible storage requests, and the common domain limit must account for every listed built-in representation.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library unless qualified otherwise. Template excerpts omit SFINAE return-type restrictions described in the text.

    dimension_type check_space_dimension_overflow(dimension_type, dimension_type,
                                                   const char*, const char*,
                                                   const char*);
    dimension_type max_space_dimension();
    
    VERIFICATION_CRITERIA:

    Check zero, equality, immediately excessive and greatest representable dimensions with exact diagnostic text, then independently take the minimum of all listed static domain limits and repeat the free query. Check callability before PPL initialization separately from shared-cache synchronization.

    SOURCE:

    src/globals.cc; src/globals_defs.hh; src/max_space_dimension.hh; tests/scalaradaptersspec1.cc; tests/scalaradapterspreinit1.cc.

  • 1. Public coordinate-index set and value lifecycle UID: PPL-SPEC-000021 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The public C++ interface shall expose Variables_Set as a public derivative of std::set<dimension_type>. Its stored value shall be a finite set of distinct indices enumerated in increasing numerical order. A coordinate-valid set shall contain only indices i < Variable : : max_space_dimension(). The empty set shall be coordinate-valid. A set shall select coordinates without imposing an ambient dimension on an object that consumes the selection.

    The inherited C++20 std::set<dimension_type> interface shall remain available subject to the overloads actually declared by Variables_Set. Base-class constructors and assignment overloads shall not be implicitly added to the public derived interface. Construction from arbitrary iterator ranges shall be performed by default construction followed by inherited range insertion. Raw-index base operations may store any dimension_type value; they shall not validate coordinate admissibility. Before using the set as a coordinate selection or calling a member that requires coordinate validity, clients shall establish the validity of every stored index, for example using OK().

    Implicit copy construction and copy assignment shall have the C++20 value and exception behavior of the std::set base. Successful copies shall contain exactly the source indices with independently owned nodes. Implicit moves shall transfer the value according to the standard base-container rules; moved-from objects shall remain valid with the state permitted by those rules. Destruction shall release owned nodes. A Variables_Set shall not be deleted through a pointer to its nonvirtual base destructor.

    Operations on existing objects shall require live container objects. Callers shall obey the supported library/thread regime, serialize modifications of a shared instance and prevent unsynchronized modification while another call observes or copies it. No automatic invalid-lifetime or concurrent-use detection shall be required.

    RATIONALE:

    Coordinate selections need an ordered, duplicate-free representation with ordinary value ownership. Public inheritance exposes raw storage operations, so representable indices and valid coordinate indices are distinct contracts.

    INTERFACE:

    Public header: <ppl.hh>. Public type declaration:

    namespace Parma_Polyhedra_Library {
      class Variables_Set : public std::set<dimension_type> {
        // Member declarations are given in the following contracts.
      };
    }
    

    The following contracts describe declared members and applicable inherited operations. Copy/move members and destruction are implicitly declared.

    VERIFICATION_CRITERIA:

    Compile an installed-public-header C++20 client using the type, base conversion, copy/move operations and declared members. Check independent copies, lvalue assignment, self-copy assignment and permitted reuse of moved-from objects. Inject copy-construction and copy-assignment allocation failures, verifying source preservation and the target-state guarantees of the standard base container. Inspect owned-node cleanup and synchronization preconditions.

    SOURCE:

    src/Variables_Set_defs.hh: public inheritance and implicit value members. tests/variablesset1.cc: value, mutation and allocation-failure cases.

  • PPL-SPEC-000022
    2. Empty, singleton and inclusive-range construction UID: PPL-SPEC-000022 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Successful default construction shall create an empty Variables_Set. Successful construction from a valid Variable v shall create exactly {v.id()}. Successful construction from valid variables v and w shall create exactly {i ∣ v.id() ≤ i ≤ w.id()} when v.id() <= w.id() and the empty set otherwise. Both endpoints shall be included. No ambient dimension or additional indices shall be introduced.

    Failure to allocate storage shall propagate the applicable C++ exception and release resources acquired for the incomplete object. Inputs shall remain unchanged. No successfully constructed destination shall be returned on failure.

    RATIONALE:

    Empty selections, individual coordinates and inclusive consecutive selections are the primitive construction forms used by coordinate operations.

    INTERFACE:

    Public constructor declarations:

    Variables_Set();
    explicit Variables_Set(Variable v);
    Variables_Set(Variable v, Variable w);
    
    VERIFICATION_CRITERIA:

    Check empty, zero singleton, greatest valid singleton, equal endpoints, small inclusive intervals and reversed intervals, including a reversed interval whose first endpoint is the greatest valid index. Compare all stored indices with an independent sequence. Inject failures at each actual allocation in singleton and range construction; check input preservation and successful reconstruction. Do not attempt to allocate a set spanning the entire index range.

    SOURCE:

    src/Variables_Set_inlines.hh: empty and singleton constructors. src/Variables_Set.cc: inclusive-range constructor. tests/variablesset1.cc: construction and failed-construction cases.

  • PPL-SPEC-000023
    3. Index insertion and inherited ordered-set operations UID: PPL-SPEC-000023 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a live Variables_Set, successful insert(v) with a valid Variable shall add exactly v.id(). Inserting an already present index shall not create a duplicate. The declared overload shall coexist with the inherited C++20 std::set<dimension_type> insertion overloads. Raw insertion shall store the supplied index value without constructing or validating a Variable.

    Inherited insertion, emplacement, extraction, merging, erasure, clearing, lookup, bounds, comparison and iteration shall have the C++20 semantics of the base container. Forward traversal shall enumerate each stored index once in increasing order; reverse traversal shall enumerate them in decreasing order. Insertion shall preserve existing element references and iterators. Erasure shall invalidate references and iterators to erased elements according to the base-container rules. Callers shall satisfy the standard preconditions for iterator ranges, hints, node ownership and allocator compatibility. A node's key may be changed only while detached, under the inherited node-handle rules. Coordinate use of inserted or changed keys shall additionally require the validity conditions of 🔗 1. Public coordinate-index set and value lifecycle.

    Failed single-element insert allocation shall propagate std::bad_alloc without changing the set. Range insertion and other inherited operations shall have their standard operation-specific exception guarantees; no transactional rollback of an entire partially completed range insertion shall be implied.

    RATIONALE:

    Standard container interoperability supports coordinate-selection algorithms without silently changing raw indices into another mathematical object.

    INTERFACE:

    Declared overload and inherited insertion exposure:

    void insert(Variable v);
    using std::set<dimension_type>::insert;
    

    Other inherited operations retain their standard signatures. The using declaration shown expresses the exposed base overload set; the implementation may name that base using a private alias.

    VERIFICATION_CRITERIA:

    Compare insertion and mutation histories with an independent sorted sequence. Exercise Variable and raw-index insertion, duplicate insertion, hints, iterator ranges, initializer lists, emplacement, node extraction/reinsertion and merge. Check traversal in both directions, lookup and bounds at present/absent indices, iterator/reference stability, erasure and clear. Inject failed new-node insertion and check the complete unchanged set before retry. Check raw invalid indices through storage operations and OK(), without using them as coordinates.

    SOURCE:

    src/Variables_Set_defs.hh: public base operations and insertion overloads. src/Variables_Set_inlines.hh: insertion of a Variable index. tests/variablesset1.cc: ordered-container histories and failed insertion.

  • PPL-SPEC-000024
    4. Coordinate-set dimension and maximum dimension UID: PPL-SPEC-000024 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Variables_Set::max_space_dimension() shall return the same value as Variable::max_space_dimension(). For a coordinate-valid set S, space_dimension() shall return zero when S = ⌀ and 1 + maxS otherwise. Both queries shall leave the set unchanged.

    The returned dimension shall describe the smallest space enclosing the selected coordinates. It shall not count the selected coordinates or prescribe the ambient dimension of a consuming object. space_dimension() shall require a coordinate-valid set under 🔗 1. Public coordinate-index set and value lifecycle; raw storage of an invalid index shall not establish a supported dimension query.

    RATIONALE:

    A sparse selection may contain few coordinates while requiring a much larger enclosing space. An empty selection has enclosing dimension zero.

    INTERFACE:

    Public declarations:

    static dimension_type max_space_dimension();
    dimension_type space_dimension() const;
    
    VERIFICATION_CRITERIA:

    Check empty sets, index zero, sparse sets, insertion and removal of the greatest stored index, clear, and a singleton at the greatest valid index. Independently compare against zero or one plus the largest index and verify unchanged contents. Check equality of the Variable and Variables_Set maximum dimension queries.

    SOURCE:

    src/Variables_Set_inlines.hh: dimension queries. tests/variablesset1.cc: sparse and boundary dimension cases.

  • PPL-SPEC-000025
    5. Inherited set swap and element ownership UID: PPL-SPEC-000025 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For live Variables_Set objects satisfying the inherited allocator compatibility preconditions, inherited member swap shall exchange their complete stored sets with the C++20 base-container semantics. A successful self-swap shall preserve the value. References and iterators to stored elements shall remain associated with those elements in the receiving container, subject to the standard exception for past-the-end iterators. Swap shall not require coordinate validity of raw stored indices.

    RATIONALE:

    Ownership exchange must preserve coordinate indices and existing element references without introducing a hidden copy of a selection.

    INTERFACE:

    Inherited member callable form, where base_type denotes std::set<dimension_type>:

    void swap(base_type& other);
    

    The actual inherited exception specification follows the C++20 base container.

    VERIFICATION_CRITERIA:

    Swap distinct empty/nonempty and differently sized sets. Check exact contents, reference and iterator association, dimensions for valid sets and self-swap. Arm allocation failure across member swap and verify it completes without allocating under the selected standard allocator configuration.

    SOURCE:

    src/Variables_Set_defs.hh: inherited std::set member swap. tests/variablesset1.cc: ownership, reference stability and allocation-free swap.

  • PPL-SPEC-000026
    6. Coordinate-set diagnostic output and formatter prerequisites UID: PPL-SPEC-000026 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Diagnostic output shall observe a coordinate-valid set without modifying its indices. With compatible ordinary character formatting and successful output, operator<< shall write "{", each selected Variable in increasing index order preceded by one space, a comma after every Variable except the last, and the final text " }". Thus an empty set shall write "{ }". Variable text shall be produced by the active Variable formatter at each write. The operator shall return the supplied stream reference. It shall not add a newline or request a flush. print() shall perform this output to std::cerr.

    Calls shall require the library/thread initialization protocol of 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization to have established a valid active Variable formatter under 🔗 7. Active Variable formatter and initialized thread state. Formatter dispatch shall follow 🔗 8. Variable names, formatter dispatch and output failures. Clients shall synchronize formatter changes, shared streams and shared-set access under the supported thread regime. The formatter shall not mutate the printed set during output. Stream formatting and error reporting shall follow ordinary C++ insertion semantics. Formatter exceptions and stream exceptions shall propagate; ordinary nonthrowing stream failures shall remain observable through the stream state. Partial output may remain after failure, while the set shall remain unchanged.

    RATIONALE:

    Diagnostic text is a formatted view of coordinates and depends on the same initialization and formatter state as individual Variable output.

    INTERFACE:

    Public declarations:

    std::ostream& IO_Operators::operator<<(std::ostream& s,
                                         const Variables_Set& vs);
    void print() const;
    
    VERIFICATION_CRITERIA:

    Check literal empty and sparse output, ordering, return-reference identity, absence of newline/flush, custom formatters and forwarding through print(). Check pending width/fill behavior using the actual sequence of character and text insertions. Exercise nonthrowing and throwing stream failures and a throwing formatter, verifying unchanged indices and restoration of test-owned formatter and stream state. Review initialization and thread prerequisites.

    SOURCE:

    src/Variables_Set_defs.hh and src/Variables_Set.cc: output operator. src/globals_defs.hh: generated print forwarding definition. tests/variablesset1.cc: output, formatter and stream-failure cases.

  • PPL-SPEC-000027
    7. Reloadable coordinate-set text export UID: PPL-SPEC-000027 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a live Variables_Set and a stream with decimal integer formatting, zero pending field width and the classic C locale, successful ascii_dump(s) shall write a newline, "variables( ", the number of stored indices, " )", a newline, and then each raw stored index in increasing order followed by one space. An empty set shall have no index payload. The operation shall append no additional characters or explicit flush after this sequence. It shall leave the set unchanged and shall not invoke the Variable formatter and shall also permit raw indices that fail coordinate validity. The no-argument overload shall write the same representation to std::cerr under those formatting conditions.

    For coordinate-valid input and compatible producer/consumer formatting, successful loading of this representation under 🔗 8. Coordinate-set text loading and partial failure state shall preserve the selected indices and enclosing dimension. The format shall not promise compatibility with every library version or with arbitrary incompatible locale, numeric base or formatting settings. Stream failure shall follow C++ stream state and exception-mask semantics; partial output may remain and the source set shall remain unchanged.

    RATIONALE:

    Machine-oriented coordinate indices must be reloadable independently of custom human-readable coordinate names.

    INTERFACE:

    Public declarations:

    void ascii_dump(std::ostream& s) const;
    void ascii_dump() const;
    
    VERIFICATION_CRITERIA:

    Compare exact empty and sparse dumps against independently written literals. Round-trip valid sets including the greatest valid index and compare all indices and dimensions. Verify dump ignores a throwing Variable formatter, forwards the no-argument overload to std::cerr and preserves the source after nonthrowing or throwing stream failure.

    SOURCE:

    src/Variables_Set.cc: stream dump implementation. src/globals_defs.hh: generated no-argument dump forwarding definition. tests/variablesset1.cc: literal frames, reload and dump-failure cases.

  • PPL-SPEC-000028
    8. Coordinate-set text loading and partial failure state UID: PPL-SPEC-000028 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_load(s) shall first clear the destination's existing indices. With whitespace-skipping extraction enabled, decimal integer conversion and the classic C locale, it shall accept an opening token "variables(", a nonnegative dimension_type count, a closing token ")" and exactly that count of nonnegative indices below Variable::max_space_dimension(). On successful loading it shall return true and contain exactly the set of extracted indices. Duplicate payload indices shall be collapsed and payload order need not be sorted. Tokens following the declared payload shall remain available to the caller. Loading shall not invoke the Variable formatter.

    Missing, wrong, unextractable or out-of-range required fields shall return false unless the stream's exception mask causes an exception. A false result shall leave the destination empty if the header failed, or containing exactly the successfully inserted prefix of payload indices if a payload extraction failed. Allocation or stream exceptions shall propagate; the old value shall not be restored, and successfully inserted prefix indices may remain. The destination shall remain a live base-container object available for inspection, clear, reassignment and destruction. No unchanged-state guarantee shall be implied.

    A true result shall certify a coordinate-valid set with exactly the loaded indices and their enclosing dimension as checked by 🔗 10. Coordinate-validity checking of raw indices.

    RATIONALE:

    A nontransactional parser must make replacement and valid-prefix state explicit.

    INTERFACE:

    Public declaration:

    bool ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Load independent empty, sparse, unsorted and duplicate-containing literals into nonempty receivers. Check allowed whitespace, exact payload framing and an unconsumed trailing marker. Exercise every bounded truncation, wrong markers, nonnumeric and overflowing counts/indices; check the exact retained prefix before reset. Reject signed-negative counts and out-of-range coordinate indices. Inject allocation failure at payload insertion and throwing stream extraction, checking live prefix state and successful later clear/reload.

    SOURCE:

    src/Variables_Set.cc: ascii_load clear, token parsing and index insertion. tests/variablesset1.cc: valid, malformed and exceptional loading cases.

  • PPL-SPEC-000029
    9. Coordinate-set memory estimates UID: PPL-SPEC-000029 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a live Variables_Set, external_memory_in_bytes() shall return the implementation's per-node estimate multiplied by the number of stored indices. Its per-node estimate shall account for one dimension index, three pointers and one stored tree-color enumeration. It shall be independent of the numerical values of the indices, and shall be zero for an empty set. Where the reported arithmetic is representable in memory_size_type, total_memory_in_bytes() shall equal sizeof(Variables_Set) plus that external estimate. Both queries shall leave the set unchanged and shall also permit raw indices outside the coordinate-valid range.

    These results shall be storage estimates under the stated node-layout model. They shall not certify allocator bookkeeping, alignment padding, actual standard-library node layout or process resident memory.

    RATIONALE:

    Stable estimates support relative resource observations while exposing the layout assumptions instead of presenting them as exact allocator measurements.

    INTERFACE:

    Public declarations:

    memory_size_type external_memory_in_bytes() const;
    memory_size_type total_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check empty, singleton and larger sets for zero external estimate, positive linear growth and the total/external identity. Compare equal-sized sets with different indices and verify changes through duplicate insertion, erasure, clear, copy and swap. Inspect the per-node arithmetic against its documented model; do not equate the estimate with allocator or resident-memory counters.

    SOURCE:

    src/Variables_Set_inlines.hh: per-node memory estimate and total query. tests/variablesset1.cc: memory estimates across value histories.

  • 10. Coordinate-validity checking of raw indices UID: PPL-SPEC-000030 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For any live Variables_Set satisfying its base-container invariants, OK() shall return true exactly when every stored raw index is strictly less than Variable::max_space_dimension(). It shall return true for an empty set. An index equal to the maximum dimension, one greater than that limit, or not_a_dimension() shall make the result false. Invalid raw coordinate indices shall be a defined check outcome and shall not cause std::length_error. The check shall leave every stored index unchanged.

    RATIONALE:

    Raw inherited operations and syntactic loading can introduce indices that do not denote Variables. A boolean invariant check must inspect that state safely before coordinate-semantic operations are attempted.

    INTERFACE:

    Public declaration:

    bool OK() const;
    
    VERIFICATION_CRITERIA:

    Check empty and sparse valid sets, the greatest valid index, and each distinct invalid boundary index alone and mixed with valid indices. Insert invalid values through raw base operations and through text loading. Require false without an exception and compare complete contents before and after each check. Verify clear or removal restores validity.

    SOURCE:

    src/Variables_Set.cc: raw-index validity check. tests/variablesset1.cc: valid/invalid boundary checking and restoration.

  • 1. Coordinate type and reserved dimension index UID: PPL-SPEC-000011 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The public dimension_type shall be an unsigned integral type identical to std::size_t. Let S be its largest representable value. The function not_a_dimension() shall return S, reserved to indicate that no valid dimension is designated. Zero shall be an ordinary index and the dimension of a zero-dimensional space. The type shall not depend on the coefficient profile. The representable index range shall not by itself promise that a particular numerical object supports that many coordinates or that corresponding storage can be allocated.

    RATIONALE:

    A common unsigned coordinate vocabulary distinguishes ordinary coordinates, space-dimension counts and an absent-dimension indication without making a storage-capacity promise.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    typedef std::size_t dimension_type;
    dimension_type not_a_dimension();
    
    VERIFICATION_CRITERIA:

    Check type identity with std::size_t, unsigned integral properties and sentinel equality to std::numeric_limits<dimension_type>::max() in C++20. Check zero and boundary arithmetic without overflowing the type. Inspect the configuration-independent declaration and sentinel implementation. Compile a client against installed <ppl.hh> and its matching configured library.

    SOURCE:

    src/globals_types.hh: dimension_type. src/globals_defs.hh and src/globals_inlines.hh: not_a_dimension. tests/variable1.cc: coordinate_type_and_reserved_value.

  • PPL-SPEC-000012
    2. Variable value identity and lifetime operations UID: PPL-SPEC-000012 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The public Variable type shall represent one Cartesian coordinate by its nonnegative identifier, with limits defined by 🔗 3. Variable construction, coordinate queries and bounds. Its meaning shall depend only on that identifier, independently of C++ object names, other variables and the current output function. Operations on existing variables shall require live valid objects; construction shall require valid source objects only where a source is supplied.

    Implicit copy and move construction shall create a variable with the source's identifier and shall preserve the source. Implicit copy and move assignment shall set the target's identifier to the source's entry identifier, return a reference to the target and preserve a distinct source. Self-assignment shall preserve the identifier. Each variable shall remain an independent value. These value operations and destruction shall require no external storage allocation; destruction shall not alter another variable. Callers shall prevent unsynchronized access to an object while another operation changes its value.

    RATIONALE:

    Coordinate identity is a value, so copying or disposing of a C++ handle must not rename another coordinate or create shared mutable coordinate storage.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    class Variable;
    
    // Callable forms of the implicit public value operations:
    Variable(const Variable& source);
    Variable(Variable&& source);
    Variable& operator=(const Variable& source);
    Variable& operator=(Variable&& source);
    ~Variable();
    
    VERIFICATION_CRITERIA:

    Copy, move and assign variables with zero, ordinary and greatest admitted identifiers. Check source preservation, independent later assignment, returned references, chained assignments and self-copy/self-move assignment. Inspect the scalar representation, implicit special members and absence of external storage; check their C++20 trivial-copy and nonthrowing value-operation traits. Use installed-public-header clients for public exposure and matching-library compatibility. Review synchronization separately from sequential value tests.

    SOURCE:

    src/Variable_defs.hh: public class and scalar representation. tests/variable1.cc: variable_value_operations_preserve_coordinate_identity.

  • 3. Variable construction, coordinate queries and bounds UID: PPL-SPEC-000013 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Let S = not_a_dimension(). The query Variable::max_space_dimension() shall return S − 1. Construction from i shall succeed exactly for 0 ≤ i < S − 1, subject to ordinary C++ runtime conditions, and shall create a variable with id() == i and space_dimension() == i+1. In particular, the greatest admitted identifier shall be S − 2; its space dimension shall be S − 1.

    An identifier equal to S − 1 or S shall be rejected with std::length_error without producing a variable. Range rejection shall not rely on wrapping i+1. Exact exception-message text is not prescribed. Queries on a live valid variable shall leave its identifier unchanged and return the exact identifier and enclosing-space dimension. These operations shall not depend on the active formatter or allocate coordinate storage.

    RATIONALE:

    An enclosing space must include the coordinate itself while avoiding the reserved dimension value and unsigned overflow at the upper boundary.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    explicit Variable(dimension_type i);
    static dimension_type max_space_dimension();
    dimension_type id() const;
    dimension_type space_dimension() const;
    
    VERIFICATION_CRITERIA:

    Check zero, ordinary identifiers, alphabet boundaries and the greatest admitted identifier against independent arithmetic. Check exact std::length_error type for both rejected boundary values, then construct and query another valid variable. Inspect the comparison performed before addition and query formulas. Exercise both assertion regimes without allocating a coordinate-sized object.

    SOURCE:

    src/Variable_defs.hh and src/Variable_inlines.hh: constructor and queries. tests/variable1.cc: variable_bounds_and_dimensions.

  • PPL-SPEC-000014
    4. Variable ordering by coordinate identity UID: PPL-SPEC-000014 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For live valid variables v and w, less(v, w) and Variable::Compare{}(v, w) shall both return true exactly when v.id() < w.id(). They shall leave the operands unchanged. Equal identifiers shall compare false in both directions, independently of object identity or formatted names. The predicates shall define a strict total ordering of coordinate identifiers and shall allocate no storage.

    RATIONALE:

    Ordered coordinate containers require one consistent ordering that preserves coordinate identity even when output names are customized.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    bool less(Variable v, Variable w);
    struct Variable::Compare {
      bool operator()(Variable v, Variable w) const;
    };
    
    VERIFICATION_CRITERIA:

    Compare all pairs in an independently ordered sample containing duplicates, zero and the greatest admitted identifier. Check both predicates against index comparison, irreflexivity, reversed unequal pairs and transitivity. Verify unchanged identifiers and inspect allocation-free implementations.

    SOURCE:

    src/Variable_defs.hh and src/Variable_inlines.hh: less and Compare. tests/variable1.cc: variable_ordering_matches_identifier_order.

  • PPL-SPEC-000015
    5. Variable exchange and self-exchange UID: PPL-SPEC-000015 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For live valid variables x and y, both x.m_swap(y) and swap(x, y) shall exchange their entry identifiers exactly and leave both variables valid. When both arguments designate the same variable, its identifier shall remain unchanged. Exchange shall allocate no storage and shall not depend on formatted names or the active output function.

    RATIONALE:

    Coordinate values need a constant-storage exchange operation with defined aliasing behavior for generic value manipulation.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    void m_swap(Variable& other);
    void swap(Variable& x, Variable& y);
    
    VERIFICATION_CRITERIA:

    Check member and nonmember exchange of distinct values, equal identifiers, zero and the greatest admitted identifier. Check self-exchange through both entry points. Verify both identifiers, dimensions and validity after each call; inspect the scalar exchange for absence of allocation.

    SOURCE:

    src/Variable_defs.hh and src/Variable_inlines.hh: exchange functions. tests/variable1.cc: variable_swap_exchanges_only_the_two_values.

  • PPL-SPEC-000016
    6. Variable validity and memory accounting UID: PPL-SPEC-000016 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For every live valid variable, OK() shall return true without changing its value. The representation invariant checked by OK() shall be id() < max_space_dimension(). external_memory_in_bytes() shall return zero and total_memory_in_bytes() shall return sizeof(Variable): variables shall own no separately allocated coordinate storage. These queries shall leave the identifier and formatter state unchanged and shall allocate no storage. No operation shall require constructing an invalid object to use this diagnostic.

    RATIONALE:

    Validity and memory reports make the compact coordinate-value representation observable without exposing or manufacturing invalid object states.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    bool OK() const;
    memory_size_type external_memory_in_bytes() const;
    memory_size_type total_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check validity and both memory reports for zero, ordinary and greatest admitted identifiers and after copying, assignment and exchange. Compare total memory with sizeof(Variable), preserving identifiers and the active formatter. Inspect the invariant check and scalar representation; do not corrupt an object solely to execute a diagnostic failure path.

    SOURCE:

    src/Variable_defs.hh, src/Variable_inlines.hh and src/Variable.cc: validity and memory-accounting queries. tests/variable1.cc: variable_validity_and_memory_are_value_independent.

  • 7. Active Variable formatter and initialized thread state UID: PPL-SPEC-000017 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The public output_function_type shall denote a function accepting an output stream and a Variable value, returning void. set_output_function(p) shall store exactly p without invoking it; get_output_function() shall return the pointer currently stored for the applicable runtime context. Neither operation shall allocate storage or change any variable identifier.

    The applicable initialization and thread-entry protocol of 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization shall establish the default output function before variable insertion is used. In a thread-safe build the stored pointer shall be thread-local. Otherwise it shall be shared within the process, and callers shall serialize formatter changes and uses. Callers shall also synchronize shared-stream access and mutable callback state as needed.

    Storing a null pointer shall be permitted, and a subsequent getter shall return null; insertion shall require a nonnull callable pointer. The caller shall retain any callback dependencies for its use period and restore a callable pointer before subsequent insertion. Setting a formatter shall not acquire ownership of callback dependencies. This interface shall not diagnose every violation of initialization, callback-lifetime or concurrency preconditions.

    RATIONALE:

    Separating the current callback from coordinate identity permits user naming and thread-specific names while making callback validity and ownership explicit.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    typedef void output_function_type(std::ostream& s, const Variable v);
    static void set_output_function(output_function_type* p);
    static output_function_type* get_output_function();
    
    VERIFICATION_CRITERIA:

    Check the initialized default pointer, exact set/get round trips for distinct callbacks, absence of callback invocation during set/get, null storage followed by restoration and unchanged coordinate values. In thread-safe builds initialize workers through the supported thread protocol and check isolated pointers and output on separate streams while preserving the parent pointer. Review the shared-pointer and callback-state synchronization conditions in other builds. Check independent public-header workers, default formatter and precision, parent-state isolation and worker rounding restoration.

    SOURCE:

    src/Variable_defs.hh, src/Variable_inlines.hh and src/Variable.cc: formatter type, accessors and configured pointer storage. src/Init.cc: default formatter installation at thread initialization. tests/variable1.cc: variable_formatter_pointer_round_trips_without_calls and variable_formatters_are_thread_local. tests/threadsafepublic1.cc: Check independent public-header workers, default formatter and precision, parent-state isolation and worker rounding restoration.

  • 8. Variable names, formatter dispatch and output failures UID: PPL-SPEC-000018 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a live valid variable with identifier i, let q = ⌊i ⁄ 26⌋ and r = i − 26q. Successful direct use of default_output_function shall insert the uppercase character at position r in ABCDEFGHIJKLMNOPQRSTUVWXYZ. If q is nonzero, it shall then insert q as an unsigned integer using the stream's current formatting; otherwise it shall insert no suffix. Character and integer insertions shall honor their applicable stream formatting and locale. The function shall add no separator, newline or explicit flush, and shall not change the active formatter.

    Under 🔗 7. Active Variable formatter and initialized thread state, IO_Operators::operator<< shall invoke the currently active output function exactly once with the supplied stream and variable value, and shall return that same stream reference on normal return. Each insertion shall obtain the pointer active for that call. A callback may change the formatter for subsequent calls; insertion shall not restore the old pointer or undo callback changes to the stream. Direct default formatting shall not consult the active pointer.

    Output shall not change the variable identifier. Stream failures shall follow the stream's state and exception-mask rules. Callback exceptions and applicable C++ resource exceptions shall propagate; partial output and callback changes to formatter or stream state shall remain observable, with no output rollback promised. Callbacks shall satisfy the stream, lifetime and synchronization preconditions and shall not invalidate an object accessed by the call.

    RATIONALE:

    Default coordinate names are compact and deterministic under a given stream format, while direct callback dispatch preserves customization and ordinary C++ stream failure semantics.

    INTERFACE:

    Public header: <ppl.hh>. Declarations in Parma_Polyhedra_Library; member declarations belong to Variable unless qualified otherwise.

    static void default_output_function(std::ostream& s, const Variable v);
    
    namespace IO_Operators {
      std::ostream& operator<<(std::ostream& s, const Variable v);
    }
    
    VERIFICATION_CRITERIA:

    Check independent expected names across alphabet and quotient boundaries and at the greatest admitted identifier. Check width, fill, alignment, integer base, locale, returned stream identity and absence of an added newline or explicit flush. Check exactly one callback invocation and the passed identifier, direct default formatting with another callback active, callback changes between successive insertions, a prefailed stream, rejecting streams with exceptions disabled and enabled, and a callback that changes state before throwing. Verify unchanged identifiers and retained callback/stream effects on failures.

    SOURCE:

    src/Variable_defs.hh and src/Variable.cc: default output and insertion. tests/variable1.cc: default-name, formatting, dispatch and failure checks.

  • PPL-SPEC-001728
    6. Java mathematical representations and operation options UID: PPL-SPEC-001728 STATUS: APPROVED COMPONENT: JAVA_INTERFACE APPLICABILITY: IF_JAVA VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Java VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For valid supported Java values, native exchange shall preserve variable indices, representable coefficients and the mathematical meaning of expression trees, constraints, congruences, generators, grid generators and artificial parameters. Expression sums, differences, integer products and negation shall retain their operands' meanings. Constraint direction, congruence modulus, generator kind and divisor, and artificial-parameter numerator and denominator shall be preserved. Coefficient exchange obeys 🔗 1. Java integral coefficient exchange. Native affine, constraint, congruence, generator and grid-generator meanings are specified by 🔗 1. Affine value, numerical prerequisites and shared zero, 🔗 1. Constraint relation meaning and numerical prerequisites, 🔗 1. Affine congruence meaning and valid numerical use, 🔗 1. Generator kinds and numerical prerequisites and 🔗 1. Grid-generator values and integer versus continuous displacement, respectively. Returned mathematical objects may be normalized and need not preserve the input expression-tree shape.

    Conversion of a finite acyclic expression into native form shall preserve operator grouping and apply the configured coefficient rules at each node. This conversion and copying through built-in Java expression nodes shall use stack space independent of tree depth. Construction and cloning shall retain the documented ownership of copied operands.

    System and variable-set conversion shall retain the represented collection; artificial-parameter sequences shall retain their order. Relation objects shall encode the native predicates (subsumption; disjointness, strict intersection, inclusion and saturation). Boxed primitives, Pair fields and By_Reference values shall preserve the values or object references assigned to them.

    Named Java enumeration values for relation symbols, integer widths, representations and overflow policies, optimization modes, solver results and MIP/PIP control parameters shall denote the corresponding native choices. Choosing a complexity or overflow policy shall not strengthen the native operation's exactness guarantee. Nonnegative integral arguments converted to an unsigned native type shall be rejected if negative or outside that type's range; failures follow 🔗 3. Java native failure and pending-exception protocol. Native dimension and object validity preconditions remain applicable.

    RATIONALE:

    Java object layout, enum ordinals and container fields are representation details; native conversion must preserve their mathematical and option meanings.

    INTERFACE:

    Package parma_polyhedra_library: Variable, the Linear_Expression hierarchy, Constraint, Congruence, Generator, Grid_Generator, Artificial_Parameter, their system/sequence classes, Variables_Set, Poly_Gen_Relation, Poly_Con_Relation, the operation-option/result enums, Pair and By_Reference. Values must have the documented class, finite acyclic expression structure and supported enum membership; mathematical objects must satisfy their native constructor preconditions.

    VERIFICATION_CRITERIA:

    Inspect each constructor/accessor correspondence, expression-node case, system iterator and enum switch against the Java definitions and native meanings. Check signed/unsigned range admission, affine constants, generator divisors, relation flags and container field positions. Use existing Java domain and solver scenarios as supporting runtime evidence, comparing normalization by mathematical meaning. Construct and copy mixed expression trees, check subtree independence and convert against an independently known affine result.

    SOURCE:

    interfaces/Java/jni/ppl_java_common.cc; interfaces/Java/jni/ppl_java_common_defs.hh; interfaces/Java/jni/ppl_java_common_inlines.hh; interfaces/Java/tests/Linear_Expression_test1.java; interfaces/Java/parma_polyhedra_library.

  • PPL-SPEC-001692
    1. OCaml mathematical representation exchange UID: PPL-SPEC-001692 STATUS: APPROVED COMPONENT: OCAML_INTERFACE APPLICABILITY: IF_OCAML VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: OCaml VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For well-formed values of the exposed algebraic types, conversion to native objects shall preserve zero-based variable identities, signed integral Z.t coefficients within the configured native range, affine expression meaning, equality and strict/non-strict inequality meaning, and generator kind. Returned values shall denote the native result; syntactic tree shape and normalization need not be preserved.

    Conversion of finite acyclic expressions to native objects shall preserve operator grouping and apply the configured coefficient rules at each node. Native stack usage shall be independent of expression depth. The expression values used during traversal shall remain valid under the OCaml runtime's lifetime and collection rules.

    A point or closure point with expression coordinates ai and nonzero divisor d denotes coordinates ai ⁄ d. Lines and rays denote the native direction described by the expression. Grid generators and congruences shall preserve their native rational-divisor and integral-modulus meanings. Native validity and operation-specific topology and arithmetic preconditions apply. A Z.t may be immediate or heap allocated; the binding shall use its value rather than assume either memory layout.

    RATIONALE:

    An algebraic representation can change tree shape while preserving exactly the same affine function or geometric object.

    INTERFACE:

    Module Ppl_ocaml.

    type linear_expression =
      Variable of int | Coefficient of Z.t
      | Unary_Plus of linear_expression | Unary_Minus of linear_expression
      | Plus of linear_expression * linear_expression
      | Minus of linear_expression * linear_expression
      | Times of Z.t * linear_expression
    type linear_constraint =
      Less_Than of linear_expression * linear_expression
      | Less_Or_Equal of linear_expression * linear_expression
      | Equal of linear_expression * linear_expression
      | Greater_Than of linear_expression * linear_expression
      | Greater_Or_Equal of linear_expression * linear_expression
    type linear_generator =
      Line of linear_expression | Ray of linear_expression
      | Point of linear_expression * Z.t
      | Closure_Point of linear_expression * Z.t
    

    Configured domain and solver constructors consume these types; their expression, constraint and generator queries return the corresponding types. The companion linear_grid_generator and linear_congruence types in the module signature define grid exchange.

    VERIFICATION_CRITERIA:

    Independently evaluate returned affine expressions and convert nested inputs with known grouped affine results. Round-trip positive, negative, zero and configured coefficient endpoints. Check multiple coordinates, all five relation kinds and all four polyhedral generator kinds. Include immediate and large Zarith values, divisor normalization and compacting collections.

    SOURCE:

    interfaces/OCaml/ppl_ocaml_globals.mli; interfaces/OCaml/ppl_ocaml_common.cc; interfaces/OCaml/ppl_ocaml_globals.ml; interfaces/OCaml/tests/zarith1.ml; interfaces/OCaml/tests/polyhedron1.ml; interfaces/OCaml/tests/boundary_contracts1.ml.

  • PPL-SPEC-001695
    1. Prolog mathematical term exchange UID: PPL-SPEC-001695 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For each configured supported Prolog engine, supported integral terms, affine expressions, constraints, congruences and generators shall be interpreted with their documented native mathematical meaning. '$VAR'(I) shall denote the zero-based coordinate I. Unary negation, addition, subtraction and integral scalar multiplication shall preserve affine meaning. Relations shall preserve equality and strict/non-strict order. Point and closure-point coordinates shall be divided by the supplied nonzero divisor; lines and rays denote directions. Returned terms may be normalized but shall denote the native result.

    Values shall be representable by both the engine and configured native coefficient type. A bounded engine does not acquire arbitrary-size integers from GMP in the native library. Malformed or nonlinear expressions and invalid native objects shall follow 🔗 2. Prolog success failure and exception outcomes.

    RATIONALE:

    The common term protocol must express the same mathematics independently of the selected foreign runtime.

    INTERFACE:

    Common numerical term protocol:

    '$VAR'(I)
    -E
    E + F
    E - F
    N * E
    E = F
    E =< F
    E < F
    E >= F
    E > F
    point(E, D)
    closure_point(E, D)
    ray(E)
    line(E)
    

    Here I is a valid coordinate index, N an integral coefficient and E/F supported affine expressions. Lists of such terms are the system interfaces accepted and returned by configured domain and solver predicates. Grid-point, parameter and congruence terms follow the common Prolog manual's rational-divisor and modulus conventions.

    VERIFICATION_CRITERIA:

    Across each available configured engine, compare coefficient round trips and independently reconstructed expressions/constraints/generators. Cover signs, zero, multiple indices, all relation and generator kinds, and each engine/native range intersection; check unsupported numeric and malformed cases separately.

    SOURCE:

    interfaces/Prolog/Prolog_interface_sysindep.dox; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.

PPL-LLR-000012
2. Affine meaning of linear expressions UID: PPL-LLR-000012 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

A linear expression shall denote the sum of its coordinate values multiplied by their coefficients, together with its constant term. For valid operands satisfying the operation's stated input and computational-arithmetic preconditions, a successfully completed algebraic operation shall produce the affine result specified for that operation. Under those conditions, a transformation specified as value-preserving shall retain the expression's affine value.

RATIONALE:

Expressions are mathematical descriptors used across domains and solvers, independently of their storage representation. Addition, subtraction and scaling change a value according to their mathematical operations; preserving a descriptor's zero set alone does not establish preservation of its affine value. Computational preconditions limit the operation's guarantee rather than the mathematical meaning of the stored expression. Apparent completion of unchecked arithmetic does not establish that those preconditions hold.

COMMENT:

Verification covers linear-expression value types and their supported algebraic operations. Their normative contracts make the delegated input and computational-arithmetic preconditions precise while retaining the required affine semantics. Related obligations: 🔗 1. Meaning of successful exact and approximate results, 🔗 3. Preservation by representation-only changes.

VERIFICATION_CRITERIA:

Establish the stated input and computational-arithmetic preconditions for the assessed operation and evidence cases. Evaluate operands and results independently at selected rational points and compare addition, subtraction and scaling with their specified affine results. For a transformation claimed to preserve value, check equality of affine evaluations within those conditions. Assess coefficient normalization against its stated transformation rather than inferring value preservation from an unchanged zero set. Include zero coefficients, constant expressions and expressions with trailing unused coordinates. Do not use unchecked completion alone as evidence of valid coefficient arithmetic.

SOURCE:

src/Linear_Expression_defs.hh: expression semantics and algebra. src/Linear_Expression_Interface_defs.hh: expression representation interface. doc/definitions.dox: Basic Geometric Descriptors.

  • PPL-SPEC-001524
    2. C affine expression values and updates UID: PPL-SPEC-001524 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Expression construction shall produce independent zero, dimensioned, copied or descriptor-derived native affine expressions. Assignment, coefficient additions, constant additions, expression addition/subtraction and scaling shall have the corresponding native affine meaning and retain native dimension/admission rules. Source handles shall remain valid during operations; owned results shall be independently deletable. Mutations shall not alter an independent source copy.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    C expression operations must preserve affine algebra and dimensions.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Linear_Expression(ppl_Linear_Expression_t *ple);
    int ppl_new_Linear_Expression_with_dimension(ppl_Linear_Expression_t *ple,
                                                 ppl_dimension_type d);
    int ppl_new_Linear_Expression_from_Linear_Expression(
        ppl_Linear_Expression_t *ple, ppl_const_Linear_Expression_t le);
    int ppl_new_Linear_Expression_from_Constraint(ppl_Linear_Expression_t *ple,
                                                  ppl_const_Constraint_t c);
    int ppl_new_Linear_Expression_from_Generator(ppl_Linear_Expression_t *ple,
                                                 ppl_const_Generator_t g);
    int ppl_new_Linear_Expression_from_Congruence(ppl_Linear_Expression_t *ple,
                                                  ppl_const_Congruence_t c);
    int ppl_new_Linear_Expression_from_Grid_Generator(ppl_Linear_Expression_t *ple,
                                                      ppl_const_Grid_Generator_t g);
    int ppl_assign_Linear_Expression_from_Linear_Expression(
        ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src);
    int ppl_delete_Linear_Expression(ppl_const_Linear_Expression_t le);
    int ppl_Linear_Expression_all_homogeneous_terms_are_zero(
        ppl_const_Linear_Expression_t le);
    int ppl_Linear_Expression_add_to_coefficient(ppl_Linear_Expression_t le,
                                                 ppl_dimension_type var,
                                                 ppl_const_Coefficient_t n);
    int ppl_Linear_Expression_add_to_inhomogeneous(ppl_Linear_Expression_t le,
                                                   ppl_const_Coefficient_t n);
    int ppl_add_Linear_Expression_to_Linear_Expression(
        ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src);
    int ppl_subtract_Linear_Expression_from_Linear_Expression(
        ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src);
    
    VERIFICATION_CRITERIA:

    Compare literal coefficient vectors and constants after each constructor and arithmetic update, including cancellation, zero scaling, borrowed input conversion and rejected dimensions.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001525
    3. C affine expression queries UID: PPL-SPEC-001525 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Expression dimension and coefficient queries shall assign the corresponding native extent, selected coefficient or constant. Zero tests and validity tests shall return boolean results. Query outputs shall be live writable coefficient objects rather than newly allocated handles. Indexed access shall observe native index admission and virtual zero coefficients where provided.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Queries distinguish assigning an existing coefficient from creating another owned object.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_Linear_Expression_space_dimension(ppl_const_Linear_Expression_t le,
                                              ppl_dimension_type *m);
    int ppl_Linear_Expression_coefficient(ppl_const_Linear_Expression_t le,
                                          ppl_dimension_type var,
                                          ppl_Coefficient_t n);
    int ppl_Linear_Expression_inhomogeneous_term(ppl_const_Linear_Expression_t le,
                                                 ppl_Coefficient_t n);
    int ppl_Linear_Expression_OK(ppl_const_Linear_Expression_t le);
    int ppl_Linear_Expression_is_zero(ppl_const_Linear_Expression_t le);
    
    VERIFICATION_CRITERIA:

    Check exact coefficients/constants, zero expressions, padded dimensions, range admission and query-output reuse.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001645
    1. Descriptor collection identity and affine comparison UID: PPL-SPEC-001645 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For live valid constraint systems or generator systems, free equality shall compare their retained internal row sequences under 🔗 22. Internal sequence equality and bookkeeping scope: ambient dimension, row count, pending boundary and corresponding row values shall agree. Storage representation, capacity and sorted certificates shall not affect the result. Inequality shall negate equality. These predicates shall preserve their operands. Equality shall not minimize, reorder, remove duplicate rows or decide geometric equivalence of the represented conjunctions or hulls. Row-empty systems shall follow the underlying dimension/boundary rule without an additional topology comparison.

    The free compare(x,y) for linear expressions shall forward the zero-extended affine ordering of 🔗 5. Backend equality, comparison and common-variable queries. It shall return -2 or 2 at the first differing homogeneous coefficient, -1 or 1 for a constant-only difference, and zero when all zero-extended coefficients agree. Equal affine values with different declared dimensions may therefore compare as zero. Initialization, coefficient arithmetic, lifetimes and synchronized access shall follow the selected descriptor or expression query.

    RATIONALE:

    Stored descriptor sequence identity and zero-extended affine ordering are useful implementation queries with meanings distinct from geometric set equivalence.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library unless stated otherwise.

    bool operator==(const Constraint_System&, const Constraint_System&);
    bool operator!=(const Constraint_System&, const Constraint_System&);
    bool operator==(const Generator_System&, const Generator_System&);
    bool operator!=(const Generator_System&, const Generator_System&);
    int compare(const Linear_Expression&, const Linear_Expression&);
    
    VERIFICATION_CRITERIA:

    Check copied and differently stored collections, differing dimensions, row order/count, duplicate rows and unchanged operands. Compare signed affine vectors, constant-only differences, unequal zero tails and both argument orders against literal expected return codes.

    SOURCE:

    src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; src/Linear_Expression_inlines.hh; tests/descriptorequalityspec1.cc.

  • 1. Borrowed expression-view construction and one-level access UID: PPL-SPEC-001566 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Expression_Adapter<T> shall borrow a const reference to its raw_type. Construction from a temporary raw owner shall be rejected by deleted rvalue overloads, including the transparent and hiding adapters. Copies and temporary adapter values may query their still-live lvalue raw owner. The raw expression shall outlive the adapter and every borrowed iterator or coefficient reference. Copying an adapter shall retain that binding; destroying it shall not destroy or modify the raw expression. Changes to the live raw expression shall be visible on subsequent queries; previously obtained references and iterators retain the raw type's invalidation rules.

    inner() shall return the one-level T::const_reference view of the same raw expression. representation() shall report the raw representation. Expression_Adapter_Transparent<T> shall add no transformation to T's view. Construction and copying shall not copy coefficient storage.

    RATIONALE:

    Borrowed descriptor views must not be confused with independent expression values.

    INTERFACE:

    The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation.

    template <typename T> class Expression_Adapter;
    template <typename T> class Expression_Adapter_Transparent;
    template <typename T> class Expression_Hide_Inhomo;
    template <typename T> class Expression_Hide_Last;
    // On Expression_Adapter<T>:
    inner_type inner() const;
    Representation representation() const;
    // Public adapter constructors:
    explicit Expression_Adapter_Transparent(const raw_type&);
    explicit Expression_Hide_Inhomo(const raw_type&);
    Expression_Hide_Last(const raw_type&, bool hide_last);
    // The corresponding const raw_type&& constructors are deleted.
    
    VERIFICATION_CRITERIA:

    Check rejection of temporary raw owners and admission of temporary views; check binding and one-level type/reference identities, copies and destruction; mutate coefficients, dimension and representation between queries without retaining invalidated positions. Confirm independent exported values remain unchanged.

    SOURCE:

    src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc.

  • 2. Expression-view coefficients, iterators and independent row export UID: PPL-SPEC-001567 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For a view with visible dimension d and visible coefficient vector a = (a0, …, ad), inhomogeneous_term() and get(0) shall return a0; get(i) for 1 ≤ i ≤ d shall return ai. coefficient(Variable(k)) and get(Variable(k)) shall return ak + 1 for 0 ≤ k < d. These are borrowed const accesses. The transformations defining a and d are specified in 🔗 4. Expression view with a hidden inhomogeneous coefficient and 🔗 5. Expression view with an optional hidden final coordinate; a transparent view shall retain its inner view's coefficients and dimension.

    begin()/end() shall delimit the nonzero homogeneous coefficients in increasing variable order, excluding the constant and every hidden last coordinate. lower_bound(v) shall select the first such variable at least v, or end(); a one-past-visible-dimension variable is admitted. Mutations shall follow 🔗 1. Borrowed expression-view construction and one-level access.

    Each get_row(r) shall replace the dense or sparse output with an independent copy of all d + 1 visible coefficients, including zero slots. Altering that output shall not alter the raw expression, and later raw mutations shall not alter the output copy.

    RATIONALE:

    All consumers of a descriptor view need the same visible coefficient vector, including iterators and materialized copies.

    INTERFACE:

    The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation.

    dimension_type space_dimension() const;
    Coefficient_traits::const_reference inhomogeneous_term() const;
    Coefficient_traits::const_reference coefficient(Variable) const;
    Coefficient_traits::const_reference get(dimension_type) const;
    Coefficient_traits::const_reference get(Variable) const;
    const_iterator begin() const;
    const_iterator end() const;
    const_iterator lower_bound(Variable) const;
    void get_row(Dense_Row&) const;
    void get_row(Sparse_Row&) const;
    
    VERIFICATION_CRITERIA:

    Compare all slots, ordered nonzero iteration and every lower bound with literal vectors in both representations, including constants, trailing zeros and a hidden nonzero final slot. Overwrite prepopulated rows of different sizes and mutate each copy independently.

    SOURCE:

    src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc.

  • 3. Expression-view predicates, coefficient ranges and support filtering UID: PPL-SPEC-001568 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    With the vector and dimension in 🔗 2. Expression-view coefficients, iterators and independent row export, is_zero() shall hold exactly when every visible coefficient is zero; all_homogeneous_terms_are_zero() shall ignore a0. For 0 ≤ s ≤ e ≤ d + 1, range queries shall use the half-open raw-slot range [s, e): all_zeroes shall test every slot; num_zeroes shall count zero slots; gcd shall return their nonnegative greatest common divisor, with zero for an empty or all-zero range. first_nonzero(s,e) and last_nonzero(s,e) shall return the least/greatest nonzero slot or e if none exists. No-argument last_nonzero() shall return the greatest nonzero slot, or zero if no such slot exists.

    all_zeroes(vars) shall test only the selected variable coefficients; all_zeroes_except(vars,s,e) shall test the range after excluding those variables, with slot zero never excluded by a variable set. has_a_free_dimension_helper(indices) shall remove precisely the selected raw slots whose visible coefficients are nonzero, inserting no new indices. Variable sets and raw indices shall be within the visible dimension.

    Full is_equal_to(y) shall require equal dimensions and equal visible coefficients. Range equality shall compare the selected slots; scaled equality shall test c1ai = c2bi for every selected slot. Both operands shall admit the selected range; an operand passed to an overload requiring conversion to raw_type shall support that conversion. Scaled products shall satisfy the configured coefficient arithmetic's representability preconditions. The coefficient prerequisites in 🔗 1. Affine value, numerical prerequisites and shared zero shall apply, including representability of the nonnegative gcd and of each scaled product when required by the configured arithmetic. Underlying numerical exceptions shall propagate without modifying the borrowed expression. Empty-range equality shall hold. have_a_common_variable(y,first,last) shall hold exactly when some variable in the valid half-open variable range has nonzero coefficients in both operands; constants shall be irrelevant.

    RATIONALE:

    Raw coefficient slots and variable identifiers have distinct meanings, and empty-range sentinels must remain consistent under adaptation.

    INTERFACE:

    The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation.

    bool is_zero() const;
    bool all_homogeneous_terms_are_zero() const;
    bool all_zeroes(const Variables_Set&) const;
    bool all_zeroes(dimension_type start, dimension_type end) const;
    dimension_type num_zeroes(dimension_type start, dimension_type end) const;
    Coefficient gcd(dimension_type start, dimension_type end) const;
    dimension_type last_nonzero() const;
    dimension_type last_nonzero(dimension_type first, dimension_type last) const;
    dimension_type first_nonzero(dimension_type first, dimension_type last) const;
    bool all_zeroes_except(const Variables_Set&, dimension_type, dimension_type) const;
    void has_a_free_dimension_helper(std::set<dimension_type>&) const;
    template <typename E> bool is_equal_to(const E&) const;
    template <typename E>
    bool is_equal_to(const E&, dimension_type start, dimension_type end) const;
    template <typename E>
    bool is_equal_to(const E&, Coefficient_traits::const_reference c1,
                     Coefficient_traits::const_reference c2,
                     dimension_type start, dimension_type end) const;
    template <typename E>
    bool have_a_common_variable(const E&, Variable first, Variable last) const;
    
    VERIFICATION_CRITERIA:

    Use independent small integer vectors to enumerate every valid subrange, zero mask, support search and selected-index filter. Check equal and unequal dimensions, constants and scaled operands of both signs, zero multipliers, common-variable boundaries and both representations without coefficient overflow.

    SOURCE:

    src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc.

  • 4. Expression view with a hidden inhomogeneous coefficient UID: PPL-SPEC-001569 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Expression_Hide_Inhomo<T> shall preserve its inner view's dimension and homogeneous coefficients and expose zero as the inhomogeneous coefficient, even when the raw constant is nonzero. All queries and row exports in 🔗 2. Expression-view coefficients, iterators and independent row export and 🔗 3. Expression-view predicates, coefficient ranges and support filtering shall use this transformed vector. Hiding the constant shall neither alter it in the raw expression nor hide any homogeneous coefficient. In a composition, the transformation shall apply to the one-level inner view, retaining the same borrowed raw object.

    RATIONALE:

    Geometric generator numerators must omit divisors or other raw constant metadata from their affine expression views.

    INTERFACE:

    The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation.

    template <typename T>
    class Expression_Hide_Inhomo;
    
    VERIFICATION_CRITERIA:

    Check constant-only, zero and mixed expressions, hidden nonzero constants, every range including or excluding slot zero, scaled comparison with nonzero other constants, selected index zero, exported rows and compositions with hidden-last views. Include live raw mutations.

    SOURCE:

    src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc.

  • 5. Expression view with an optional hidden final coordinate UID: PPL-SPEC-001570 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Expression_Hide_Last<T>(raw,false) shall preserve its inner view. With hide_last == true, the inner dimension shall remain positive for every operation, and the view shall expose dimension one less, omitting exactly the inner view's final homogeneous coefficient. The constant and preceding coefficients shall remain unchanged. All queries and row exports in 🔗 2. Expression-view coefficients, iterators and independent row export and 🔗 3. Expression-view predicates, coefficient ranges and support filtering shall use this prefix. The stored hiding choice shall remain fixed; the currently hidden coordinate shall follow the inner view's current dimension after a valid raw resize.

    compare(x,y) for two matching hidden-last adapter types shall compare their homogeneous coefficient sequences lexicographically in increasing variable order, treating missing trailing coefficients as zero. It shall return  − 2, zero or 2 according to the first unequal coefficient. Constants, hidden coefficients and trailing zero dimensions shall not affect this comparison. It shall neither mutate its operands nor compare affine constants.

    RATIONALE:

    Strictness and generator metadata occupy a raw final slot that must not become a public coordinate; homogeneous ordering is distinct from affine equality.

    INTERFACE:

    The templates belong to Parma_Polyhedra_Library. Their defining headers are Expression_Adapter_defs.hh, Expression_Hide_Inhomo_defs.hh and Expression_Hide_Last_defs.hh; each includes its inline implementation.

    template <typename T>
    class Expression_Hide_Last;
    template <typename T>
    int compare(const Expression_Hide_Last<T>&, const Expression_Hide_Last<T>&);
    
    VERIFICATION_CRITERIA:

    Compare hidden and transparent prefixes against literal vectors, including a single raw variable, zero visible support, nonzero hidden coefficients, growth and shrinkage. Check lexicographic signs for mismatched leading supports, unequal matching coefficients, unequal dimensions and ignored constants, in both representations.

    SOURCE:

    src/Expression_Adapter_defs.hh; src/Expression_Adapter_inlines.hh; src/Expression_Hide_Inhomo_defs.hh; src/Expression_Hide_Inhomo_inlines.hh; src/Expression_Hide_Last_defs.hh; src/Expression_Hide_Last_inlines.hh; tests/expressionadaptersspec1.cc; tests/expressionhideinhomo1.cc; tests/expressionhidelast1.cc.

  • 1. Internal affine value, coefficient storage and dispatch prerequisites UID: PPL-SPEC-001622 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For Row equal to Dense_Row or Sparse_Row, a live Linear_Expression_Impl<Row> of dimension d shall own d + 1 coefficient slots. Slot zero shall contain the constant; slot i + 1 shall contain the coefficient of Variable(i). Dense storage shall retain zero slots; valid sparse expression storage shall contain no explicit zero entries. Trailing zero coordinates shall retain the ambient dimension. representation() shall return DENSE or SPARSE accordingly, and max_space_dimension() shall equal Row::max_size()-1.

    Calls shall satisfy the initialization, synchronization, coefficient-range and resource conditions of 🔗 1. Affine value, numerical prerequisites and shared zero. Raw slot indices shall be in [0, d + 1) and half-open windows shall satisfy 0 ≤ s ≤ e ≤ d + 1. A new dimension shall fit the selected backend's maximum; its increment for the constant slot shall be representable. Internal coordinate transformations shall receive in-dimension variables, valid distinct permutation cycles, and growth within that maximum.

    An argument dispatched through Linear_Expression_Interface shall have one of these two concrete backend types. Dispatch shall preserve the operation's meaning for every dense/sparse pairing. Setters and dimension transformations shall implement the coefficient effects of 🔗 5. Ambient dimension queries and trailing-coordinate resizing, 🔗 6. Coefficient access, replacement and zero predicates and 🔗 12. Explicit coefficient-coordinate transformations on these admitted inputs. A const access shall borrow its coefficient according to the selected traits; reads beyond the homogeneous dimension through coefficient(v) shall return zero. Mutations shall invalidate borrowed positions according to their storage.

    The internal row_data() accessor shall borrow the complete read-only row only from a live lvalue expression. Mutable and const temporary expression owners shall be rejected. A row borrow shall not outlive its owner or a mutation that invalidates the underlying coefficient storage.

    coefficient_is_owned(n) shall identify a reference to a stored coefficient in assertion builds when coefficient arguments use reference traits, without changing the expression. With value traits or assertions disabled it shall return false. Internal scalar-independence preconditions shall apply in every build mode; that diagnostic predicate shall not replace them.

    RATIONALE:

    Raw coefficient indices and variable identifiers have different meanings. Internal callers supply the validated dimensions and storage assumptions used by the public interface.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    template <typename Row> class Linear_Expression_Impl;
    static dimension_type max_space_dimension();
    const Row& row_data() const &;
    const Row& row_data() const && = delete;
    Representation representation() const;
    dimension_type space_dimension() const;
    void set_space_dimension(dimension_type);
    Coefficient_traits::const_reference coefficient(Variable) const;
    Coefficient_traits::const_reference inhomogeneous_term() const;
    void set_coefficient(Variable, Coefficient_traits::const_reference);
    void set_inhomogeneous_term(Coefficient_traits::const_reference);
    void swap_space_dimensions(Variable, Variable);
    void shift_space_dimensions(Variable, dimension_type);
    void remove_space_dimensions(const Variables_Set&);
    void permute_space_dimensions(const std::vector<Variable>&);
    // Private diagnostic helper:
    bool coefficient_is_owned(const Coefficient&) const;
    
    VERIFICATION_CRITERIA:

    Check both concrete backends, constant-slot mapping, zero reads beyond the dimension, coordinate transformations and trait-dependent borrowing. Inspect interface dispatch and scalar guards; compare public and backend effects on admitted inputs. Admit read-only row borrows from mutable and const lvalues of both backend types, and reject temporary owners.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001623
    2. Independent backend construction, copying and affine arithmetic UID: PPL-SPEC-001623 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Default construction shall create the zero expression of dimension zero; coefficient and variable construction shall implement 🔗 2. Zero, constant, variable and dimensioned construction. The sizing constructor's Boolean argument shall distinguish its overload and shall not alter its meaning: it shall create the zero expression of the admitted requested dimension. Ordinary, cross-storage and interface-based copy construction shall produce independent coefficients. A dimensioned copy shall retain the selected prefix and zero-extend as necessary. Private construct helpers shall establish those same copied values. Destruction shall release the owned row without changing a distinct source.

    Backend affine additions, subtractions, multiplication, truncating division, negation, normalization and coordinate updates shall implement the value rules of 🔗 7. Affine addition, subtraction and negation, 🔗 8. Integral scalar multiplication and coefficient-wise division, 🔗 9. Explicit scaled accumulation, combination and elimination and 🔗 10. Coefficient normalization and sign normalization. Expression addition and subtraction shall admit self operands. Whole-expression combinations and scaled accumulations shall receive a distinct source; their scalar arguments shall be independent of modified target coefficients. Multiplication and division factors shall likewise be independent of the target. Division shall receive a nonzero divisor. Scaled variable accumulation shall retain the variable's dimension even for a zero factor; zero-factor scaled expression accumulation shall preserve the target's current dimension and value.

    The prerequisites of 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites shall apply. Each operation that returns a backend reference shall return its target. Distinct sources shall retain their values and dimensions.

    RATIONALE:

    Concrete storage and dynamic dispatch must preserve the public affine value while retaining the stronger internal operand-independence conditions.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    Linear_Expression_Impl();
    explicit Linear_Expression_Impl(Coefficient_traits::const_reference);
    Linear_Expression_Impl(Variable);
    Linear_Expression_Impl(dimension_type, bool);
    Linear_Expression_Impl(const Linear_Expression_Impl&);
    template <typename Other>
    Linear_Expression_Impl(const Linear_Expression_Impl<Other>&);
    Linear_Expression_Impl(const Linear_Expression_Interface&);
    Linear_Expression_Impl(const Linear_Expression_Interface&, dimension_type);
    ~Linear_Expression_Impl();
    Linear_Expression_Impl& operator+=(Coefficient_traits::const_reference);
    Linear_Expression_Impl& operator-=(Coefficient_traits::const_reference);
    Linear_Expression_Impl& operator+=(Variable);
    Linear_Expression_Impl& operator-=(Variable);
    Linear_Expression_Impl& operator+=(const Linear_Expression_Interface&);
    Linear_Expression_Impl& operator-=(const Linear_Expression_Interface&);
    Linear_Expression_Impl& operator*=(Coefficient_traits::const_reference);
    Linear_Expression_Impl& operator/=(Coefficient_traits::const_reference);
    void negate();
    void normalize();
    void sign_normalize();
    Linear_Expression_Impl& add_mul_assign(Coefficient_traits::const_reference, Variable);
    Linear_Expression_Impl& sub_mul_assign(Coefficient_traits::const_reference, Variable);
    void add_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Interface&);
    void sub_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Interface&);
    // Typed source overloads and private construct helpers:
    template <typename Other>
    Linear_Expression_Impl& operator+=(const Linear_Expression_Impl<Other>&);
    template <typename Other>
    Linear_Expression_Impl& operator-=(const Linear_Expression_Impl<Other>&);
    template <typename Other>
    void add_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Impl<Other>&);
    template <typename Other>
    void sub_mul_assign(Coefficient_traits::const_reference, const Linear_Expression_Impl<Other>&);
    template <typename Other> void construct(const Linear_Expression_Impl<Other>&);
    template <typename Other>
    void construct(const Linear_Expression_Impl<Other>&, dimension_type);
    
    VERIFICATION_CRITERIA:

    Compare copied, truncated and extended values across all storage pairings; mutate copies independently. Check exact coefficient-vector arithmetic, self addition/subtraction, zero factors and returned-target identity using existing public and direct-backend histories.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001624
    3. Raw coefficient access, zero ranges, gcd and support filtering UID: PPL-SPEC-001624 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, get(i) shall return the raw coefficient ai; set(i,n) shall replace it by the entry value of n, removing a sparse entry when zero. is_zero() shall test every slot; all_homogeneous_terms_are_zero() shall exclude slot zero.

    For an admitted window [s, e), all_zeroes shall test every slot, num_zeroes shall count zero slots, and gcd shall return the nonnegative greatest common divisor of those coefficients. An empty or all-zero window shall have gcd zero. The positive gcd shall be representable in the selected coefficient type. first_nonzero(s,e) and last_nonzero(s,e) shall return the least and greatest nonzero slot, respectively, or e if none exists. No-argument last_nonzero() shall return the greatest nonzero slot, or zero for the all-zero vector.

    all_zeroes(vars) shall test precisely the selected homogeneous coefficients. all_zeroes_except(vars,s,e) shall test the window after excluding the selected variable coefficients; slot zero shall never be excluded by a variable set. Empty windows shall satisfy both universal predicates. has_a_free_dimension_helper(indices) shall retain exactly those input raw indices whose coefficients are zero, inserting no new indices. Variable sets and raw indices shall be within the respective admitted extent. All queries shall preserve the expression.

    RATIONALE:

    Internal algebra uses raw coefficient windows, including the constant, and needs consistent empty-window results and absence sentinels.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    Coefficient_traits::const_reference get(dimension_type) const;
    void set(dimension_type, Coefficient_traits::const_reference);
    bool is_zero() const;
    bool all_homogeneous_terms_are_zero() const;
    bool all_zeroes(dimension_type start, dimension_type end) const;
    dimension_type num_zeroes(dimension_type start, dimension_type end) const;
    Coefficient gcd(dimension_type start, dimension_type end) const;
    dimension_type first_nonzero(dimension_type first, dimension_type last) const;
    dimension_type last_nonzero(dimension_type first, dimension_type last) const;
    dimension_type last_nonzero() const;
    bool all_zeroes(const Variables_Set&) const;
    bool all_zeroes_except(const Variables_Set&, dimension_type, dimension_type) const;
    void has_a_free_dimension_helper(std::set<dimension_type>&) const;
    
    VERIFICATION_CRITERIA:

    Compare every window of literal vectors with independent counts, gcds and nonzero positions. Enumerate variable masks and raw-index subsets; include nonzero constants, zero-dimensional expressions, empty windows, negative inputs and both storage types.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001625
    4. Range scaling and exact affine elimination UID: PPL-SPEC-001625 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, mul_assign(c,s,e) shall multiply exactly the raw slots in [s, e) by c; zero shall clear that window. exact_div_assign(c,s,e) shall divide those slots exactly by a nonzero c that divides every selected coefficient. negate(s,e) shall negate precisely those slots. Every operation shall retain dimension and all coefficients outside its window.

    For distinct target x and source y, range linear_combine shall assign xi :  = c1xi + c2yi from entry values for s ≤ i < e, with nonzero scalars. linear_combine_lax shall admit zero scalars as well. Both windows shall fit their respective expressions. Whole-expression forms shall use the maximum input dimension and zero-extend absent coordinates. Scalar arguments shall be live and independent of modified target coefficients. The source shall retain its value and dimension. Empty windows shall preserve the target; valid sparse results shall contain no explicit zeros.

    The raw-index elimination overload shall require equal dimensions, a distinct source and nonzero pivot coefficients xk, yk. With g = gcd(|xk|, |yk|) > 0, it shall replace every target coefficient by (yk ⁄ g)xi − (xk ⁄ g)yi. The selected pivot shall become zero. The variable overload shall use raw index v.space_dimension(). All evaluated coefficient arithmetic, including normalization factors, shall meet the selected profile's representability conditions.

    RATIONALE:

    Elimination is an exact integer combination with reduced factors. Windowed operations must preserve independent prefix and suffix coefficients across storage pairings.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    void mul_assign(Coefficient_traits::const_reference, dimension_type, dimension_type);
    void exact_div_assign(Coefficient_traits::const_reference, dimension_type, dimension_type);
    void negate(dimension_type, dimension_type);
    void linear_combine(const Linear_Expression_Interface&, Variable);
    void linear_combine(const Linear_Expression_Interface&, dimension_type);
    void linear_combine(const Linear_Expression_Interface&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    void linear_combine_lax(const Linear_Expression_Interface&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    void linear_combine(const Linear_Expression_Interface&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                        dimension_type, dimension_type);
    void linear_combine_lax(const Linear_Expression_Interface&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                            dimension_type, dimension_type);
    // Each linear-combination form also has a typed source overload:
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&, dimension_type);
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&, Variable);
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    template <typename Other>
    void linear_combine_lax(const Linear_Expression_Impl<Other>&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference);
    template <typename Other>
    void linear_combine(const Linear_Expression_Impl<Other>&,
                        Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                        dimension_type, dimension_type);
    template <typename Other>
    void linear_combine_lax(const Linear_Expression_Impl<Other>&,
                            Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                            dimension_type, dimension_type);
    
    VERIFICATION_CRITERIA:

    Use independent integer vectors for all four storage pairings, every admitted small window and signed/zero/unit factors. Check direct and interface-dispatched paths, outside-window preservation, source independence, exact-divisibility cases and the reduced pivot formula.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • 5. Backend equality, comparison and common-variable queries UID: PPL-SPEC-001626 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, full is_equal_to(y) shall require equal dimensions and equal raw coefficient vectors. Range equality shall compare only the admitted common window. Scaled range equality shall test c1xi = c2yi at every selected slot, including when either scalar is zero. Each evaluated scaled product shall be representable. Empty-window equality shall hold.

    compare(y) shall compare homogeneous coefficients in increasing variable order, treating absent trailing coefficients as zero, and compare the constant only if all homogeneous coefficients agree. It shall return -2 or 2 for the first homogeneous difference, -1 or 1 for a constant-only difference, and zero for equal zero-extended affine values. Consequently, different declared dimensions containing only additional zero coefficients may compare as zero while failing full dimension-sensitive equality.

    have_a_common_variable(y,first,last) shall hold exactly when some variable in the admitted half-open variable range has nonzero coefficients in both operands. Constants shall be irrelevant. All queries shall preserve their operands and shall have the same meaning through typed and interface dispatch.

    RATIONALE:

    Dimension-sensitive identity and affine-value ordering serve different internal purposes. Sparse support and dispatch must not change either result.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    bool is_equal_to(const Linear_Expression_Interface&) const;
    bool is_equal_to(const Linear_Expression_Interface&, dimension_type, dimension_type) const;
    bool is_equal_to(const Linear_Expression_Interface&,
                     Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                     dimension_type, dimension_type) const;
    int compare(const Linear_Expression_Interface&) const;
    bool have_a_common_variable(const Linear_Expression_Interface&, Variable, Variable) const;
    template <typename Other> bool is_equal_to(const Linear_Expression_Impl<Other>&) const;
    template <typename Other>
    bool is_equal_to(const Linear_Expression_Impl<Other>&, dimension_type, dimension_type) const;
    template <typename Other>
    bool is_equal_to(const Linear_Expression_Impl<Other>&,
                     Coefficient_traits::const_reference, Coefficient_traits::const_reference,
                     dimension_type, dimension_type) const;
    template <typename Other> int compare(const Linear_Expression_Impl<Other>&) const;
    template <typename Other>
    bool have_a_common_variable(const Linear_Expression_Impl<Other>&, Variable, Variable) const;
    
    VERIFICATION_CRITERIA:

    Compare signed literal vectors and zero-extended unequal dimensions in all storage pairings. Enumerate every common window, zero/nonzero scale pair and common-variable interval, checking direct and dispatched calls and source preservation.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001627
    6. Owned raw iterator handles and borrowed coefficient positions UID: PPL-SPEC-001627 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, begin() and end() shall allocate independent polymorphic iterator handles delimiting the nonzero homogeneous coefficients in increasing variable order. lower_bound(v) shall allocate a handle at the first such variable at least v, or at end. The search variable shall be within the dimension or its one-past position. The caller shall delete each allocated handle through its virtual interface. The handles shall borrow the live expression's row without owning it.

    Direct nested-iterator construction shall require a row of at least one slot and a starting raw index 1 ≤ i ≤ row.size(). It shall borrow that row at the first nonzero slot at or after i, or at end. The row shall outlive every such handle.

    clone() shall allocate an independent handle at the same borrowed position. Advancing or destroying one handle shall preserve another handle's position and the coefficients. Dereference, variable() and index() shall require a live non-end position; index shall be variable().id()+1. Increment shall move to the next nonzero homogeneous coefficient, admitting arrival at end. Decrement shall require a preceding nonzero homogeneous coefficient and shall move to it, including from end. Constant slot zero shall be excluded.

    Equality shall compare positions in the same row and concrete iterator type. Expression mutation shall invalidate borrowed positions as declared for the row; the caller shall obtain new handles afterward. Allocation failures shall propagate without changing the expression or existing handles. The internal zero-skipping helpers shall implement this traversal without changing values.

    RATIONALE:

    Raw polymorphic iterator handles have caller-owned allocation and a separately borrowed coefficient lifetime. Copying a handle must preserve independent traversal state.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    using iterator_interface = Linear_Expression_Interface::const_iterator_interface;
    iterator_interface* begin() const;
    iterator_interface* end() const;
    iterator_interface* lower_bound(Variable) const;
    // Members of Linear_Expression_Impl<Row>::const_iterator:
    explicit const_iterator(const Row&, dimension_type);
    iterator_interface* clone() const;
    void operator++();
    void operator--();
    Coefficient_traits::const_reference operator*() const;
    Variable variable() const;
    dimension_type index() const;
    bool operator==(const iterator_interface&) const;
    // Private traversal helpers:
    void skip_zeroes_forward();
    void skip_zeroes_backward();
    
    VERIFICATION_CRITERIA:

    Exercise forward and reverse paths, constants and trailing zero slots, every lower bound, clone independence and deletion through the base interface in both backends. Check empty traversal and allocation failures without using invalidated handles.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • PPL-SPEC-001628
    7. Backend row export, serialization, diagnostics and accounting UID: PPL-SPEC-001628 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Internal affine value, coefficient storage and dispatch prerequisites, get_row(r) shall replace a dense or sparse output with an independent copy of the complete raw coefficient vector. The copy shall include its logical extent, all constant and trailing zero slots, and shall not borrow the backend's coefficient storage.

    ascii_dump(stream) shall emit size, the raw slot count, and every coefficient in slot order, using the producer grammar of 🔗 13. Reloadable ASCII export and replacement loading. ascii_load(stream) shall implement that raw grammar: require its exact size keyword and a nonzero raw count, replace the row and read exactly that many coefficients. Normal malformed or truncated extraction shall return false; resource and stream exceptions shall propagate. A rejected or throwing load may leave a partially replaced row; only destruction shall be required until the caller restores a valid value. A following token shall remain available after a complete record. The selected coefficient input grammar, stream formatting and exception masks shall retain their ordinary behavior.

    print(stream) and the free stream insertion shall implement the affine format and variable formatter dispatch of 🔗 14. Human-readable affine output and formatter dispatch; insertion shall return its stream. Source values shall be preserved by export and print. OK() shall return false for a row of size zero, and sparse OK() shall also reject any explicit stored zero, with its documented diagnostic to std::cerr. This local check shall not inspect unrelated domain state. external_memory_in_bytes() shall report the owned row's external storage; total_memory_in_bytes() shall add sizeof(*this).

    RATIONALE:

    A raw backend export must preserve both the affine coefficient vector and its owning storage, while failed loading has a deliberately limited lifetime guarantee.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library. Backend member excerpts apply to Linear_Expression_Impl<Row> unless a nested or free interface is named.

    void get_row(Dense_Row&) const;
    void get_row(Sparse_Row&) const;
    void ascii_dump(std::ostream&) const;
    bool ascii_load(std::istream&);
    void print(std::ostream&) const;
    bool OK() const;
    memory_size_type external_memory_in_bytes() const;
    memory_size_type total_memory_in_bytes() const;
    template <typename Row>
    std::ostream& operator<<(std::ostream&, const Linear_Expression_Impl<Row>&);
    
    VERIFICATION_CRITERIA:

    Overwrite differently sized prepopulated rows, then mutate source and outputs independently. Check exact dumps, valid reloads, malformed/truncated input, suffix retention, ordinary stream failures, formatting and accounting identities in both backends.

    SOURCE:

    src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; src/Linear_Expression_Impl.cc; tests/linearexpression1.cc; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc; tests/expressionbackendspec1.cc.

  • 1. Affine value, numerical prerequisites and shared zero UID: PPL-SPEC-000071 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A live Linear_Expression of space dimension d, with homogeneous coefficients ai and inhomogeneous term b, shall denote the function E(x) = b + ∑d − 1i = 0aixi on rational valuations. The constant term shall not occupy a coordinate. Trailing zero coefficients shall remain part of the declared ambient dimension.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization. The caller shall synchronize access to an object while another operation modifies it. The valid representations shall be DENSE and SPARSE; default_representation shall be SPARSE. zero() shall return a borrowed, constant expression of dimension zero and value zero. The returned object shall remain alive until its owning initialized thread is finalized.

    The computed arithmetic guarantees of 🔗 7. Affine addition, subtraction and negation, 🔗 8. Integral scalar multiplication and coefficient-wise division, 🔗 9. Explicit scaled accumulation, combination and elimination and 🔗 10. Coefficient normalization and sign normalization shall require every evaluated coefficient arithmetic step and result to be representable in the selected coefficient profile. Checked arithmetic may report overflow; unchecked completion shall not prove that this precondition held. Allocation failures may propagate. Failed construction shall release resources owned by the incomplete expression. Distinct, unchanged operands shall remain valid after a reported failure. Other modified objects shall be destructible; no universal rollback is promised.

    RATIONALE:

    An expression has an affine value independently of its storage or any constraint later formed from it. Shared numerical prerequisites delimit arithmetic guarantees without weakening that value meaning.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Linear_Expression;
    enum Representation { DENSE, SPARSE };
    static constexpr Representation Linear_Expression::default_representation = SPARSE;
    static const Linear_Expression& Linear_Expression::zero();
    
    VERIFICATION_CRITERIA:

    Evaluate explicit coefficient vectors independently over rational valuations, including dimension zero and trailing zeros. Check the shared zero during a balanced initialized lifetime and verify both supported representations. Inspect construction cleanup and failure paths without inferring unpromised rollback.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc.

  • 2. Zero, constant, variable and dimensioned construction UID: PPL-SPEC-000072 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Expression_Adapter_Source<T> shall have the truth value of std::is_convertible_v<const T&, const Expression_Adapter_Base&>. The four adapter-copy constructors shall use this predicate as their type constraint, including implicit base-reference conversions and excluding inaccessible or ambiguous base conversions. Their optional trailing void* parameter shall retain its default null value and shall be ignored.

    Construction with only an optional representation shall produce dimension zero and value zero. Construction from a coefficient shall produce dimension zero and that constant value. Construction from Variable v shall produce dimension v.space_dimension(), coefficient one at v.id(), and zero elsewhere, including the constant term.

    A variable whose dimension exceeds max_space_dimension() shall cause std::length_error. A requested representation shall be used. The ordinary copy constructor shall copy all coefficients and the declared dimension and retain the source representation. The overload accepting a representation shall use that representation. The overloads accepting space_dim shall copy the retained coefficients, discard coefficients of removed trailing coordinates when shrinking, and insert zero coefficients when extending. Their caller shall supply space_dim <= max_space_dimension(). All copies shall own independent values.

    The four corresponding copy forms shall also accept a supported, live expression adapter, including the borrowed expression views exposed by constraints and congruences. They shall copy the adapter's visible coefficients, constant and declared dimension. Copying a view shall not introduce a descriptor's hidden representation columns. Omitting the representation shall retain the adapter's representation; an explicit representation shall select that representation. Dimensioned copies shall apply the same truncation and zero-extension rules as ordinary copies.

    RATIONALE:

    Constructor dimensions are observable and must not be inferred from the last nonzero term. Explicit dimensioned copying is a semantic truncation when removed coefficients are nonzero. Named constraints expose source admission while the implementation argument alias preserves the established constructor linkage.

    INTERFACE:
    template <typename T>
    concept Expression_Adapter_Source =
      std::is_convertible_v<const T&, const Expression_Adapter_Base&>;
    
    explicit Linear_Expression(Representation r = default_representation);
    explicit Linear_Expression(Coefficient_traits::const_reference n,
                              Representation r = default_representation);
    Linear_Expression(Variable v, Representation r = default_representation);
    Linear_Expression(const Linear_Expression& e);
    Linear_Expression(const Linear_Expression& e, Representation r);
    Linear_Expression(const Linear_Expression& e, dimension_type space_dim);
    Linear_Expression(const Linear_Expression& e, dimension_type space_dim,
                      Representation r);
    

    For a supported expression adapter v, representation r and valid space dimension d, these effective constructor calls shall be admitted:

    Linear_Expression a(v);
    Linear_Expression b(v, r);
    Linear_Expression c(v, d);
    Linear_Expression e(v, d, r);
    
    VERIFICATION_CRITERIA:

    Check both representations, constants of each sign, variables including a nonleading coordinate, zero-sized and trailing-zero copies, shrink/extend operations, independent later mutations and variable-limit rejection. Evaluate copies over rational points against a separately transformed coefficient vector. Check all four adapter-copy forms with constraint and congruence expression views, including hidden strictness, shrinking, extending and later independent mutations.

    SOURCE:

    src/Expression_Adapter_defs.hh; tests/commonhelpersspec1.cc; src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc; tests/linearexpressionbranches1.cc.

  • PPL-SPEC-000073
    3. Independent assignment, destruction and swapping UID: PPL-SPEC-000073 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy assignment shall replace the target coefficients, dimension and representation with those of the source at entry, return a reference to the target, and preserve a distinct source. Self-assignment shall preserve the value, dimension and representation. Construction or assignment from an rvalue shall admit the copy forms and retain the source value; no distinct move operation is required. A separately owned copy shall remain usable after mutation or destruction of the original.

    m_swap and the PPL swap overload shall exchange complete values, dimensions and representations; swapping an object with itself shall preserve it. Destruction shall release the object's owned representation. Assignment shall leave the target unchanged if creating its replacement copy fails.

    RATIONALE:

    Owning value semantics separate expression lifetime from borrowed coefficient references. Swapping the owned representation must also exchange its representation choice.

    INTERFACE:
    Linear_Expression& Linear_Expression::operator=(const Linear_Expression& e);
    Linear_Expression::~Linear_Expression();
    void Linear_Expression::m_swap(Linear_Expression& y);
    void swap(Linear_Expression& x, Linear_Expression& y);
    
    VERIFICATION_CRITERIA:

    Check return identity, self-assignment, rvalue copy behavior, cross-representation assignment and both swap forms. Destroy originals while retaining copies. Inject failure while copying a replacement and check unchanged target and source.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc.

  • PPL-SPEC-000074
    4. Value-preserving representation selection and conversion UID: PPL-SPEC-000074 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report the expression's current storage choice. For r equal to DENSE or SPARSE, successful set_representation(r) shall select r while preserving every coefficient, the constant term and declared space dimension. Repeating the current choice shall preserve the expression. Explicit-representation copy construction shall make the same coefficient-preservation guarantee for a distinct result. If creating a converted representation fails, set_representation shall leave the original unchanged.

    RATIONALE:

    Dense and sparse storage encode the same affine function; changing storage is not coefficient normalization.

    INTERFACE:
    Representation Linear_Expression::representation() const;
    void Linear_Expression::set_representation(Representation r);
    Linear_Expression(const Linear_Expression& e, Representation r);
    
    VERIFICATION_CRITERIA:

    Convert both directions and repeat the existing representation, including zero, constants, sparse gaps and unused trailing coordinates. Compare coefficient vectors and independent rational evaluations. Inject conversion allocation failures and check unchanged state.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionfailure1.cc.

  • 5. Ambient dimension queries and trailing-coordinate resizing UID: PPL-SPEC-000075 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall return the common maximum supported expression dimension. space_dimension() shall return the declared ambient dimension, including unused trailing coordinates. For n <= max_space_dimension(), successful set_space_dimension(n) shall retain the constant term and coefficients with indices below the lesser of the old and new dimensions. Extension shall give all new coordinates zero coefficients. Shrinking shall discard removed coefficients. Resizing to the current dimension shall preserve all coefficients. These operations shall retain the representation.

    RATIONALE:

    Expression resizing erases coefficient slots rather than performing existential projection of a pointset.

    INTERFACE:
    static dimension_type Linear_Expression::max_space_dimension();
    dimension_type Linear_Expression::space_dimension() const;
    void Linear_Expression::set_space_dimension(dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check zero-dimensional extension, unchanged size, nonzero trailing-coordinate truncation, all-coordinate removal and subsequent extension. Compare coefficients and evaluations with an independent vector resize, for dense and sparse storage.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 6. Coefficient access, replacement and zero predicates UID: PPL-SPEC-000076 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Coefficient accessors shall require an lvalue receiver, with the corresponding const && overloads deleted in every coefficient profile. References shall not outlive their owning expression.

    coefficient(v) shall return the stored homogeneous coefficient when v.id() is within the declared dimension, and zero otherwise. inhomogeneous_term() shall return the constant term. Returned references, where the configured trait returns references, shall be borrowed until the expression is modified or destroyed.

    For a variable within the declared dimension, set_coefficient(v,n) shall replace only that coefficient. set_inhomogeneous_term(n) shall replace only the constant term. Both shall preserve dimension and representation. Scalar inputs may be borrowed from the expression being modified; their entry values shall be used.

    is_zero() shall hold exactly when every homogeneous coefficient and the constant term are zero. all_homogeneous_terms_are_zero() shall disregard the constant term. For a Variables_Set whose indices are within the expression dimension, all_zeroes(vars) shall hold exactly when every selected homogeneous coefficient is zero. An empty selection shall satisfy that predicate. is_equal_to(other) shall hold exactly when the declared space dimensions, constant terms and all homogeneous coefficients are equal, independently of representation. It shall not test equality of zero sets; expressions differing by a nonunit scale shall generally compare unequal.

    RATIONALE:

    A missing homogeneous coefficient is zero, while overwriting a term must not silently extend the ambient dimension. Constant and homogeneous zero tests answer different questions.

    INTERFACE:
    Coefficient_traits::const_reference
    Linear_Expression::coefficient(Variable v) const &;
    Coefficient_traits::const_reference
    Linear_Expression::inhomogeneous_term() const &;
    void Linear_Expression::set_coefficient(Variable v,
                                          Coefficient_traits::const_reference n);
    void Linear_Expression::set_inhomogeneous_term(
      Coefficient_traits::const_reference n);
    bool Linear_Expression::is_zero() const;
    bool Linear_Expression::all_homogeneous_terms_are_zero() const;
    bool Linear_Expression::all_zeroes(const Variables_Set& vars) const;
    bool Linear_Expression::is_equal_to(const Linear_Expression& other) const;
    
    VERIFICATION_CRITERIA:

    Check sparse absent terms and out-of-dimension reads, replacement by zero and nonzero values, untouched coefficients and dimensions, constant-only and total zero, empty and mixed selected zero sets. Copy borrowed values before mutation.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 7. Affine addition, subtraction and negation UID: PPL-SPEC-000077 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For operands denoting E and F, expression addition and subtraction shall produce E + F and E − F, using zero coefficients for missing trailing coordinates and the maximum input dimension. Mixed variable forms shall treat a variable as its coordinate function. Mixed coefficient forms shall treat a coefficient as a dimension-zero constant. Unary plus shall return an independent copy; unary minus and neg_assign shall negate every coefficient, including the constant, without changing dimension.

    Compound addition and subtraction shall update the target from entry values, return a reference to it, retain its representation, and permit the target as the expression source. Distinct sources shall remain unchanged. Zero cancellation shall retain the computed maximum dimension. An operation adding or subtracting a variable beyond the supported expression dimension shall throw std::length_error before modifying the target. The numerical prerequisites of 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Affine equality is stronger than equality of the zero sets of expressions. Independent evaluation detects unintended scaling or sign changes.

    INTERFACE:

    For Linear_Expression operands e and f, Variable operands v and w, and Coefficient operand n, these forms shall be available in a C++ function using PPL names:

    Linear_Expression sum(e + f), difference(e - f);
    Linear_Expression vv_sum(v + w), vv_difference(v - w);
    Linear_Expression ev_sum(e + v), ve_sum(v + e);
    Linear_Expression ev_difference(e - v), ve_difference(v - e);
    Linear_Expression en_sum(e + n), ne_sum(n + e);
    Linear_Expression en_difference(e - n), ne_difference(n - e);
    Linear_Expression positive(+e), negative(-e);
    Linear_Expression& expression_sum = (e += f);
    Linear_Expression& expression_difference = (e -= f);
    Linear_Expression& variable_sum = (e += v);
    Linear_Expression& variable_difference = (e -= v);
    Linear_Expression& constant_sum = (e += n);
    Linear_Expression& constant_difference = (e -= n);
    neg_assign(e);
    
    VERIFICATION_CRITERIA:

    Compare all overloads against independent affine sums and differences over rational valuations. Include unequal dimensions in both orders, dense/sparse combinations, self-addition/subtraction, constant changes, zero cancellation, return identity, source preservation and oversized variable rejection.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 8. Integral scalar multiplication and coefficient-wise division UID: PPL-SPEC-000078 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Multiplication by a coefficient c shall multiply every stored coefficient and the constant term by c, producing the affine function cE. Multiplication by zero shall retain the expression's dimension. operator*= shall update and return the target and retain its representation. Both scalar operand orders shall be available for a new result.

    For nonzero divisor c, operator/= shall replace each homogeneous coefficient and the constant term separately by its integral quotient rounded towards zero. It shall retain dimension and representation and return the target. This shall denote affine division E ⁄ c when all coefficients are divisible by c; otherwise it shall denote the expression formed from those truncated coefficients. No rational-coefficient result is implied. The scalar passed to a mutating operation shall not reference a coefficient owned by that target. The numerical prerequisites of 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Integer-coefficient division can change an affine function by truncating its coefficients. Exact scalar division is a special case that must not be confused with the general operation.

    INTERFACE:
    Linear_Expression operator*(const Linear_Expression& e,
                                Coefficient_traits::const_reference n);
    Linear_Expression operator*(Coefficient_traits::const_reference n,
                                const Linear_Expression& e);
    Linear_Expression& operator*=(Linear_Expression& e,
                                  Coefficient_traits::const_reference n);
    Linear_Expression& operator/=(Linear_Expression& e,
                                  Coefficient_traits::const_reference n);
    
    VERIFICATION_CRITERIA:

    Check both signs and zero multipliers, exact and inexact division with positive and negative divisors, constant terms and trailing dimensions. Compare quotient coefficients with an independent GMP truncating-division oracle and evaluate the resulting affine functions at rational points.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 9. Explicit scaled accumulation, combination and elimination UID: PPL-SPEC-000079 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Variable accumulation shall add or subtract cxv to the target, extending its dimension when needed. Expression accumulation shall add or subtract cF and use the maximum input dimension. linear_combine(y,c1,c2) shall assign c1E + c2F and require both multipliers nonzero. linear_combine_lax shall have that same meaning while admitting zero multipliers. Both shall retain the maximum input dimension, even when its coefficient cancels, and retain the target representation.

    For equal-dimension distinct expressions with nonzero coefficients a and b at v, linear_combine(y,v) shall assign (b ⁄ g)E − (a ⁄ g)F, where g = gcd(|a|, |b|). The chosen coordinate coefficient shall therefore be zero. The variable shall lie in that dimension.

    Expression sources shall be distinct from the target. Scalar multipliers shall not reference a coefficient owned by the target. Distinct sources shall be preserved. Numerical prerequisites in 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Eliminating a coefficient requires a specified scaled combination, not merely an expression that happens to have zero in that slot.

    INTERFACE:
    Linear_Expression& add_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, Variable v);
    Linear_Expression& sub_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, Variable v);
    void add_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, const Linear_Expression& y);
    void sub_mul_assign(Linear_Expression& e,
      Coefficient_traits::const_reference n, const Linear_Expression& y);
    void Linear_Expression::linear_combine(const Linear_Expression& y,
      Coefficient_traits::const_reference c1,
      Coefficient_traits::const_reference c2);
    void Linear_Expression::linear_combine_lax(const Linear_Expression& y,
      Coefficient_traits::const_reference c1,
      Coefficient_traits::const_reference c2);
    void Linear_Expression::linear_combine(const Linear_Expression& y, Variable v);
    
    VERIFICATION_CRITERIA:

    Use dense/sparse cross products and unequal dimensions, positive and negative factors, zero factors for lax combinations, variable extension and accumulation return identity. Independently compute all coefficient vectors and rational evaluations. For elimination include shared factors and all coefficient-sign pairs.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 10. Coefficient normalization and sign normalization UID: PPL-SPEC-000080 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    normalize() shall divide all homogeneous coefficients and the constant term by their common nonnegative greatest common divisor when it is nonzero. The all-zero expression shall remain zero. sign_normalize() shall negate all coefficients and the constant term exactly when the first nonzero homogeneous coefficient, in increasing variable order, is negative. An expression having no nonzero homogeneous coefficient shall be unchanged by sign normalization, including a negative constant.

    Both operations shall retain dimension and representation and be idempotent. Normalization can scale the affine value; sign normalization can negate it. Neither operation shall promise affine-value preservation merely because its result has the same zero set. The numerical prerequisites of 🔗 1. Affine value, numerical prerequisites and shared zero shall apply.

    RATIONALE:

    Primitive coefficients and a chosen leading sign are useful descriptor conventions, but they change affine values unless the chosen scale is one.

    INTERFACE:
    void Linear_Expression::normalize();
    void Linear_Expression::sign_normalize();
    
    VERIFICATION_CRITERIA:

    Check all-zero, positive and negative constants, coprime coefficients, a shared divisor, leading zero gaps, each sign of the first nonzero coefficient and unused trailing coordinates. Compare exact expected coefficients and rational evaluation scaling, and repeat each operation to establish idempotence.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • PPL-SPEC-000081
    11. Ordered iteration of nonzero homogeneous coefficients UID: PPL-SPEC-000081 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The owning expression's iterator-position accessors shall require an lvalue receiver, with the corresponding const && overloads deleted. Iterators shall not extend the owning expression's lifetime.

    begin() and end() shall delimit homogeneous nonzero coefficients in increasing coordinate order; the constant term and zero coefficients shall not occur. end() shall be the past-the-end position. lower_bound(v) shall return the first such coefficient whose variable identifier is at least v.id(), or end() when none exists; callers shall supply v.id() <= space_dimension(), including the past-the-end coordinate.

    Dereferencing a valid non-end iterator shall return its coefficient; variable() shall return its coordinate and index() shall return that coordinate's identifier plus one. Prefix increment/decrement shall navigate the sequence and return the changed iterator. Decrement shall require a preceding element; decrementing a nonempty sequence's end shall yield its last element. Iterator copies and assignment shall own independent positions, while borrowing the same expression. Iterators shall be compared only within the same unchanged expression. Mutating or destroying the expression shall invalidate them. A default iterator shall admit destruction or replacement; copying, dereferencing or navigating it is not required.

    visit_nonzero_coefficients(visitor) const & shall invoke the callback exactly once with a concrete borrowed, bidirectional range of the same ordered nonzero homogeneous terms. The callback shall accept dense and sparse ranges and return the same type for both. Representation shall be selected once; constructing, traversing and copying range iterators shall not allocate. Range begin and end access shall take constant time; locating their positions may be performed when constructing the view. The callback result and exceptions shall propagate unchanged. Owner rvalues shall be rejected. A range or iterator returned by the callback shall borrow the expression and shall obey the same invalidation rules. Adapter visitors shall honor the visible dimension and omit hidden descriptor coordinates.

    RATIONALE:

    Logical nonzero iteration hides storage differences. The public iterator index also includes the constant-slot offset, unlike a Variable identifier.

    INTERFACE:
    template <typename Visitor>
    decltype(auto) Linear_Expression::visit_nonzero_coefficients(Visitor&&) const &;
    class Linear_Expression::const_iterator;
    Linear_Expression::const_iterator Linear_Expression::begin() const &;
    Linear_Expression::const_iterator Linear_Expression::end() const &;
    Linear_Expression::const_iterator Linear_Expression::lower_bound(Variable v) const &;
    
    explicit Linear_Expression::const_iterator::const_iterator();
    Linear_Expression::const_iterator::const_iterator(const const_iterator& i);
    Linear_Expression::const_iterator::~const_iterator();
    Linear_Expression::const_iterator&
    Linear_Expression::const_iterator::operator=(const const_iterator& i);
    Linear_Expression::const_iterator& Linear_Expression::const_iterator::operator++();
    Linear_Expression::const_iterator& Linear_Expression::const_iterator::operator--();
    Linear_Expression::const_iterator::reference
    Linear_Expression::const_iterator::operator*() const;
    Variable Linear_Expression::const_iterator::variable() const;
    dimension_type Linear_Expression::const_iterator::index() const;
    bool Linear_Expression::const_iterator::operator==(const const_iterator& i) const;
    bool Linear_Expression::const_iterator::operator!=(const const_iterator& i) const;
    void Linear_Expression::const_iterator::m_swap(const_iterator& i);
    
    VERIFICATION_CRITERIA:

    Compare forward and reverse sequences with independently listed indices and coefficients for empty, constant, gapped and trailing-zero expressions in both representations. Check lower bounds at and between supported positions, copied/assigned iterator independence, return identity, member swap and replacement of a default iterator. Check the concrete visitor against independent coefficient lists, prefix visibility, exception propagation, rvalue rejection and an armed allocation failure.

    SOURCE:

    src/Linear_Expression_Coefficients.hh; src/Linear_Expression_templates.hh; src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 12. Explicit coefficient-coordinate transformations UID: PPL-SPEC-000082 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For variables within the expression dimension, swap_space_dimensions shall exchange exactly their coefficients and retain the constant term. permute_space_dimensions(cycle) shall require distinct, in-dimension variables. It shall move each listed coordinate coefficient to the following listed coordinate, and the last to the first. Empty and singleton cycles shall preserve the expression.

    remove_space_dimensions(vars) shall require in-dimension indices, discard their coefficients, and compact retained coordinates in their original order. Removing none shall preserve the expression; removing all shall retain only the constant term. shift_space_dimensions(v,n) shall require v.id() <= space_dimension() and a resulting dimension not exceeding max_space_dimension(). It shall insert n zero coefficients immediately before v, shift subsequent coefficients by n, and increase the dimension accordingly. Insertion at the old dimension shall append zeros. A zero shift shall preserve the expression.

    These transformations shall preserve the inhomogeneous term and representation. They shall implement the stated coefficient rearrangement, with no claim that discarding a nonzero coefficient preserves the original affine value.

    RATIONALE:

    Descriptor coefficient transformation is distinct from existential pointset projection. Explicit placement makes the resulting affine meaning unambiguous.

    INTERFACE:
    void Linear_Expression::swap_space_dimensions(Variable v1, Variable v2);
    void Linear_Expression::permute_space_dimensions(
      const std::vector<Variable>& cycle);
    void Linear_Expression::remove_space_dimensions(const Variables_Set& vars);
    void Linear_Expression::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Use independently permuted, filtered and shifted coefficient vectors. Check self-swaps, empty/singleton and longer cycles, zero and nonzero moved coefficients, removal of no/all/interior coordinates, zero shifts, insertion at front/interior/end and preserved constant terms in both representations.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 13. Reloadable ASCII export and replacement loading UID: PPL-SPEC-000083 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall write a reloadable representation consisting of the word size, the number of coefficient slots d + 1, and then the constant term followed by all homogeneous coefficients in increasing variable order. Whitespace shall separate tokens. ascii_dump() shall write the same representation to std::cerr. Export shall preserve the expression.

    Given a compatible complete representation with representable coefficient values and a positive slot count not exceeding the supported storage limit, ascii_load(s) shall return true and replace the expression with the encoded coefficients and dimension, retaining its destination representation. The slot count shall include the constant slot, so zero shall be rejected with false before resizing, preserving the destination expression. A missing or incorrect size token, missing count, malformed coefficient or truncated coefficient sequence shall yield false. Trailing input after the indicated coefficient count shall remain available to the caller. The contract shall not promise a stable cross-version wire format.

    Other reported load failures may change the destination. It shall remain destructible and may be replaced by a subsequent complete valid load; no rollback is promised. Allocation and configured numerical failures may propagate through their documented exception channels.

    RATIONALE:

    A reloadable expression carries its ambient dimension and constant term, while storage choice belongs to the destination. An empty coefficient sequence cannot encode an affine expression.

    INTERFACE:
    void Linear_Expression::ascii_dump(std::ostream& s) const;
    void Linear_Expression::ascii_dump() const;
    bool Linear_Expression::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip constants, gaps, trailing zeros and modified expressions through all dense/sparse producer and consumer pairs. Compare literal coefficient vectors and rational evaluations. Check exact token order, trailing-input preservation, malformed headers/counts/coefficients and truncation. Verify that zero-slot rejection preserves coefficients, dimension and representation. After other failures exercise destruction and complete replacement, without assuming unchanged state.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc; tests/linearexpressionbranches1.cc.

  • 14. Human-readable affine output and formatter dispatch UID: PPL-SPEC-000084 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The output operator shall display the nonzero homogeneous terms in increasing variable order, followed by a nonzero constant term. It shall use the active Variable formatter specified by 🔗 7. Active Variable formatter and initialized thread state. For coefficient magnitudes other than one it shall put * between the coefficient and variable; a magnitude of one shall be omitted. Later positive and negative terms shall be separated by " + " and " - " respectively, with a minus sign also preceding a negative first term. A zero expression shall display 0. No newline shall be added. The supplied stream shall be returned. print() shall use the same display on std::cerr.

    Output shall preserve coefficients, dimension and representation. Its formatting arithmetic shall satisfy the selected coefficient profile's preconditions, including representability of any negated coefficient. The human-readable display shall not substitute for the reloadable representation in 🔗 13. Reloadable ASCII export and replacement loading.

    RATIONALE:

    Readable output uses coordinate naming supplied by the client, whereas machine reload requires explicit coefficient slots and dimensions.

    INTERFACE:
    namespace IO_Operators {
      std::ostream& operator<<(std::ostream& s, const Linear_Expression& e);
    }
    void Linear_Expression::print() const;
    
    VERIFICATION_CRITERIA:

    Check literal output for zero, constants, both leading signs, unit magnitudes, gaps and mixed signs. Install an indexed variable formatter and verify dispatch and stream identity. Redirect std::cerr to check print without a newline and verify the expression remains unchanged.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • PPL-SPEC-000085
    15. Invariant query and memory accounting UID: PPL-SPEC-000085 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    OK() shall report whether the expression's owned representation satisfies its checked storage invariants. Expressions produced by successful operations under their stated preconditions shall satisfy those invariants. external_memory_in_bytes() shall report the memory accounted for by its owned representation, including that representation object. total_memory_in_bytes() shall equal sizeof(Linear_Expression) plus external_memory_in_bytes(). These queries shall preserve the expression's coefficients, dimension and representation. Memory counts shall not promise allocator overhead, a fixed dense-to-sparse ordering or exact process memory consumption.

    RATIONALE:

    An owning interface object accounts separately for itself and its dynamically selected representation. Storage diagnostics do not measure process resident memory.

    INTERFACE:
    bool Linear_Expression::OK() const;
    memory_size_type Linear_Expression::external_memory_in_bytes() const;
    memory_size_type Linear_Expression::total_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check valid empty, constant, dense and sparse expressions, resized copies and representation conversions. Verify the total/external identity and preservation of every observable value without imposing architecture-specific byte totals.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression.cc; src/Linear_Expression_Impl_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/linearexpressionspec1.cc.

  • 1. Augmented coefficient products and numerical prerequisites UID: PPL-SPEC-000561 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    The internal Scalar_Products operations shall pair stored coefficient rows, without dividing generator coordinates by a point or parameter divisor. A stored expression row shall place the constant in slot zero and coordinate i in slot i + 1. A necessarily closed constraint or generator shall use this visible row. A not necessarily closed descriptor shall also have its final epsilon slot. A grid generator shall have a final hidden parameter-divisor slot after its visible row; a congruence modulus shall not be a coefficient-row slot.

    An operation shall use exactly the coefficient positions in its individual contract. Its output coefficient shall be live, assignable and separate from all operand-owned storage. The operands shall be live valid objects with the stated dimension/topology conditions. Read-only operands may alias where their types permit it. Dense and sparse representations shall give the same result. Distinct sources, dimensions, representations and topology shall be preserved.

    Products and accumulated sums shall be evaluated exactly. A bounded coefficient profile shall admit the final sum when assigning it to a coefficient; individual products and partial sums need not fit that profile. Sign-only operations shall not require the exact sum to fit a stored coefficient. Unrepresentable final assignments shall follow 🔗 1. Affine value, numerical prerequisites and shared zero. Callers shall provide sufficient resources and initialization for the participating descriptor/constant lifetimes, including the initialized-thread rules in 🔗 3. Thread initialization, default state and finalization. Shared scratch-coefficient pools in a non-thread-safe configuration shall be serialized; thread-safe configurations shall use calling-thread scratch pools. Object access shall be synchronized against mutation. Arithmetic or resource failure shall not constitute a successful product, and no unchanged-output promise shall apply after such failure.

    RATIONALE:

    Augmented rows carry numerical representation columns whose products differ from evaluation at normalized geometric coordinates.

    INTERFACE:

    Internal source header: Scalar_Products_defs.hh, with Scalar_Products_inlines.hh after descriptor definitions. Names belong to Parma_Polyhedra_Library; static member signatures apply to Scalar_Products.

    class Scalar_Products;
    class Topology_Adjusted_Scalar_Product_Sign;
    
    VERIFICATION_CRITERIA:

    Use literal coefficient-vector oracles across dense/sparse combinations, positive/zero/negative sums, hidden columns and supported aliases. Include cancellation of products beyond the stored range and the working machine-word range, signs of unrepresentable sums, rejected final assignments and unchanged distinct sources.

    SOURCE:

    src/Exact_Arithmetic.hh; src/Scalar_Products_defs.hh; src/Scalar_Products_inlines.hh; src/Scalar_Products.cc; src/Linear_Expression_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc.

  • 2. Full expression and polyhedral descriptor products UID: PPL-SPEC-000562 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For expression coefficient rows X = (x0, …, xn) and Y = (y0, …, ym) with n ≤ m, full assignment shall set z = ∑ni = 0xiyi. The Constraint, Generator and Generator, Constraint overloads shall apply the same formula to their stored augmented rows in argument order. The first row shall not be longer than the second; an epsilon slot present in the first row shall be included. The second row's trailing slots shall not contribute. This positionwise product shall not implicitly align epsilon slots at different positions.

    sign with expression, constraint/generator or generator/constraint operands shall return -1, 0 or 1 according as that same exact full product is negative, zero or positive. It shall not return a sign inferred from an inexact or overflowed coefficient. Prerequisites and source preservation shall follow 🔗 1. Augmented coefficient products and numerical prerequisites.

    RATIONALE:

    The full stored-row product supplies exact incidence calculations, including epsilon when requested, without changing either descriptor.

    INTERFACE:

    Internal source header: Scalar_Products_defs.hh, with Scalar_Products_inlines.hh after descriptor definitions. Names belong to Parma_Polyhedra_Library; static member signatures apply to Scalar_Products.

    static void assign(Coefficient& z, const Linear_Expression& x,
                       const Linear_Expression& y);
    static void assign(Coefficient& z, const Constraint& c, const Generator& g);
    static void assign(Coefficient& z, const Generator& g, const Constraint& c);
    static int sign(const Linear_Expression& x, const Linear_Expression& y);
    static int sign(const Constraint& c, const Generator& g);
    static int sign(const Generator& g, const Constraint& c);
    
    VERIFICATION_CRITERIA:

    Check both typed argument orders, expression aliases, unequal compatible row lengths, empty visible dimensions and all dense/sparse pairs. Include full NNC products with a nonzero epsilon contribution, plus arbitrary-precision products and negative/zero/positive signs.

    SOURCE:

    src/Scalar_Products_defs.hh; src/Scalar_Products_inlines.hh; src/Scalar_Products.cc; src/Linear_Expression_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc.

  • PPL-SPEC-000563
    3. Grid products exclude the hidden parameter divisor UID: PPL-SPEC-000563 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For assign(z, gg, cg) and reduced_assign(z, gg, cg), let d be the visible grid-generator dimension and G and C the stored grid-generator and congruence rows. The congruence shall have visible dimension at least d; both operations shall assign z = ∑di = 0GiiC. They shall exclude the grid generator's hidden parameter-divisor slot and every congruence coordinate beyond d.

    For assign(z, cg, gg), the congruence's visible dimension e shall not exceed the generator's visible dimension, and the result shall be z = ∑ei = 0CiiG. No modulus shall participate in either order. For assign(z, c, gg) and sign(c, gg), full stored-row pairing in 🔗 2. Full expression and polyhedral descriptor products shall apply, with the constraint row no longer than the grid-generator row; any participating final slot shall retain its stored positionwise meaning. The sign shall be -1, 0 or 1 for the exact product. Prerequisites and preservation shall follow 🔗 1. Augmented coefficient products and numerical prerequisites.

    RATIONALE:

    A parameter divisor is storage metadata for a different numerical role; multiplying it by a later visible congruence coordinate would change the intended grid incidence product.

    INTERFACE:

    Internal source header: Scalar_Products_defs.hh, with Scalar_Products_inlines.hh after descriptor definitions. Names belong to Parma_Polyhedra_Library; static member signatures apply to Scalar_Products.

    static void assign(Coefficient& z, const Grid_Generator& gg,
                       const Congruence& cg);
    static void assign(Coefficient& z, const Congruence& cg,
                       const Grid_Generator& gg);
    static void reduced_assign(Coefficient& z, const Grid_Generator& gg,
                               const Congruence& cg);
    static void assign(Coefficient& z, const Constraint& c,
                       const Grid_Generator& gg);
    static int sign(const Constraint& c, const Grid_Generator& gg);
    
    VERIFICATION_CRITERIA:

    Check point, parameter and line rows, zero-dimensional constants, nonzero hidden divisors, larger second operands and both congruence/generator orders. Change only an excluded trailing coordinate or modulus and verify no product change. Include constraint/grid products and exact signs.

    SOURCE:

    src/Scalar_Products_defs.hh; src/Scalar_Products_inlines.hh; src/Scalar_Products.cc; src/Linear_Expression_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc.

  • PPL-SPEC-000564
    4. Reduced products omit the first epsilon slot UID: PPL-SPEC-000564 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For expression rows X = (x0, …, xn) and Y = (y0, …, ym), reduced assignment shall require n ≥ 1 and n − 1 ≤ m, and assign z = ∑n − 1i = 0xiyi. The final first-row slot shall not contribute, whether or not the second row has a corresponding slot.

    For typed Constraint, Generator and Generator, Constraint overloads, the first descriptor shall have not necessarily closed topology, so the omitted slot shall be its epsilon slot. The second stored row shall contain all retained positions. reduced_sign with expression or either typed argument order shall return -1, 0 or 1 according to that exact reduced sum. The second typed descriptor may have either topology. The distinct grid reduced_assign overload shall instead follow 🔗 3. Grid products exclude the hidden parameter divisor. Other prerequisites and preservation shall follow 🔗 1. Augmented coefficient products and numerical prerequisites.

    RATIONALE:

    Epsilon is needed in some stored-row calculations and deliberately excluded from topology-adjusted geometric incidence calculations.

    INTERFACE:

    Internal source header: Scalar_Products_defs.hh, with Scalar_Products_inlines.hh after descriptor definitions. Names belong to Parma_Polyhedra_Library; static member signatures apply to Scalar_Products.

    static void reduced_assign(Coefficient& z, const Linear_Expression& x,
                               const Linear_Expression& y);
    static void reduced_assign(Coefficient& z, const Constraint& c,
                               const Generator& g);
    static void reduced_assign(Coefficient& z, const Generator& g,
                               const Constraint& c);
    static int reduced_sign(const Linear_Expression& x,
                            const Linear_Expression& y);
    static int reduced_sign(const Constraint& c, const Generator& g);
    static int reduced_sign(const Generator& g, const Constraint& c);
    
    VERIFICATION_CRITERIA:

    Use a nonzero omitted product to distinguish full and reduced results. Cross first-NNC/second-closed and first-NNC/second-NNC cases in both typed orders, raw expression aliases and unequal retained lengths. Check exact negative, zero and positive sums.

    SOURCE:

    src/Scalar_Products_defs.hh; src/Scalar_Products_inlines.hh; src/Scalar_Products.cc; src/Linear_Expression_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc.

  • PPL-SPEC-000565
    5. Homogeneous products omit constants and grid metadata UID: PPL-SPEC-000565 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For expression rows X = (x0, …, xn) and Y = (y0, …, ym) with n ≤ m, homogeneous assignment shall set z = ∑ni = 1xiyi, including a final slot when it belongs to the first expression. A zero-dimensional expression shall therefore give zero. For expression/generator and expression/grid-generator overloads, the second row shall be the descriptor's complete stored row, long enough for all first-expression positions.

    For grid-generator/congruence and grid-generator/constraint overloads, the second descriptor's visible dimension shall be at least the grid generator's visible dimension d. The sum shall be z = ∑di = 1GiiC, excluding both the constant and the hidden parameter-divisor slot. Constants and any trailing second-operand coordinates shall not contribute. Each supported homogeneous_sign overload shall return -1, 0 or 1 for its corresponding exact sum. Other prerequisites and preservation shall follow 🔗 1. Augmented coefficient products and numerical prerequisites.

    RATIONALE:

    Homogeneous products isolate displacement coefficients from affine offsets and generator normalization metadata.

    INTERFACE:

    Internal source header: Scalar_Products_defs.hh, with Scalar_Products_inlines.hh after descriptor definitions. Names belong to Parma_Polyhedra_Library; static member signatures apply to Scalar_Products.

    static void homogeneous_assign(Coefficient& z, const Linear_Expression& x,
                                   const Linear_Expression& y);
    static void homogeneous_assign(Coefficient& z, const Linear_Expression& e,
                                   const Generator& g);
    static void homogeneous_assign(Coefficient& z, const Linear_Expression& e,
                                   const Grid_Generator& gg);
    static void homogeneous_assign(Coefficient& z, const Grid_Generator& gg,
                                   const Constraint& c);
    static void homogeneous_assign(Coefficient& z, const Grid_Generator& gg,
                                   const Congruence& cg);
    static int homogeneous_sign(const Linear_Expression& x,
                                const Linear_Expression& y);
    static int homogeneous_sign(const Linear_Expression& e, const Generator& g);
    static int homogeneous_sign(const Linear_Expression& e,
                                const Grid_Generator& gg);
    static int homogeneous_sign(const Grid_Generator& gg, const Constraint& c);
    
    VERIFICATION_CRITERIA:

    Vary nonzero constants and hidden grid divisors while retaining visible coordinates. Include zero-dimensional rows, expression aliases, unequal compatible dimensions, all descriptor overloads and all exact signs under dense/sparse combinations.

    SOURCE:

    src/Scalar_Products_defs.hh; src/Scalar_Products_inlines.hh; src/Scalar_Products.cc; src/Linear_Expression_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc.

  • PPL-SPEC-000566
    6. Topology-selected scalar-product sign objects UID: PPL-SPEC-000566 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Construction of Topology_Adjusted_Scalar_Product_Sign from a constraint or generator shall retain the choice of full product for necessarily closed topology and reduced product for not necessarily closed topology. It shall retain no borrowed descriptor reference; the source object's later lifetime shall not be required. Copying the function object shall preserve that choice.

    For an invocation with Constraint, Generator operands, the constraint's visible dimension shall not exceed the generator's visible dimension; for Generator, Constraint operands, the first generator's visible dimension shall not exceed the constraint's visible dimension. The first operand's current topology shall agree with the stored choice, and the corresponding full or reduced row-length prerequisites shall hold. The call shall return the exact sign defined by 🔗 2. Full expression and polyhedral descriptor products or 🔗 4. Reduced products omit the first epsilon slot, respectively, and preserve the function object and both operands. It may be reused on different valid pairs satisfying the same topology choice. Other prerequisites shall follow 🔗 1. Augmented coefficient products and numerical prerequisites.

    RATIONALE:

    Topology selection depends on the first operand kind and topology, while a reusable function object needs no ownership of the descriptor used to select it.

    INTERFACE:

    Internal source header: Scalar_Products_defs.hh, with Scalar_Products_inlines.hh after descriptor definitions. Names belong to Parma_Polyhedra_Library; member signatures apply to Topology_Adjusted_Scalar_Product_Sign.

    Topology_Adjusted_Scalar_Product_Sign(const Constraint& c);
    Topology_Adjusted_Scalar_Product_Sign(const Generator& g);
    int operator()(const Constraint& c, const Generator& g) const;
    int operator()(const Generator& g, const Constraint& c) const;
    
    VERIFICATION_CRITERIA:

    Cross both constructor kinds and call orders with closed/NNC topology, copied selectors, different later operands and selector-source destruction. Include products whose full and reduced signs differ, nonzero epsilon, and compatible unequal visible dimensions.

    SOURCE:

    src/Scalar_Products_defs.hh; src/Scalar_Products_inlines.hh; src/Scalar_Products.cc; src/Linear_Expression_inlines.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc.

  • PPL-SPEC-000567
    7. Expression coefficient-range scalar products UID: PPL-SPEC-000567 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For coefficient rows X and Y with the slot conventions in 🔗 1. Augmented coefficient products and numerical prerequisites, a range product shall accept 0 ≤ s ≤ t ≤ min(|X|, |Y|) and assign z = ∑t − 1i = sXiiY. An empty range shall assign zero. The full expression overload shall use s = 0, t = |X| and require |X| ≤ |Y|. A backend interface's range sign query shall return -1, 0 or 1 for that same exact range sum.

    The result shall include a constant, visible coordinate or extra stored coordinate exactly when its slot is in the range, and shall treat omitted sparse coefficients as zero. Both operand representations and permitted read-only aliases shall give the same sum. The result shall not borrow operand storage. Exact-arithmetic, initialization, output-separation and preservation prerequisites shall follow 🔗 1. Augmented coefficient products and numerical prerequisites.

    RATIONALE:

    A precise half-open coefficient range supports full, homogeneous and reduced products through one consistent numerical operation.

    INTERFACE:

    Private helper methods of Linear_Expression and public methods of its internal Linear_Expression_Interface in Parma_Polyhedra_Library:

    void Linear_Expression::scalar_product_assign(Coefficient& result,
      const Linear_Expression& y) const;
    void Linear_Expression::scalar_product_assign(Coefficient& result,
      const Linear_Expression& y, dimension_type start, dimension_type end) const;
    void Linear_Expression_Interface::scalar_product_assign(Coefficient& result,
      const Linear_Expression_Interface& y,
      dimension_type start, dimension_type end) const;
    int Linear_Expression_Interface::scalar_product_sign(
      const Linear_Expression_Interface& y,
      dimension_type start, dimension_type end) const;
    
    VERIFICATION_CRITERIA:

    Check every range in literal coefficient arrays, including empty ranges at both ends, constants, skipped zero coordinates and sparse disjoint support. Cross dense/sparse backends and interface dispatch, exact signs, read-only aliases and unchanged sources.

    SOURCE:

    src/Linear_Expression_defs.hh; src/Linear_Expression_inlines.hh; src/Linear_Expression_Interface_defs.hh; src/Linear_Expression_Impl_defs.hh; src/Linear_Expression_Impl_templates.hh; tests/scalarproductsspec1.cc; tests/linearexpression1.cc.

  • PPL-SPEC-001728
    6. Java mathematical representations and operation options UID: PPL-SPEC-001728 STATUS: APPROVED COMPONENT: JAVA_INTERFACE APPLICABILITY: IF_JAVA VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Java VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For valid supported Java values, native exchange shall preserve variable indices, representable coefficients and the mathematical meaning of expression trees, constraints, congruences, generators, grid generators and artificial parameters. Expression sums, differences, integer products and negation shall retain their operands' meanings. Constraint direction, congruence modulus, generator kind and divisor, and artificial-parameter numerator and denominator shall be preserved. Coefficient exchange obeys 🔗 1. Java integral coefficient exchange. Native affine, constraint, congruence, generator and grid-generator meanings are specified by 🔗 1. Affine value, numerical prerequisites and shared zero, 🔗 1. Constraint relation meaning and numerical prerequisites, 🔗 1. Affine congruence meaning and valid numerical use, 🔗 1. Generator kinds and numerical prerequisites and 🔗 1. Grid-generator values and integer versus continuous displacement, respectively. Returned mathematical objects may be normalized and need not preserve the input expression-tree shape.

    Conversion of a finite acyclic expression into native form shall preserve operator grouping and apply the configured coefficient rules at each node. This conversion and copying through built-in Java expression nodes shall use stack space independent of tree depth. Construction and cloning shall retain the documented ownership of copied operands.

    System and variable-set conversion shall retain the represented collection; artificial-parameter sequences shall retain their order. Relation objects shall encode the native predicates (subsumption; disjointness, strict intersection, inclusion and saturation). Boxed primitives, Pair fields and By_Reference values shall preserve the values or object references assigned to them.

    Named Java enumeration values for relation symbols, integer widths, representations and overflow policies, optimization modes, solver results and MIP/PIP control parameters shall denote the corresponding native choices. Choosing a complexity or overflow policy shall not strengthen the native operation's exactness guarantee. Nonnegative integral arguments converted to an unsigned native type shall be rejected if negative or outside that type's range; failures follow 🔗 3. Java native failure and pending-exception protocol. Native dimension and object validity preconditions remain applicable.

    RATIONALE:

    Java object layout, enum ordinals and container fields are representation details; native conversion must preserve their mathematical and option meanings.

    INTERFACE:

    Package parma_polyhedra_library: Variable, the Linear_Expression hierarchy, Constraint, Congruence, Generator, Grid_Generator, Artificial_Parameter, their system/sequence classes, Variables_Set, Poly_Gen_Relation, Poly_Con_Relation, the operation-option/result enums, Pair and By_Reference. Values must have the documented class, finite acyclic expression structure and supported enum membership; mathematical objects must satisfy their native constructor preconditions.

    VERIFICATION_CRITERIA:

    Inspect each constructor/accessor correspondence, expression-node case, system iterator and enum switch against the Java definitions and native meanings. Check signed/unsigned range admission, affine constants, generator divisors, relation flags and container field positions. Use existing Java domain and solver scenarios as supporting runtime evidence, comparing normalization by mathematical meaning. Construct and copy mixed expression trees, check subtree independence and convert against an independently known affine result.

    SOURCE:

    interfaces/Java/jni/ppl_java_common.cc; interfaces/Java/jni/ppl_java_common_defs.hh; interfaces/Java/jni/ppl_java_common_inlines.hh; interfaces/Java/tests/Linear_Expression_test1.java; interfaces/Java/parma_polyhedra_library.

  • PPL-SPEC-001692
    1. OCaml mathematical representation exchange UID: PPL-SPEC-001692 STATUS: APPROVED COMPONENT: OCAML_INTERFACE APPLICABILITY: IF_OCAML VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: OCaml VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For well-formed values of the exposed algebraic types, conversion to native objects shall preserve zero-based variable identities, signed integral Z.t coefficients within the configured native range, affine expression meaning, equality and strict/non-strict inequality meaning, and generator kind. Returned values shall denote the native result; syntactic tree shape and normalization need not be preserved.

    Conversion of finite acyclic expressions to native objects shall preserve operator grouping and apply the configured coefficient rules at each node. Native stack usage shall be independent of expression depth. The expression values used during traversal shall remain valid under the OCaml runtime's lifetime and collection rules.

    A point or closure point with expression coordinates ai and nonzero divisor d denotes coordinates ai ⁄ d. Lines and rays denote the native direction described by the expression. Grid generators and congruences shall preserve their native rational-divisor and integral-modulus meanings. Native validity and operation-specific topology and arithmetic preconditions apply. A Z.t may be immediate or heap allocated; the binding shall use its value rather than assume either memory layout.

    RATIONALE:

    An algebraic representation can change tree shape while preserving exactly the same affine function or geometric object.

    INTERFACE:

    Module Ppl_ocaml.

    type linear_expression =
      Variable of int | Coefficient of Z.t
      | Unary_Plus of linear_expression | Unary_Minus of linear_expression
      | Plus of linear_expression * linear_expression
      | Minus of linear_expression * linear_expression
      | Times of Z.t * linear_expression
    type linear_constraint =
      Less_Than of linear_expression * linear_expression
      | Less_Or_Equal of linear_expression * linear_expression
      | Equal of linear_expression * linear_expression
      | Greater_Than of linear_expression * linear_expression
      | Greater_Or_Equal of linear_expression * linear_expression
    type linear_generator =
      Line of linear_expression | Ray of linear_expression
      | Point of linear_expression * Z.t
      | Closure_Point of linear_expression * Z.t
    

    Configured domain and solver constructors consume these types; their expression, constraint and generator queries return the corresponding types. The companion linear_grid_generator and linear_congruence types in the module signature define grid exchange.

    VERIFICATION_CRITERIA:

    Independently evaluate returned affine expressions and convert nested inputs with known grouped affine results. Round-trip positive, negative, zero and configured coefficient endpoints. Check multiple coordinates, all five relation kinds and all four polyhedral generator kinds. Include immediate and large Zarith values, divisor normalization and compacting collections.

    SOURCE:

    interfaces/OCaml/ppl_ocaml_globals.mli; interfaces/OCaml/ppl_ocaml_common.cc; interfaces/OCaml/ppl_ocaml_globals.ml; interfaces/OCaml/tests/zarith1.ml; interfaces/OCaml/tests/polyhedron1.ml; interfaces/OCaml/tests/boundary_contracts1.ml.

  • PPL-SPEC-001695
    1. Prolog mathematical term exchange UID: PPL-SPEC-001695 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For each configured supported Prolog engine, supported integral terms, affine expressions, constraints, congruences and generators shall be interpreted with their documented native mathematical meaning. '$VAR'(I) shall denote the zero-based coordinate I. Unary negation, addition, subtraction and integral scalar multiplication shall preserve affine meaning. Relations shall preserve equality and strict/non-strict order. Point and closure-point coordinates shall be divided by the supplied nonzero divisor; lines and rays denote directions. Returned terms may be normalized but shall denote the native result.

    Values shall be representable by both the engine and configured native coefficient type. A bounded engine does not acquire arbitrary-size integers from GMP in the native library. Malformed or nonlinear expressions and invalid native objects shall follow 🔗 2. Prolog success failure and exception outcomes.

    RATIONALE:

    The common term protocol must express the same mathematics independently of the selected foreign runtime.

    INTERFACE:

    Common numerical term protocol:

    '$VAR'(I)
    -E
    E + F
    E - F
    N * E
    E = F
    E =< F
    E < F
    E >= F
    E > F
    point(E, D)
    closure_point(E, D)
    ray(E)
    line(E)
    

    Here I is a valid coordinate index, N an integral coefficient and E/F supported affine expressions. Lists of such terms are the system interfaces accepted and returned by configured domain and solver predicates. Grid-point, parameter and congruence terms follow the common Prolog manual's rational-divisor and modulus conventions.

    VERIFICATION_CRITERIA:

    Across each available configured engine, compare coefficient round trips and independently reconstructed expressions/constraints/generators. Cover signs, zero, multiple indices, all relation and generator kinds, and each engine/native range intersection; check unsupported numeric and malformed cases separately.

    SOURCE:

    interfaces/Prolog/Prolog_interface_sysindep.dox; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.

PPL-LLR-000013
3. Meaning of linear constraints UID: PPL-LLR-000013 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

A linear constraint shall denote the set of valuations satisfying its stated equality, strict inequality or non-strict inequality; a finite constraint system shall denote the conjunction of its members.

RATIONALE:

This separates the exact meaning of a descriptor from the approximation a particular abstract domain may apply when accepting it.

COMMENT:

Verification covers constraint and constraint-system value types and their relation meanings. Related obligations: 🔗 5. Constraint and congruence refinement.

VERIFICATION_CRITERIA:

Check independently chosen valuations on, inside and outside boundaries. Include constant tautologies, constant contradictions, duplicate constraints, an empty system and systems whose members use different numbers of coordinates.

SOURCE:

doc/definitions.dox: Constraint Geometric Descriptors; Constraint Description. src/Constraint_defs.hh: constraint relations. src/Constraint_System_defs.hh: finite systems.

  • PPL-SPEC-001534
    1. C constraint systems UID: PPL-SPEC-001534 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The Constraint_System functions shall construct independent empty, copied, single-element or dedicated canonical native systems as exposed. Insertion shall copy the supplied constraint with the native system's topology and dimension rules. The represented condition after insertion shall be the conjunction of the previous condition and the inserted constraint. Assignment, clear and deletion shall have the native value and ownership effects. Dimension, emptiness and validity queries shall expose the native result. Begin/end operations shall position caller-owned iterators in the live system; dereferenced elements shall remain borrowed from that system and shall not be deleted or mutated.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Systems own elements, while traversal only borrows them.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Constraint_System(ppl_Constraint_System_t *pcs);
    int ppl_new_Constraint_System_zero_dim_empty(ppl_Constraint_System_t *pcs);
    int ppl_new_Constraint_System_from_Constraint(ppl_Constraint_System_t *pcs,
                                                  ppl_const_Constraint_t c);
    int ppl_new_Constraint_System_from_Constraint_System(
        ppl_Constraint_System_t *pcs, ppl_const_Constraint_System_t cs);
    int ppl_assign_Constraint_System_from_Constraint_System(
        ppl_Constraint_System_t dst, ppl_const_Constraint_System_t src);
    int ppl_delete_Constraint_System(ppl_const_Constraint_System_t cs);
    int ppl_Constraint_System_space_dimension(ppl_const_Constraint_System_t cs,
                                              ppl_dimension_type *m);
    int ppl_Constraint_System_empty(ppl_const_Constraint_System_t cs);
    int ppl_Constraint_System_has_strict_inequalities(
        ppl_const_Constraint_System_t cs);
    int ppl_Constraint_System_begin(ppl_const_Constraint_System_t cs,
                                    ppl_Constraint_System_const_iterator_t cit);
    int ppl_Constraint_System_end(ppl_const_Constraint_System_t cs,
                                  ppl_Constraint_System_const_iterator_t cit);
    int ppl_Constraint_System_OK(ppl_const_Constraint_System_t cs);
    int ppl_Constraint_System_clear(ppl_Constraint_System_t cs);
    int ppl_Constraint_System_insert_Constraint(ppl_Constraint_System_t cs,
                                                ppl_const_Constraint_t c);
    
    VERIFICATION_CRITERIA:

    Check insertion and copy independence, empty and canonical systems, declared dimensions, native iterator filtering and destruction/invalidation histories.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001526
    4. C linear constraint values UID: PPL-SPEC-001526 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Creation shall copy inputs into an independent owned Constraint representing the supplied affine expression compared with zero using the requested supported relation, including strict relations. Dedicated zero-dimensional constructors shall provide the corresponding native canonical objects. Copying and assignment shall preserve native value and dimension; deletion shall release owned storage. An unsupported relation code shall report PPL_ERROR_INVALID_ARGUMENT. Native dimension and size failures shall be translated by the C failure protocol.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Descriptor conversion must preserve its geometric or arithmetic meaning.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Constraint(ppl_Constraint_t *pc, ppl_const_Linear_Expression_t le,
                           enum ppl_enum_Constraint_Type rel);
    int ppl_new_Constraint_zero_dim_false(ppl_Constraint_t *pc);
    int ppl_new_Constraint_zero_dim_positivity(ppl_Constraint_t *pc);
    int ppl_new_Constraint_from_Constraint(ppl_Constraint_t *pc,
                                           ppl_const_Constraint_t c);
    int ppl_assign_Constraint_from_Constraint(ppl_Constraint_t dst,
                                              ppl_const_Constraint_t src);
    int ppl_delete_Constraint(ppl_const_Constraint_t c);
    
    VERIFICATION_CRITERIA:

    Check each supported kind, exact coefficients and normalization, empty/universe canonical descriptors, source independence and native admission failures.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001527
    5. C linear constraint queries UID: PPL-SPEC-001527 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Queries shall report the native Constraint relation type, dimension, variable coefficients and inhomogeneous term. Validity queries shall return a boolean outcome. Coefficient and inhomogeneous-term outputs shall assign existing writable coefficient objects. Native argument failures shall be translated.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    C query results need the same interpretation as their native descriptor.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_Constraint_space_dimension(ppl_const_Constraint_t c,
                                       ppl_dimension_type *m);
    int ppl_Constraint_type(ppl_const_Constraint_t c);
    int ppl_Constraint_coefficient(ppl_const_Constraint_t c, ppl_dimension_type var,
                                   ppl_Coefficient_t n);
    int ppl_Constraint_inhomogeneous_term(ppl_const_Constraint_t c,
                                          ppl_Coefficient_t n);
    int ppl_Constraint_OK(ppl_const_Constraint_t c);
    
    VERIFICATION_CRITERIA:

    Check each kind against literal descriptors, normalized ratios or congruences, output reuse and rejected inappropriate queries.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001061
    6. Bounded-difference construction from supported constraints UID: PPL-SPEC-001061 STATUS: APPROVED COMPONENT: BOUNDED_DIFFERENCES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    BD_Shape(cs) shall start from universe in the system's ambient dimension and conjoin every admitted constraint. Nontrivial admitted rows shall be nonstrict unary constraints or two-coordinate differences with equal-magnitude opposite coefficients; equalities shall impose both directions. Constant tautologies shall have no effect and constant falsehood shall produce empty. An empty system shall produce universe.

    A nontrivial strict inequality, a row with more than two nonzero variable coefficients, or a two-variable row with unequal-magnitude or same-sign coefficients shall throw std::invalid_argument, including after an earlier contradiction. Supported unary/difference bounds not exactly representable in the selected profile shall be rounded outward to the best admitted bound; with unbounded exact rational arithmetic, the result shall equal the admitted conjunction. The source rows and represented conjunction shall remain unchanged. can_recycle_constraint_systems() shall return false.

    The validity, lifetime, arithmetic, range, rounding and synchronization prerequisites in 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Logically const normalization may update caches but shall preserve the represented set and ambient dimension. Underlying supported numerical or allocation failures may propagate through their declared channels. Failure during construction shall release resources owned by the incomplete shape. Failure of a mutating operation shall retain the ownership needed for safe destruction; a general rollback guarantee shall not be inferred.

    A source dimension above the destination profile's max_space_dimension() shall throw std::length_error before source normalization or allocation of the corresponding target matrix storage.

    RATIONALE:

    Syntactic bounded-difference admission and outward bound normalization determine the meaning of a directly supplied conjunction.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for BD_Shape<T> and related free functions in Parma_Polyhedra_Library:

    explicit BD_Shape(const Constraint_System& cs);
    static bool can_recycle_constraint_systems();
    
    VERIFICATION_CRITERIA:

    Use independent rational unary/difference conjunctions, negative/fractional scaling, equalities, constants, contradictions, strict/relational rejection and zero dimensions. Check const-source preservation and that can_recycle_constraint_systems returns false.

    SOURCE:

    src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapevaluesspec1.cc; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/bdshapevaluespublic1.cc; tests/BD_Shape/dimensionlimits1.cc.

  • PPL-SPEC-001067
    12. Relations between bounded-difference values and linear constraints UID: PPL-SPEC-001067 STATUS: APPROVED COMPONENT: BOUNDED_DIFFERENCES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    relation_with(c) shall return the Poly_Con_Relation flags describing the whole represented set relative to the constraint: inclusion, disjointness, saturation when its affine expression vanishes throughout the set and strict intersection as defined by 🔗 1. Constraint-relation assertion values and named factories. The supplied row need not have bounded-difference syntax. A constraint within the ambient dimension shall not alter the represented set. A descriptor dimension above the receiver's shall throw std::invalid_argument. Empty and constant-row cases shall retain their set-theoretic flag combinations.

    The validity, lifetime, arithmetic, range, rounding and synchronization prerequisites in 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Logically const normalization may update caches but shall preserve the represented set and ambient dimension. Underlying supported numerical or allocation failures may propagate through their declared channels. Failure during construction shall release resources owned by the incomplete shape. Failure of a mutating operation shall retain the ownership needed for safe destruction; a general rollback guarantee shall not be inferred.

    RATIONALE:

    A restricted representation can still answer semantic queries about arbitrary linear halfspaces and hyperplanes.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for BD_Shape<T> and related free functions in Parma_Polyhedra_Library:

    Poly_Con_Relation relation_with(const Constraint& c) const;
    
    VERIFICATION_CRITERIA:

    Project arbitrary rational affine forms independently and derive every relation flag from the attained range. Include unary, difference and general correlated forms, weak/strict/equality relations, constants, empty/zero dimensions and incompatible descriptors.

    SOURCE:

    src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapevaluesspec1.cc; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/bdshapevaluespublic1.cc; tests/BD_Shape/relations1.cc; tests/BD_Shape/relations2.cc; tests/BD_Shape/relations3.cc; tests/BD_Shape/relations4.cc.

  • PPL-SPEC-001044
    1. Box construction from supported constraints UID: PPL-SPEC-001044 STATUS: APPROVED COMPONENT: INTERVALS_BOXES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Box(cs) shall construct the coordinate enclosure obtained by conjoining the constraints in cs with a universe box of the same ambient dimension, using the admitted row forms and endpoint interpretation in 🔗 1. Addition of optimally supported box constraints. With exact rational endpoints and supported openness, the result shall equal the conjunction of admitted rows. Rounded profiles shall preserve the specified outward endpoint enclosure, without a general optimality claim for inexact arithmetic. An empty system shall produce universe. A constant false row shall produce empty. With exact rational operations, every inconsistent admitted conjunction shall produce empty. Under inexact endpoint conversion, successive row enclosures may lose enough information to leave an inconsistent conjunction undetected.

    A non-interval row, or a nontrivial strict inequality when the selected interval policy cannot retain open boundaries, shall throw std::invalid_argument. Rejection shall still occur if an earlier admitted row already made the conjunction empty. Tautological and inconsistent constant rows shall retain their declared meanings.

    Construction from an rvalue system shall have the same result and rejection behavior. Its const source shall not be consumed or have its rows removed.

    The result shall inherit the source's ambient dimension, including when empty. A source dimension above max_space_dimension() shall throw std::length_error before allocating that coordinate storage. Its coordinate storage shall have the independent ownership specified in 🔗 3. Owned box copying, assignment and cleanup. Endpoint conversion shall retain the profile conditions in 🔗 4. Upward box conversion between interval profiles.

    Sources shall remain live, valid and synchronized throughout construction. Their represented values shall remain unchanged; logically const normalization may update their caches. The selected source-domain arithmetic and the target interval operations shall meet their range, resource, rounding and policy prerequisites. The numerical and runtime prerequisites in 🔗 1. Cartesian box values, coordinate identity and valid use, and descriptor initialization in 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization where used, shall apply. Failure during construction shall release resources owned by the incompletely constructed box. Underlying numerical or resource exceptions may propagate.

    RATIONALE:

    A coordinate-constraint conjunction directly describes an interval product, but construction must retain row admission and empty-system distinctions.

    INTERFACE:

    Public header: <ppl.hh>; constructor excerpts for Box<ITV> in Parma_Polyhedra_Library:

    explicit Box(const Constraint_System& cs);
    
    VERIFICATION_CRITERIA:

    Use an independent rational conjunction model for unary equalities, weak/strict inequalities, scaled rows, contradictions, constants and zero dimensions. Check lvalue/rvalue agreement, source value preservation, finite-profile outward conversion and every unsupported-row rejection, including after a contradiction.

    SOURCE:

    tests/recyclingconstructors1.cc; src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxconversionsspec1.cc; tests/boxconversionoracle.hh; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxconversionspublic1.cc.

  • PPL-SPEC-000144
    4. Equality-constraint conversion and explicit modulus construction UID: PPL-SPEC-000144 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from an equality Constraint shall produce a modulus-zero congruence with the same satisfying valuations and dimension, using requested storage. A dimensioned overload shall apply coefficient truncation or zero extension as specified by 🔗 6. Congruence dimensions and coefficient-coordinate transformations. Inequality constraints shall be rejected with std::invalid_argument.

    operator/(c,m) for an equality constraint and nonnegative modulus m shall construct the congruence formed from that equality expression with modulus m. In particular a positive supplied modulus shall produce a proper congruence, while zero shall preserve equality. It shall preserve its source and use the default representation. Numerical prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    An equality can be viewed modulo zero or used as the coefficient source for a periodic condition with an explicitly selected modulus.

    INTERFACE:
    explicit Congruence(const Constraint& c,
                        Representation r = default_representation);
    Congruence(const Constraint& c, dimension_type new_space_dimension,
               Representation r = default_representation);
    Congruence operator/(const Constraint& c, Coefficient_traits::const_reference m);
    
    VERIFICATION_CRITERIA:

    Convert equalities in both representations, compare rational truth, resize during conversion and reject each inequality kind. Check explicit modulus zero and positive moduli independently, ensuring a positive modulus is not silently retained as equality.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000156
    16. Congruence-system meaning and construction UID: PPL-SPEC-000156 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Congruence_System shall denote the conjunction of its retained congruences over rational coordinates. An empty conjunction shall be true. Default construction shall have dimension zero and no rows; the dimensioned empty constructor shall retain its supplied admitted dimension. A singleton constructor from a congruence shall copy that relation and its dimension. Construction from an equality constraint shall make its modulus-zero singleton; inequalities shall throw std::invalid_argument. Construction from a constraint system shall extract its equality rows and retain its ambient dimension, omitting inequalities.

    All constructors shall use requested storage, with default_representation equal to SPARSE. zero_dim_empty() shall borrow a dimension-zero inconsistent singleton, not an empty conjunction, until owning-thread finalization. Initialization, synchronization and numerical/failure preconditions shall follow 🔗 1. Affine congruence meaning and valid numerical use.

    RATIONALE:

    A system's conjunction and ambient space remain meaningful even without nontrivial rows. Equality extraction deliberately omits ordered inequalities.

    INTERFACE:
    class Congruence_System;
    static constexpr Representation Congruence_System::default_representation = SPARSE;
    explicit Congruence_System(Representation r = default_representation);
    explicit Congruence_System(dimension_type d, Representation r = default_representation);
    explicit Congruence_System(const Congruence& cg, Representation r = default_representation);
    explicit Congruence_System(const Constraint& c, Representation r = default_representation);
    explicit Congruence_System(const Constraint_System& cs, Representation r = default_representation);
    static const Congruence_System& Congruence_System::zero_dim_empty();
    
    VERIFICATION_CRITERIA:

    Check empty/singleton/shared inconsistent systems, positive-dimensional empty construction, equality/inequality conversion and extraction from mixed constraint systems using independent rational conjunctions.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000158
    18. System insertion, ownership transfer and coordinate changes UID: PPL-SPEC-000158 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion of a congruence, equality constraint or congruence system shall conjoin copies, preserving sources and target representation. Inequality constraints shall throw std::invalid_argument. Single congruence and constraint insertion shall strongly normalize the inserted copy. Result dimension shall be the maximum input dimension, zero-extending shorter rows. Ordinary self-system insertion and insertion of a borrowed row from the target shall be admitted using entry values.

    Rvalue insertion shall conjoin transferred relations, requiring a source distinct from the target system and not borrowing one of its rows. Transferred inputs shall remain destructible. Successful recycled-system insertion shall clear the source to a dimension-zero empty system. clear() shall likewise remove all rows and reset dimension zero while retaining storage.

    space_dimension() shall report ambient dimension, and max_space_dimension() the congruence limit. Successful set_space_dimension(n) shall resize all row coefficients by truncation or zero extension and retain moduli. Swapping/permuting system coordinates shall apply 🔗 6. Congruence dimensions and coefficient-coordinate transformations to every row. Dimension and variable arguments shall satisfy that contract's bounds. These are coefficient transformations rather than existential projection.

    Const row sources, including const rvalues, shall use preserving insertion. Const system sources shall likewise use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Copying and recycling have different source-ownership consequences, while their resulting conjunction and coordinate alignment must agree.

    INTERFACE:
    void Congruence_System::insert(const Congruence& cg);
    void Congruence_System::insert(Congruence&& cg);
    void Congruence_System::insert(const Constraint& c);
    void Congruence_System::insert(const Congruence_System& y);
    void Congruence_System::insert(Congruence_System&& y);
    void Congruence_System::clear();
    static dimension_type Congruence_System::max_space_dimension();
    dimension_type Congruence_System::space_dimension() const;
    void Congruence_System::set_space_dimension(dimension_type n);
    void Congruence_System::swap_space_dimensions(Variable x, Variable y);
    void Congruence_System::permute_space_dimensions(const std::vector<Variable>& cycle);
    
    VERIFICATION_CRITERIA:

    Check mixed dimensions, duplicates, borrowed-row and self-system ordinary insertion, recycled rows/systems, rejected inequalities, clear/reuse and coordinate transformations against independently evaluated conjunctions. Check source preservation for copy forms and source clearing for successful recycled systems.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • 1. Constraint relation meaning and numerical prerequisites UID: PPL-SPEC-000101 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Constraint of dimension d shall describe one relation on rational valuations x ∈ ℚd. With its exposed expression E(x) = b + ∑d − 1i = 0aixi, its three types shall mean E(x) = 0, E(x) ≥ 0 and E(x) > 0, respectively. A coefficient belonging to an internal strictness representation shall not be exposed as a coordinate of this relation.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization. The caller shall synchronize any access overlapping modification of the same object. Both DENSE and SPARSE storage shall be supported and default_representation shall be SPARSE. Computed construction, conversion, normalization, dimension transformation and comparison guarantees shall require representability of every evaluated coefficient arithmetic step in the selected coefficient profile. Unchecked completion shall not establish this precondition. Allocation and configured numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete constraint. Distinct, unchanged sources shall survive a reported failure; otherwise a modified destination shall remain destructible, without a universal unchanged-state guarantee.

    RATIONALE:

    Constraint meaning concerns the admitted valuations, rather than a particular coefficient scale or hidden strictness column.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Constraint;
    enum Constraint::Type { EQUALITY, NONSTRICT_INEQUALITY, STRICT_INEQUALITY };
    static constexpr Representation Constraint::default_representation = SPARSE;
    
    VERIFICATION_CRITERIA:

    Evaluate exposed affine expressions with independent rational arithmetic, testing equality, strict boundaries and nonstrict boundaries. Include zero-dimensional relations and trailing unused coordinates in both representations. Check numerical-profile preconditions separately from relation truth.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000102
    2. Relational construction from affine operands UID: PPL-SPEC-000102 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The relational operators ==, >=, <=, > and < applied to affine operands shall construct constraints denoting those mathematical relations. They shall accept two expressions, two variables, or an expression and a coefficient in either order. Variables shall denote coordinate functions and coefficients shall denote constants. The result dimension shall be the maximum operand dimension, including unused trailing coordinates. Equality shall have type EQUALITY; the ordered operators shall select the corresponding strict or nonstrict inequality type. Operands shall be preserved. Results shall use Constraint::default_representation.

    Coefficient normalization may rescale the relation without changing its truth. For equalities and closed nonstrict inequalities produced directly by these operators, coefficients and the constant term shall have common divisor one unless all are zero. Equality's first nonzero homogeneous coefficient shall be positive; inequality orientation shall be preserved. These conventions shall not imply that every later strict constraint has a primitive exposed coefficient vector. The prerequisites of 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    Relational operators construct geometric descriptors; expression equality here does not return a boolean expression-value comparison.

    INTERFACE:

    For Linear_Expression operands e and f, Variable operands x and y, and Coefficient operand n, the following forms shall be admitted in a C++ function using PPL names:

    Constraint ee_equal(e == f), vv_equal(x == y), en_equal(e == n), ne_equal(n == e);
    Constraint ee_ge(e >= f), vv_ge(x >= y), en_ge(e >= n), ne_ge(n >= e);
    Constraint ee_le(e <= f), vv_le(x <= y), en_le(e <= n), ne_le(n <= e);
    Constraint ee_gt(e > f), vv_gt(x > y), en_gt(e > n), ne_gt(n > e);
    Constraint ee_lt(e < f), vv_lt(x < y), en_lt(e < n), ne_lt(n < e);
    
    VERIFICATION_CRITERIA:

    Compare all overloads with independently evaluated operand relations at rational points on and around boundaries. Include unequal dimensions in both orders, common coefficient factors, equal operands, constants of both signs and unchanged sources. Check relation type, declared dimensions and the stated normalization conventions.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000103
    3. Default and shared zero-dimensional constraints UID: PPL-SPEC-000103 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Default construction with optional representation shall yield a dimension-zero nonstrict tautology with expression zero. The requested representation shall be used. zero_dim_false() shall return a borrowed dimension-zero inconsistent equality; zero_dim_positivity() shall return a borrowed dimension-zero nonstrict tautology with a positive constant term. Shared objects shall remain usable until their owning initialized thread is finalized. Copying a shared object shall create an independently owned value.

    RATIONALE:

    An empty coordinate space still admits true and false relations, with lifetime distinct from a client-owned copy.

    INTERFACE:
    explicit Constraint(Representation r = default_representation);
    static const Constraint& Constraint::zero_dim_false();
    static const Constraint& Constraint::zero_dim_positivity();
    
    VERIFICATION_CRITERIA:

    Check default type, value and requested representation; classify both shared constants independently; copy them into owned objects and exercise copies during a balanced initialized lifetime.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000104
    4. Owned constraint copying, assignment and swapping UID: PPL-SPEC-000104 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Ordinary copy construction shall preserve relation type, exposed coefficients, constant term, dimension and representation. Explicit-representation copying shall use the requested representation. Copy assignment shall replace the target with the source's entry value and representation, preserve a distinct source and return the target reference. Self-assignment shall preserve the constraint. Rvalue arguments shall admit these copy forms without requiring a distinct move operation; the source shall retain its value.

    Distinct copies shall remain independent of later mutation and destruction. m_swap and the PPL swap overload shall exchange complete constraint values, including dimensions and representation. Self-swap shall preserve the value. Destruction shall release owned storage. Failure while constructing a replacement for copy assignment shall leave the target unchanged.

    RATIONALE:

    Constraint values own their storage even when constructed from borrowed expression views or shared constants.

    INTERFACE:
    Constraint(const Constraint& c);
    Constraint(const Constraint& c, Representation r);
    Constraint& Constraint::operator=(const Constraint& c);
    Constraint::~Constraint();
    void Constraint::m_swap(Constraint& y);
    void swap(Constraint& x, Constraint& y);
    
    VERIFICATION_CRITERIA:

    Check all relation types, dense/sparse copy combinations, return identity, self-assignment, rvalue copies, mutation independence, retained copies after source destruction, both swap forms and replacement-copy failures.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000105
    5. Constraint representation conversion UID: PPL-SPEC-000105 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report the current coefficient storage. For r equal to DENSE or SPARSE, successful set_representation(r) shall preserve relation type, every exposed coefficient, constant term and dimension, and select r. Repeating the current choice shall preserve the object. A failed replacement allocation shall leave the original representation and value unchanged.

    RATIONALE:

    Storage conversion must preserve the complete descriptor rather than only its satisfying set.

    INTERFACE:
    Representation Constraint::representation() const;
    void Constraint::set_representation(Representation r);
    
    VERIFICATION_CRITERIA:

    Convert equality, nonstrict and strict constraints both ways, including zero-dimensional and trailing-zero cases. Check exact coefficients and independent satisfaction before and after conversion; inject conversion allocation failures.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • 6. Constraint dimensions and explicit coordinate transformations UID: PPL-SPEC-000106 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall report the expression dimension limit and space_dimension() shall report the constraint's public ambient dimension. Dimension arguments and resulting dimensions shall not exceed that limit; all referenced existing coordinates shall lie within the current dimension.

    Dimensioned copy construction and set_space_dimension(n) shall retain coordinates below the lesser dimension and the constant term, insert zero coefficients on extension, and discard removed trailing coefficients on shrinking. Normalization may rescale retained coefficients without changing the transformed relation. Dimensioned copies without an explicit storage choice shall retain source representation. remove_space_dimensions(vars) shall discard selected coefficients, compact surviving coordinates in their original order, and return true. Removing none or all shall be admitted.

    swap_space_dimensions shall exchange the designated coefficients; permute_space_dimensions shall require a cycle of distinct coordinates and move each listed coefficient to the next listed coordinate, wrapping the last to the first. Cycles of fewer than two entries shall preserve the value. shift_space_dimensions(v,n) shall insert n zero coordinate coefficients before v.id(), where v.id() <= space_dimension(), shifting the suffix and increasing the public dimension by n. A zero shift shall preserve value. These operations shall preserve relation type and representation. They shall describe coefficient transformation rather than existential projection of satisfying points. Arithmetic prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    Descriptor coordinate removal substitutes zero for removed terms before reindexing; it does not eliminate variables existentially.

    INTERFACE:
    static dimension_type Constraint::max_space_dimension();
    dimension_type Constraint::space_dimension() const;
    Constraint(const Constraint& c, dimension_type space_dim);
    Constraint(const Constraint& c, dimension_type space_dim, Representation r);
    void Constraint::set_space_dimension(dimension_type n);
    bool Constraint::remove_space_dimensions(const Variables_Set& vars);
    void Constraint::swap_space_dimensions(Variable x, Variable y);
    void Constraint::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Constraint::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Transform independent coefficient vectors and compare relation truth at rational valuations. Include strict constraints so hidden strictness storage cannot be exposed or lost; test shrinking, extending, empty/all removals, inverse swaps/cycles and insertion at front/interior/end.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000107
    7. Constraint kind, coefficients and borrowed expression access UID: PPL-SPEC-000107 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    type() and the four kind predicates shall identify equality, either inequality, nonstrict inequality and strict inequality exactly. coefficient(v) shall return the corresponding homogeneous coefficient when v.id() < space_dimension() and otherwise throw std::invalid_argument. inhomogeneous_term() shall return the public constant term. A configured reference return shall remain borrowed until modification or destruction of its owning constraint.

    expression() shall return a read-only borrowed adapter exposing precisely the affine expression in 🔗 1. Constraint relation meaning and numerical prerequisites, with the same public dimension, homogeneous coefficients and constant term and without a hidden strictness coordinate. The view shall require its owning constraint to remain alive and unchanged for the uses covered here. Materializing it as a Linear_Expression shall produce an independent value. Queries shall preserve their source.

    RATIONALE:

    Public affine coefficients have geometric meaning independently of internal representation columns.

    INTERFACE:
    Constraint::Type Constraint::type() const;
    bool Constraint::is_equality() const;
    bool Constraint::is_inequality() const;
    bool Constraint::is_nonstrict_inequality() const;
    bool Constraint::is_strict_inequality() const;
    Coefficient_traits::const_reference Constraint::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Constraint::inhomogeneous_term() const &;
    typedef Expression_Hide_Last<Linear_Expression> Constraint::expr_type;
    Constraint::expr_type Constraint::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check all type/predicate combinations and in-range coefficients for each relation type. Reject the first and a later out-of-range coordinate, including dimension zero. Copy each view to a standalone expression and verify dimensions/coefficients and independence after source mutation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000108
    8. Exact tautology and inconsistency classification UID: PPL-SPEC-000108 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_tautological() shall hold exactly when every rational valuation in the declared ambient dimension satisfies the constraint. is_inconsistent() shall hold exactly when none does. An expression with a nonzero public homogeneous coefficient shall satisfy neither predicate. For constant b, equality shall be tautological exactly at b = 0 and inconsistent otherwise; nonstrict inequality shall be tautological at b ≥ 0 and inconsistent at b < 0; strict inequality shall be tautological at b > 0 and inconsistent at b ≤ 0. These queries shall preserve the object.

    RATIONALE:

    A single affine relation can be classified completely from its coefficients; a system of nontrivial constraints requires separate satisfiability analysis.

    INTERFACE:
    bool Constraint::is_tautological() const;
    bool Constraint::is_inconsistent() const;
    
    VERIFICATION_CRITERIA:

    Exhaust constant signs for every relation type at zero and positive dimensions. Check nonconstant constraints with independent witnesses satisfying and violating the relation, including strict boundaries and both storage choices.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000109
    9. Semantic equivalence and exact descriptor identity UID: PPL-SPEC-000109 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_equivalent_to(y) and constraint operator== shall report equality of the satisfying sets when the public dimensions agree, independently of storage and internal strictness topology. Different public dimensions shall compare nonequivalent. Tautologies of the same dimension shall be equivalent even if their types or constant forms differ; the same shall hold for inconsistent constraints. Nontrivial equivalence shall respect relation type, positive rescaling of inequalities, and arbitrary nonzero rescaling of equalities. Inequality expressions shall negate semantic equivalence.

    is_equal_to(y) shall report complete identity of the stored normalized descriptor, including internal topology, relation kind, coefficient sequence and dimension, independently of dense/sparse storage. A positive identity result shall imply semantic equivalence; a negative result shall not establish nonequivalence. Queries shall preserve operands. Numerical prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    Mathematical equivalence and stored identity support different client decisions, especially for strict constraints and constant relations.

    INTERFACE:
    bool Constraint::is_equivalent_to(const Constraint& y) const;
    bool Constraint::is_equal_to(const Constraint& y) const;
    bool operator==(const Constraint& x, const Constraint& y);
    // Inequality uses C++20 rewriting of operator==.
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Check equivalent positive/negative equality scales, positive inequality scales, different relations and dimensions, cross-representation copies, all tautology/inconsistency forms and public nonstrict constraints obtained through NNC systems. Validate equivalence expectations with independent rational truth conditions, rather than using the query as its own oracle.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • 10. Conversion of equality congruences to constraints UID: PPL-SPEC-000110 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from a zero-modulus Congruence shall yield an equality constraint with the same public dimension and satisfying valuations, using the requested representation. Normalization may rescale its coefficients. The source shall remain unchanged. A proper congruence with nonzero modulus shall be rejected with std::invalid_argument and shall not yield a constraint. Numerical prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    A congruence with nonzero modulus denotes a periodic condition and cannot be silently reinterpreted as equality.

    INTERFACE:
    explicit Constraint(const Congruence& cg,
                        Representation r = default_representation);
    
    VERIFICATION_CRITERIA:

    Convert zero-modulus congruences with both coefficient signs, constants and trailing zeros in both representations. Compare rational equality truth independently. Reject positive-modulus proper congruences and check source preservation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000111
    11. Reloadable constraint representation UID: PPL-SPEC-000111 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export all fields needed to reload the constraint: its full stored coefficient expression, relation token and topology token. ascii_dump() shall use std::cerr. Export shall preserve its source. For compatible complete exported data with representable coefficients, ascii_load(s) shall return true and replace the destination's stored relation, dimension and coefficients, retaining the destination storage choice. It shall preserve the source relation's satisfying set and public kind.

    Malformed expression, relation or topology tokens, missing coefficient slots, truncated input, violations of the checked row invariants and inconsistent encoded relation/type combinations shall return false. The expression slot count shall include the constant and any required internal strictness slot; invalid counts shall not be accepted as valid relations. If expression loading fails, ascii_load(s) shall return false without reading the relation or topology suffix. Trailing input shall remain available to the caller. A failed load may change the destination; it shall remain destructible and admit replacement by a subsequent complete valid load. No rollback or cross-version format stability is promised. Allocation and configured numerical exceptions may propagate.

    RATIONALE:

    A reloadable constraint must retain strictness and public dimensions rather than merely a printed inequality.

    INTERFACE:
    void Constraint::ascii_dump(std::ostream& s) const;
    void Constraint::ascii_dump() const;
    bool Constraint::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip every relation type, constants, sparse gaps and trailing dimensions through both producer/destination representations. Compare exposed coefficients, kind and rational truth. Test malformed/truncated expressions and relation/topology fields, invalid counts, trailing-input preservation and complete replacement after reported failure. Reject invalid expression prefixes followed by otherwise valid relation/topology suffixes, checking that those suffixes remain unread. Reject missing NNC epsilon storage and nonzero equality epsilon across source/destination representations. Preserve the exported internal epsilon bounds, including positive epsilon inequalities. Exercise both inequality strictness signs, trailing input and complete valid replacement after false.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000112
    12. Readable constraint and system output UID: PPL-SPEC-000112 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Constraint output shall print nonzero homogeneous terms in increasing coordinate order, followed by " = ", " >= " or " > " according to public type, and the negated inhomogeneous term. A zero homogeneous part shall print 0. Unit coefficient magnitudes shall omit the numeral and *; other magnitudes shall use *. Signs shall use a leading minus or the separators " + " and " - ". Coordinates shall use the active formatter in 🔗 7. Active Variable formatter and initialized thread state. Type output shall print EQUALITY, NONSTRICT_INEQUALITY or STRICT_INEQUALITY for the corresponding Constraint::Type value.

    System output shall print its publicly iterated constraints separated by ", ", or true when that range is empty. Output operators shall return the supplied stream, add no newline and preserve their objects. Each type's print() shall use that output on std::cerr. Formatting arithmetic shall require representability of all evaluated coefficient negations.

    RATIONALE:

    Human output describes public relations and hides internal strictness machinery, while each system uses its public iterator range.

    INTERFACE:
    namespace IO_Operators {
      std::ostream& operator<<(std::ostream& s, const Constraint& c);
      std::ostream& operator<<(std::ostream& s, const Constraint::Type& t);
      std::ostream& operator<<(std::ostream& s, const Constraint_System& cs);
    }
    void Constraint::print() const;
    void Constraint_System::print() const;
    
    VERIFICATION_CRITERIA:

    Check literal equality/nonstrict/strict displays with unit and nonunit coefficients, signs, zero homogeneous parts and custom coordinate names. Check exact type names, empty and multirow system separators, stream identity and redirected standard-error print output.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000113
    13. Constraint and system invariants and memory accounting UID: PPL-SPEC-000113 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    OK() on a constraint or system shall report the checked representation invariants. Values produced by successful operations under their preconditions shall satisfy those invariants. For each type, total_memory_in_bytes() shall equal sizeof that object's type plus external_memory_in_bytes(). Memory queries shall preserve relation meaning, dimensions and representation. Their counts shall not promise allocator overhead, process resident memory or a fixed ordering between sparse and dense storage.

    RATIONALE:

    Representation diagnostics and owned-storage accounting are available independently of geometric satisfiability.

    INTERFACE:
    bool Constraint::OK() const;
    memory_size_type Constraint::total_memory_in_bytes() const;
    memory_size_type Constraint::external_memory_in_bytes() const;
    bool Constraint_System::OK() const;
    memory_size_type Constraint_System::total_memory_in_bytes() const;
    memory_size_type Constraint_System::external_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check invariants and accounting identities for constants, every relation kind, empty/singleton/mixed systems, copies and representation conversions. Confirm all semantic observations remain unchanged without imposing target-specific memory totals.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • 14. Constraint-system conjunction, construction and shared contradiction UID: PPL-SPEC-000114 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Constraint_System shall denote the conjunction of its constraints over its declared rational coordinate space. An empty conjunction shall be true. An empty public range shall not mean an inconsistent set. Conversely, zero_dim_empty() shall return a borrowed, dimension-zero system containing an inconsistent equality and denoting the empty set of valuations. That shared system shall remain alive until its owning initialized thread is finalized.

    Default construction shall create a dimension-zero system with no constraints. Construction from one constraint shall create its singleton conjunction and use that constraint's public dimension. Both shall use the requested representation; default_representation shall be SPARSE. Construction shall own its stored values independently of the source. Use shall satisfy 🔗 1. Constraint relation meaning and numerical prerequisites's initialization, synchronization, arithmetic and failure prerequisites.

    RATIONALE:

    The empty constraint list denotes the universe, whereas an inconsistent singleton denotes no points; the word empty has distinct container and geometric uses.

    INTERFACE:
    class Constraint_System;
    static constexpr Representation Constraint_System::default_representation = SPARSE;
    explicit Constraint_System(Representation r = default_representation);
    explicit Constraint_System(const Constraint& c,
                               Representation r = default_representation);
    static const Constraint_System& Constraint_System::zero_dim_empty();
    
    VERIFICATION_CRITERIA:

    Evaluate default, singleton and shared inconsistent systems independently at rational points. Check dimensions, requested representations, source independence and the distinction between no constraints and no satisfying valuation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000115
    15. Constraint-system owned values and representation conversion UID: PPL-SPEC-000115 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    System copy construction shall preserve the conjunction, dimension and representation; the explicit-representation overload shall use its requested storage. Copy assignment shall replace the target with an independent copy of the source's entry value and representation, preserve a distinct source and return the target reference. Self-assignment shall preserve the system. Rvalue arguments shall admit the copy forms without requiring a distinct move operation, retaining source value. Copies shall survive later source modification or destruction.

    m_swap and the PPL swap overload shall exchange entire system values, dimensions and representations. Self-swap shall preserve the system. representation() shall report current storage. Successful set_representation(r) for DENSE or SPARSE shall select that storage for the system and its rows while preserving conjunction and dimension. Destruction shall release owned storage. Copy-assignment replacement failure shall preserve the target. Other failure guarantees shall follow 🔗 1. Constraint relation meaning and numerical prerequisites.

    RATIONALE:

    Systems are owning values whose storage may change without altering the conjunction they denote.

    INTERFACE:
    Constraint_System(const Constraint_System& cs);
    Constraint_System(const Constraint_System& cs, Representation r);
    Constraint_System& Constraint_System::operator=(const Constraint_System& y);
    Constraint_System::~Constraint_System();
    Representation Constraint_System::representation() const;
    void Constraint_System::set_representation(Representation r);
    void Constraint_System::m_swap(Constraint_System& y);
    void swap(Constraint_System& x, Constraint_System& y);
    
    VERIFICATION_CRITERIA:

    Check both storage choices and conversions for empty, equality, inequality and mixed strict systems. Check copy independence, retained copies after destruction, assignment return identity, self/rvalue use, swaps and unchanged conjunction under conversion using independent rational evaluation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000116
    16. System insertion, dimension adjustment and clearing UID: PPL-SPEC-000116 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    insert(const Constraint&) shall conjoin a copy of its source with the system's existing meaning, preserve the source constraint and retain system representation. The resulting dimension shall be the maximum of old system and inserted constraint dimensions. Rows with fewer coordinates shall be extended with zero coefficients. Inserting duplicates or tautologies shall preserve the corresponding conjunction; insertion of an inconsistent constraint shall make it unsatisfiable. Retrievable rows need only describe an equivalent conjunction and need not preserve insertion order or duplicate multiplicity.

    Rvalue insertion shall have the same mathematical, coordinate and topology semantics while permitting reuse of source storage. The source shall not borrow a row of the receiving system and shall remain destructible and assignable, with no unchanged-value guarantee. Const sources, including const rvalues, shall use preserving insertion.

    max_space_dimension() shall return the constraint dimension limit. space_dimension() shall return the declared system dimension. set_space_dimension(n) shall require an admitted result dimension and apply the constraint coordinate-resizing semantics in 🔗 6. Constraint dimensions and explicit coordinate transformations to its rows; an empty system may retain a positive dimension. clear() shall remove all constraints and reset dimension zero, retaining representation. These are descriptor transformations and do not promise existential projection when nonzero coefficients are discarded. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Insertion must align coordinates and distinguish preserving inputs from explicitly consumed sources. Declared dimensions also matter for empty systems.

    INTERFACE:
    void Constraint_System::insert(const Constraint& c);
    void Constraint_System::insert(Constraint&& c);
    static dimension_type Constraint_System::max_space_dimension();
    dimension_type Constraint_System::space_dimension() const;
    void Constraint_System::set_space_dimension(dimension_type n);
    void Constraint_System::clear();
    
    VERIFICATION_CRITERIA:

    Insert different-dimension equality, nonstrict and strict constraints in multiple orders, duplicates, tautologies and contradictions. Compare conjunction truth over independent valuations. Check source preservation, empty-system extension, nonzero coefficient truncation, clear and reuse. Check const and borrowed row insertion into both representations, matching and differing topology, and smaller/equal/larger declared row dimensions; verify NNC epsilon placement, independent conjunction and source preservation.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000117
    17. System emptiness and retained constraint-kind queries UID: PPL-SPEC-000117 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    empty() shall return whether the public iterator range has no nontrivial constraints. Tautological stored rows shall be omitted from that range, so a system containing only tautologies shall be empty under this query. The query shall not determine whether a nonempty conjunction is satisfiable.

    has_equalities() shall report whether a retained stored row is an equality, including a tautological equality omitted by public iteration. has_strict_inequalities() shall report whether a retained row is a nontautological strict inequality; tautological strict rows and internal strictness bounds shall not make it true. These properties shall concern the retained descriptor representation and shall not claim a minimal equivalent system. Queries shall preserve conjunction and dimensions.

    RATIONALE:

    Container emptiness and stored relation kinds differ from the satisfiability of a conjunction, and public iteration deliberately omits tautologies.

    INTERFACE:
    bool Constraint_System::empty() const;
    bool Constraint_System::has_equalities() const;
    bool Constraint_System::has_strict_inequalities() const;
    
    VERIFICATION_CRITERIA:

    Check truly empty and tautology-only systems, tautological equality rows, strict tautologies, nontrivial strict rows and inconsistent rows. Use a contradictory pair of individually nontrivial inequalities to establish that nonempty is not a satisfiability decision.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000118
    18. Read-only forward iteration over nontrivial constraints UID: PPL-SPEC-000118 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    begin() and end() shall delimit the system's retained, non-tautological constraints. Each exposed row shall have the system's declared public dimension. Iteration order shall not be a semantic ordering guarantee. Dereference and member selection at a non-end position shall borrow its constraint. Prefix increment shall advance and return the iterator; postfix increment shall return an independent copy of its entry position.

    Iterator copy construction and assignment shall preserve the borrowed system and position while allowing subsequent navigation of independent copies. Iterators shall be compared only within the same unchanged system. Default iterators shall admit copying, assignment and destruction; they shall not be dereferenced or advanced until assigned a valid position. Modification or destruction of the system shall invalidate its iterators and borrowed row references.

    RATIONALE:

    Read-only iteration exposes an equivalent conjunction while preserving ownership in the system and filtering tautologies.

    INTERFACE:
    typedef Constraint_System_const_iterator Constraint_System::const_iterator;
    Constraint_System::const_iterator Constraint_System::begin() const;
    Constraint_System::const_iterator Constraint_System::end() const;
    Constraint_System_const_iterator();
    Constraint_System_const_iterator(const Constraint_System_const_iterator& y);
    Constraint_System_const_iterator::~Constraint_System_const_iterator();
    Constraint_System_const_iterator&
    Constraint_System_const_iterator::operator=(const Constraint_System_const_iterator& y);
    const Constraint& Constraint_System_const_iterator::operator*() const;
    const Constraint* Constraint_System_const_iterator::operator->() const;
    Constraint_System_const_iterator& Constraint_System_const_iterator::operator++();
    Constraint_System_const_iterator Constraint_System_const_iterator::operator++(int);
    bool Constraint_System_const_iterator::operator==(const Constraint_System_const_iterator& y) const;
    bool Constraint_System_const_iterator::operator!=(const Constraint_System_const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty and tautology-filtered ranges and mixed relation kinds; compare the iterated conjunction with an independent oracle. Check copied/default-assigned positions, prefix return identity, postfix entry position, pointer/reference identity and row dimensions.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000119
    19. Reloadable constraint-system representation UID: PPL-SPEC-000119 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export the system's complete stored coefficient rows, public dimension, topology, representation choice and row-state fields needed for compatible reloading. ascii_dump() shall use std::cerr. Export shall preserve the source.

    Loading a complete compatible export with representable coefficients shall return true and replace the destination with the encoded system, retaining its conjunction, public dimension and encoded representation choice. Malformed or truncated headers, row data, relation/topology fields and inconsistent encoded dimensions or row-state fields shall be reported by false rather than accepted as a valid system. Trailing input after the representation shall remain available. Failure may change the destination; it shall remain destructible and admit complete valid replacement. No rollback or cross-version format stability is promised. Allocation and configured numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    System reload preserves its conjunction and coordinate context, including fields that a human-readable list does not encode.

    INTERFACE:
    void Constraint_System::ascii_dump(std::ostream& s) const;
    void Constraint_System::ascii_dump() const;
    bool Constraint_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimension, singleton, duplicate/tautology-containing and mixed strict systems across initial destination choices. Compare dimensions, encoded representation and independent rational conjunction truth. Check malformed/truncated headers and rows, inconsistent counts/dimensions/state and replacement after failure. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000120
    20. Extracting equality constraints from a congruence system UID: PPL-SPEC-000120 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from a Congruence_System shall produce the conjunction of its zero-modulus equality rows converted according to 🔗 10. Conversion of equality congruences to constraints. Proper congruences shall be omitted rather than converted to equalities or used as periodic constraints. The result shall retain the congruence system's declared public dimension even when no equality survives, use the requested representation, and preserve its source. Arithmetic prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    The conversion extracts only the affine equality part of a congruence system; the result is not a representation of its periodic conditions.

    INTERFACE:
    explicit Constraint_System(const Congruence_System& cgs,
                               Representation r = default_representation);
    
    VERIFICATION_CRITERIA:

    Use mixed equality/proper-congruence systems, proper-only systems and empty systems with positive dimension. Compare the resulting equality conjunction independently over rational points, verify retained dimension/representation and unchanged source.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-001645
    1. Descriptor collection identity and affine comparison UID: PPL-SPEC-001645 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For live valid constraint systems or generator systems, free equality shall compare their retained internal row sequences under 🔗 22. Internal sequence equality and bookkeeping scope: ambient dimension, row count, pending boundary and corresponding row values shall agree. Storage representation, capacity and sorted certificates shall not affect the result. Inequality shall negate equality. These predicates shall preserve their operands. Equality shall not minimize, reorder, remove duplicate rows or decide geometric equivalence of the represented conjunctions or hulls. Row-empty systems shall follow the underlying dimension/boundary rule without an additional topology comparison.

    The free compare(x,y) for linear expressions shall forward the zero-extended affine ordering of 🔗 5. Backend equality, comparison and common-variable queries. It shall return -2 or 2 at the first differing homogeneous coefficient, -1 or 1 for a constant-only difference, and zero when all zero-extended coefficients agree. Equal affine values with different declared dimensions may therefore compare as zero. Initialization, coefficient arithmetic, lifetimes and synchronized access shall follow the selected descriptor or expression query.

    RATIONALE:

    Stored descriptor sequence identity and zero-extended affine ordering are useful implementation queries with meanings distinct from geometric set equivalence.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library unless stated otherwise.

    bool operator==(const Constraint_System&, const Constraint_System&);
    bool operator!=(const Constraint_System&, const Constraint_System&);
    bool operator==(const Generator_System&, const Generator_System&);
    bool operator!=(const Generator_System&, const Generator_System&);
    int compare(const Linear_Expression&, const Linear_Expression&);
    
    VERIFICATION_CRITERIA:

    Check copied and differently stored collections, differing dimensions, row order/count, duplicate rows and unchanged operands. Compare signed affine vectors, constant-only differences, unequal zero tails and both argument orders against literal expected return codes.

    SOURCE:

    src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; src/Linear_Expression_inlines.hh; tests/descriptorequalityspec1.cc.

  • 1. Addition of supported octagonal constraints UID: PPL-SPEC-001167 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    add_constraint(c) shall conjoin the receiver with the target-profile normalization of the admitted constraint c. The nonconstant supported forms shall be unary bounds and signed two-coordinate bounds with equal nonzero coefficient magnitudes, including equalities. Constant tautologies shall have no effect; constant falsehoods shall make the receiver empty. Constant strict conditions shall retain their truth value. A nonconstant strict constraint or an unsupported nonconstant linear form shall throw std::invalid_argument without changing the receiver's represented set.

    For a unary normalized inequality sxi ≤ b, its stored primitive bound shall be the least admitted target bound at least 2b in the doubled-unary encoding. For a binary normalized inequality sixi + sjxj ≤ b, the bound shall be the least admitted target bound at least b. Signs shall belong to { − 1, 1}. Each side of an equality shall have its own outward bound. The result shall be exactly the intersection of the entry set with these normalized target inequalities; when the normalized bounds are exact, this shall be the concrete conjunction. Every entry point satisfying c shall be retained.

    add_constraints(cs) and add_recycled_constraints(cs) shall conjoin all admitted system rows with the same normalization and validation rules. A descriptor or system dimension at most the receiver dimension shall be accepted, with zero coefficients in omitted trailing coordinates. A larger dimension shall throw std::invalid_argument before changing the receiver's represented set. An empty receiver shall still undergo these validation rules.

    An ordinary copying call shall preserve its source descriptor or system. The result shall not borrow source storage. After a recycled-system call, including exceptional return, the only required property of cs shall be safe destruction. A rejected system need not undo earlier accepted rows; no particular row visitation order shall be promised.

    The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

    Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved. Recycled sources shall retain their explicit destruction-only guarantee.

    RATIONALE:

    An adding operation validates optimal support instead of silently discarding unsupported information. The doubled unary representation must be normalized before outward rounding, including when the storage type is integral.

    INTERFACE:

    Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

    void add_constraint(const Constraint& c);
    void add_constraints(const Constraint_System& cs);
    void add_recycled_constraints(Constraint_System& cs);
    
    VERIFICATION_CRITERIA:

    Normalize raw integer coefficients with exact GMP rationals, using all four binary sign combinations and unary doubled bounds. Conjoin the independent halfspaces with the entry real set. Cover equality, common scales, negative constants, exact and inexact normalization, tautology, falsehood, strict constant rows, unsupported forms, dimension validation on empty and nonempty receivers, ordinary and recycled systems, source ownership and partial batch failure. Do not query recycled donors beyond their destruction guarantee.

    BIBLIOGRAPHY:

    BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/constraints1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

  • PPL-SPEC-001169
    3. Conservative refinement by linear constraints UID: PPL-SPEC-001169 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    refine_with_constraint(c) shall refine the receiver by an admitted linear constraint without rejecting a row merely because its nonconstant form is not octagonal. A supported closed unary or equal-magnitude signed binary row shall have the outward-normalized conjunction in 🔗 1. Addition of supported octagonal constraints. A supported nonconstant strict inequality shall first be relaxed to its non-strict counterpart and then normalized. An unsupported nonconstant linear form shall have no effect.

    Constant true rows shall have no effect and constant false rows shall make the receiver empty, including the strict false condition 0 > 0. An empty receiver shall remain empty. refine_with_constraints(cs) shall apply these rules to the entire conjunction. For entry set X, exact condition set C and result R, X∩C ⊆ R ⊆ X shall hold. For a system, the represented result shall be the intersection with all the retained, relaxed and outward-normalized rows; ignored rows shall impose no restriction.

    Source dimensions at most the receiver dimension shall be admitted with zero trailing coefficients. A larger descriptor or system dimension shall throw std::invalid_argument before changing the receiver's represented set, including when the receiver is empty. Copying calls shall preserve source descriptors and own any resulting bounds independently. Exceptions during a system call need not roll back previously applied refinements.

    The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

    Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

    RATIONALE:

    Filtering may conservatively relax strictness or omit unsupported rows, while adding has a stricter admission contract. The two operations must still agree on supported closed primitive normalization.

    INTERFACE:

    Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

    void refine_with_constraint(const Constraint& c);
    void refine_with_constraints(const Constraint_System& cs);
    
    VERIFICATION_CRITERIA:

    Conjoin independently normalized supported rows, relax nonconstant strict rows, and leave unsupported rows out of the expected conjunction. Verify exact result equality to that conjunction and containment of every original satisfying point. Cover constants, unsupported sparse forms, all signs, rounded cutoffs, empty/zero dimensions, late inconsistent rows, dimension errors, source preservation and safe failure cleanup.

    BIBLIOGRAPHY:

    BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/constraints1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

  • PPL-SPEC-001151
    6. Octagonal construction from supported constraints UID: PPL-SPEC-001151 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from Constraint_System shall inherit its ambient dimension and describe the conjunction of its supported constraints, rounded outward where required by the coefficient profile. Supported nonconstant rows shall be weak inequalities or equalities with one nonzero coordinate coefficient, or two nonzero coordinate coefficients of equal absolute magnitude.

    Normalization shall preserve the signs of both coordinates. For distinct coordinates, a(sixi + sjxj) ≤ b, with a > 0, shall use an outward approximation of b ⁄ a. Unary storage shall account for its doubled-coordinate encoding, so axi ≤ b shall use an outward approximation of 2b ⁄ a before interpreting the unary bound. Equality shall impose both corresponding weak inequalities. Exact representable normalized bounds shall retain their values. This shall give the optimal supported primitive bound in the selected profile; it shall not imply exact rational closure in a rounded profile.

    Tautological rows shall impose no restriction; inconsistent rows shall make the represented conjunction empty. These constant-row meanings shall also apply to strict constant rows. A nontrivial strict row or non-octagonal row shall throw std::invalid_argument rather than silently being accepted as an exact supported descriptor. An empty constraint system shall give universe in the system's ambient dimension. The supplied system shall be preserved. can_recycle_constraint_systems() shall return false. Failed construction shall release its acquired resources.

    The lifetime, numerical-profile, initialization and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Logically const normalization may update caches while preserving the represented set and ambient dimension. Supported numerical or allocation failures may propagate through their declared channels; temporary resources shall be released.

    A source dimension above the destination profile's max_space_dimension() shall throw std::length_error before source normalization or allocation of the corresponding target matrix storage.

    RATIONALE:

    Binary sign choices and the doubled unary encoding determine primitive precision; unsupported syntax needs an explicit rejection channel.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for Octagonal_Shape<T> and related free functions in Parma_Polyhedra_Library:

    explicit Octagonal_Shape(const Constraint_System& cs);
    static bool can_recycle_constraint_systems();
    
    VERIFICATION_CRITERIA:

    Normalize each row independently over rationals. Check all four binary signs, negative constants, equalities, doubled unary halves, rational third bounds and optimal outward primitive integer/native bounds. Include redundant and inconsistent conjunctions, strict tautology/inconsistency, unsupported strict and unequal-magnitude binary/general rows, empty systems with explicit ambient dimension, source preservation and failed-construction cleanup.

    BIBLIOGRAPHY:

    BagnaraHZ09FMSD | Section 4, octagonal constraints and doubled unary encoding (PDF page index 9, zero-based).

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapevaluesspec1.cc; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/octagonalshapevaluespublic1.cc; tests/Octagonal_Shape/constraints1.cc; tests/octagonalshapevaluesfailure1.cc; tests/Octagonal_Shape/congruences1.cc; tests/Octagonal_Shape/fromgrid1.cc; tests/Octagonal_Shape/dimensionlimits1.cc.

  • PPL-SPEC-001157
    12. Relations between octagonal values and linear constraints UID: PPL-SPEC-001157 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    relation_with(c) shall return the exact Poly_Con_Relation flags of the represented set relative to c under 🔗 1. Constraint-relation assertion values and named factories. Inclusion shall mean every source point satisfies the row, disjointness that none does, and saturation that its affine expression is zero throughout the source. Strict intersection shall retain its declared logical meaning. Empty and constant-row cases shall retain the simultaneous flags implied by those meanings.

    The supplied linear row need not have octagonal syntax and may be weak, strict or an equality. Its dimension shall not exceed the receiver's; otherwise the call shall throw std::invalid_argument. The descriptor and source value shall be preserved. Rounded outer extrema alone shall not justify a relation flag that is false of the represented set.

    The lifetime, numerical-profile, initialization and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Logically const normalization may update caches while preserving the represented set and ambient dimension. Supported numerical or allocation failures may propagate through their declared channels; temporary resources shall be released.

    RATIONALE:

    A restricted shape representation can answer exact semantic questions about more general linear halfspaces and hyperplanes.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for Octagonal_Shape<T> and related free functions in Parma_Polyhedra_Library:

    Poly_Con_Relation relation_with(const Constraint& c) const;
    
    VERIFICATION_CRITERIA:

    Project arbitrary rational affine forms independently and derive each flag from the attained range and boundary relation. Include all octagonal signs, unary half-integers, general correlated objectives, strict/equality/weak rows, constant true/false rows, empty/zero dimensions, rounded extrema and oversized descriptor rejection.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; tests/octagonalshapevaluesspec1.cc; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/octagonalshapevaluespublic1.cc; tests/Octagonal_Shape/relatwithcons1.cc; tests/Octagonal_Shape/relatwithcons2.cc; tests/Octagonal_Shape/relatwithcons3.cc; tests/Octagonal_Shape/semanticqueries1.cc.

  • PPL-SPEC-001728
    6. Java mathematical representations and operation options UID: PPL-SPEC-001728 STATUS: APPROVED COMPONENT: JAVA_INTERFACE APPLICABILITY: IF_JAVA VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Java VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For valid supported Java values, native exchange shall preserve variable indices, representable coefficients and the mathematical meaning of expression trees, constraints, congruences, generators, grid generators and artificial parameters. Expression sums, differences, integer products and negation shall retain their operands' meanings. Constraint direction, congruence modulus, generator kind and divisor, and artificial-parameter numerator and denominator shall be preserved. Coefficient exchange obeys 🔗 1. Java integral coefficient exchange. Native affine, constraint, congruence, generator and grid-generator meanings are specified by 🔗 1. Affine value, numerical prerequisites and shared zero, 🔗 1. Constraint relation meaning and numerical prerequisites, 🔗 1. Affine congruence meaning and valid numerical use, 🔗 1. Generator kinds and numerical prerequisites and 🔗 1. Grid-generator values and integer versus continuous displacement, respectively. Returned mathematical objects may be normalized and need not preserve the input expression-tree shape.

    Conversion of a finite acyclic expression into native form shall preserve operator grouping and apply the configured coefficient rules at each node. This conversion and copying through built-in Java expression nodes shall use stack space independent of tree depth. Construction and cloning shall retain the documented ownership of copied operands.

    System and variable-set conversion shall retain the represented collection; artificial-parameter sequences shall retain their order. Relation objects shall encode the native predicates (subsumption; disjointness, strict intersection, inclusion and saturation). Boxed primitives, Pair fields and By_Reference values shall preserve the values or object references assigned to them.

    Named Java enumeration values for relation symbols, integer widths, representations and overflow policies, optimization modes, solver results and MIP/PIP control parameters shall denote the corresponding native choices. Choosing a complexity or overflow policy shall not strengthen the native operation's exactness guarantee. Nonnegative integral arguments converted to an unsigned native type shall be rejected if negative or outside that type's range; failures follow 🔗 3. Java native failure and pending-exception protocol. Native dimension and object validity preconditions remain applicable.

    RATIONALE:

    Java object layout, enum ordinals and container fields are representation details; native conversion must preserve their mathematical and option meanings.

    INTERFACE:

    Package parma_polyhedra_library: Variable, the Linear_Expression hierarchy, Constraint, Congruence, Generator, Grid_Generator, Artificial_Parameter, their system/sequence classes, Variables_Set, Poly_Gen_Relation, Poly_Con_Relation, the operation-option/result enums, Pair and By_Reference. Values must have the documented class, finite acyclic expression structure and supported enum membership; mathematical objects must satisfy their native constructor preconditions.

    VERIFICATION_CRITERIA:

    Inspect each constructor/accessor correspondence, expression-node case, system iterator and enum switch against the Java definitions and native meanings. Check signed/unsigned range admission, affine constants, generator divisors, relation flags and container field positions. Use existing Java domain and solver scenarios as supporting runtime evidence, comparing normalization by mathematical meaning. Construct and copy mixed expression trees, check subtree independence and convert against an independently known affine result.

    SOURCE:

    interfaces/Java/jni/ppl_java_common.cc; interfaces/Java/jni/ppl_java_common_defs.hh; interfaces/Java/jni/ppl_java_common_inlines.hh; interfaces/Java/tests/Linear_Expression_test1.java; interfaces/Java/parma_polyhedra_library.

  • PPL-SPEC-001692
    1. OCaml mathematical representation exchange UID: PPL-SPEC-001692 STATUS: APPROVED COMPONENT: OCAML_INTERFACE APPLICABILITY: IF_OCAML VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: OCaml VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For well-formed values of the exposed algebraic types, conversion to native objects shall preserve zero-based variable identities, signed integral Z.t coefficients within the configured native range, affine expression meaning, equality and strict/non-strict inequality meaning, and generator kind. Returned values shall denote the native result; syntactic tree shape and normalization need not be preserved.

    Conversion of finite acyclic expressions to native objects shall preserve operator grouping and apply the configured coefficient rules at each node. Native stack usage shall be independent of expression depth. The expression values used during traversal shall remain valid under the OCaml runtime's lifetime and collection rules.

    A point or closure point with expression coordinates ai and nonzero divisor d denotes coordinates ai ⁄ d. Lines and rays denote the native direction described by the expression. Grid generators and congruences shall preserve their native rational-divisor and integral-modulus meanings. Native validity and operation-specific topology and arithmetic preconditions apply. A Z.t may be immediate or heap allocated; the binding shall use its value rather than assume either memory layout.

    RATIONALE:

    An algebraic representation can change tree shape while preserving exactly the same affine function or geometric object.

    INTERFACE:

    Module Ppl_ocaml.

    type linear_expression =
      Variable of int | Coefficient of Z.t
      | Unary_Plus of linear_expression | Unary_Minus of linear_expression
      | Plus of linear_expression * linear_expression
      | Minus of linear_expression * linear_expression
      | Times of Z.t * linear_expression
    type linear_constraint =
      Less_Than of linear_expression * linear_expression
      | Less_Or_Equal of linear_expression * linear_expression
      | Equal of linear_expression * linear_expression
      | Greater_Than of linear_expression * linear_expression
      | Greater_Or_Equal of linear_expression * linear_expression
    type linear_generator =
      Line of linear_expression | Ray of linear_expression
      | Point of linear_expression * Z.t
      | Closure_Point of linear_expression * Z.t
    

    Configured domain and solver constructors consume these types; their expression, constraint and generator queries return the corresponding types. The companion linear_grid_generator and linear_congruence types in the module signature define grid exchange.

    VERIFICATION_CRITERIA:

    Independently evaluate returned affine expressions and convert nested inputs with known grouped affine results. Round-trip positive, negative, zero and configured coefficient endpoints. Check multiple coordinates, all five relation kinds and all four polyhedral generator kinds. Include immediate and large Zarith values, divisor normalization and compacting collections.

    SOURCE:

    interfaces/OCaml/ppl_ocaml_globals.mli; interfaces/OCaml/ppl_ocaml_common.cc; interfaces/OCaml/ppl_ocaml_globals.ml; interfaces/OCaml/tests/zarith1.ml; interfaces/OCaml/tests/polyhedron1.ml; interfaces/OCaml/tests/boundary_contracts1.ml.

  • PPL-SPEC-001695
    1. Prolog mathematical term exchange UID: PPL-SPEC-001695 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For each configured supported Prolog engine, supported integral terms, affine expressions, constraints, congruences and generators shall be interpreted with their documented native mathematical meaning. '$VAR'(I) shall denote the zero-based coordinate I. Unary negation, addition, subtraction and integral scalar multiplication shall preserve affine meaning. Relations shall preserve equality and strict/non-strict order. Point and closure-point coordinates shall be divided by the supplied nonzero divisor; lines and rays denote directions. Returned terms may be normalized but shall denote the native result.

    Values shall be representable by both the engine and configured native coefficient type. A bounded engine does not acquire arbitrary-size integers from GMP in the native library. Malformed or nonlinear expressions and invalid native objects shall follow 🔗 2. Prolog success failure and exception outcomes.

    RATIONALE:

    The common term protocol must express the same mathematics independently of the selected foreign runtime.

    INTERFACE:

    Common numerical term protocol:

    '$VAR'(I)
    -E
    E + F
    E - F
    N * E
    E = F
    E =< F
    E < F
    E >= F
    E > F
    point(E, D)
    closure_point(E, D)
    ray(E)
    line(E)
    

    Here I is a valid coordinate index, N an integral coefficient and E/F supported affine expressions. Lists of such terms are the system interfaces accepted and returned by configured domain and solver predicates. Grid-point, parameter and congruence terms follow the common Prolog manual's rational-divisor and modulus conventions.

    VERIFICATION_CRITERIA:

    Across each available configured engine, compare coefficient round trips and independently reconstructed expressions/constraints/generators. Cover signs, zero, multiple indices, all relation and generator kinds, and each engine/native range intersection; check unsupported numeric and malformed cases separately.

    SOURCE:

    interfaces/Prolog/Prolog_interface_sysindep.dox; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.

PPL-LLR-000014
4. Meaning of linear congruences UID: PPL-LLR-000014 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

A linear congruence shall hold exactly when its expression differs from its base value by an integer multiple of its modulus; a zero modulus shall express equality, and a finite congruence system shall denote conjunction.

RATIONALE:

Proper congruences describe periodic restrictions, whereas zero-modulus congruences express exact linear equalities.

COMMENT:

Verification covers congruence and congruence-system value types, including zero-modulus equality. Related obligations: 🔗 5. Constraint and congruence refinement.

VERIFICATION_CRITERIA:

Use exact rational calculations to check zero and nonzero moduli, positive and negative integer multiples, nonmember values, tautologies and inconsistent systems. Verify that equivalent normalized congruences admit the same valuations.

SOURCE:

doc/definitions.dox: Congruences and Congruence Relations. src/Congruence_defs.hh: congruence meaning and modulus. src/Congruence_System_defs.hh: finite congruence systems.

  • PPL-SPEC-001536
    3. C congruence systems UID: PPL-SPEC-001536 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The Congruence_System functions shall construct independent empty, copied, single-element or dedicated canonical native systems as exposed. Insertion shall copy the supplied congruence with the native system's dimension rules. The represented condition after insertion shall be the conjunction of the previous condition and the inserted congruence. Assignment, clear and deletion shall have the native value and ownership effects. Dimension, emptiness and validity queries shall expose the native result. Begin/end operations shall position caller-owned iterators in the live system; dereferenced elements shall remain borrowed from that system and shall not be deleted or mutated.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Systems own elements, while traversal only borrows them.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Congruence_System(ppl_Congruence_System_t *pcs);
    int ppl_new_Congruence_System_zero_dim_empty(ppl_Congruence_System_t *pcs);
    int ppl_new_Congruence_System_from_Congruence(ppl_Congruence_System_t *pcs,
                                                  ppl_const_Congruence_t c);
    int ppl_new_Congruence_System_from_Congruence_System(
        ppl_Congruence_System_t *pcs, ppl_const_Congruence_System_t cs);
    int ppl_assign_Congruence_System_from_Congruence_System(
        ppl_Congruence_System_t dst, ppl_const_Congruence_System_t src);
    int ppl_delete_Congruence_System(ppl_const_Congruence_System_t cs);
    int ppl_Congruence_System_space_dimension(ppl_const_Congruence_System_t cs,
                                              ppl_dimension_type *m);
    int ppl_Congruence_System_empty(ppl_const_Congruence_System_t cs);
    int ppl_Congruence_System_begin(ppl_const_Congruence_System_t cs,
                                    ppl_Congruence_System_const_iterator_t cit);
    int ppl_Congruence_System_end(ppl_const_Congruence_System_t cs,
                                  ppl_Congruence_System_const_iterator_t cit);
    int ppl_Congruence_System_OK(ppl_const_Congruence_System_t cs);
    int ppl_Congruence_System_clear(ppl_Congruence_System_t cs);
    int ppl_Congruence_System_insert_Congruence(ppl_Congruence_System_t cs,
                                                ppl_const_Congruence_t c);
    
    VERIFICATION_CRITERIA:

    Check insertion and copy independence, empty and canonical systems, declared dimensions, native iterator filtering and destruction/invalidation histories.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001530
    8. C rational congruence values UID: PPL-SPEC-001530 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Creation shall copy inputs into an independent owned Congruence representing the supplied affine expression and modulus, with modulus zero denoting equality and native normalization of nonzero moduli. Dedicated zero-dimensional constructors shall provide the corresponding native canonical objects. Copying and assignment shall preserve native value and dimension; deletion shall release owned storage. Native dimension and size failures shall be translated by the C failure protocol.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Descriptor conversion must preserve its geometric or arithmetic meaning.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Congruence(ppl_Congruence_t *pc, ppl_const_Linear_Expression_t le,
                           ppl_const_Coefficient_t m);
    int ppl_new_Congruence_zero_dim_false(ppl_Congruence_t *pc);
    int ppl_new_Congruence_zero_dim_integrality(ppl_Congruence_t *pc);
    int ppl_new_Congruence_from_Congruence(ppl_Congruence_t *pc,
                                           ppl_const_Congruence_t c);
    int ppl_assign_Congruence_from_Congruence(ppl_Congruence_t dst,
                                              ppl_const_Congruence_t src);
    int ppl_delete_Congruence(ppl_const_Congruence_t c);
    
    VERIFICATION_CRITERIA:

    Check each supported kind, exact coefficients and normalization, empty/universe canonical descriptors, source independence and native admission failures.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001531
    9. C rational congruence queries UID: PPL-SPEC-001531 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Queries shall report the native Congruence dimension, variable coefficients, inhomogeneous term and modulus. Validity queries shall return a boolean outcome. Coefficient, inhomogeneous-term and modulus outputs shall assign existing writable coefficient objects. Native argument failures shall be translated.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    C query results need the same interpretation as their native descriptor.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_Congruence_space_dimension(ppl_const_Congruence_t c,
                                       ppl_dimension_type *m);
    int ppl_Congruence_coefficient(ppl_const_Congruence_t c, ppl_dimension_type var,
                                   ppl_Coefficient_t n);
    int ppl_Congruence_inhomogeneous_term(ppl_const_Congruence_t c,
                                          ppl_Coefficient_t n);
    int ppl_Congruence_modulus(ppl_const_Congruence_t c, ppl_Coefficient_t m);
    int ppl_Congruence_OK(ppl_const_Congruence_t c);
    
    VERIFICATION_CRITERIA:

    Check each kind against literal descriptors, normalized ratios or congruences, output reuse and rejected inappropriate queries.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001062
    7. Bounded-difference construction from supported congruences UID: PPL-SPEC-001062 STATUS: APPROVED COMPONENT: BOUNDED_DIFFERENCES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    BD_Shape(cgs) shall inherit the system's ambient dimension and conjoin its admitted equalities and constant truth values. Nontrivial equality rows shall be expressible as unary or equal-magnitude opposite-coefficient differences. A nontrivial proper congruence or unsupported equality shall throw std::invalid_argument, including after an earlier inconsistency. Constant proper congruences shall retain their tautological or inconsistent meaning. An empty system shall produce universe.

    Exact rational coefficient arithmetic shall represent admitted equalities exactly. Other profiles shall retain the declared outward bound conversion on both equality directions. The const source shall retain its rows and value. can_recycle_congruence_systems() shall return false.

    The validity, lifetime, arithmetic, range, rounding and synchronization prerequisites in 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Logically const normalization may update caches but shall preserve the represented set and ambient dimension. Underlying supported numerical or allocation failures may propagate through their declared channels. Failure during construction shall release resources owned by the incomplete shape. Failure of a mutating operation shall retain the ownership needed for safe destruction; a general rollback guarantee shall not be inferred.

    A source dimension above the destination profile's max_space_dimension() shall throw std::length_error before source normalization or allocation of the corresponding target matrix storage.

    RATIONALE:

    A closed difference domain can retain affine equalities and constant truth values without representing nontrivial periodic residue classes.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for BD_Shape<T> and related free functions in Parma_Polyhedra_Library:

    explicit BD_Shape(const Congruence_System& cgs);
    static bool can_recycle_congruence_systems();
    
    VERIFICATION_CRITERIA:

    Check independently solved rational unary/difference equalities, negative scaling, constants, contradictions, proper-congruence rejection and unsupported equalities, including after falsehood; compare profiles and preserve sources.

    SOURCE:

    src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapevaluesspec1.cc; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/bdshapevaluespublic1.cc; tests/BD_Shape/dimensionlimits1.cc.

  • PPL-SPEC-001068
    13. Relations between bounded-difference values and linear congruences UID: PPL-SPEC-001068 STATUS: APPROVED COMPONENT: BOUNDED_DIFFERENCES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    relation_with(cg) shall classify the represented set relative to the congruence using the declared Poly_Con_Relation semantics. Modulus zero shall mean equality. For a proper modulus, inclusion shall require every source point to satisfy the residue condition; disjointness shall mean no source point does. For a nonempty receiver, saturation shall mean that the affine image consists of one value belonging to the eligible modulus lattice; the value need not be zero. These tests shall use the real convex source set rather than treating integer bounds as integer coordinates. Arbitrary admitted affine congruence syntax shall be queryable even when it is not representable by a bounded-difference value. Descriptor dimension above the receiver's shall throw std::invalid_argument.

    The validity, lifetime, arithmetic, range, rounding and synchronization prerequisites in 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Logically const normalization may update caches but shall preserve the represented set and ambient dimension. Underlying supported numerical or allocation failures may propagate through their declared channels. Failure during construction shall release resources owned by the incomplete shape. Failure of a mutating operation shall retain the ownership needed for safe destruction; a general rollback guarantee shall not be inferred.

    RATIONALE:

    A query can test periodic conditions without adding their nonconvex solution set to the representation.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for BD_Shape<T> and related free functions in Parma_Polyhedra_Library:

    Poly_Con_Relation relation_with(const Congruence& cg) const;
    
    VERIFICATION_CRITERIA:

    Combine independent rational affine ranges with exact integer-multiple tests. Check constant satisfied/unsatisfied residues, equality modulus, ranges meeting or avoiding residue levels, continuous nonconstant ranges, empty/zero dimensions and dimension rejection.

    SOURCE:

    src/Shape_Congruence_Queries.hh; tests/shapeconstantqueryspec1.cc; src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapevaluesspec1.cc; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/bdshapevaluespublic1.cc; tests/BD_Shape/relations1.cc; tests/BD_Shape/relations2.cc; tests/BD_Shape/relations3.cc; tests/BD_Shape/relations4.cc; tests/BD_Shape/semanticqueries1.cc; tests/shapequerycertificatespec1.cc.

  • PPL-SPEC-001045
    2. Box construction from supported congruences UID: PPL-SPEC-001045 STATUS: APPROVED COMPONENT: INTERVALS_BOXES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Box(cgs) shall construct the coordinate enclosure obtained by conjoining the congruences in cgs with a universe box, using the admitted forms in 🔗 2. Addition of optimally supported box congruences. Nontrivial unary equalities shall constrain the corresponding coordinate to their rational solution, with target endpoint conversion as declared. Tautological rows shall have no effect and inconsistent rows shall produce empty. An empty system shall produce universe. With exact rational interval endpoints, admitted equalities shall be represented exactly.

    A non-interval equality or a nontrivial proper congruence shall throw std::invalid_argument, including after an earlier row has made the conjunction empty. A proper congruence whose meaning is tautological or inconsistent shall retain that meaning instead of being rejected merely because its modulus is nonzero.

    Construction from an rvalue system shall have the same result and rejection behavior; its const source shall retain its rows and value.

    The result shall inherit the source's ambient dimension, including when empty. A source dimension above max_space_dimension() shall throw std::length_error before allocating that coordinate storage. Its coordinate storage shall have the independent ownership specified in 🔗 3. Owned box copying, assignment and cleanup. Endpoint conversion shall retain the profile conditions in 🔗 4. Upward box conversion between interval profiles.

    Sources shall remain live, valid and synchronized throughout construction. Their represented values shall remain unchanged; logically const normalization may update their caches. The selected source-domain arithmetic and the target interval operations shall meet their range, resource, rounding and policy prerequisites. The numerical and runtime prerequisites in 🔗 1. Cartesian box values, coordinate identity and valid use, and descriptor initialization in 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization where used, shall apply. Failure during construction shall release resources owned by the incompletely constructed box. Underlying numerical or resource exceptions may propagate.

    RATIONALE:

    A box can express coordinate equalities and the two constant truth values without representing a nontrivial periodic lattice.

    INTERFACE:

    Public header: <ppl.hh>; constructor excerpts for Box<ITV> in Parma_Polyhedra_Library:

    explicit Box(const Congruence_System& cgs);
    
    VERIFICATION_CRITERIA:

    Check independent rational solutions of admitted unary equalities, fractions, negative scaling, contradictory coordinates, trivial proper congruences and zero dimensions. Compare both overloads, preserve sources and reject unsupported rows even after inconsistency.

    SOURCE:

    src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxconversionsspec1.cc; tests/boxconversionoracle.hh; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxconversionspublic1.cc.

  • 1. Affine congruence meaning and valid numerical use UID: PPL-SPEC-000141 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For dimension d, integer coefficient expression E(x) = b + ∑d − 1i = 0aixi and nonnegative modulus m, a Congruence shall denote the rational valuations satisfying E(x) = 0 when m = 0, and E(x) ⁄ m ∈ ℤ when m > 0. Coordinates themselves need not be integral. is_equality() and is_proper_congruence() shall distinguish these cases exactly. is_tautological() shall report whether all rational valuations satisfy the relation; is_inconsistent() shall report whether none do. With a nonzero homogeneous coefficient neither predicate shall hold. For a constant expression, the first shall equal its equality/divisibility truth and the second its negation.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization; the caller shall synchronize access overlapping modification of an object. Both dense and sparse storage shall be supported, with default_representation equal to SPARSE. Computed construction, arithmetic, normalization, comparison and transformation guarantees shall require every evaluated coefficient step and result to be representable in the selected numerical profile. Unchecked completion shall not prove this precondition. Allocation and configured numerical exceptions may propagate. Failed construction shall release its owned resources; distinct unchanged sources shall survive failures, while modified destinations shall remain destructible without a universal rollback guarantee.

    RATIONALE:

    Congruence divisibility applies to the affine result, including rational coordinate values, rather than forcing each coordinate to be an integer.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Congruence;
    static constexpr Representation Congruence::default_representation = SPARSE;
    bool Congruence::is_equality() const;
    bool Congruence::is_proper_congruence() const;
    bool Congruence::is_tautological() const;
    bool Congruence::is_inconsistent() const;
    
    VERIFICATION_CRITERIA:

    Evaluate exact rational affine results and test equality or integral quotient independently. Include fractional satisfying and nonsatisfying coordinates, zero dimension, constants and trailing unused coordinates in both storage choices.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000142
    2. Default congruence and shared zero-dimensional values UID: PPL-SPEC-000142 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Default construction shall produce a dimension-zero equality with expression zero and use the requested representation. zero_dim_false() shall return a borrowed dimension-zero inconsistent equality. zero_dim_integrality() shall return a borrowed dimension-zero tautological proper congruence with modulus one. Shared constants shall remain usable until their initialized owning thread is finalized; owned copies shall be independent values.

    RATIONALE:

    Zero coordinates still admit true and false modular conditions. The shared integrality constant is a proper congruence even though it is tautological.

    INTERFACE:
    explicit Congruence(Representation r = default_representation);
    static const Congruence& Congruence::zero_dim_false();
    static const Congruence& Congruence::zero_dim_integrality();
    
    VERIFICATION_CRITERIA:

    Check zero expression/modulus, requested storage, shared classifications and dimensions, and owned copies within balanced initialization.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000143
    3. Congruence creation from affine operand differences UID: PPL-SPEC-000143 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    create and operator%= shall construct modulus-one congruences relating their operand expressions. The satisfying condition shall be E(x) − F(x) ∈ ℤ; a scalar operand shall denote a constant. The result dimension shall be the maximum operand dimension, including trailing zero coordinates. Sources shall be preserved. create shall use the requested representation; operator%= shall use default_representation. Reversing operands shall preserve the satisfying set, without requiring the same coefficient signs. The recycle-input constructor shall transfer an expression's coefficient value and representation, use its nonnegative modulus argument's entry value, and leave the transferred expression valid and independently destructible. A modulus borrowed from that expression shall be admitted. Numerical prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    The congruence construction symbol creates a descriptor rather than assigning to the affine operand.

    INTERFACE:
    static Congruence Congruence::create(const Linear_Expression& e1,
      const Linear_Expression& e2, Representation r = default_representation);
    static Congruence Congruence::create(const Linear_Expression& e,
      Coefficient_traits::const_reference n, Representation r = default_representation);
    static Congruence Congruence::create(Coefficient_traits::const_reference n,
      const Linear_Expression& e, Representation r = default_representation);
    Congruence operator%=(const Linear_Expression& e1, const Linear_Expression& e2);
    Congruence operator%=(const Linear_Expression& e, Coefficient_traits::const_reference n);
    Congruence(Linear_Expression& le, Coefficient_traits::const_reference m, Recycle_Input);
    
    VERIFICATION_CRITERIA:

    Compare all create/operator forms with independent rational operand differences, unequal dimensions, constants and variable conversions. Check modulus one, selected/default representation and unchanged sources.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000144
    4. Equality-constraint conversion and explicit modulus construction UID: PPL-SPEC-000144 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from an equality Constraint shall produce a modulus-zero congruence with the same satisfying valuations and dimension, using requested storage. A dimensioned overload shall apply coefficient truncation or zero extension as specified by 🔗 6. Congruence dimensions and coefficient-coordinate transformations. Inequality constraints shall be rejected with std::invalid_argument.

    operator/(c,m) for an equality constraint and nonnegative modulus m shall construct the congruence formed from that equality expression with modulus m. In particular a positive supplied modulus shall produce a proper congruence, while zero shall preserve equality. It shall preserve its source and use the default representation. Numerical prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    An equality can be viewed modulo zero or used as the coefficient source for a periodic condition with an explicitly selected modulus.

    INTERFACE:
    explicit Congruence(const Constraint& c,
                        Representation r = default_representation);
    Congruence(const Constraint& c, dimension_type new_space_dimension,
               Representation r = default_representation);
    Congruence operator/(const Constraint& c, Coefficient_traits::const_reference m);
    
    VERIFICATION_CRITERIA:

    Convert equalities in both representations, compare rational truth, resize during conversion and reject each inequality kind. Check explicit modulus zero and positive moduli independently, ensuring a positive modulus is not silently retained as equality.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000145
    5. Owned congruence values and representation conversion UID: PPL-SPEC-000145 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall preserve expression, modulus, dimension and source representation; the explicit-storage overload shall select its requested storage. Assignment shall copy the source's entry value and representation, return the target reference, preserve a distinct source and support self-assignment. Rvalue inputs shall admit those copy forms and preserve source value without requiring a distinct move operation. Distinct copies shall survive later source mutation or destruction.

    m_swap and PPL swap shall exchange complete values, dimensions and storage; self-swap shall preserve the value. representation() shall report current storage. Successful set_representation(r) shall change only storage, preserving exact exposed coefficients, modulus and dimension. Destruction shall release owned storage. Copy assignment or representation conversion failing while constructing a replacement shall preserve the target.

    RATIONALE:

    Modulus and expression form one owning value; changing coefficient storage does not normalize or reinterpret the relation.

    INTERFACE:
    Congruence(const Congruence& cg);
    Congruence(const Congruence& cg, Representation r);
    Congruence& Congruence::operator=(const Congruence& y);
    Congruence::~Congruence();
    Representation Congruence::representation() const;
    void Congruence::set_representation(Representation r);
    void Congruence::m_swap(Congruence& y);
    void swap(Congruence& x, Congruence& y);
    
    VERIFICATION_CRITERIA:

    Check owned copies, return identity, self/rvalue assignment, destruction independence, cross-storage conversions and swaps, exact field preservation and replacement-copy/conversion failures.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • 6. Congruence dimensions and coefficient-coordinate transformations UID: PPL-SPEC-000146 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall return the expression dimension limit and space_dimension() the public ambient dimension. Dimension arguments and results shall lie within the limit. Dimensioned copies and set_space_dimension(n) shall retain the constant and lower-index coefficients, zero-extend new coordinates or discard removed trailing coefficients, while preserving modulus. Copies without explicit storage shall retain source storage.

    swap_space_dimensions shall exchange two in-dimension coefficients. permute_space_dimensions shall require distinct in-dimension variables and move each cycle coefficient to the following coordinate, wrapping the last to the first. Empty/singleton cycles shall preserve the value. shift_space_dimensions(v,n) shall require v.id() <= space_dimension(), insert n zero coefficients before that position and increase dimension by n. These transformations shall retain modulus, constant term and representation. Discarding coefficients shall not mean existential projection of the original solution set.

    RATIONALE:

    Descriptor coordinates transform coefficient positions, independently of the arithmetic progression selected by the modulus.

    INTERFACE:
    static dimension_type Congruence::max_space_dimension();
    dimension_type Congruence::space_dimension() const;
    Congruence(const Congruence& cg, dimension_type new_space_dimension);
    Congruence(const Congruence& cg, dimension_type new_space_dimension, Representation r);
    void Congruence::set_space_dimension(dimension_type n);
    void Congruence::swap_space_dimensions(Variable x, Variable y);
    void Congruence::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Congruence::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Transform independent coefficient vectors and compare rational divisibility, including zero dimension, shrink/extend, nonzero discarded coefficients and front/interior/end insertion. Check constant, modulus and representation preservation.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000147
    7. Borrowed congruence coefficients, modulus and expression view UID: PPL-SPEC-000147 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    coefficient(v) shall return the indicated homogeneous coefficient when v.id() < space_dimension() and otherwise throw std::invalid_argument. inhomogeneous_term() and modulus() shall return the current constant and modulus. Configured reference returns shall borrow their owner until modification or destruction.

    expression() shall return a read-only borrowed adapter exposing the public affine expression with the same dimension, coefficients and constant. Uses covered here shall require the owner to remain alive and unchanged. Materializing the view as a Linear_Expression shall make an independent value. Queries shall preserve the congruence.

    RATIONALE:

    A congruence separates its affine expression from its modulus; neither returned view transfers ownership.

    INTERFACE:
    Coefficient_traits::const_reference Congruence::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Congruence::inhomogeneous_term() const &;
    Coefficient_traits::const_reference Congruence::modulus() const;
    typedef Expression_Adapter_Transparent<Linear_Expression> Congruence::expr_type;
    Congruence::expr_type Congruence::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check every exposed term, first/later rejected coordinates including dimension zero, copied borrowed values and independent materialized views after source mutation.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000148
    8. Explicit modulus replacement and multiplicative modulus syntax UID: PPL-SPEC-000148 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For nonnegative m, set_modulus(m) shall replace only the modulus with its input entry value, admitting a borrowed coefficient from the same congruence. Zero shall select equality. It shall preserve dimension and representation.

    For coefficient factor k, operator/=(k) shall multiply the entry modulus by |k|, preserving all affine coefficients and return the target reference. The factor may reference the modulus or a coefficient in the same object; its entry value shall be used. Nonmutating operator/ shall apply that operation to an independent copy, preserving the source. Multiplication by zero shall yield modulus zero; an existing zero modulus shall remain zero for any factor. These operations shall not divide the coefficients. Every computed absolute value/product shall satisfy 🔗 1. Affine congruence meaning and valid numerical use's arithmetic prerequisites.

    RATIONALE:

    The slash notation selects or multiplies a modulus, rather than performing affine division. Entry-value rules make borrowed scalar inputs unambiguous.

    INTERFACE:
    void Congruence::set_modulus(Coefficient_traits::const_reference m);
    Congruence& Congruence::operator/=(Coefficient_traits::const_reference k);
    Congruence operator/(const Congruence& cg, Coefficient_traits::const_reference k);
    
    VERIFICATION_CRITERIA:

    Check zero/positive modulus replacement, positive/negative/zero factors, chained factors, equality preservation, source independence and return identity. Exercise modulus self-alias, expression-coefficient factors and borrowed constant replacement within representable ranges.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000149
    9. Scaling expression and modulus together UID: PPL-SPEC-000149 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a nonnegative factor k, scale(k) shall multiply every homogeneous coefficient, the constant and modulus by the factor's entry value. Positive factors shall preserve the satisfying set. A zero factor shall produce the tautological equality with the same dimension. Dimension and representation shall be preserved.

    The factor shall not borrow a coefficient of the affine expression being modified. Borrowing the modulus shall be admitted and shall use its entry value consistently for expression and modulus. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Positive common scaling is a representation change; zero scaling deliberately collapses the condition to a tautology.

    INTERFACE:
    void Congruence::scale(Coefficient_traits::const_reference factor);
    
    VERIFICATION_CRITERIA:

    Compare all coefficient and modulus products independently for zero, one and larger positive factors. Check rational satisfaction preservation for positive factors, dimension retention for zero and self-modulus borrowing.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000150
    10. Sign, constant-residue and common-factor normalization UID: PPL-SPEC-000150 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    sign_normalize() shall negate the affine expression exactly when its first nonzero homogeneous coefficient is negative, preserving modulus. An expression without nonzero homogeneous coefficients shall retain its sign. normalize() shall apply that sign rule, then, for positive modulus m, replace the constant with its unique residue in [0, m). Zero-modulus normalization shall not reduce the constant by a modulus.

    strong_normalize() shall additionally divide the expression and modulus by their nonnegative common greatest divisor when that divisor exceeds one. The zero expression with positive modulus shall reduce to modulus one. Each operation shall preserve the satisfying set, dimension and representation and shall be idempotent. They may change the affine expression value while preserving the modular relation. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Canonical residue and scale conventions concern congruence meaning, not preservation of the unqualified affine expression value.

    INTERFACE:
    void Congruence::sign_normalize();
    void Congruence::normalize();
    void Congruence::strong_normalize();
    
    VERIFICATION_CRITERIA:

    Check first-nonzero signs, constant-only inputs, negative constants, zero modulus, common factors and zero expressions. Derive residues/GCDs independently and compare rational satisfaction before/after each normalization, with repeated application.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000151
    11. Congruence semantic equivalence UID: PPL-SPEC-000151 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Congruence operator== shall report whether equal-dimension operands admit the same rational valuations, independently of storage and equivalent common scales, signs or constant residues. Different public dimensions shall compare unequal. Tautologies of the same dimension shall compare equivalent, including zero-modulus and positive-modulus forms. The same shall hold for inconsistent congruences even when their moduli differ. operator!= shall negate that result. Both shall preserve operands. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Canonical coefficient comparison must still account for relations that denote the entire space or the empty set.

    INTERFACE:
    bool operator==(const Congruence& x, const Congruence& y);
    bool operator!=(const Congruence& x, const Congruence& y);
    
    VERIFICATION_CRITERIA:

    Check positive/common and negative expression scales, added modulus multiples in constants, non-equivalent periodic spacings, different dimensions and representations, and all constant tautology/inconsistency classes against independent rational predicates.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000152
    12. Rational affine substitution preimage of a congruence UID: PPL-SPEC-000152 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For an in-dimension variable v, an independent affine expression e of dimension at most the target dimension, and positive denominator q, affine_preimage(v,e,q) shall replace the congruence by the condition obtained by substituting xv = e(x) ⁄ q into its entry relation. The result shall retain the original public dimension and representation. If the entry coefficient of v is zero the congruence shall be unchanged. Otherwise its new modulus shall be qm; the new affine expression shall be q(E(x) − avvx) + ave(x). A bounded profile shall retain this storage formula whenever its completed values fit. If they do not fit, it may store an equivalent primitive row using a proper constant residue and positive common-factor cancellation, admitting only completed reduced values. The source expression shall be preserved. The denominator shall not borrow from the target's affine expression; borrowing its modulus shall be admitted using entry values. Arithmetic prerequisites in 🔗 1. Affine congruence meaning and valid numerical use shall apply.

    RATIONALE:

    Multiplying both substituted expression and modulus by the positive denominator represents rational substitution using integer coefficients.

    INTERFACE:
    void Congruence::affine_preimage(Variable v, const Linear_Expression& e,
                                   Coefficient_traits::const_reference denominator);
    
    VERIFICATION_CRITERIA:

    Evaluate the original congruence at independently substituted rational points and compare the result. Include zero/nonzero selected coefficients, source dimensions below/equal to target, constant/noninvertible substitutions, negative coefficients, equality/proper moduli and borrowed modulus denominator. Check the literal stored scale and signed constant for an admitted result with a nontrivial common factor, in both representations.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000153
    13. Reloadable congruence representation UID: PPL-SPEC-000153 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall write the full affine coefficient expression followed by the token m and its nonnegative modulus; ascii_dump() shall use std::cerr. Export shall preserve its source. For a complete compatible export with representable coefficients, ascii_load(s) shall return true and replace the target with those coefficients, dimension and modulus, retaining destination storage.

    Malformed or truncated expressions, missing/invalid modulus tokens, negative moduli and structurally invalid coefficient counts shall return false. If expression loading fails, ascii_load(s) shall return false without reading the modulus marker or value. Trailing input shall remain available. A failed load may modify the target; it shall remain destructible and admit complete valid replacement. No rollback or cross-version wire-format stability is promised. Allocation and configured numerical exceptions may propagate.

    RATIONALE:

    Expression syntax and modulus both need validation before a loaded object can be interpreted as a congruence.

    INTERFACE:
    void Congruence::ascii_dump(std::ostream& s) const;
    void Congruence::ascii_dump() const;
    bool Congruence::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip equality/proper, constant, gapped and trailing-zero forms across storage choices. Check exact coefficient/modulus preservation, rational meaning and trailing input; reject malformed/truncated expressions, negative modulus and invalid counts, and replace destinations after failures. Reject invalid expression prefixes followed by otherwise valid modulus suffixes, checking that those suffixes remain unread. Reject representable negative moduli through false with assertions enabled or disabled. Replace failed targets completely across storage representations, retaining modulus-zero equality and trailing input.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000154
    14. Readable congruence and system output UID: PPL-SPEC-000154 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Congruence output shall print homogeneous terms in increasing variable order, using the active formatter in 🔗 7. Active Variable formatter and initialized thread state, followed by " = " and the negated constant. A zero homogeneous part shall print 0. A proper congruence shall append " (mod ", its positive modulus and ")"; an equality shall omit that suffix. Coefficient signs, unit magnitudes and * separators shall follow the affine output conventions in 🔗 14. Human-readable affine output and formatter dispatch.

    System output shall print its publicly iterated nontrivial rows after strong normalization of copies, separated by ", ", or true for an empty range. Operators shall return the supplied stream, add no newline and preserve their objects. print() shall use that output on std::cerr. Evaluated coefficient negations shall be representable in the selected profile.

    RATIONALE:

    Human-readable modular conditions use public coordinates and may normalize system-row copies without changing stored values.

    INTERFACE:
    namespace IO_Operators {
      std::ostream& operator<<(std::ostream& s, const Congruence& cg);
      std::ostream& operator<<(std::ostream& s, const Congruence_System& cgs);
    }
    void Congruence::print() const;
    void Congruence_System::print() const;
    
    VERIFICATION_CRITERIA:

    Check literal equality/proper displays, unit/nonunit signs, constants, custom variable formatting, system separators and empty output. Check stream identity, standard-error printing and unchanged source fields.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000155
    15. Congruence and system invariant and memory queries UID: PPL-SPEC-000155 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    OK() shall report the checked representation invariants of its congruence or system. Values produced by successful operations under the stated valid input and arithmetic conditions shall satisfy those invariants. For each type, total_memory_in_bytes() shall equal sizeof that type plus external_memory_in_bytes(). Queries shall preserve dimensions, coefficients, moduli and representation. Counts shall not promise allocator overhead, process memory consumption or a dense/sparse size ordering.

    RATIONALE:

    Storage diagnostics and ownership accounting do not determine satisfiability or process memory consumption.

    INTERFACE:
    bool Congruence::OK() const;
    memory_size_type Congruence::total_memory_in_bytes() const;
    memory_size_type Congruence::external_memory_in_bytes() const;
    bool Congruence_System::OK() const;
    memory_size_type Congruence_System::total_memory_in_bytes() const;
    memory_size_type Congruence_System::external_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check valid constants, all modulus forms, copies/conversions and empty/mixed systems. Verify accounting identities and unchanged semantic fields without architecture-specific byte expectations.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000156
    16. Congruence-system meaning and construction UID: PPL-SPEC-000156 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Congruence_System shall denote the conjunction of its retained congruences over rational coordinates. An empty conjunction shall be true. Default construction shall have dimension zero and no rows; the dimensioned empty constructor shall retain its supplied admitted dimension. A singleton constructor from a congruence shall copy that relation and its dimension. Construction from an equality constraint shall make its modulus-zero singleton; inequalities shall throw std::invalid_argument. Construction from a constraint system shall extract its equality rows and retain its ambient dimension, omitting inequalities.

    All constructors shall use requested storage, with default_representation equal to SPARSE. zero_dim_empty() shall borrow a dimension-zero inconsistent singleton, not an empty conjunction, until owning-thread finalization. Initialization, synchronization and numerical/failure preconditions shall follow 🔗 1. Affine congruence meaning and valid numerical use.

    RATIONALE:

    A system's conjunction and ambient space remain meaningful even without nontrivial rows. Equality extraction deliberately omits ordered inequalities.

    INTERFACE:
    class Congruence_System;
    static constexpr Representation Congruence_System::default_representation = SPARSE;
    explicit Congruence_System(Representation r = default_representation);
    explicit Congruence_System(dimension_type d, Representation r = default_representation);
    explicit Congruence_System(const Congruence& cg, Representation r = default_representation);
    explicit Congruence_System(const Constraint& c, Representation r = default_representation);
    explicit Congruence_System(const Constraint_System& cs, Representation r = default_representation);
    static const Congruence_System& Congruence_System::zero_dim_empty();
    
    VERIFICATION_CRITERIA:

    Check empty/singleton/shared inconsistent systems, positive-dimensional empty construction, equality/inequality conversion and extraction from mixed constraint systems using independent rational conjunctions.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000157
    17. Owned congruence systems, storage conversion and descriptor equality UID: PPL-SPEC-000157 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction and assignment shall preserve the system's row sequence, conjunction and declared dimension; ordinary copies and assignment shall retain source representation, while an explicit-storage copy shall use its argument. Assignment shall return the target, preserve a distinct source, support self-assignment and retain the source when using rvalue copy forms. Copies shall remain independent after source modification or destruction. Swaps shall exchange complete values, dimensions and storage, including self-swap. Successful representation conversion shall select requested dense or sparse storage for all rows without changing their conjunction or dimension. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Affine congruence meaning and valid numerical use.

    is_equal_to and system operator== shall test equal declared dimensions and matching retained row counts/order, comparing corresponding congruences semantically. They shall not decide whether differently ordered or redundant systems denote the same conjunction. Storage choice shall not change this comparison. Destruction shall release owned rows.

    RATIONALE:

    Owned row-sequence comparison is distinct from semantic equality of conjunctions, but ambient dimension remains part of an exact descriptor comparison.

    INTERFACE:
    Congruence_System(const Congruence_System& cgs);
    Congruence_System(const Congruence_System& cgs, Representation r);
    Congruence_System& Congruence_System::operator=(const Congruence_System& y);
    Congruence_System::~Congruence_System();
    Representation Congruence_System::representation() const;
    void Congruence_System::set_representation(Representation r);
    void Congruence_System::m_swap(Congruence_System& y);
    void swap(Congruence_System& x, Congruence_System& y);
    bool Congruence_System::is_equal_to(const Congruence_System& y) const;
    bool operator==(const Congruence_System& x, const Congruence_System& y);
    
    VERIFICATION_CRITERIA:

    Check copy/self/rvalue operations, swaps, storage conversion and independence. Compare matching sequences across storage, changed/reordered rows, different row counts, and empty systems whose declared dimensions differ.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000158
    18. System insertion, ownership transfer and coordinate changes UID: PPL-SPEC-000158 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion of a congruence, equality constraint or congruence system shall conjoin copies, preserving sources and target representation. Inequality constraints shall throw std::invalid_argument. Single congruence and constraint insertion shall strongly normalize the inserted copy. Result dimension shall be the maximum input dimension, zero-extending shorter rows. Ordinary self-system insertion and insertion of a borrowed row from the target shall be admitted using entry values.

    Rvalue insertion shall conjoin transferred relations, requiring a source distinct from the target system and not borrowing one of its rows. Transferred inputs shall remain destructible. Successful recycled-system insertion shall clear the source to a dimension-zero empty system. clear() shall likewise remove all rows and reset dimension zero while retaining storage.

    space_dimension() shall report ambient dimension, and max_space_dimension() the congruence limit. Successful set_space_dimension(n) shall resize all row coefficients by truncation or zero extension and retain moduli. Swapping/permuting system coordinates shall apply 🔗 6. Congruence dimensions and coefficient-coordinate transformations to every row. Dimension and variable arguments shall satisfy that contract's bounds. These are coefficient transformations rather than existential projection.

    Const row sources, including const rvalues, shall use preserving insertion. Const system sources shall likewise use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Copying and recycling have different source-ownership consequences, while their resulting conjunction and coordinate alignment must agree.

    INTERFACE:
    void Congruence_System::insert(const Congruence& cg);
    void Congruence_System::insert(Congruence&& cg);
    void Congruence_System::insert(const Constraint& c);
    void Congruence_System::insert(const Congruence_System& y);
    void Congruence_System::insert(Congruence_System&& y);
    void Congruence_System::clear();
    static dimension_type Congruence_System::max_space_dimension();
    dimension_type Congruence_System::space_dimension() const;
    void Congruence_System::set_space_dimension(dimension_type n);
    void Congruence_System::swap_space_dimensions(Variable x, Variable y);
    void Congruence_System::permute_space_dimensions(const std::vector<Variable>& cycle);
    
    VERIFICATION_CRITERIA:

    Check mixed dimensions, duplicates, borrowed-row and self-system ordinary insertion, recycled rows/systems, rejected inequalities, clear/reuse and coordinate transformations against independently evaluated conjunctions. Check source preservation for copy forms and source clearing for successful recycled systems.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000159
    19. Filtered system iteration, emptiness and retained row counts UID: PPL-SPEC-000159 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    begin() and end() shall delimit retained nontautological rows. empty() shall report that this range is empty and shall not decide satisfiability of a nonempty conjunction. Exposed rows shall share the system's declared dimension. has_linear_equalities(), num_equalities() and num_proper_congruences() shall inspect/count retained stored rows, including tautologies omitted by public iteration.

    The forward iterator shall borrow its system, expose row references/pointers, and support copied or assigned independent positions. Prefix increment shall return the advanced iterator; postfix shall return its entry-position copy. Comparison shall require positions in the same unchanged system. Default iterators shall admit copying, assignment and destruction before being assigned a valid position. Mutation/destruction shall invalidate iterators and borrowed rows.

    RATIONALE:

    Public iteration suppresses tautologies, whereas retained row-kind counts describe stored rows rather than the mathematical rank or minimum description.

    INTERFACE:
    class Congruence_System::const_iterator;
    Congruence_System::const_iterator Congruence_System::begin() const;
    Congruence_System::const_iterator Congruence_System::end() const;
    bool Congruence_System::empty() const;
    bool Congruence_System::has_linear_equalities() const;
    dimension_type Congruence_System::num_equalities() const;
    dimension_type Congruence_System::num_proper_congruences() const;
    
    Congruence_System::const_iterator::const_iterator();
    Congruence_System::const_iterator::const_iterator(const const_iterator& y);
    Congruence_System::const_iterator::~const_iterator();
    Congruence_System::const_iterator& Congruence_System::const_iterator::operator=(const const_iterator& y);
    const Congruence& Congruence_System::const_iterator::operator*() const;
    const Congruence* Congruence_System::const_iterator::operator->() const;
    Congruence_System::const_iterator& Congruence_System::const_iterator::operator++();
    Congruence_System::const_iterator Congruence_System::const_iterator::operator++(int);
    bool Congruence_System::const_iterator::operator==(const const_iterator& y) const;
    bool Congruence_System::const_iterator::operator!=(const const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty, tautology-only, mixed and inconsistent systems; verify retained counts separately from public-range length. Exercise prefix/postfix, copied/default-assigned positions, borrowed pointer identity and shared row dimensions.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-000160
    20. Reloadable congruence-system representation UID: PPL-SPEC-000160 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export stored row count, public dimension, representation choice and every full congruence row; ascii_dump() shall write that representation on std::cerr. Export shall preserve the source. A complete compatible export with representable coefficients shall load with true, replacing the target conjunction, dimension, stored rows and encoded representation choice.

    Malformed/truncated headers or rows, invalid modulus or coefficient structure, and inconsistent encoded row dimensions shall return false rather than be accepted as a valid system. Trailing input shall remain available. Failure may modify a destination but shall leave it destructible and replaceable by a complete valid load. No rollback or cross-version format stability is promised. Allocation and configured numerical exceptions may propagate. The decoded row count shall be nonnegative and fit the row container. The decoded header dimension shall be nonnegative and shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    Reloading must retain the system's ambient coordinate context as well as its modular rows.

    INTERFACE:
    void Congruence_System::ascii_dump(std::ostream& s) const;
    void Congruence_System::ascii_dump() const;
    bool Congruence_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimension, equality/proper and duplicate/tautology-containing systems through initial destination storage choices. Check encoded representation, dimensions and independent rational truth; reject malformed/truncated headers and rows and incompatible row dimensions. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Congruence_defs.hh; src/Congruence_inlines.hh; src/Congruence.cc; src/Congruence_System_defs.hh; src/Congruence_System_inlines.hh; src/Congruence_System.cc; tests/congruencespec1.cc; tests/exactboundedworking1.cc.

  • PPL-SPEC-001656
    21. Common-modulus normalization of congruence systems UID: PPL-SPEC-001656 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For a valid congruence system with positive moduli m1, …, mk, normalize_moduli() shall set every proper row's modulus to L = lcm(m1, …, mk) and multiply its affine expression by L ⁄ mi. It shall preserve row order, row count, ambient dimension, storage representation and the relation denoted by every row. Modulus-zero equalities shall remain unchanged. Empty and equality-only systems shall remain unchanged.

    Every evaluated LCM, ratio and coefficient-scaling intermediate shall be representable in the configured coefficient profile. Initialization, lifetime, synchronization and failure guarantees shall follow 🔗 1. Affine congruence meaning and valid numerical use.

    RATIONALE:

    Multiplying the expression and modulus by the same positive factor preserves their integral-quotient relation. A common positive modulus supports joint system transformations without changing the represented grid.

    INTERFACE:

    Internal member of Parma_Polyhedra_Library::Congruence_System:

    void normalize_moduli();
    
    VERIFICATION_CRITERIA:

    Exercise public grid construction and normalization with empty systems, equalities, equal and unequal positive moduli, mixed row orders and both storage representations. Compare independent coordinate-period generator models and preserve copied sources. Include large GMP moduli and bounded profiles within representability limits. Inspect the exact row-scaling loop for order, count and representation preservation.

    SOURCE:

    src/Congruence_System_defs.hh; src/Congruence_System.cc; tests/gridvaluesspec1.cc.

  • 10. Conversion of equality congruences to constraints UID: PPL-SPEC-000110 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from a zero-modulus Congruence shall yield an equality constraint with the same public dimension and satisfying valuations, using the requested representation. Normalization may rescale its coefficients. The source shall remain unchanged. A proper congruence with nonzero modulus shall be rejected with std::invalid_argument and shall not yield a constraint. Numerical prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    A congruence with nonzero modulus denotes a periodic condition and cannot be silently reinterpreted as equality.

    INTERFACE:
    explicit Constraint(const Congruence& cg,
                        Representation r = default_representation);
    
    VERIFICATION_CRITERIA:

    Convert zero-modulus congruences with both coefficient signs, constants and trailing zeros in both representations. Compare rational equality truth independently. Reject positive-modulus proper congruences and check source preservation.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-000120
    20. Extracting equality constraints from a congruence system UID: PPL-SPEC-000120 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from a Congruence_System shall produce the conjunction of its zero-modulus equality rows converted according to 🔗 10. Conversion of equality congruences to constraints. Proper congruences shall be omitted rather than converted to equalities or used as periodic constraints. The result shall retain the congruence system's declared public dimension even when no equality survives, use the requested representation, and preserve its source. Arithmetic prerequisites in 🔗 1. Constraint relation meaning and numerical prerequisites shall apply.

    RATIONALE:

    The conversion extracts only the affine equality part of a congruence system; the result is not a representation of its periodic conditions.

    INTERFACE:
    explicit Constraint_System(const Congruence_System& cgs,
                               Representation r = default_representation);
    
    VERIFICATION_CRITERIA:

    Use mixed equality/proper-congruence systems, proper-only systems and empty systems with positive dimension. Compare the resulting equality conjunction independently over rational points, verify retained dimension/representation and unchanged source.

    SOURCE:

    src/Constraint_defs.hh; src/Constraint_inlines.hh; src/Constraint.cc; src/Constraint_System_defs.hh; src/Constraint_System_inlines.hh; src/Constraint_System.cc; tests/constraintspec1.cc.

  • PPL-SPEC-001650
    10. Native finite affine interval congruence classification UID: PPL-SPEC-001650 STATUS: APPROVED COMPONENT: NUMERICS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    native_interval_relation<Halve>() shall require finite native bounds, a positive magnitude a, a positive modulus m and exact unbounded native arithmetic. With h = 2 when Halve is true and h = 1 otherwise, its admitted affine interval shall be nonempty: L = c − a neg_lower ⁄ h ≤ U = c + a upper ⁄ h, where c is expr.inhomogeneous_term(). The selected halving operation shall be exact.

    The result shall be disjoint exactly when [L, U]∩mℤ is empty. It shall be included and saturating exactly when L = U ∈ mℤ. Otherwise it shall strictly intersect. Expression, magnitude, modulus and supplied bounds shall be preserved. Supported numerical and allocation failures may propagate; temporaries shall release their owned resources. Numerical initialization, lifetime and synchronization prerequisites shall follow 🔗 1. Bounded-difference values, numerical profiles and valid use and 🔗 1. Octagonal values, numerical profiles and valid use for the calling domain.

    RATIONALE:

    A convex affine image meets a modulus lattice according to its two endpoints; computing both together permits one expression classification.

    INTERFACE:

    Internal source header: Shape_Congruence_Queries.hh; namespace Parma_Polyhedra_Library::Implementation::Shape_Congruence_Queries.

    template <bool Halve, typename N>
    Poly_Con_Relation native_interval_relation(
      const Linear_Expression& expr, const Coefficient& magnitude,
      const N& neg_lower, const N& upper, const Coefficient& modulus);
    
    VERIFICATION_CRITERIA:

    Compare results with independently enumerated lattice levels for positive, negative, zero and fractional endpoints, nonzero offsets, multiple magnitudes, congruent and incongruent singletons, narrow gaps and nontrivial intervals. Exercise both halving choices. Check domain queries against analytic images, including general expressions, empty and unbounded sets and cold/warm caches.

    SOURCE:

    src/Shape_Congruence_Queries.hh; src/BD_Shape_templates.hh; src/Octagonal_Shape_templates.hh; tests/shapequerycertificatespec1.cc.

  • PPL-SPEC-001168
    2. Addition of supported octagonal congruences UID: PPL-SPEC-001168 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    add_congruence(cg) shall accept congruence equalities whose expression is an admitted unary or equal-magnitude signed two-coordinate equality, together with constant tautologies and falsehoods. An accepted equality shall conjoin the two outward-normalized inequalities defined in 🔗 1. Addition of supported octagonal constraints. A tautology shall have no effect; a falsehood shall make the receiver empty.

    A nontrivial proper congruence or an unsupported nonconstant equality shall throw std::invalid_argument without changing the receiver's represented set. An adding call shall not silently discard a nontrivial periodic restriction. add_congruences(cgs) and add_recycled_congruences(cgs) shall apply these rules to the system.

    A descriptor or system dimension above the receiver dimension shall throw std::invalid_argument before changing its represented set, including on an empty receiver. Smaller dimensions shall have zero trailing coefficients. Ordinary copying forms shall preserve their source values and shall not borrow their storage. A recycled system shall be required only to remain safely destructible after normal or exceptional return. If a later system row is rejected, preceding accepted rows need not be rolled back; no row visitation order shall be promised.

    The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

    Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved. Recycled sources shall retain their explicit destruction-only guarantee.

    RATIONALE:

    Equality is convex and can be expressed by opposite octagonal bounds, while a nontrivial periodic congruence generally cannot. Explicit rejection keeps addition distinct from conservative refinement.

    INTERFACE:

    Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

    void add_congruence(const Congruence& cg);
    void add_congruences(const Congruence_System& cgs);
    void add_recycled_congruences(Congruence_System& cgs);
    
    VERIFICATION_CRITERIA:

    Derive equality halfspaces independently and apply the rational normalization oracle for 🔗 1. Addition of supported octagonal constraints. Include scaled unary and all signed binary equalities, constant true/false proper congruences, nontrivial periodic rows, unsupported equalities, trailing dimensions, empty states, ordinary/recycled batches and late rejection. Preserve copying inputs and safely destroy recycled inputs.

    BIBLIOGRAPHY:

    BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/congruences1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh; tests/Octagonal_Shape/constraints1.cc.

  • PPL-SPEC-001170
    4. Conservative refinement by congruences UID: PPL-SPEC-001170 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    refine_with_congruence(cg) shall conjoin an octagonal congruence equality using the outward-normalized opposite inequalities in 🔗 1. Addition of supported octagonal constraints. An unsupported nonconstant equality shall have no effect. A proper constant false congruence shall make the receiver empty; other proper congruences shall have no effect. A tautology shall have no effect. The real carrier in 🔗 1. Octagonal values, numerical profiles and valid use shall remain unchanged; ignored periodic information shall not turn this call into an integer-valued state restriction.

    refine_with_congruences(cgs) shall apply those rules to the conjunction. For entry set X, supplied congruence set C and result R, X∩C ⊆ R ⊆ X shall hold. The result shall equal the intersection with all accepted normalized equality rows, unless a false row makes it empty. Empty receivers shall remain empty.

    Larger descriptor or system dimensions shall throw std::invalid_argument before changing the receiver's represented set, including on empty receivers. Smaller dimensions shall use zero trailing coefficients. Copying calls shall preserve their source values; result bounds shall not borrow source storage. A system call that throws need not roll back preceding accepted refinements.

    The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. All operands and input descriptors shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

    Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

    RATIONALE:

    A convex octagonal refinement can retain supported equalities while ignoring nonconvex periodic information. Soundness concerns the real input states satisfying the congruence, not an implicit integer carrier.

    INTERFACE:

    Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

    void refine_with_congruence(const Congruence& cg);
    void refine_with_congruences(const Congruence_System& cgs);
    
    VERIFICATION_CRITERIA:

    Use independent rational equality halfspaces and direct truth tests for constant proper congruences. Exercise all signed binary equalities, unary halves, unsupported unequal-magnitude equalities, periodic rows, dimensions, empty receivers, copying systems and source lifetime. Require both contraction and preservation of states satisfying the original congruences.

    BIBLIOGRAPHY:

    BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/congruences1.cc; tests/Octagonal_Shape/systemdimension1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh; tests/Octagonal_Shape/constraints1.cc.

  • PPL-SPEC-001152
    7. Octagonal construction from supported congruences UID: PPL-SPEC-001152 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Construction from Congruence_System shall inherit its ambient dimension. A modulus-zero row shall be treated as its equality and shall use the supported signed unary/binary syntax and outward normalization in 🔗 6. Octagonal construction from supported constraints. Tautological congruences shall impose no restriction; inconsistent ones shall make the result empty. A nontrivial proper congruence or unsupported equality shall throw std::invalid_argument. Periodic solutions shall not be replaced by an integer-coordinate interpretation of the convex real carrier.

    An empty congruence system shall produce universe in its ambient dimension. The source system shall be preserved. can_recycle_congruence_systems() shall return false. Failed construction shall release acquired resources.

    The lifetime, numerical-profile, initialization and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Logically const normalization may update caches while preserving the represented set and ambient dimension. Supported numerical or allocation failures may propagate through their declared channels; temporary resources shall be released.

    A source dimension above the destination profile's max_space_dimension() shall throw std::length_error before source normalization or allocation of the corresponding target matrix storage.

    RATIONALE:

    Affine equalities can define an octagon; nontrivial periodic restrictions need a richer representation.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for Octagonal_Shape<T> and related free functions in Parma_Polyhedra_Library:

    explicit Octagonal_Shape(const Congruence_System& cgs);
    static bool can_recycle_congruence_systems();
    
    VERIFICATION_CRITERIA:

    Check signed unary/binary equality constructors, including half-integral fixed coordinates, implicit equality chains, redundant rows and source-system preservation. Include proper tautologies/inconsistencies, rejected nontrivial proper congruences and non-octagonal equalities, zero dimensions and explicit system dimensions. Check failed-construction cleanup.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapevaluesspec1.cc; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/octagonalshapevaluespublic1.cc; tests/Octagonal_Shape/congruences1.cc; tests/octagonalshapevaluesfailure1.cc; tests/Octagonal_Shape/dimensionlimits1.cc.

  • PPL-SPEC-001158
    13. Relations between octagonal values and linear congruences UID: PPL-SPEC-001158 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    relation_with(cg) shall classify the represented real set using Poly_Con_Relation. Modulus zero shall have equality meaning. For a proper modulus, inclusion shall mean every source point satisfies the periodic condition; disjointness shall mean none does. For a nonempty source, saturation shall mean that its affine image is one value in the eligible modulus lattice, including a nonzero lattice value. Other overlapping cases shall use the declared strict-intersection flag. Empty shall retain its set-theoretic simultaneous flags.

    General admitted affine congruences shall be queryable even when their solution sets cannot be represented by an octagonal shape. The call shall throw std::invalid_argument when the descriptor dimension exceeds the source's. The descriptor and represented set shall be preserved. The decision shall use real convex points rather than an integer-only reinterpretation of integer bound storage.

    The lifetime, numerical-profile, initialization and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Logically const normalization may update caches while preserving the represented set and ambient dimension. Supported numerical or allocation failures may propagate through their declared channels; temporary resources shall be released.

    RATIONALE:

    Testing a periodic predicate does not require adding its nonconvex solution set to the shape representation.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for Octagonal_Shape<T> and related free functions in Parma_Polyhedra_Library:

    Poly_Con_Relation relation_with(const Congruence& cg) const;
    
    VERIFICATION_CRITERIA:

    Combine exact rational affine ranges with independent arithmetic-progression intersection tests. Include negative and fractional singleton values, satisfied/unsatisfied constant residues, modulus zero, narrow intervals between residue levels, nonconstant unbounded ranges, all coefficient profiles, empty/zero dimensions and incompatible descriptors.

    SOURCE:

    src/Shape_Congruence_Queries.hh; tests/shapeconstantqueryspec1.cc; src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; tests/octagonalshapevaluesspec1.cc; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/octagonalshapevaluespublic1.cc; tests/Octagonal_Shape/relatwithcons2.cc; tests/Octagonal_Shape/relatwithcons3.cc; tests/Octagonal_Shape/semanticqueries1.cc; tests/shapequerycertificatespec1.cc.

  • PPL-SPEC-001728
    6. Java mathematical representations and operation options UID: PPL-SPEC-001728 STATUS: APPROVED COMPONENT: JAVA_INTERFACE APPLICABILITY: IF_JAVA VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Java VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For valid supported Java values, native exchange shall preserve variable indices, representable coefficients and the mathematical meaning of expression trees, constraints, congruences, generators, grid generators and artificial parameters. Expression sums, differences, integer products and negation shall retain their operands' meanings. Constraint direction, congruence modulus, generator kind and divisor, and artificial-parameter numerator and denominator shall be preserved. Coefficient exchange obeys 🔗 1. Java integral coefficient exchange. Native affine, constraint, congruence, generator and grid-generator meanings are specified by 🔗 1. Affine value, numerical prerequisites and shared zero, 🔗 1. Constraint relation meaning and numerical prerequisites, 🔗 1. Affine congruence meaning and valid numerical use, 🔗 1. Generator kinds and numerical prerequisites and 🔗 1. Grid-generator values and integer versus continuous displacement, respectively. Returned mathematical objects may be normalized and need not preserve the input expression-tree shape.

    Conversion of a finite acyclic expression into native form shall preserve operator grouping and apply the configured coefficient rules at each node. This conversion and copying through built-in Java expression nodes shall use stack space independent of tree depth. Construction and cloning shall retain the documented ownership of copied operands.

    System and variable-set conversion shall retain the represented collection; artificial-parameter sequences shall retain their order. Relation objects shall encode the native predicates (subsumption; disjointness, strict intersection, inclusion and saturation). Boxed primitives, Pair fields and By_Reference values shall preserve the values or object references assigned to them.

    Named Java enumeration values for relation symbols, integer widths, representations and overflow policies, optimization modes, solver results and MIP/PIP control parameters shall denote the corresponding native choices. Choosing a complexity or overflow policy shall not strengthen the native operation's exactness guarantee. Nonnegative integral arguments converted to an unsigned native type shall be rejected if negative or outside that type's range; failures follow 🔗 3. Java native failure and pending-exception protocol. Native dimension and object validity preconditions remain applicable.

    RATIONALE:

    Java object layout, enum ordinals and container fields are representation details; native conversion must preserve their mathematical and option meanings.

    INTERFACE:

    Package parma_polyhedra_library: Variable, the Linear_Expression hierarchy, Constraint, Congruence, Generator, Grid_Generator, Artificial_Parameter, their system/sequence classes, Variables_Set, Poly_Gen_Relation, Poly_Con_Relation, the operation-option/result enums, Pair and By_Reference. Values must have the documented class, finite acyclic expression structure and supported enum membership; mathematical objects must satisfy their native constructor preconditions.

    VERIFICATION_CRITERIA:

    Inspect each constructor/accessor correspondence, expression-node case, system iterator and enum switch against the Java definitions and native meanings. Check signed/unsigned range admission, affine constants, generator divisors, relation flags and container field positions. Use existing Java domain and solver scenarios as supporting runtime evidence, comparing normalization by mathematical meaning. Construct and copy mixed expression trees, check subtree independence and convert against an independently known affine result.

    SOURCE:

    interfaces/Java/jni/ppl_java_common.cc; interfaces/Java/jni/ppl_java_common_defs.hh; interfaces/Java/jni/ppl_java_common_inlines.hh; interfaces/Java/tests/Linear_Expression_test1.java; interfaces/Java/parma_polyhedra_library.

  • PPL-SPEC-001692
    1. OCaml mathematical representation exchange UID: PPL-SPEC-001692 STATUS: APPROVED COMPONENT: OCAML_INTERFACE APPLICABILITY: IF_OCAML VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: OCaml VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For well-formed values of the exposed algebraic types, conversion to native objects shall preserve zero-based variable identities, signed integral Z.t coefficients within the configured native range, affine expression meaning, equality and strict/non-strict inequality meaning, and generator kind. Returned values shall denote the native result; syntactic tree shape and normalization need not be preserved.

    Conversion of finite acyclic expressions to native objects shall preserve operator grouping and apply the configured coefficient rules at each node. Native stack usage shall be independent of expression depth. The expression values used during traversal shall remain valid under the OCaml runtime's lifetime and collection rules.

    A point or closure point with expression coordinates ai and nonzero divisor d denotes coordinates ai ⁄ d. Lines and rays denote the native direction described by the expression. Grid generators and congruences shall preserve their native rational-divisor and integral-modulus meanings. Native validity and operation-specific topology and arithmetic preconditions apply. A Z.t may be immediate or heap allocated; the binding shall use its value rather than assume either memory layout.

    RATIONALE:

    An algebraic representation can change tree shape while preserving exactly the same affine function or geometric object.

    INTERFACE:

    Module Ppl_ocaml.

    type linear_expression =
      Variable of int | Coefficient of Z.t
      | Unary_Plus of linear_expression | Unary_Minus of linear_expression
      | Plus of linear_expression * linear_expression
      | Minus of linear_expression * linear_expression
      | Times of Z.t * linear_expression
    type linear_constraint =
      Less_Than of linear_expression * linear_expression
      | Less_Or_Equal of linear_expression * linear_expression
      | Equal of linear_expression * linear_expression
      | Greater_Than of linear_expression * linear_expression
      | Greater_Or_Equal of linear_expression * linear_expression
    type linear_generator =
      Line of linear_expression | Ray of linear_expression
      | Point of linear_expression * Z.t
      | Closure_Point of linear_expression * Z.t
    

    Configured domain and solver constructors consume these types; their expression, constraint and generator queries return the corresponding types. The companion linear_grid_generator and linear_congruence types in the module signature define grid exchange.

    VERIFICATION_CRITERIA:

    Independently evaluate returned affine expressions and convert nested inputs with known grouped affine results. Round-trip positive, negative, zero and configured coefficient endpoints. Check multiple coordinates, all five relation kinds and all four polyhedral generator kinds. Include immediate and large Zarith values, divisor normalization and compacting collections.

    SOURCE:

    interfaces/OCaml/ppl_ocaml_globals.mli; interfaces/OCaml/ppl_ocaml_common.cc; interfaces/OCaml/ppl_ocaml_globals.ml; interfaces/OCaml/tests/zarith1.ml; interfaces/OCaml/tests/polyhedron1.ml; interfaces/OCaml/tests/boundary_contracts1.ml.

  • PPL-SPEC-001695
    1. Prolog mathematical term exchange UID: PPL-SPEC-001695 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For each configured supported Prolog engine, supported integral terms, affine expressions, constraints, congruences and generators shall be interpreted with their documented native mathematical meaning. '$VAR'(I) shall denote the zero-based coordinate I. Unary negation, addition, subtraction and integral scalar multiplication shall preserve affine meaning. Relations shall preserve equality and strict/non-strict order. Point and closure-point coordinates shall be divided by the supplied nonzero divisor; lines and rays denote directions. Returned terms may be normalized but shall denote the native result.

    Values shall be representable by both the engine and configured native coefficient type. A bounded engine does not acquire arbitrary-size integers from GMP in the native library. Malformed or nonlinear expressions and invalid native objects shall follow 🔗 2. Prolog success failure and exception outcomes.

    RATIONALE:

    The common term protocol must express the same mathematics independently of the selected foreign runtime.

    INTERFACE:

    Common numerical term protocol:

    '$VAR'(I)
    -E
    E + F
    E - F
    N * E
    E = F
    E =< F
    E < F
    E >= F
    E > F
    point(E, D)
    closure_point(E, D)
    ray(E)
    line(E)
    

    Here I is a valid coordinate index, N an integral coefficient and E/F supported affine expressions. Lists of such terms are the system interfaces accepted and returned by configured domain and solver predicates. Grid-point, parameter and congruence terms follow the common Prolog manual's rational-divisor and modulus conventions.

    VERIFICATION_CRITERIA:

    Across each available configured engine, compare coefficient round trips and independently reconstructed expressions/constraints/generators. Cover signs, zero, multiple indices, all relation and generator kinds, and each engine/native range intersection; check unsupported numeric and malformed cases separately.

    SOURCE:

    interfaces/Prolog/Prolog_interface_sysindep.dox; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.

PPL-LLR-000015
5. Distinct meanings of geometric generators UID: PPL-LLR-000015 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

Generator descriptors shall preserve the mathematical distinction between included points, closure points, rays, lines and grid parameters: closure points need not be included points, rays admit nonnegative displacement, lines admit arbitrary real displacement, and grid parameters admit integer displacement.

RATIONALE:

Confusing generator kinds changes boundary membership, boundedness or periodicity even when their coordinate vectors coincide.

COMMENT:

Verification covers polyhedral and grid generator value types and generator-kind interpretation. Related obligations: 🔗 2. Equivalent polyhedral representations, 🔗 2. Equivalent grid representations.

VERIFICATION_CRITERIA:

Construct independent one- and two-dimensional examples that distinguish each applicable generator kind. Check rational point scaling and verify that changing a generator's kind changes the represented possibilities in the prescribed manner.

SOURCE:

doc/definitions.dox: Generator Geometric Descriptors; Generator Description; Points, Parameters and Lines. src/Generator_defs.hh: polyhedral generator kinds. src/Grid_Generator_defs.hh: grid generator kinds.

  • PPL-SPEC-001528
    6. C polyhedral generator values UID: PPL-SPEC-001528 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Creation shall copy inputs into an independent owned Generator representing the requested line, ray, point or closure point with the native direction or divisor semantics. Dedicated zero-dimensional constructors shall provide the corresponding native canonical objects. Copying and assignment shall preserve native value and dimension; deletion shall release owned storage. Invalid kinds, undefined divisors and dimension/size violations designated by the native operation shall be reported through the C failure protocol.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Descriptor conversion must preserve its geometric or arithmetic meaning.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Generator(ppl_Generator_t *pg, ppl_const_Linear_Expression_t le,
                          enum ppl_enum_Generator_Type t,
                          ppl_const_Coefficient_t d);
    int ppl_new_Generator_zero_dim_point(ppl_Generator_t *pg);
    int ppl_new_Generator_zero_dim_closure_point(ppl_Generator_t *pg);
    int ppl_new_Generator_from_Generator(ppl_Generator_t *pg,
                                         ppl_const_Generator_t g);
    int ppl_assign_Generator_from_Generator(ppl_Generator_t dst,
                                            ppl_const_Generator_t src);
    int ppl_delete_Generator(ppl_const_Generator_t g);
    
    VERIFICATION_CRITERIA:

    Check each supported kind, exact coefficients and normalization, empty/universe canonical descriptors, source independence and native admission failures.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001529
    7. C polyhedral generator queries UID: PPL-SPEC-001529 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Queries shall report the native Generator kind, dimension and variable coefficients. Divisor queries shall report the native divisor for a point or closure point and shall report PPL_ERROR_INVALID_ARGUMENT for a line or ray. Validity queries shall return a boolean outcome. Coefficient and divisor outputs shall assign existing writable coefficient objects. Native argument failures shall be translated.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    C query results need the same interpretation as their native descriptor.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_Generator_space_dimension(ppl_const_Generator_t g,
                                      ppl_dimension_type *m);
    int ppl_Generator_type(ppl_const_Generator_t g);
    int ppl_Generator_coefficient(ppl_const_Generator_t g, ppl_dimension_type var,
                                  ppl_Coefficient_t n);
    int ppl_Generator_divisor(ppl_const_Generator_t g, ppl_Coefficient_t n);
    int ppl_Generator_OK(ppl_const_Generator_t g);
    
    VERIFICATION_CRITERIA:

    Check each kind against literal descriptors, normalized ratios or congruences, output reuse and rejected inappropriate queries.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001532
    10. C grid generator values UID: PPL-SPEC-001532 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Creation shall copy inputs into an independent owned Grid_Generator representing the requested line, parameter or point with the native direction and divisor semantics. Dedicated zero-dimensional constructors shall provide the corresponding native canonical objects. Copying and assignment shall preserve native value and dimension; deletion shall release owned storage. Invalid kinds, undefined divisors and dimension/size violations designated by the native operation shall be reported through the C failure protocol.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    Descriptor conversion must preserve its geometric or arithmetic meaning.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_new_Grid_Generator(ppl_Grid_Generator_t *pg,
                               ppl_const_Linear_Expression_t le,
                               enum ppl_enum_Grid_Generator_Type t,
                               ppl_const_Coefficient_t d);
    int ppl_new_Grid_Generator_zero_dim_point(ppl_Grid_Generator_t *pg);
    int ppl_new_Grid_Generator_from_Grid_Generator(ppl_Grid_Generator_t *pg,
                                                   ppl_const_Grid_Generator_t g);
    int ppl_assign_Grid_Generator_from_Grid_Generator(
        ppl_Grid_Generator_t dst, ppl_const_Grid_Generator_t src);
    int ppl_delete_Grid_Generator(ppl_const_Grid_Generator_t g);
    
    VERIFICATION_CRITERIA:

    Check each supported kind, exact coefficients and normalization, empty/universe canonical descriptors, source independence and native admission failures.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001533
    11. C grid generator queries UID: PPL-SPEC-001533 STATUS: APPROVED COMPONENT: C_INTERFACE APPLICABILITY: IF_C VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: C VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Queries shall report the native Grid_Generator kind, dimension and variable coefficients. Divisor queries shall report the native divisor for a point or parameter and shall report PPL_ERROR_INVALID_ARGUMENT for a line. Validity queries shall return a boolean outcome. Coefficient and divisor outputs shall assign existing writable coefficient objects. Native argument failures shall be translated.

    The valid-use and result-category conditions in 🔗 1. C handles, arguments and successful outcomes shall apply.

    RATIONALE:

    C query results need the same interpretation as their native descriptor.

    INTERFACE:

    Public header: <ppl_c.h>.

    int ppl_Grid_Generator_space_dimension(ppl_const_Grid_Generator_t g,
                                           ppl_dimension_type *m);
    int ppl_Grid_Generator_type(ppl_const_Grid_Generator_t g);
    int ppl_Grid_Generator_coefficient(ppl_const_Grid_Generator_t g,
                                       ppl_dimension_type var, ppl_Coefficient_t n);
    int ppl_Grid_Generator_divisor(ppl_const_Grid_Generator_t g,
                                   ppl_Coefficient_t n);
    int ppl_Grid_Generator_OK(ppl_const_Grid_Generator_t g);
    
    VERIFICATION_CRITERIA:

    Check each kind against literal descriptors, normalized ratios or congruences, output reuse and rejected inappropriate queries.

    SOURCE:

    interfaces/C/ppl_c_header.h; interfaces/C/ppl_c_implementation_common.cc; interfaces/C/tests/ccontractsspec1.cc.

  • PPL-SPEC-001072
    1. Closed bounded-difference support hull of geometric generators UID: PPL-SPEC-001072 STATUS: APPROVED COMPONENT: BOUNDED_DIFFERENCES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    BD_Shape(gs) shall give the least target-profile bounded-difference enclosure of the convex set generated by gs. The constructor shall close finite excluded boundaries: points and closure points shall both contribute their actual rational coordinates to support extrema. A ray shall make a normal unbounded exactly when its scalar product with that normal is positive; a line shall do so when that scalar product is nonzero. A zero directional product shall not remove a finite bound.

    An empty generator system shall construct empty in its declared dimension. A nonempty generator system shall contain an ordinary point; otherwise the constructor shall throw std::invalid_argument. Rational point and closure-point divisors, zero trailing coordinates and the distinction between rays and lines shall retain the meanings in 🔗 1. Generator kinds and numerical prerequisites and [LINK: PPL-SPEC-000182].

    For each supported unary or difference normal, a finite source supremum shall yield the least bound representable by the target profile that is no smaller than that supremum. An unbounded source normal shall impose no finite restriction. Consequently an unbounded exact rational target shall give the least closed bounded-difference enclosure. A rounded profile shall give the least enclosure expressible with its admitted bounds.

    The result shall inherit the source's ambient dimension and own its storage independently of the source, as in 🔗 3. Owned bounded-difference copying, assignment and cleanup. Successful construction and logically const source normalization shall preserve the source's represented value. Later source mutation or destruction shall not affect the result.

    A source dimension above max_space_dimension() shall throw std::length_error before allocating the corresponding matrix storage. Empty and zero-dimensional values shall retain the meanings in [LINK: PPL-SPEC-001057].

    Source objects shall be live, valid and synchronized throughout the call. The source-domain arithmetic and target numerical profile shall satisfy their range, rounding, resource and initialization prerequisites. The supported profile and runtime conditions in 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply, including the required initialized native floating environment. Underlying numerical or allocation failures may propagate. Failure during construction shall release resources owned by the incomplete result; no general source-cache rollback guarantee shall be inferred.

    RATIONALE:

    A closed relational enclosure depends on support in every admitted normal, including differences; separate coordinate bounds do not determine that enclosure after numerical rounding.

    INTERFACE:

    Public header: <ppl.hh>; constructor excerpts for BD_Shape<T> in Parma_Polyhedra_Library:

    explicit BD_Shape(const Generator_System& gs);
    
    VERIFICATION_CRITERIA:

    Compute rational support directly from raw point and closure-point coordinates and direction signs. Check every unary/difference bound and independently computed affine dimension, empty and zero dimensions, fractional divisors, repeated extrema, missing trailing coordinates and invalid point-free systems. Exercise admitted integer and native target profiles with independent outward-bound models. Check literal support entries for dense and sparse systems at dimensions 0, 1, 2, 63, 64, 65 and 128, including implicit zero tails, dyadic coordinates, origin and fully populated points, closure-first updates and repeated points. Exercise exact, integral and native boundaries, source lifetime independence and unchanged native floating state. Bound additional C++ allocation against independently constructed matrix storage, including value-returning coefficient traits, and sweep observed allocation failures after numeric-pool warmup; require incomplete-result cleanup and unchanged source values. Compare every stored support bound for positive and negative first, middle and last coordinate lines and rays, zero-coordinate rows, equal/opposite pairs and fixed nonzero point coordinates in dense and sparse storage. Exercise exact, integral and native boundaries and require finite bounds for zero directional products. Retain the selected coefficient profile's admitted arithmetic and failure behavior.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4.

    SOURCE:

    src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapeconversionsspec1.cc; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/bdshapeconversionspublic1.cc; tests/BD_Shape/fromgensys1.cc; tests/BD_Shape/dimensionlimits1.cc. tests/generatorconstructionfixture.hh; tests/generatorconstructionallocationsspec1.cc.

  • PPL-SPEC-001069
    14. Subsumption of geometric generators by bounded-difference values UID: PPL-SPEC-001069 STATUS: APPROVED COMPONENT: BOUNDED_DIFFERENCES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    relation_with(g) shall return Poly_Gen_Relation::subsumes() exactly when the represented set subsumes the generator under 🔗 6. Generator-relation assertion values and named factories. An ordinary point or closure point shall use its rational coordinates; closure points shall obey the same membership test because this domain is closed. A ray shall satisfy every represented homogeneous direction inequality, and a line shall satisfy each corresponding homogeneous equality. Empty shall subsume no generator. A generator dimension above the receiver's shall throw std::invalid_argument; a lower-dimensional generator shall have zero additional coordinates.

    The validity, lifetime, arithmetic, range, rounding and synchronization prerequisites in 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Logically const normalization may update caches but shall preserve the represented set and ambient dimension. Underlying supported numerical or allocation failures may propagate through their declared channels. Failure during construction shall release resources owned by the incomplete shape. Failure of a mutating operation shall retain the ownership needed for safe destruction; a general rollback guarantee shall not be inferred.

    RATIONALE:

    Point membership and recession directions require different homogeneous tests; closedness identifies point and closure-point membership.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for BD_Shape<T> and related free functions in Parma_Polyhedra_Library:

    Poly_Gen_Relation relation_with(const Generator& g) const;
    
    VERIFICATION_CRITERIA:

    Check independent rational point substitution and homogeneous ray/line evaluation against source inequalities. Include divisor signs/canonical values, relational restrictions, zero trailing coordinates, empty/zero dimensions and incompatible descriptors. Exercise pairs with two infinite bounds, either one-sided finite bound, two finite bounds and equalities, for all four generator kinds and both descriptor representations against literal substitution.

    SOURCE:

    src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapevaluesspec1.cc; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/bdshapevaluespublic1.cc; tests/BD_Shape/relations1.cc; tests/BD_Shape/relations2.cc; tests/BD_Shape/relations3.cc; tests/BD_Shape/relations4.cc.

  • PPL-SPEC-001046
    3. Cartesian enclosure of a polyhedral generator system UID: PPL-SPEC-001046 STATUS: APPROVED COMPONENT: INTERVALS_BOXES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Box(gs) shall contain the polyhedral set generated by gs with the point, closure-point, ray and line meanings in 🔗 1. Generator kinds and numerical prerequisites and 🔗 15. Generator-system hull meaning and construction. For exact rational endpoint operations and supported openness, the result shall be its least Cartesian box.

    At a coordinate not made unbounded by directions, the finite extrema shall be those of the generator points and closure points. Such an extremum shall be included exactly when an ordinary point attains it; a closure point alone shall not include that endpoint. A ray with a nonzero component shall remove the bound in that component's sign direction. A line with a nonzero component shall remove both coordinate bounds. Zero components shall not change other factors. Inexact endpoint profiles shall provide outward enclosures of these coordinate ranges.

    An empty generator system shall produce empty with the inherited dimension. A nonempty system with no ordinary point shall throw std::invalid_argument. A point in dimension zero shall generate the unique empty tuple. Construction from an rvalue system shall have the same result, rejection and source preservation as ordinary construction.

    The result shall inherit the source's ambient dimension, including when empty. A source dimension above max_space_dimension() shall throw std::length_error before allocating that coordinate storage. Its coordinate storage shall have the independent ownership specified in 🔗 3. Owned box copying, assignment and cleanup. Endpoint conversion shall retain the profile conditions in 🔗 4. Upward box conversion between interval profiles.

    Sources shall remain live, valid and synchronized throughout construction. Their represented values shall remain unchanged; logically const normalization may update their caches. The selected source-domain arithmetic and the target interval operations shall meet their range, resource, rounding and policy prerequisites. The numerical and runtime prerequisites in 🔗 1. Cartesian box values, coordinate identity and valid use, and descriptor initialization in 🔗 1. Initialization owners and automatic C++ initialization and 🔗 3. Thread initialization, default state and finalization where used, shall apply. Failure during construction shall release resources owned by the incompletely constructed box. Underlying numerical or resource exceptions may propagate.

    RATIONALE:

    Independent coordinate extrema give the Cartesian enclosure of a generated convex set, while closure points distinguish finite excluded endpoints from attained ones.

    INTERFACE:

    Public header: <ppl.hh>; constructor excerpts for Box<ITV> in Parma_Polyhedra_Library:

    explicit Box(const Generator_System& gs);
    
    VERIFICATION_CRITERIA:

    Compute exact rational extrema and point attainment independently from raw point/closure-point coordinates and ray/line signs. Include fractions with different divisors, repeated extrema, orthogonal directions, empty and zero-dimensional systems, both overloads, profile conversion and rejection of nonempty systems without a point.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4.

    SOURCE:

    src/Box_defs.hh; src/Box_inlines.hh; src/Box_templates.hh; tests/boxconversionsspec1.cc; tests/boxconversionoracle.hh; tests/boxrefinementoracle.hh; tests/boxallocationfixture.hh; tests/boxconversionspublic1.cc; tests/Box/fromgensys1.cc.

  • PPL-SPEC-001645
    1. Descriptor collection identity and affine comparison UID: PPL-SPEC-001645 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For live valid constraint systems or generator systems, free equality shall compare their retained internal row sequences under 🔗 22. Internal sequence equality and bookkeeping scope: ambient dimension, row count, pending boundary and corresponding row values shall agree. Storage representation, capacity and sorted certificates shall not affect the result. Inequality shall negate equality. These predicates shall preserve their operands. Equality shall not minimize, reorder, remove duplicate rows or decide geometric equivalence of the represented conjunctions or hulls. Row-empty systems shall follow the underlying dimension/boundary rule without an additional topology comparison.

    The free compare(x,y) for linear expressions shall forward the zero-extended affine ordering of 🔗 5. Backend equality, comparison and common-variable queries. It shall return -2 or 2 at the first differing homogeneous coefficient, -1 or 1 for a constant-only difference, and zero when all zero-extended coefficients agree. Equal affine values with different declared dimensions may therefore compare as zero. Initialization, coefficient arithmetic, lifetimes and synchronized access shall follow the selected descriptor or expression query.

    RATIONALE:

    Stored descriptor sequence identity and zero-extended affine ordering are useful implementation queries with meanings distinct from geometric set equivalence.

    INTERFACE:

    Names belong to Parma_Polyhedra_Library unless stated otherwise.

    bool operator==(const Constraint_System&, const Constraint_System&);
    bool operator!=(const Constraint_System&, const Constraint_System&);
    bool operator==(const Generator_System&, const Generator_System&);
    bool operator!=(const Generator_System&, const Generator_System&);
    int compare(const Linear_Expression&, const Linear_Expression&);
    
    VERIFICATION_CRITERIA:

    Check copied and differently stored collections, differing dimensions, row order/count, duplicate rows and unchanged operands. Compare signed affine vectors, constant-only differences, unequal zero tails and both argument orders against literal expected return codes.

    SOURCE:

    src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; src/Linear_Expression_inlines.hh; tests/descriptorequalityspec1.cc.

  • PPL-SPEC-001579
    1. Rectilinear distance between generator points UID: PPL-SPEC-001579 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For admitted generators with rational coordinates as specified by 🔗 4. Generator-distance admission, workspaces and dispatch, rectilinear_distance_assign shall assign the requested directed bound on

    D1(x, y) = n − 1∑i = 0|xi − yi|.

    With exact rational temporary arithmetic and an exactly representable output, the sum shall be returned exactly.

    The admission, direction, workspace, alias, lifetime and failure conditions of 🔗 4. Generator-distance admission, workspaces and dispatch shall apply. Successful completion shall return true; rejection shall return false with the stated preservation. An upward result shall be at least the exact norm and a downward result shall be nonnegative and at most the exact norm, under the numerical prerequisites. Both source generators shall retain their values, kinds, representations and dimensions.

    RATIONALE:

    A rational point descriptor supplies geometric coordinates independently of its normalized integer coefficients and divisor; the chosen norm determines the meaning of their distance.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    template <typename To>
    bool rectilinear_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir);
    template <typename Temp, typename To>
    bool rectilinear_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir);
    template <typename Work, typename To>
    bool rectilinear_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir,
        Work& tmp0, Work& tmp1, Work& tmp2);
    
    VERIFICATION_CRITERIA:

    Compute independent exact rational coordinate differences and their absolute sum; check both source orders, identical coordinates with different point kinds, negative coordinates, zero dimensions and all overload/workspace choices.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/distances_defs.hh; src/distances_inlines.hh; tests/generatorspec1.cc; tests/generatorpublic1.cc; tests/generatormetricsspec1.cc.

  • PPL-SPEC-001580
    2. Euclidean distance between generator points UID: PPL-SPEC-001580 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For admitted generators with rational coordinates as specified by 🔗 4. Generator-distance admission, workspaces and dispatch, euclidean_distance_assign shall assign the requested directed bound on

    D2(x, y) = √(n − 1∑i = 0(xi − yi)2).

    Every squared contribution shall preserve the directed bound even when a coordinate difference is inexact in the workspace type. Rational square roots shall retain the precision and enclosure conditions of 🔗 2. Finite rational square root at the selected irrational precision and 🔗 3. Selection and ownership of irrational rational precision; no universal exactness or fixed error width shall be inferred beyond those contracts.

    The admission, direction, workspace, alias, lifetime and failure conditions of 🔗 4. Generator-distance admission, workspaces and dispatch shall apply. Successful completion shall return true; rejection shall return false with the stated preservation. An upward result shall be at least the exact norm and a downward result shall be nonnegative and at most the exact norm, under the numerical prerequisites. Both source generators shall retain their values, kinds, representations and dimensions.

    RATIONALE:

    A rational point descriptor supplies geometric coordinates independently of its normalized integer coefficients and divisor; the chosen norm determines the meaning of their distance.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    template <typename To>
    bool euclidean_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir);
    template <typename Temp, typename To>
    bool euclidean_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir);
    template <typename Work, typename To>
    bool euclidean_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir,
        Work& tmp0, Work& tmp1, Work& tmp2);
    
    VERIFICATION_CRITERIA:

    Compare nonnegative results by exact squared inequalities, without using a floating square root as the oracle. Include a 3-4-5 displacement, irrational norms, close rational coordinates rounded into native workspaces and both directions through every overload.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/distances_defs.hh; src/distances_inlines.hh; tests/generatorspec1.cc; tests/generatorpublic1.cc; tests/generatormetricsspec1.cc.

  • PPL-SPEC-001581
    3. Maximum-coordinate distance between generator points UID: PPL-SPEC-001581 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For admitted generators with rational coordinates as specified by 🔗 4. Generator-distance admission, workspaces and dispatch, l_infinity_distance_assign shall assign the requested directed bound on

    D∞(x, y) =  max0 ≤ i < n|xi − yi|.

    The maximum over the empty coordinate tuple shall be zero. With exact rational temporary arithmetic and an exactly representable output, the maximum shall be returned exactly.

    The admission, direction, workspace, alias, lifetime and failure conditions of 🔗 4. Generator-distance admission, workspaces and dispatch shall apply. Successful completion shall return true; rejection shall return false with the stated preservation. An upward result shall be at least the exact norm and a downward result shall be nonnegative and at most the exact norm, under the numerical prerequisites. Both source generators shall retain their values, kinds, representations and dimensions.

    RATIONALE:

    A rational point descriptor supplies geometric coordinates independently of its normalized integer coefficients and divisor; the chosen norm determines the meaning of their distance.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    template <typename To>
    bool l_infinity_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir);
    template <typename Temp, typename To>
    bool l_infinity_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir);
    template <typename Work, typename To>
    bool l_infinity_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir,
        Work& tmp0, Work& tmp1, Work& tmp2);
    
    VERIFICATION_CRITERIA:

    Compute the exact maximum of absolute rational coordinate differences. Check ties, each coordinate as the unique maximum, zero contributions, both source orders, empty tuples and rounded native workspaces through every overload.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/distances_defs.hh; src/distances_inlines.hh; tests/generatorspec1.cc; tests/generatorpublic1.cc; tests/generatormetricsspec1.cc.

  • 4. Generator-distance admission, workspaces and dispatch UID: PPL-SPEC-001582 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Distances shall be admitted exactly when both generators are points or closure points and have the same ambient dimension. A line, a ray or a dimension mismatch shall return false before assigning the output or any supplied scratch object. Equal-dimensional point/closure-point pairs shall return true on successful numerical completion. A zero-dimensional pair shall assign exact zero. A closure point shall contribute its rational coordinates without asserting inclusion in any polyhedron. For each source, xi = ai ⁄ d shall use its own positive divisor. Neither coefficient vectors alone nor homogeneous-coordinate distances shall replace these coordinates. Boolean success shall not imply exactness of a rounded result.

    The default overload shall use three Checked_Number<To,Extended_Number_Policy> workspaces. An explicit scalar temporary type Temp shall use three Checked_Number<Temp,Extended_Number_Policy> workspaces. Supplied references shall use their actual admitted raw or checked numerical type Work. Their accumulation shall use 🔗 17. Rectilinear distance between bound-entry arrays, 🔗 18. Euclidean distance between bound-entry arrays or 🔗 19. Maximum-coordinate distance between bound-entry arrays, respectively. The generic helper instantiated with the corresponding specialization shall use the same admission, coordinate and numerical rules.

    Source validity and coefficient conditions of 🔗 1. Generator kinds and numerical prerequisites shall apply. Each scalar conversion, subtraction, accumulation, square, square root and final assignment shall satisfy its backend's representability, failure, resource, shared-temporary, nontrapping and FPU prerequisites. Native floating types shall retain their configured availability and hardware conditions. Rational square-root precision shall remain stable throughout a dependent call. Calls evaluating coordinate differences shall use ROUND_UP or ROUND_DOWN, optionally with ROUND_STRICT_RELATION. Inexact coordinate conversion shall not by itself invalidate a directed bound. The zero-dimensional exact assignment shall admit any otherwise valid direction for that scalar assignment.

    Supplied scratch objects shall be pairwise distinct and disjoint from both source generators. Their entry values need not be initialized where they are overwritten before reading. The output shall have live assignable storage disjoint from the sources; it may coincide with any one scratch object or its compatible raw storage. The same generator may be passed as both sources. Callers shall preserve object and borrowed-storage lifetimes and provide synchronization required by the selected numerical profile. Numerical or allocation failures may propagate through their declared channels, shall not establish a successful directed bound, and may leave partial output/scratch values according to the selected scalar policies; no aggregate rollback guarantee shall be inferred.

    RATIONALE:

    Explicit admission and workspace rules distinguish a geometric distance from a coefficient-vector calculation and make directed bounds meaningful under rounding and permitted output aliases.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    template <typename Specialization, typename Work, typename To>
    bool l_m_distance_assign(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir,
        Work& tmp0, Work& tmp1, Work& tmp2);
    
    VERIFICATION_CRITERIA:

    Check all rejected kind pairs and both dimension-mismatch orders with output and scratch sentinels. Exercise both point kinds, zero dimensions, default and explicit raw/checked workspaces, each output/scratch alias and identical sources. Use independent rational norms and squared comparisons under inexact conversions; verify source preservation and caller-owned rounding state.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/distances_defs.hh; src/distances_inlines.hh; tests/generatorspec1.cc; tests/generatorpublic1.cc; tests/generatormetricsspec1.cc.

  • PPL-SPEC-001583
    5. Stored ordering of polyhedral generators UID: PPL-SPEC-001583 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    compare(x,y) shall order valid generator rows of the same topology without changing either source. Callers shall provide this common-topology precondition, as in rows of one generator system. Its result shall be negative, zero or positive according to the stored ordering, with magnitude at most two. Lines shall precede all other kinds, returning magnitude two when this rule decides the order.

    For two necessarily-closed rows, comparison shall use their stored expressions: homogeneous coefficients in increasing variable order followed by the divisor field, with absent trailing coefficients treated as zero. A homogeneous coefficient difference shall return magnitude two and a divisor-field difference magnitude one, using the sign of the first difference.

    For NNC rows, comparison shall first use the public homogeneous coefficients in the same order with zero padding. A difference shall return magnitude two. With equal homogeneous coefficients, two lines shall compare equal; otherwise a ray shall precede a point or closure point with magnitude one, and two rays shall compare equal. Remaining point or closure-point rows shall compare divisors and then stored epsilon coefficients, returning their signed comparison with magnitude one when unequal.

    The ordering shall be of stored row descriptions, not lexicographic order of rational point coordinates and not generator equivalence. Source validity, coefficient representability and synchronization prerequisites of 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    Generator-system algorithms need a deterministic row ordering whose tie breakers retain divisor and topology information independently of geometric equivalence.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    int compare(const Generator& x, const Generator& y);
    
    VERIFICATION_CRITERIA:

    Use literal normalized rows to exercise line priority, homogeneous differences, zero padding, ray/point priority, divisor differences and epsilon tie breaking. Check both orders, equality, transitivity on a fixed catalogue, both storage representations and each common topology; preserve each source.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/distances_defs.hh; src/distances_inlines.hh; tests/generatorspec1.cc; tests/generatorpublic1.cc; tests/generatormetricsspec1.cc.

  • PPL-SPEC-001653
    6. Admitted generator-distance evaluation kernel UID: PPL-SPEC-001653 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    l_m_distance_assign_impl shall evaluate a valid point or closure-point pair of equal strictly positive dimension. Callers shall meet the source, workspace, output-alias, rounding, initialization, synchronization and backend conditions of 🔗 4. Generator-distance admission, workspaces and dispatch before entering this kernel; it shall not perform the public admission checks.

    With Skip_Common_Zero_Runs equal to false, the kernel shall process every coordinate in decreasing index order, using each source's own positive divisor. It shall initialize tmp0 to zero, form the directed nonnegative coordinate differences, call Specialization::combine once for each coordinate, call Specialization::finalize once after accumulation, and assign the result from tmp0. The applicable numerical obligations of 🔗 1. Rectilinear distance between generator points, 🔗 2. Euclidean distance between generator points or 🔗 3. Maximum-coordinate distance between generator points shall apply for their corresponding standard specialization.

    With Skip_Common_Zero_Runs equal to true, both sources shall have sparse representation and Specialization shall be the standard rectilinear, Euclidean or infinity-distance specialization for Work. The kernel may replace a maximal run of coordinates zero in both sources by one ordinary zero-coordinate step. Successful completion shall preserve the full traversal's result, final scratch values, directed rounding and floating-point zero signs and status effects. Contributions at nonzero coordinates shall retain their decreasing-index order. The skipping path shall not allocate coefficient vectors or polymorphic expression iterators.

    Successful numerical completion shall return true. Numerical or allocation failures shall retain the failure channels and partial-state conditions of 🔗 4. Generator-distance admission, workspaces and dispatch. The public dispatcher shall retain ordinary traversal for other specialization types; callbacks of those types shall not lose coordinate invocations.

    RATIONALE:

    Zero contributions do not change the three standard norms. Retaining one zero step per run preserves idempotent signed-zero and scratch effects, while ordering all nonzero contributions preserves directed accumulation. The same assumption is unavailable for arbitrary specialization callbacks.

    INTERFACE:

    Internal function template in namespace Parma_Polyhedra_Library; src/Generator_inlines.hh and public header <ppl.hh>.

    template <bool Skip_Common_Zero_Runs, typename Specialization,
              typename Work, typename To>
    bool l_m_distance_assign_impl(
        Checked_Number<To, Extended_Number_Policy>& result,
        const Generator& x, const Generator& y, Rounding_Dir dir,
        Work& tmp0, Work& tmp1, Work& tmp2);
    
    VERIFICATION_CRITERIA:

    Compare sparse evaluations with dense full traversal and independent exact rational norms or squared Euclidean bounds. Check zero runs before, between and after nonzero coordinates, one-dimensional zeros, equal inexact rational coordinates, overlapping/disjoint supports, density and dimension boundaries, asymmetric supports, both directed and strict directions, raw/checked workspaces and each output alias. Compare final scratch values, floating-point bits and status, rounding state and unchanged sources. Count invocations for a custom specialization and inspect the skipping path's allocation behavior.

    SOURCE:

    src/Generator_inlines.hh; tests/generatorspec1.cc; tests/generatormetricsspec1.cc; tests/generatorsparsedistances1.cc.

  • 1. Generator kinds and numerical prerequisites UID: PPL-SPEC-000181 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Generator shall describe one of four geometric objects in a declared ambient dimension: an included rational point, a rational closure point, a ray direction or a line direction. For homogeneous integer coefficients ai and positive divisor d, point and closure-point coordinates shall be ai ⁄ d. A line shall admit arbitrary real multiples of its nonzero direction; a ray shall admit nonnegative real multiples. Closure points shall retain their distinct kind and shall not assert boundary inclusion. Internal divisor/strictness fields shall not become public coordinates.

    Use shall satisfy 🔗 3. Thread initialization, default state and finalization and require caller synchronization for overlapping modification of an object. Dense and sparse storage shall be supported, with default_representation equal to SPARSE. Computed construction, normalization, transformation and comparison guarantees shall require representability of every evaluated coefficient step/result in the selected profile. Unchecked completion shall not prove those preconditions. Allocation and numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete generator; distinct unchanged sources shall survive failures, while modified destinations shall remain destructible without universal rollback.

    RATIONALE:

    Point inclusion, closure and directional reachability have different geometric meanings even when their coordinate coefficients coincide.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Generator;
    enum Generator::Type { LINE, RAY, POINT, CLOSURE_POINT };
    static constexpr Representation Generator::default_representation = SPARSE;
    
    VERIFICATION_CRITERIA:

    Use independent exact rational point coordinates and direction-proportionality checks; distinguish positive ray scales from signed line scales and included points from closure points. Exercise all supported storage choices and trailing coordinates.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • 2. Construction of nonzero lines and rays UID: PPL-SPEC-000182 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    line(e) and ray(e) shall use the expression's homogeneous coefficients as their respective direction, ignore its constant term and retain its declared dimension. They shall use requested storage. A zero homogeneous direction, including a nonzero constant expression, shall throw std::invalid_argument. Results shall have primitive homogeneous coefficients; lines shall orient their first nonzero coefficient positively, while rays shall preserve orientation. Source expressions shall remain unchanged. Numerical prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    The zero vector is not a direction; nonzero expression constants do not change the represented line or ray.

    INTERFACE:
    static Generator Generator::line(const Linear_Expression& e,
      Representation r = default_representation);
    static Generator Generator::ray(const Linear_Expression& e,
      Representation r = default_representation);
    Generator line(const Linear_Expression& e, Representation r = Generator::default_representation);
    Generator ray(const Linear_Expression& e, Representation r = Generator::default_representation);
    
    VERIFICATION_CRITERIA:

    Check static/free forms, both direction signs, common factors, leading/trailing zeros, ignored constants and zero-direction rejection with unchanged sources.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000183
    3. Construction of rational points and closure points UID: PPL-SPEC-000183 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    point(e,d) and closure_point(e,d) shall respectively construct an included or closure point whose coordinates are the homogeneous coefficients of e divided by the entry value of nonzero d. They shall ignore the expression constant, retain its dimension and use requested storage. A negative divisor shall be accepted by reversing all coordinate numerators and making the stored divisor positive, preserving rational coordinates. The stored numerator/divisor tuple shall be primitive. Zero divisor shall throw std::invalid_argument and preserve sources.

    Omitted expressions shall denote the dimension-zero origin; omitted divisors shall be one. Representation-only overloads shall make that origin, and expression/representation overloads shall use divisor one. A divisor borrowed from the unchanged input expression shall be admitted using its entry value. The numerical prerequisites of 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    A numerator coefficient is not itself a point coordinate when the positive divisor differs from one.

    INTERFACE:
    static Generator Generator::point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Generator Generator::point(Representation r);
    static Generator Generator::point(const Linear_Expression& e, Representation r);
    static Generator Generator::closure_point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Generator Generator::closure_point(Representation r);
    static Generator Generator::closure_point(const Linear_Expression& e, Representation r);
    
    Generator point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Generator::default_representation);
    Generator point(Representation r);
    Generator point(const Linear_Expression& e, Representation r);
    Generator closure_point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Generator::default_representation);
    Generator closure_point(Representation r);
    Generator closure_point(const Linear_Expression& e, Representation r);
    
    VERIFICATION_CRITERIA:

    Compare exact rational coordinates for all static/free overloads, positive/negative divisors, common factors, origin/default arguments, borrowed divisor and ignored constants. Check retained dimensions, point/closure kind and zero-divisor rejection.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000184
    4. Default generator and shared zero-dimensional origins UID: PPL-SPEC-000184 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Default construction shall create the dimension-zero included origin using requested storage. zero_dim_point() and zero_dim_closure_point() shall return borrowed dimension-zero origins of their respective distinct types, with positive divisor. Shared values shall remain alive until owning-thread finalization. Owned copies shall retain their values independently.

    RATIONALE:

    The origin exists in dimension zero, but included-origin and closure-origin descriptors still have distinct topological roles.

    INTERFACE:
    explicit Generator(Representation r = default_representation);
    static const Generator& Generator::zero_dim_point();
    static const Generator& Generator::zero_dim_closure_point();
    
    VERIFICATION_CRITERIA:

    Check requested/default storage, kinds, dimensions and positive divisors for defaults/shared values and independent copies during balanced initialization.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000185
    5. Owned generator copying, assignment and swapping UID: PPL-SPEC-000185 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Ordinary copying shall preserve kind, dimension, exposed coefficients, divisor when applicable and source representation. Explicit-storage copying shall use requested storage. Assignment shall copy the complete entry value and source storage, return the target reference, preserve a distinct source and support self-assignment. Rvalue arguments shall admit the copy forms, retaining source value without requiring a distinct move operation. Copies shall survive later source mutation or destruction.

    Both swap forms shall exchange full values, dimension and storage; self-swap shall preserve the generator. Destruction shall release owned storage. Failure while constructing copy assignment's replacement shall leave the target unchanged.

    RATIONALE:

    Owning geometric descriptors must remain independent even when their values originated from shared constants or expression views.

    INTERFACE:
    Generator(const Generator& g);
    Generator(const Generator& g, Representation r);
    Generator& Generator::operator=(const Generator& g);
    Generator::~Generator();
    void Generator::m_swap(Generator& y);
    void swap(Generator& x, Generator& y);
    
    VERIFICATION_CRITERIA:

    Check every kind across both storage choices, assignment identity/self/rvalue forms, source destruction, mutation independence, swaps and replacement-copy allocation failures.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000186
    6. Generator representation conversion UID: PPL-SPEC-000186 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report current coefficient storage. Successful set_representation(r) for dense or sparse storage shall preserve kind, public dimension, exposed coefficients and applicable divisor while selecting r. Repeating current storage shall preserve the object. Failed replacement allocation shall leave its value and representation unchanged.

    RATIONALE:

    Storage conversion changes neither rational coordinates nor direction orientation or topological kind.

    INTERFACE:
    Representation Generator::representation() const;
    void Generator::set_representation(Representation r);
    
    VERIFICATION_CRITERIA:

    Convert all four kinds both directions, including rational coordinates and unused dimensions, comparing exact fields and independent geometric values. Check repeated conversion and replacement allocation failures.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000187
    7. Generator dimensions and dimensioned copying UID: PPL-SPEC-000187 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    space_dimension() shall report public ambient dimension and max_space_dimension() the expression dimension limit. Requested/result sizes shall not exceed that limit. Dimensioned copies and set_space_dimension(n) shall retain lower-index coordinates, zero-extend new coordinates or discard removed trailing coordinates. Normalization may rescale an equivalent direction or numerator/divisor tuple. Kind and storage shall remain unchanged. Resizing a line or ray shall require a nonzero retained direction; removal that can collapse a direction shall instead follow 🔗 9. Removing generator coordinates and collapsed directions. Dimensioned copies without explicit storage shall retain source storage.

    RATIONALE:

    Dimensioned generator copies transform coordinate tuples, while a zero direction cannot remain a valid line or ray.

    INTERFACE:
    static dimension_type Generator::max_space_dimension();
    dimension_type Generator::space_dimension() const;
    Generator(const Generator& g, dimension_type space_dim);
    Generator(const Generator& g, dimension_type space_dim, Representation r);
    void Generator::set_space_dimension(dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check point/closure shrink/extend to and from dimension zero, direction resizing that retains nonzero coefficients, trailing zeros, and equivalent rational coordinates/directions after normalization.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000188
    8. Generator coordinate permutation and zero insertion UID: PPL-SPEC-000188 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Swapping two in-dimension coordinates shall exchange their coefficients. A cycle of distinct in-dimension variables shall move each coefficient to the following listed coordinate, wrapping last to first; empty/singleton cycles shall preserve the generator. shift_space_dimensions(v,n) shall require v.id() <= space_dimension() and an admitted result dimension; it shall insert n zero coordinate slots before that position and increase dimension by n. A zero shift shall preserve value.

    These operations shall preserve kind and storage, and preserve applicable rational point coordinates or direction values according to their stated coordinate correspondence. Equivalent normalization may change stored scales. Divisor and internal strictness fields shall not become coordinates.

    RATIONALE:

    Coordinate rearrangement must respect topological and rational scaling information stored alongside the homogeneous tuple.

    INTERFACE:
    void Generator::swap_space_dimensions(Variable x, Variable y);
    void Generator::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Generator::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check every kind with inverse/self swaps, longer and empty cycles, leading zeros and front/interior/end insertion against independent tuple transformations.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000189
    9. Removing generator coordinates and collapsed directions UID: PPL-SPEC-000189 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    remove_space_dimensions(vars) shall require selected indices within the public dimension, discard those coefficients and compact surviving coordinates in their original order. Points and closure points shall retain their kind and rational remaining coordinates and return true. A line or ray whose retained direction is nonzero shall retain its geometric direction kind and return true. If its entire direction is removed, it shall become the included origin in the remaining coordinate space and return false. Removing no coordinates shall be admitted. Storage shall be retained and normalization may rescale equivalent tuples.

    RATIONALE:

    A removed direction contributes no displacement; the return status distinguishes that collapse from a surviving directional descriptor.

    INTERFACE:
    bool Generator::remove_space_dimensions(const Variables_Set& vars);
    
    VERIFICATION_CRITERIA:

    Remove none, interior, trailing and all coordinates from every kind. Check normalized remaining rational tuples, surviving directions, and the origin/type/false result when every nonzero direction component disappears.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000190
    10. Generator type, coefficients, divisor and borrowed expression UID: PPL-SPEC-000190 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    The kind predicates and type() shall identify the four public kinds exactly; is_line_or_ray() shall identify the two directional kinds. coefficient(v) shall expose a homogeneous numerator/direction coefficient for an in-dimension variable and otherwise throw std::invalid_argument. divisor() shall return a positive divisor for a point or closure point and otherwise throw std::invalid_argument.

    expression() shall borrow a read-only affine adapter with the public dimension and homogeneous coefficients, constant term zero, and no hidden strictness coordinate. It shall not encode the point divisor as a constant. The owner shall remain alive and unchanged for uses covered here. Copying that view to a Linear_Expression shall make an independent value. Configured coefficient references shall borrow their owner until mutation or destruction. Queries shall preserve source value.

    RATIONALE:

    A public expression view gives numerators/directions, while obtaining a rational point still requires the separate divisor.

    INTERFACE:
    Generator::Type Generator::type() const;
    bool Generator::is_line() const;
    bool Generator::is_ray() const;
    bool Generator::is_line_or_ray() const;
    bool Generator::is_point() const;
    bool Generator::is_closure_point() const;
    Coefficient_traits::const_reference Generator::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Generator::divisor() const &;
    typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression>> Generator::expr_type;
    Generator::expr_type Generator::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check predicate tables, in-range values, rejected first/later coordinates and rejected directional divisor access. Materialize views for every kind and verify zero constant, hidden-column exclusion and independence after source modification.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000191
    11. Geometric equivalence and stored generator identity UID: PPL-SPEC-000191 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_equivalent_to and generator equality shall compare equal-dimension, equal-kind geometric objects independently of storage and internal topology. Point and closure-point comparisons shall use exact rational coordinates and keep their kinds distinct. Ray directions shall compare equivalent exactly for positive proportionality; line directions shall admit either nonzero proportionality sign. Different dimensions or kinds shall compare unequal. Inequality expressions shall negate equivalence.

    is_equal_to shall compare the complete stored normalized descriptor, including topology and fields, independently of dense/sparse storage. Positive identity shall imply equivalence; negative identity shall not imply geometric inequality. Queries shall preserve operands. Arithmetic prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply.

    RATIONALE:

    Normalizing numerators without their divisor can change point coordinates, and positive versus signed proportionality distinguishes rays from lines.

    INTERFACE:
    bool Generator::is_equivalent_to(const Generator& y) const;
    bool Generator::is_equal_to(const Generator& y) const;
    bool operator==(const Generator& x, const Generator& y);
    // Inequality uses C++20 rewriting of operator==.
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Compare exact rational points with common/different scales, same/opposite ray and line directions, kind differences and trailing dimensions. Include equivalent/different included points and directions promoted through NNC generator systems, preserving divisor information.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000192
    12. Reloadable generator representation UID: PPL-SPEC-000192 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export the full stored coefficient expression, public kind token and topology token; ascii_dump() shall use std::cerr. Export shall preserve the source. A complete compatible representation with representable coefficients shall load with true, replacing kind, coefficients, divisor and public dimension while retaining destination storage.

    Malformed/truncated expression, kind or topology fields, missing required coefficient slots, invalid directional zero vectors, nonpositive point divisors, violations of the checked row invariants and inconsistent kind/topology combinations shall return false rather than be accepted as valid generators. If expression loading fails, ascii_load(s) shall return false without reading the kind or topology suffix. Trailing input shall remain available. Failure may modify the target but shall leave it destructible and replaceable by a complete valid load. No rollback or cross-version format stability is promised; allocation and numerical exceptions may propagate.

    RATIONALE:

    A reloaded generator needs valid rational scaling, nonzero directional data and correct topological kind, in addition to syntactically complete input.

    INTERFACE:
    void Generator::ascii_dump(std::ostream& s) const;
    void Generator::ascii_dump() const;
    bool Generator::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip all kinds, rational points, gaps and trailing dimensions across destination storage. Compare independent geometric values and exact fields; reject malformed/truncated fields, missing slots, zero directions and invalid divisors/kinds, then exercise complete replacement. Reject invalid expression prefixes followed by otherwise valid kind/topology suffixes, checking that those suffixes remain unread. Reject complete zero line/ray records, nonpositive point divisors, missing NNC epsilon storage and inconsistent epsilon fields with assertions enabled or disabled, across destination storage. After false, perform only complete valid replacement before querying the target; preserve trailing input.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000193
    13. Readable generator, type and system output UID: PPL-SPEC-000193 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Generator output shall use l(...), r(...), p(...) and c(...) for its respective kind. Inside, it shall print the homogeneous numerator or direction using active variable formatting and the coefficient sign/unit conventions of 🔗 14. Human-readable affine output and formatter dispatch. A zero tuple shall print 0. For point/closure divisor other than one it shall append / and that divisor, putting parentheses around a nonzero numerator expression. Type output shall print LINE, RAY, POINT or CLOSURE_POINT exactly.

    System output shall print its public iterator range separated by ", ", or false when there are no generators. Operators shall return the supplied stream, add no newline and preserve source values. Each type's print() shall use that output on std::cerr. Formatting coefficient negations shall satisfy the selected arithmetic profile's preconditions.

    RATIONALE:

    Readable output preserves kind and rational scaling, while an empty generator list describes an empty generated set.

    INTERFACE:
    namespace IO_Operators {
      std::ostream& operator<<(std::ostream& s, const Generator& g);
      std::ostream& operator<<(std::ostream& s, const Generator::Type& type);
      std::ostream& operator<<(std::ostream& s, const Generator_System& gs);
    }
    void Generator::print() const;
    void Generator_System::print() const;
    
    VERIFICATION_CRITERIA:

    Check literal all-kind/type formats, rational/nonrational origins, signs, custom coordinate names, empty and multirow systems, separators, return identity and redirected standard-error output.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000194
    14. Generator and system invariants and memory accounting UID: PPL-SPEC-000194 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    OK() shall report the checked representation invariants of its generator or system. Values produced by successful operations under their valid-input and arithmetic preconditions shall satisfy them. Each type's total memory count shall equal its sizeof plus its external memory count. Queries shall preserve geometric fields, kind, dimension and storage. Counts shall not promise allocator overhead, process resident memory or dense/sparse size ordering.

    RATIONALE:

    Ownership accounting and storage invariants concern valid representations rather than deciding membership in a generated polyhedron.

    INTERFACE:
    bool Generator::OK() const;
    memory_size_type Generator::total_memory_in_bytes() const;
    memory_size_type Generator::external_memory_in_bytes() const;
    bool Generator_System::OK() const;
    memory_size_type Generator_System::total_memory_in_bytes() const;
    memory_size_type Generator_System::external_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check all kinds and rational tuples, empty/populated systems, copies/conversions and memory identities with preserved semantic fields, without architecture-specific byte totals.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • 15. Generator-system hull meaning and construction UID: PPL-SPEC-000195 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Generator_System with lines L, rays R, included points P and closure points C shall generate exactly the real vectors

     ∑p ∈ Pλpp +  ∑c ∈ Cγcc +  ∑r ∈ Rρrr +  ∑l ∈ Lτll, 

    where λp, γc, ρr ≥ 0, τl ∈ ℝ, ∑pλp + ∑cγc = 1 and ∑pλp > 0. Thus a system without an included supporting point shall generate the empty set, even when directions or closure points are stored. Its meaning shall be a generated hull, not a conjunction of point membership conditions.

    Default construction shall have dimension zero and no rows. Singleton construction shall own a copy of its generator and adopt its dimension. Requested storage shall be used, with default SPARSE. zero_dim_univ() shall borrow the singleton included origin generating the universe of the zero-dimensional space until owning-thread finalization. Use/failure prerequisites shall follow 🔗 1. Generator kinds and numerical prerequisites.

    RATIONALE:

    Positive total weight on included points distinguishes an NNC hull from the closed convex hull of closure points alone.

    INTERFACE:
    class Generator_System;
    static constexpr Representation Generator_System::default_representation = SPARSE;
    Generator_System(Representation r = default_representation);
    explicit Generator_System(const Generator& g, Representation r = default_representation);
    static const Generator_System& Generator_System::zero_dim_univ();
    
    VERIFICATION_CRITERIA:

    Check empty, direction-only, closure-only and supported systems with independent low-dimensional generated sets. Include a closed segment, an open segment with interior supporting point, a ray and a line through an offset point; distinguish zero-dimensional empty and universal systems.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000196
    16. Owned generator systems and storage conversion UID: PPL-SPEC-000196 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall preserve generated hull, public dimension and source storage; an explicit-storage overload shall use its argument. Assignment shall copy the source entry value and representation, return the target reference, preserve a distinct source and support self-assignment. Rvalue copy forms shall retain source value without requiring a distinct move operation. Copies shall remain independent of later source modification/destruction.

    Swaps shall exchange complete system values, dimension and storage, including self-swap. Successful representation conversion shall select dense or sparse storage for all rows while preserving the generated hull and dimension. Destruction shall release owned rows. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Generator kinds and numerical prerequisites.

    RATIONALE:

    An owning generator system may change row storage without changing the geometry or inclusion of its generated boundary.

    INTERFACE:
    Generator_System(const Generator_System& gs);
    Generator_System(const Generator_System& gs, Representation r);
    Generator_System& Generator_System::operator=(const Generator_System& y);
    Generator_System::~Generator_System();
    Representation Generator_System::representation() const;
    void Generator_System::set_representation(Representation r);
    void Generator_System::m_swap(Generator_System& y);
    void swap(Generator_System& x, Generator_System& y);
    
    VERIFICATION_CRITERIA:

    Check empty and all-kind systems across copies/conversions, self/rvalue assignment, return identity, swaps and source destruction, comparing independent geometric tuples and generated-set examples.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000197
    17. Generator insertion and coefficient ownership transfer UID: PPL-SPEC-000197 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion shall add a copy of the generator to the system's geometric generator collection, preserving the source and target storage. Result dimension shall be the maximum input dimension; shorter tuples shall be zero-extended. Inserting a closure point shall retain its topological role; any necessary internal conversion shall preserve the public coordinates and kind of existing generators. Duplicates or redundant generators may be reordered/removed provided the generated hull is preserved. Publicly retrieved rows need not reproduce insertion order or multiplicity.

    Rvalue insertion shall transfer a generator not borrowed from the target, producing the same generated hull as copying it. The source shall remain destructible; no unchanged-value guarantee shall apply to it. Ordinary insertion of a borrowed row from the same target shall use its entry value. Numerical/failure prerequisites in 🔗 1. Generator kinds and numerical prerequisites shall apply.

    Const row sources, including const rvalues, shall use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Adding a generator expands a geometric description and can require NNC representation, without conjoining a new constraint.

    INTERFACE:
    void Generator_System::insert(const Generator& g);
    void Generator_System::insert(Generator&& g);
    
    VERIFICATION_CRITERIA:

    Check mixed dimensions, borrowed-row insertion, duplicate/closure/ray/line insertion and recycled ownership. Verify unchanged copied sources and preserved existing rational coordinates when closure-point insertion promotes a closed system.

    SOURCE:

    tests/consuminginsertions1.cc; src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000198
    18. System dimensions, coordinate truncation and container emptiness UID: PPL-SPEC-000198 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall report the generator limit and space_dimension() the declared ambient dimension. For admitted dimension n, resizing shall zero-extend new coordinates or discard removed trailing coordinates in every generator. Points/closure points shall retain the corresponding remaining rational coordinates; lines/rays whose directions collapse to zero shall be removed. The resulting generated hull shall have the corresponding coordinate image, including when no supporting point was present. Representation shall be retained.

    empty() shall report absence of stored generators, not geometric emptiness of a direction-only or closure-only generated hull. clear() shall remove all generators and reset dimension zero while retaining storage. An empty system may be resized to positive ambient dimension.

    RATIONALE:

    Generator coordinate projection drops collapsed directions, while container emptiness remains distinct from the need for a supporting included point.

    INTERFACE:
    static dimension_type Generator_System::max_space_dimension();
    dimension_type Generator_System::space_dimension() const;
    void Generator_System::set_space_dimension(dimension_type n);
    bool Generator_System::empty() const;
    void Generator_System::clear();
    
    VERIFICATION_CRITERIA:

    Check positive-dimensional empty systems, every-kind resizing, collapsed directions removed during shrinking, zero-dimensional projections, clear/reuse and direction-only systems that are nonempty containers but generate no points.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • PPL-SPEC-000199
    19. Read-only forward iteration over public generators UID: PPL-SPEC-000199 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    begin() and end() shall delimit a generator collection with the system's public dimension and the same generated hull. It may suppress a closure point immediately followed by an included point at the same rational coordinates. No public iteration order or duplicate multiplicity shall be promised. Dereference/member access shall borrow a retained generator.

    Iterator copy/assignment shall preserve borrowed system and position with independent later navigation. Prefix increment shall return the advanced iterator; postfix shall return its entry-position copy. Comparison shall require iterators into the same unchanged system. Defaults shall admit copying, assignment and destruction before valid-position assignment. Modification/destruction shall invalidate iterators and borrowed rows.

    RATIONALE:

    Equivalent included and closure-point companions need not both be exposed, while remaining generators must preserve the same hull.

    INTERFACE:
    typedef Generator_System_const_iterator Generator_System::const_iterator;
    Generator_System::const_iterator Generator_System::begin() const;
    Generator_System::const_iterator Generator_System::end() const;
    Generator_System_const_iterator();
    Generator_System_const_iterator(const Generator_System_const_iterator& y);
    Generator_System_const_iterator::~Generator_System_const_iterator();
    Generator_System_const_iterator& Generator_System_const_iterator::operator=(const Generator_System_const_iterator& y);
    const Generator& Generator_System_const_iterator::operator*() const;
    const Generator* Generator_System_const_iterator::operator->() const;
    Generator_System_const_iterator& Generator_System_const_iterator::operator++();
    Generator_System_const_iterator Generator_System_const_iterator::operator++(int);
    bool Generator_System_const_iterator::operator==(const Generator_System_const_iterator& y) const;
    bool Generator_System_const_iterator::operator!=(const Generator_System_const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty, mixed and matching-companion ranges, exact rational coordinates and public dimensions. Exercise copied/default-assigned positions, prefix/postfix return semantics and borrowed pointer/reference identity.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc; tests/generatorbranches1.cc.

  • PPL-SPEC-000200
    20. Reloadable generator-system representation UID: PPL-SPEC-000200 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export full stored rows, dimension, topology, representation and required row-state fields; ascii_dump() shall use std::cerr. Export shall preserve source value. A complete compatible export with representable coefficients shall load with true, replacing the target with the encoded generated hull, public dimension and encoded storage choice.

    Malformed/truncated headers or rows, invalid generator fields and inconsistent encoded dimensions or row-state fields shall return false rather than be accepted as valid systems. Trailing input shall remain available. Failure may modify a destination but shall leave it destructible and replaceable by a complete valid load. No rollback/cross-version format stability is promised; allocation and configured numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    A generator-system reload must retain supporting-point inclusion and closure data as well as rational coordinate scaling.

    INTERFACE:
    void Generator_System::ascii_dump(std::ostream& s) const;
    void Generator_System::ascii_dump() const;
    bool Generator_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimensional, direction-only, point/closure and all-kind systems across initial destination storage choices. Compare encoded dimensions/storage and independent generated-set examples; reject malformed/truncated rows and inconsistent structural fields. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Generator_defs.hh; src/Generator_inlines.hh; src/Generator.cc; src/Generator_System_defs.hh; src/Generator_System_inlines.hh; src/Generator_System.cc; tests/generatorspec1.cc.

  • 1. Grid-generator values and integer versus continuous displacement UID: PPL-SPEC-000221 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    A Grid_Generator shall describe a rational included point, a rational parameter displacement vector, or a continuous line direction, in its public ambient dimension. For a point or parameter with numerators ai and positive divisor d, coordinates shall be ai ⁄ d. Parameters shall retain their exact rational step, including sign and magnitude; integer multiples of that step shall contribute to a generated grid. Lines shall contribute arbitrary real multiples of their direction. Hidden divisor fields shall not be public coordinates.

    Both storage representations shall be supported; default_representation shall be SPARSE. Initialization and synchronization shall follow 🔗 3. Thread initialization, default state and finalization. Computed construction, transformation, scaling and comparison guarantees shall require all evaluated coefficient steps/results to be representable in the selected profile; unchecked completion shall not prove that condition. Allocation/numerical exceptions may propagate. Failed construction shall release resources owned by the incomplete grid generator; distinct unchanged sources shall survive failures, while modified targets shall remain destructible without universal rollback.

    RATIONALE:

    A parameter is a sized displacement vector rather than a scale-free direction. Its exact value is separate from the integer span it contributes to a grid.

    INTERFACE:

    Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library.

    class Grid_Generator;
    enum Grid_Generator::Type { LINE, PARAMETER, POINT };
    static constexpr Representation Grid_Generator::default_representation = SPARSE;
    
    VERIFICATION_CRITERIA:

    Compare independent rational point/parameter vectors and line proportionality. Distinguish rational/integral displacements, scaled and opposite parameters, continuous lines and integer steps.

    BIBLIOGRAPHY:

    BagnaraHZ08SCP | Section 2.4, equation (1) and parameter representation BagnaraDHMZ07 | Section 3, The Generator Representation

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000222
    2. Construction of nonzero grid-line directions UID: PPL-SPEC-000222 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    grid_line(e,r) shall construct a line from homogeneous coefficients, ignore the constant, retain declared dimension and use requested storage. It shall produce a primitive direction with first nonzero coefficient positive. A zero homogeneous direction, including a nonzero constant expression, shall throw std::invalid_argument without modifying its source. Static and free forms shall agree geometrically. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Continuous direction is unchanged by nonzero common scaling and cannot be constructed from the zero vector.

    INTERFACE:
    static Grid_Generator Grid_Generator::grid_line(const Linear_Expression& e,
      Representation r = default_representation);
    Grid_Generator grid_line(const Linear_Expression& e,
      Representation r = Grid_Generator::default_representation);
    
    VERIFICATION_CRITERIA:

    Check static/free factories, both signs, common factors, ignored constants, gaps, trailing dimensions and zero-direction rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000223
    3. Exact rational parameter construction including zero steps UID: PPL-SPEC-000223 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    parameter(e,d,r) shall create the rational displacement with coordinates ai ⁄ d from the homogeneous input coefficients, ignoring the constant, retaining dimension and using requested storage. Nonzero negative divisors shall be accepted by reversing numerator/divisor signs to make stored divisor positive while preserving the exact signed step. The parameter's magnitude shall not be normalized as a line direction. Zero displacement shall be admitted and retain its dimension. Zero divisor shall throw std::invalid_argument and preserve sources.

    Defaults shall use dimension-zero zero expression, divisor one and default storage. Representation-only and expression/representation forms shall use divisor one. A divisor borrowed from the unchanged input expression shall be admitted using its entry value. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Dividing a parameter vector without its divisor changes its periodic step. Zero is a valid redundant displacement descriptor.

    INTERFACE:
    static Grid_Generator Grid_Generator::parameter(
      const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Grid_Generator Grid_Generator::parameter(Representation r);
    static Grid_Generator Grid_Generator::parameter(const Linear_Expression& e, Representation r);
    Grid_Generator parameter(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Grid_Generator::default_representation);
    Grid_Generator parameter(Representation r);
    Grid_Generator parameter(const Linear_Expression& e, Representation r);
    
    VERIFICATION_CRITERIA:

    Check every static/free/default form, signed/nonunit divisors, common factors, exact doubled/opposite steps, zero parameters with positive dimension, borrowed divisor and zero-divisor rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000224
    4. Rational grid-point construction, defaults and shared origin UID: PPL-SPEC-000224 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    grid_point(e,d,r) shall construct the rational point with coordinates ai ⁄ d, ignoring the expression constant, retaining dimension and using requested storage. A negative nonzero divisor shall reverse numerator signs and become positive; common factors may be removed while preserving rational coordinates. Zero divisor shall throw std::invalid_argument. A divisor borrowed from the unchanged input expression shall use its entry value.

    Omitted expression/divisor arguments shall denote the dimension-zero origin and divisor one. Representation-only and expression/representation forms shall use divisor one. Default construction shall produce that origin using requested storage. zero_dim_point() shall borrow the zero-dimensional origin until owning-thread finalization; owned copies shall be independent.

    RATIONALE:

    A rational supporting point fixes a grid offset and differs from a periodic parameter at the same coordinate vector.

    INTERFACE:
    static Grid_Generator Grid_Generator::grid_point(
      const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = default_representation);
    static Grid_Generator Grid_Generator::grid_point(Representation r);
    static Grid_Generator Grid_Generator::grid_point(const Linear_Expression& e, Representation r);
    Grid_Generator grid_point(const Linear_Expression& e = Linear_Expression::zero(),
      Coefficient_traits::const_reference d = Coefficient_one(), Representation r = Grid_Generator::default_representation);
    Grid_Generator grid_point(Representation r);
    Grid_Generator grid_point(const Linear_Expression& e, Representation r);
    explicit Grid_Generator(Representation r = default_representation);
    static const Grid_Generator& Grid_Generator::zero_dim_point();
    
    VERIFICATION_CRITERIA:

    Check all static/free/default forms, positive/negative divisors, origins in different dimensions, exact rational coordinates and shared lifetime, input aliases and zero-divisor rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000225
    5. Owned grid-generator copying, assignment and swaps UID: PPL-SPEC-000225 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall preserve exact fields, kind, dimension and source representation; explicit-storage copies shall select their argument. Assignment shall copy complete entry value/storage, preserve distinct sources, return the target and admit self-assignment. Rvalue inputs shall admit copy forms retaining source value without requiring a distinct move operation. Copies shall remain independent of source mutation/destruction. Swaps shall exchange complete values, dimension and storage; self-swap shall preserve them. Destruction shall release owned storage. Failure during copy assignment's replacement construction shall preserve the target.

    RATIONALE:

    Each grid-generator object owns its expression and divisor fields independently.

    INTERFACE:
    Grid_Generator(const Grid_Generator& g);
    Grid_Generator(const Grid_Generator& g, Representation r);
    Grid_Generator& Grid_Generator::operator=(const Grid_Generator& g);
    Grid_Generator::~Grid_Generator();
    void Grid_Generator::m_swap(Grid_Generator& y);
    void swap(Grid_Generator& x, Grid_Generator& y);
    
    VERIFICATION_CRITERIA:

    Check all kinds, exact rational parameter/point fields, representation choices, return identity, self/rvalue forms, surviving copies, swaps and replacement-copy failures.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000226
    6. Grid-generator storage conversion UID: PPL-SPEC-000226 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    representation() shall report storage. Successful conversion to dense or sparse representation shall select requested storage and preserve exact coefficients, divisor when applicable, kind and dimension. Repeating the current choice shall preserve the object. Failed replacement allocation shall leave its original value and storage unchanged.

    RATIONALE:

    Representation conversion must preserve parameter magnitude as well as point coordinates and line orientation.

    INTERFACE:
    Representation Grid_Generator::representation() const;
    void Grid_Generator::set_representation(Representation r);
    
    VERIFICATION_CRITERIA:

    Convert every kind in both directions, including unnormalized numerator/divisor tuples and zero parameters, checking exact fields and allocation-failure preservation.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000227
    7. Grid-generator dimensions and coordinate removal UID: PPL-SPEC-000227 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall equal the linear-expression limit minus one, reserving the internal divisor coordinate. space_dimension() shall report public dimension. Dimensioned copies and resizing shall require admitted result dimensions, retain lower-index coordinates and zero-extend or discard trailing coordinates. Explicit-storage copies shall use their argument; other copies shall retain source storage.

    remove_space_dimensions(vars) shall require in-dimension selected indices, discard those coordinate coefficients, compact retained coordinates in their original order and return true. Removing none/all shall be admitted. Kind, storage and applicable rational remaining coordinates shall be retained. A transformed zero parameter or zero line direction shall contribute no displacement, without supplying a supporting point.

    RATIONALE:

    A reserved divisor field must follow dimension changes without being mistaken for a coordinate; collapsed steps contribute zero displacement.

    INTERFACE:
    static dimension_type Grid_Generator::max_space_dimension();
    dimension_type Grid_Generator::space_dimension() const;
    Grid_Generator(const Grid_Generator& g, dimension_type space_dim);
    Grid_Generator(const Grid_Generator& g, dimension_type space_dim, Representation r);
    void Grid_Generator::set_space_dimension(dimension_type n);
    bool Grid_Generator::remove_space_dimensions(const Variables_Set& vars);
    
    VERIFICATION_CRITERIA:

    Check dimensioned copies, zero/trailing dimensions, shrink/extend and none/interior/all removals for all kinds. Compare exact rational vectors or retained line spans, preserving divisor and kind while excluding hidden columns.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000228
    8. Grid-generator coordinate permutation and zero insertion UID: PPL-SPEC-000228 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Swapping in-dimension variables shall exchange their coordinate coefficients. A cycle shall require distinct in-dimension variables and move each listed coefficient to the following listed position, wrapping last to first. Empty and singleton cycles shall preserve the object. Inserting zero coordinates before v.id() <= space_dimension() shall shift the suffix and increase dimension by the requested admitted amount; a zero shift shall preserve value. Kinds, storage and applicable rational point/parameter values shall follow that coordinate correspondence. A line may be reoriented by equivalent sign normalization; a parameter's sign and exact step shall be preserved.

    RATIONALE:

    Sign normalization valid for continuous lines would change an explicitly directed parameter vector.

    INTERFACE:
    void Grid_Generator::swap_space_dimensions(Variable x, Variable y);
    void Grid_Generator::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Grid_Generator::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Use independent tuple swaps/cycles and front/interior/end zero insertion, including negative-leading parameters, zero parameters and rational points with nonunit divisors.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000229
    9. Grid-generator kind, coefficient, divisor and expression queries UID: PPL-SPEC-000229 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Borrowed coefficient and expression accessors shall require an lvalue receiver, with corresponding const && overloads deleted in every coefficient profile. Copying a borrowed expression view shall not extend the owning descriptor's lifetime.

    Kind predicates and type() shall identify line, parameter and point; is_line_or_parameter() and is_parameter_or_point() shall identify their named unions. coefficient(v) shall expose a public coordinate numerator or direction coefficient, rejecting v.id() >= space_dimension() with std::invalid_argument. divisor() shall return a positive divisor for parameters/points and reject lines with std::invalid_argument. all_homogeneous_terms_are_zero() shall inspect only public homogeneous coordinates, excluding divisor fields.

    expression() shall borrow a read-only view of the public homogeneous coefficients, with public dimension and constant zero, hiding divisor fields. The owner shall remain alive and unchanged for covered view uses. Materializing the view shall yield an independent Linear_Expression. Configured returned references shall borrow until owner mutation/destruction. Queries shall preserve source values.

    RATIONALE:

    Public homogeneous queries exclude both the point divisor and the parameter's separate internal divisor coordinate.

    INTERFACE:
    Grid_Generator::Type Grid_Generator::type() const;
    bool Grid_Generator::is_line() const;
    bool Grid_Generator::is_parameter() const;
    bool Grid_Generator::is_point() const;
    bool Grid_Generator::is_line_or_parameter() const;
    bool Grid_Generator::is_parameter_or_point() const;
    Coefficient_traits::const_reference Grid_Generator::coefficient(Variable v) const &;
    Coefficient_traits::const_reference Grid_Generator::divisor() const &;
    bool Grid_Generator::all_homogeneous_terms_are_zero() const;
    typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression>> Grid_Generator::expr_type;
    Grid_Generator::expr_type Grid_Generator::expression() const &;
    
    VERIFICATION_CRITERIA:

    Check every predicate combination, exact coefficients/divisors, zero tests, first/later out-of-range access and line-divisor rejection. Materialize views and verify hidden-column exclusion and independence.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000230
    10. Explicit replacement of a rational generator divisor UID: PPL-SPEC-000230 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a point or parameter and positive input d, set_divisor(d) shall replace only its divisor using the input entry value, preserving coordinate numerators, dimension, kind and storage. It shall therefore change the rational vector when the divisor changes. A divisor borrowed from the same object shall be admitted. Calling it on a line shall throw std::invalid_argument without changing that line.

    RATIONALE:

    Replacing a divisor changes rational coordinates; it is different from scaling a representation to an equivalent divisor.

    INTERFACE:
    void Grid_Generator::set_divisor(Coefficient_traits::const_reference d);
    
    VERIFICATION_CRITERIA:

    Check point/parameter divisor replacement, self-divisor and positive borrowed-coordinate inputs with unchanged numerators. Compare changed rational vectors and verify documented line rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000231
    11. Value-preserving scaling to a common positive divisor UID: PPL-SPEC-000231 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a point or parameter, scale_to_divisor(d) shall require a positive d that is an exact multiple of the current positive divisor. It shall set the divisor to d and multiply all public numerators by the same positive ratio, preserving exact rational vector, kind, dimension and storage. Reusing the current divisor shall preserve exact fields. Borrowed inputs from the same object shall use their entry values. For a line and any admitted positive d it shall do nothing. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Common-denominator maintenance preserves an exact parameter step, unlike plain divisor replacement.

    INTERFACE:
    void Grid_Generator::scale_to_divisor(Coefficient_traits::const_reference d);
    
    VERIFICATION_CRITERIA:

    Check exact multiples, unchanged divisor, point/parameter rational preservation, borrowed divisor and positive coefficient multiples, line no-op and representable product boundaries.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000232
    12. Grid-generator equivalence and stored identity UID: PPL-SPEC-000232 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    is_equivalent_to and equality shall compare equal-kind, equal-dimension generators independently of storage. Points and parameters shall compare their exact rational vectors, including parameter sign and magnitude. Opposite parameter vectors may generate the same integer span but shall remain distinct parameter values. Lines shall compare their real direction spans, admitting opposite nonzero scales. Different dimensions/kinds shall compare unequal. Inequality shall negate equivalence.

    is_equal_to shall compare complete stored fields and kind independently of storage. Positive identity shall imply equivalence; a negative identity shall not prove different geometric values. Queries shall preserve sources. Numerical prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    RATIONALE:

    Exact parameter vectors and the grids generated by their integer spans support different equivalence questions.

    INTERFACE:
    bool Grid_Generator::is_equivalent_to(const Grid_Generator& y) const;
    bool Grid_Generator::is_equal_to(const Grid_Generator& y) const;
    bool operator==(const Grid_Generator& x, const Grid_Generator& y);
    // Inequality uses C++20 rewriting of operator==.
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Compare independently equal rational tuples with unreduced common factors, changed point/parameter magnitudes and opposite signs, line scales/signs, dimensions and representations. Include transformed lines whose leading nonzero sign changes after removal.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000233
    13. Reloadable grid-generator representation UID: PPL-SPEC-000233 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export all stored coefficient/divisor fields and the public kind token; the no-argument form shall use std::cerr. Export shall preserve the source. Compatible complete exported data with representable coefficients shall load with true, replacing the generator's fields and public dimension while retaining destination storage.

    Malformed/truncated expression or kind fields, missing internal divisor slots, nonpositive point/parameter divisors and encoded kind/field mismatches shall return false rather than be accepted as valid generators. Trailing input shall remain available. A failed target shall remain destructible and admit complete valid replacement, without rollback or cross-version format promises. Allocation and numerical exceptions may propagate.

    RATIONALE:

    A declared point token must not silently load as a parameter merely because its coefficient fields encode that different kind.

    INTERFACE:
    void Grid_Generator::ascii_dump(std::ostream& s) const;
    void Grid_Generator::ascii_dump() const;
    bool Grid_Generator::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip all kinds, zero/nonzero parameters, rational and unreduced tuples across destination choices. Check exact kind/divisor/coordinate fields and reject malformed/truncated expressions, kind mismatches, invalid counts/divisors and unsupported structure. Reject missing hidden divisor storage, nonpositive parameter/point divisors and inconsistent point/line fields through false rather than assertion failure. Exercise dense/sparse destination replacement and preserve positive-divisor zero parameters and valid line records retaining hidden divisor metadata.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000234
    14. Readable grid-generator, kind and system output UID: PPL-SPEC-000234 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Grid-generator output shall use l(...), q(...) or p(...) for line, parameter or point, printing public homogeneous coefficients with the active formatter and sign/unit conventions of 🔗 14. Human-readable affine output and formatter dispatch. Zero tuples shall print 0. A nonunit point/parameter divisor shall be printed after /, with parentheses around a nonzero numerator expression. Kind output shall print LINE, PARAMETER or POINT.

    System output shall print its public generators separated by ", ", or false for an empty range. Output shall return the supplied stream, add no newline and preserve source values. Each type's print() shall use that output on std::cerr. Evaluated coefficient negations shall be representable.

    RATIONALE:

    Display retains parameter step size and rational scaling without exposing internal divisor columns.

    INTERFACE:
    namespace IO_Operators {
      std::ostream& operator<<(std::ostream& s, const Grid_Generator& g);
      std::ostream& operator<<(std::ostream& s, const Grid_Generator::Type& type);
      std::ostream& operator<<(std::ostream& s, const Grid_Generator_System& gs);
    }
    void Grid_Generator::print() const;
    void Grid_Generator_System::print() const;
    
    VERIFICATION_CRITERIA:

    Check literal all-kind/type output, unreduced parameters, rational/zero vectors, custom variable names, empty/multirow systems, separators, stream identity and standard-error printing.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000235
    15. Grid-generator-system integer-affine span and construction UID: PPL-SPEC-000235 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For lines L, parameters Q and included points P, a Grid_Generator_System shall generate the real vectors

     ∑l ∈ Lτll +  ∑q ∈ Qkqq +  ∑p ∈ Pzpp,   τl ∈ ℝ,  kq, zp ∈ ℤ,   ∑p ∈ Pzp = 1.

    Without a point the generated grid shall be empty, even with stored nonzero lines/parameters. Integer affine combinations of multiple points shall not be replaced by convex combinations. Default construction shall make a zero-dimensional system with no rows; an explicit dimension constructor shall retain its supplied admitted dimension. Singleton construction shall copy its generator and dimension, including a zero parameter. Ordinary insertion shall separately follow 🔗 17. Grid-generator insertion, zero steps and ownership transfer. Requested storage shall be used, with default SPARSE. zero_dim_univ() shall borrow the singleton zero-dimensional origin until owning-thread finalization. Numerical/use/failure prerequisites shall follow 🔗 1. Grid-generator values and integer versus continuous displacement.

    RATIONALE:

    Grid generation combines integer affine offsets and integer parameter steps with continuous line spans; a convex hull would admit incorrect fractional displacements.

    INTERFACE:
    class Grid_Generator_System;
    static constexpr Representation Grid_Generator_System::default_representation = SPARSE;
    explicit Grid_Generator_System(Representation r = default_representation);
    explicit Grid_Generator_System(dimension_type dim, Representation r = default_representation);
    explicit Grid_Generator_System(const Grid_Generator& g, Representation r = default_representation);
    static const Grid_Generator_System& Grid_Generator_System::zero_dim_univ();
    
    VERIFICATION_CRITERIA:

    Check supporting-point absence, rational offsets, half-integer steps, points at zero and two generating even integers, continuous line directions and zero-dimensional empty/universal systems against independent lattice equations.

    BIBLIOGRAPHY:

    BagnaraHZ08SCP | Section 2.4, equation (1) and parameter representation BagnaraDHMZ07 | Section 3, The Generator Representation

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000236
    16. Owned grid-generator systems and representation comparison UID: PPL-SPEC-000236 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copies/assignment shall preserve generated grid, declared dimension and retained row sequence. Ordinary copies and assignment shall retain source storage, while explicit-storage copies shall use their argument. Assignment shall return the target, preserve distinct sources, admit self-assignment and retain source value under rvalue copy forms. Copies shall survive source mutation/destruction. Swaps shall exchange full values, dimensions and storage, including self-swap. Successful representation conversion shall select dense or sparse row storage and preserve the generated grid and dimension. Copy-assignment replacement failure shall preserve the target; other failures shall follow 🔗 1. Grid-generator values and integer versus continuous displacement.

    is_equal_to and system equality shall compare declared dimensions and retained row sequence using equivalent corresponding generators, not decide equality of arbitrarily reordered or redundant generated grids. Comparison shall ignore dense/sparse choice. Destruction shall release owned storage.

    RATIONALE:

    Owning row-sequence comparison remains distinct from equality of the lattice or continuous affine set generated by a system.

    INTERFACE:
    Grid_Generator_System(const Grid_Generator_System& gs);
    Grid_Generator_System(const Grid_Generator_System& gs, Representation r);
    Grid_Generator_System& Grid_Generator_System::operator=(const Grid_Generator_System& y);
    Grid_Generator_System::~Grid_Generator_System();
    Representation Grid_Generator_System::representation() const;
    void Grid_Generator_System::set_representation(Representation r);
    void Grid_Generator_System::m_swap(Grid_Generator_System& y);
    void swap(Grid_Generator_System& x, Grid_Generator_System& y);
    bool Grid_Generator_System::is_equal_to(const Grid_Generator_System& y) const;
    bool operator==(const Grid_Generator_System& x, const Grid_Generator_System& y);
    
    VERIFICATION_CRITERIA:

    Check copy/self/rvalue forms, swaps/conversions and destruction independence for empty and mixed systems. Compare matching sequences across storage, different dimensions/counts and changed rows without inferring a general grid-equivalence decision.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • 17. Grid-generator insertion, zero steps and ownership transfer UID: PPL-SPEC-000237 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Const-reference insertion shall add a copy of a grid generator to the generating collection, preserve its source and retain target storage. Result dimension shall be the maximum input dimension, zero-extending shorter rows. A zero parameter shall add no row but shall still extend ambient dimension as needed; it shall not supply a supporting point. Copy insertion of a borrowed target row shall use its entry value. Duplicates/redundant generators may be removed or reordered while preserving the generated grid.

    Rvalue row insertion shall transfer a source not borrowed from the target, with the same generated-grid effect as copying; the source shall remain destructible. Consuming-system insertion shall require distinct systems, combine their generating collections in aligned dimensions, and clear the source to a dimension-zero empty system on success. No unchanged-value guarantee shall apply to transferred inputs. Numerical/failure prerequisites in 🔗 1. Grid-generator values and integer versus continuous displacement shall apply.

    Const row sources, including const rvalues, shall use preserving insertion. Successful rvalue row insertion shall leave its source a valid descriptor with an unspecified value.

    RATIONALE:

    Zero displacement is redundant yet still carries ambient dimension. Ownership transfer must not accidentally add a supporting point or change a parameter period.

    INTERFACE:
    void Grid_Generator_System::insert(const Grid_Generator& g);
    void Grid_Generator_System::insert(Grid_Generator&& g);
    void Grid_Generator_System::insert(Grid_Generator_System&& gs);
    
    VERIFICATION_CRITERIA:

    Check dimension alignment, zero-parameter discarding, borrowed-row insertion, copied-source preservation and recycled row/system ownership. Compare independent generated-grid examples before/after adding points, lines and rational parameters.

    SOURCE:

    src/Row_Transfers.cc; tests/consuminginsertions1.cc; src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000238
    18. System dimensions, row-kind counts and read-only iteration UID: PPL-SPEC-000238 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    max_space_dimension() shall return Grid_Generator::max_space_dimension() - 1 and space_dimension() the public ambient dimension. empty() shall mean no stored rows, independently of whether the generated grid lacks a supporting point. num_rows(), num_parameters() and num_lines() shall count retained stored generators of their named scope; has_points() shall report a retained point. clear() shall remove all rows and reset dimension zero while retaining storage.

    begin()/end() shall expose retained generators sharing system dimension, without promising geometric sorted order or duplicate multiplicity. Forward iterators shall borrow rows, support independent copied/assigned positions, return the advanced iterator from prefix increment and entry-position copy from postfix increment. Comparison shall require one unchanged system. Defaults shall admit copying/assignment/destruction before valid-position assignment. System mutation/destruction shall invalidate iterators and rows.

    RATIONALE:

    Container counts, presence of a supporting point and geometric generated-grid emptiness answer different questions.

    INTERFACE:
    static dimension_type Grid_Generator_System::max_space_dimension();
    dimension_type Grid_Generator_System::space_dimension() const;
    bool Grid_Generator_System::empty() const;
    dimension_type Grid_Generator_System::num_rows() const;
    dimension_type Grid_Generator_System::num_parameters() const;
    dimension_type Grid_Generator_System::num_lines() const;
    bool Grid_Generator_System::has_points() const;
    void Grid_Generator_System::clear();
    class Grid_Generator_System::const_iterator;
    Grid_Generator_System::const_iterator Grid_Generator_System::begin() const;
    Grid_Generator_System::const_iterator Grid_Generator_System::end() const;
    Grid_Generator_System::const_iterator::const_iterator();
    Grid_Generator_System::const_iterator::const_iterator(const const_iterator& y);
    Grid_Generator_System::const_iterator::~const_iterator();
    Grid_Generator_System::const_iterator& Grid_Generator_System::const_iterator::operator=(const const_iterator& y);
    const Grid_Generator& Grid_Generator_System::const_iterator::operator*() const;
    const Grid_Generator* Grid_Generator_System::const_iterator::operator->() const;
    Grid_Generator_System::const_iterator& Grid_Generator_System::const_iterator::operator++();
    Grid_Generator_System::const_iterator Grid_Generator_System::const_iterator::operator++(int);
    bool Grid_Generator_System::const_iterator::operator==(const const_iterator& y) const;
    bool Grid_Generator_System::const_iterator::operator!=(const const_iterator& y) const;
    
    VERIFICATION_CRITERIA:

    Check empty, zero-parameter-only and all-kind systems, exact row/kind counts and supporting-point presence. Check shared dimensions, copied/default-assigned iterator positions, prefix/postfix return semantics and borrowed pointer identity.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • PPL-SPEC-000239
    19. Grid-generator and system invariants and memory queries UID: PPL-SPEC-000239 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    OK() shall report checked storage invariants, without promising canonical normalization of every valid parameter representation. Successful operations under their preconditions shall produce values satisfying those invariants. Each type's total memory count shall equal its sizeof plus external memory count. Queries shall preserve geometric fields, kind, dimension and storage. Counts shall not promise allocator overhead, process memory or a dense/sparse size ordering.

    RATIONALE:

    Unreduced but valid rational step representations must remain admissible while ownership accounting remains exact at its declared scope.

    INTERFACE:
    bool Grid_Generator::OK() const;
    memory_size_type Grid_Generator::total_memory_in_bytes() const;
    memory_size_type Grid_Generator::external_memory_in_bytes() const;
    bool Grid_Generator_System::OK() const;
    memory_size_type Grid_Generator_System::total_memory_in_bytes() const;
    memory_size_type Grid_Generator_System::external_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check all kinds, zero/unreduced parameters, copies/conversions and empty/mixed systems. Verify invariants and memory identities with unchanged fields without target-specific byte constants.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc.

  • PPL-SPEC-000240
    20. Reloadable grid-generator-system representation UID: PPL-SPEC-000240 STATUS: APPROVED COMPONENT: GEOMETRIC_DESCRIPTORS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    ascii_dump(s) shall export stored rows, public dimension, storage and required system-state fields; the no-argument form shall use std::cerr. Export shall preserve source value. Compatible complete exports with representable coefficients shall load with true, replacing the target's generated grid, dimension, retained rows and encoded storage.

    Malformed/truncated headers/rows, invalid divisor or kind structure, and inconsistent encoded dimensions/state fields shall return false rather than be accepted as valid systems. Trailing input shall remain available. Failed targets shall remain destructible and admit complete valid replacement, without rollback or cross-version format promises. Allocation/numerical exceptions may propagate. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

    RATIONALE:

    Reload must preserve parameter periods and supporting-point offsets together with ambient dimension.

    INTERFACE:
    void Grid_Generator_System::ascii_dump(std::ostream& s) const;
    void Grid_Generator_System::ascii_dump() const;
    bool Grid_Generator_System::ascii_load(std::istream& s);
    
    VERIFICATION_CRITERIA:

    Round-trip empty positive-dimensional, no-supporting-point and mixed rational-point/parameter/line systems across destination choices. Check encoded storage, dimensions and independent lattice membership; reject malformed/truncated structural fields and row-kind/divisor inconsistencies. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

    SOURCE:

    src/Grid_Generator_defs.hh; src/Grid_Generator_inlines.hh; src/Grid_Generator.cc; src/Grid_Generator_System_defs.hh; src/Grid_Generator_System_inlines.hh; src/Grid_Generator_System.cc; tests/gridgeneratorspec1.cc; tests/gridgeneratorbranches1.cc.

  • 1. Closed octagonal support hull of geometric generators UID: PPL-SPEC-001162 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Octagonal_Shape(gs) shall construct the least target-profile octagonal enclosure of the convex set generated by gs. Its closed boundaries shall include finite limiting points supplied only as closure points. Ordinary points and closure points shall contribute their actual rational coordinates to support extrema, with the generator meanings in 🔗 1. Generator kinds and numerical prerequisites and 🔗 2. Construction of nonzero lines and rays. A ray shall make a normal unbounded exactly when its scalar product with that normal is positive; a line shall do so exactly when that scalar product is nonzero. A zero directional product shall retain any finite bound on that normal.

    An empty generator system shall construct empty in its declared dimension. A nonempty generator system shall contain an ordinary point; otherwise the constructor shall throw std::invalid_argument. Divisors, zero trailing coordinates and ambient dimension shall retain their generator-system meanings.

    For a nonempty source set X, let h(a) = supx ∈ Xa⋅x. For each sign s ∈ { − 1, 1}, the unary restriction shall be 2sxi ≤  ↑ T(2h(sei)). For each pair of distinct coordinates and signs si, sj ∈ { − 1, 1}, the binary restriction shall be sixi + sjxj ≤  ↑ T(h(siei + sjej)). Here  ↑ T(q) shall be the least admitted target bound not smaller than the exact value q, using positive infinity when no finite target bound suffices. An unbounded source support shall impose no finite restriction. These bounds shall be those obtained from exact source supports, including the unary factor of two, before target rounding. The conjunction of these restrictions shall define the least target-profile enclosure. Integral bound storage shall retain the real carrier and shall not imply exact rational half-sum closure, as specified in 🔗 1. Octagonal values, numerical profiles and valid use.

    The result shall inherit the source's ambient dimension and own its storage independently, as in 🔗 3. Owned octagonal copying, assignment and cleanup. Successful construction and logically const source normalization shall preserve the source's represented set and ambient dimension. Later source mutation or destruction shall not affect the constructed value.

    A source dimension above max_space_dimension() shall throw std::length_error before allocating the corresponding matrix storage. Empty and zero-dimensional values shall retain the meanings in 🔗 2. Dimensioned empty and universe octagonal construction.

    Sources shall remain live, valid and synchronized throughout construction. The profile, descriptor, initialization and native floating runtime prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply, together with the source domain's numerical prerequisites. For admitted inputs, the implementation shall respect the preconditions of the numerical policies it selects for intermediate operations. Underlying numerical or resource exceptions may propagate through their declared channels. Failure during construction shall release resources acquired by the incomplete result; the source's cache representation need not be rolled back.

    RATIONALE:

    Signed support extrema determine the closed octagonal hull. A closure point can determine such an extremum without being an ordinary generated point; directional signs determine whether a finite supporting inequality survives.

    INTERFACE:

    Public header: <ppl.hh>; constructor of Octagonal_Shape<T> in Parma_Polyhedra_Library:

    explicit Octagonal_Shape(const Generator_System& gs);
    
    VERIFICATION_CRITERIA:

    Compute support independently from raw rational point/closure-point coordinates and ray/line dot products for every signed primitive normal. Check unequal point divisors, all four binary signs, zero and nonzero directional products, unequal-speed rays and lines, repeated extrema, trailing zero coordinates and independent affine dimension. Include empty systems in zero and positive dimensions, point-free nonempty rejection, half-integral unary bounds, positive/negative inexact target conversion and source-lifetime independence. Inject admitted allocation failures and check incomplete-object cleanup and source-set preservation. Check literal support entries for dense and sparse systems at dimensions 0, 1, 2, 63, 64, 65 and 128, including implicit zero tails, dyadic coordinates, origin and fully populated points, closure-first updates and repeated points. Exercise exact, integral and native boundaries, source lifetime independence and unchanged native floating state. Bound additional C++ allocation against independently constructed matrix storage, including value-returning coefficient traits, and sweep observed allocation failures after numeric-pool warmup; require incomplete-result cleanup and unchanged source values. Compare every stored support bound for positive and negative first, middle and last coordinate lines and rays, zero-coordinate rows, equal/opposite pairs and fixed nonzero point coordinates in dense and sparse storage. Exercise exact, integral and native boundaries and require finite bounds for zero directional products. Retain the selected coefficient profile's admitted arithmetic and failure behavior.

    BIBLIOGRAPHY:

    BagnaraHZ05FAC | Section 4.1, Definition 4.2 and Theorem 4.4, closure points and extended generator semantics. BagnaraHZ09FMSD | Section 4, signed-variable encoding and doubled unary bounds (PDF page index 9, zero-based).

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; tests/octagonalshapeconversionsspec1.cc; tests/octagonalshapeconversionsfailure1.cc; tests/boxallocationfixture.hh; tests/octagonalshapeconversionoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeconversionspublic1.cc; tests/Octagonal_Shape/fromgensys1.cc; tests/Octagonal_Shape/dimensionlimits1.cc. tests/generatorconstructionfixture.hh; tests/generatorconstructionallocationsspec1.cc.

  • PPL-SPEC-001159
    14. Subsumption of geometric generators by octagonal values UID: PPL-SPEC-001159 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    relation_with(g) shall report Poly_Gen_Relation::subsumes() exactly when the represented set subsumes g under 🔗 6. Generator-relation assertion values and named factories, and nothing() otherwise. Points and closure points shall use their exact rational coordinates; their membership tests shall agree because the domain is topologically closed. A ray direction r shall satisfy a⋅r ≤ 0 for every defining inequality a⋅x ≤ b; a line direction shall satisfy the corresponding equalities a⋅r = 0.

    Empty shall subsume no generator. A lower-dimensional generator shall have zero trailing coordinates. A generator exceeding the source dimension shall throw std::invalid_argument. The descriptor and source value shall be preserved.

    The lifetime, numerical-profile, initialization and synchronization prerequisites in 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Logically const normalization may update caches while preserving the represented set and ambient dimension. Supported numerical or allocation failures may propagate through their declared channels; temporary resources shall be released.

    RATIONALE:

    Closed-point membership and recession directions impose different homogeneous tests over the same signed normal system.

    INTERFACE:

    Public header: <ppl.hh>; excerpts for Octagonal_Shape<T> and related free functions in Parma_Polyhedra_Library:

    Poly_Gen_Relation relation_with(const Generator& g) const;
    
    VERIFICATION_CRITERIA:

    Independently substitute rational points/closure points and evaluate every signed normal on rays/lines. Include divisors, half-integral fixed coordinates, signed sums/differences, rejected one-sided directions, free axes, lower ambient generator dimensions, empty/zero dimensions and oversized rejection.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; tests/octagonalshapevaluesspec1.cc; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/octagonalshapevaluespublic1.cc; tests/Octagonal_Shape/relatwithgen1.cc.

  • PPL-SPEC-001728
    6. Java mathematical representations and operation options UID: PPL-SPEC-001728 STATUS: APPROVED COMPONENT: JAVA_INTERFACE APPLICABILITY: IF_JAVA VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Java VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For valid supported Java values, native exchange shall preserve variable indices, representable coefficients and the mathematical meaning of expression trees, constraints, congruences, generators, grid generators and artificial parameters. Expression sums, differences, integer products and negation shall retain their operands' meanings. Constraint direction, congruence modulus, generator kind and divisor, and artificial-parameter numerator and denominator shall be preserved. Coefficient exchange obeys 🔗 1. Java integral coefficient exchange. Native affine, constraint, congruence, generator and grid-generator meanings are specified by 🔗 1. Affine value, numerical prerequisites and shared zero, 🔗 1. Constraint relation meaning and numerical prerequisites, 🔗 1. Affine congruence meaning and valid numerical use, 🔗 1. Generator kinds and numerical prerequisites and 🔗 1. Grid-generator values and integer versus continuous displacement, respectively. Returned mathematical objects may be normalized and need not preserve the input expression-tree shape.

    Conversion of a finite acyclic expression into native form shall preserve operator grouping and apply the configured coefficient rules at each node. This conversion and copying through built-in Java expression nodes shall use stack space independent of tree depth. Construction and cloning shall retain the documented ownership of copied operands.

    System and variable-set conversion shall retain the represented collection; artificial-parameter sequences shall retain their order. Relation objects shall encode the native predicates (subsumption; disjointness, strict intersection, inclusion and saturation). Boxed primitives, Pair fields and By_Reference values shall preserve the values or object references assigned to them.

    Named Java enumeration values for relation symbols, integer widths, representations and overflow policies, optimization modes, solver results and MIP/PIP control parameters shall denote the corresponding native choices. Choosing a complexity or overflow policy shall not strengthen the native operation's exactness guarantee. Nonnegative integral arguments converted to an unsigned native type shall be rejected if negative or outside that type's range; failures follow 🔗 3. Java native failure and pending-exception protocol. Native dimension and object validity preconditions remain applicable.

    RATIONALE:

    Java object layout, enum ordinals and container fields are representation details; native conversion must preserve their mathematical and option meanings.

    INTERFACE:

    Package parma_polyhedra_library: Variable, the Linear_Expression hierarchy, Constraint, Congruence, Generator, Grid_Generator, Artificial_Parameter, their system/sequence classes, Variables_Set, Poly_Gen_Relation, Poly_Con_Relation, the operation-option/result enums, Pair and By_Reference. Values must have the documented class, finite acyclic expression structure and supported enum membership; mathematical objects must satisfy their native constructor preconditions.

    VERIFICATION_CRITERIA:

    Inspect each constructor/accessor correspondence, expression-node case, system iterator and enum switch against the Java definitions and native meanings. Check signed/unsigned range admission, affine constants, generator divisors, relation flags and container field positions. Use existing Java domain and solver scenarios as supporting runtime evidence, comparing normalization by mathematical meaning. Construct and copy mixed expression trees, check subtree independence and convert against an independently known affine result.

    SOURCE:

    interfaces/Java/jni/ppl_java_common.cc; interfaces/Java/jni/ppl_java_common_defs.hh; interfaces/Java/jni/ppl_java_common_inlines.hh; interfaces/Java/tests/Linear_Expression_test1.java; interfaces/Java/parma_polyhedra_library.

  • PPL-SPEC-001692
    1. OCaml mathematical representation exchange UID: PPL-SPEC-001692 STATUS: APPROVED COMPONENT: OCAML_INTERFACE APPLICABILITY: IF_OCAML VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: OCaml VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For well-formed values of the exposed algebraic types, conversion to native objects shall preserve zero-based variable identities, signed integral Z.t coefficients within the configured native range, affine expression meaning, equality and strict/non-strict inequality meaning, and generator kind. Returned values shall denote the native result; syntactic tree shape and normalization need not be preserved.

    Conversion of finite acyclic expressions to native objects shall preserve operator grouping and apply the configured coefficient rules at each node. Native stack usage shall be independent of expression depth. The expression values used during traversal shall remain valid under the OCaml runtime's lifetime and collection rules.

    A point or closure point with expression coordinates ai and nonzero divisor d denotes coordinates ai ⁄ d. Lines and rays denote the native direction described by the expression. Grid generators and congruences shall preserve their native rational-divisor and integral-modulus meanings. Native validity and operation-specific topology and arithmetic preconditions apply. A Z.t may be immediate or heap allocated; the binding shall use its value rather than assume either memory layout.

    RATIONALE:

    An algebraic representation can change tree shape while preserving exactly the same affine function or geometric object.

    INTERFACE:

    Module Ppl_ocaml.

    type linear_expression =
      Variable of int | Coefficient of Z.t
      | Unary_Plus of linear_expression | Unary_Minus of linear_expression
      | Plus of linear_expression * linear_expression
      | Minus of linear_expression * linear_expression
      | Times of Z.t * linear_expression
    type linear_constraint =
      Less_Than of linear_expression * linear_expression
      | Less_Or_Equal of linear_expression * linear_expression
      | Equal of linear_expression * linear_expression
      | Greater_Than of linear_expression * linear_expression
      | Greater_Or_Equal of linear_expression * linear_expression
    type linear_generator =
      Line of linear_expression | Ray of linear_expression
      | Point of linear_expression * Z.t
      | Closure_Point of linear_expression * Z.t
    

    Configured domain and solver constructors consume these types; their expression, constraint and generator queries return the corresponding types. The companion linear_grid_generator and linear_congruence types in the module signature define grid exchange.

    VERIFICATION_CRITERIA:

    Independently evaluate returned affine expressions and convert nested inputs with known grouped affine results. Round-trip positive, negative, zero and configured coefficient endpoints. Check multiple coordinates, all five relation kinds and all four polyhedral generator kinds. Include immediate and large Zarith values, divisor normalization and compacting collections.

    SOURCE:

    interfaces/OCaml/ppl_ocaml_globals.mli; interfaces/OCaml/ppl_ocaml_common.cc; interfaces/OCaml/ppl_ocaml_globals.ml; interfaces/OCaml/tests/zarith1.ml; interfaces/OCaml/tests/polyhedron1.ml; interfaces/OCaml/tests/boundary_contracts1.ml.

  • PPL-SPEC-001695
    1. Prolog mathematical term exchange UID: PPL-SPEC-001695 STATUS: APPROVED COMPONENT: PROLOG_INTERFACE APPLICABILITY: IF_PROLOG_CIAO, IF_PROLOG_GNU, IF_PROLOG_SICSTUS, IF_PROLOG_SWI, IF_PROLOG_XSB, IF_PROLOG_YAP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: Prolog VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For each configured supported Prolog engine, supported integral terms, affine expressions, constraints, congruences and generators shall be interpreted with their documented native mathematical meaning. '$VAR'(I) shall denote the zero-based coordinate I. Unary negation, addition, subtraction and integral scalar multiplication shall preserve affine meaning. Relations shall preserve equality and strict/non-strict order. Point and closure-point coordinates shall be divided by the supplied nonzero divisor; lines and rays denote directions. Returned terms may be normalized but shall denote the native result.

    Values shall be representable by both the engine and configured native coefficient type. A bounded engine does not acquire arbitrary-size integers from GMP in the native library. Malformed or nonlinear expressions and invalid native objects shall follow 🔗 2. Prolog success failure and exception outcomes.

    RATIONALE:

    The common term protocol must express the same mathematics independently of the selected foreign runtime.

    INTERFACE:

    Common numerical term protocol:

    '$VAR'(I)
    -E
    E + F
    E - F
    N * E
    E = F
    E =< F
    E < F
    E >= F
    E > F
    point(E, D)
    closure_point(E, D)
    ray(E)
    line(E)
    

    Here I is a valid coordinate index, N an integral coefficient and E/F supported affine expressions. Lists of such terms are the system interfaces accepted and returned by configured domain and solver predicates. Grid-point, parameter and congruence terms follow the common Prolog manual's rational-divisor and modulus conventions.

    VERIFICATION_CRITERIA:

    Across each available configured engine, compare coefficient round trips and independently reconstructed expressions/constraints/generators. Cover signs, zero, multiple indices, all relation and generator kinds, and each engine/native range intersection; check unsupported numeric and malformed cases separately.

    SOURCE:

    interfaces/Prolog/Prolog_interface_sysindep.dox; interfaces/Prolog/ppl_prolog_common.cc; interfaces/Prolog/tests/pl_check.pl.