Parma Polyhedra Library requirements
Core data structure low-level requirements
PPL-LLR-000141
1. Injective partial coordinate maps UID: PPL-LLR-000141 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

RATIONALE:

Dimension transformations must preserve coordinate identity and must not merge coordinates unintentionally.

COMMENT:

Verification covers partial coordinate-map construction, lookup and range queries. The contracts retain the insertion preconditions and do not promise release-build detection of every invalid map. Verification compares valid operation histories with an independent finite-map model. Successful mathematical results assume valid inputs, documented caller preconditions, and arithmetic representable under the selected configuration; resource or arithmetic failures are not successful results.

VERIFICATION_CRITERIA:

Compare incrementally constructed valid maps with an independent finite-map model, including sparse domains, reordered images, empty maps, and repeated absent lookups. Verify unchanged output on absence and the reported maximum image. Review uniqueness and reserved-index preconditions without assuming release-build validation of their violation.

SOURCE:

src/Partial_Function_defs.hh: injectivity, insertion preconditions, lookup-output preservation, and empty-codomain behavior. src/Partial_Function_inlines.hh and src/Partial_Function.cc: represented mapping and maximum-image queries.

  • PPL-SPEC-001202
    5. Injective partial remapping of octagonal coordinates UID: PPL-SPEC-001202 STATUS: APPROVED COMPONENT: OCTAGONS APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    map_space_dimensions(mapping) shall existentially discard entry coordinates outside the mapping domain and place each retained coordinate i at target index f(i). For a positive-dimensional receiver, the admitted mapping shall be a partial injection from {0, …, n − 1} with image exactly {0, …, m − 1} for some m ≤ n. The concrete result shall be

    {(xf − 1(0), …, xf − 1(m − 1)) ∣ x ∈ X}.

    The result shall have dimension m. An empty mapping shall project to the zero-dimensional value. A permutation shall retain all renamed relationships; an identity mapping shall preserve the value. The exactness, rounded enclosure and empty-set guarantees of 🔗 3. Existential removal of selected octagonal coordinates shall apply to the projection part.

    The mapping type shall supply logically const has_empty_codomain(), max_in_codomain() and maps(i,j) queries with the meanings of [LINK: PPL-SPEC-000004], 🔗 5. Exact empty-codomain query and 🔗 6. Largest image and defined empty-map failure. Queries shall describe one stable mapping throughout the call. A zero-dimensional receiver shall remain unchanged without querying the mapping. Otherwise has_empty_codomain() shall be queried first; when it returns true, neither remaining query shall be called. For a nonempty image the maximum query shall precede individual mapping queries. No fixed count or order of maps queries shall be required. The mapping's value shall remain unchanged apart from effects explicitly permitted by its query contract.

    Violating injectivity, source bounds, the contiguous-image condition or query consistency shall be outside admitted use. In particular, output-index holes shall not denote newly introduced free coordinates. Exceptions from mapping queries shall propagate; no rollback of the receiver shall be inferred after such an exception.

    The supported coefficient profiles, real-set interpretation, initialization, numerical-intermediate, native floating-point runtime and synchronization conditions of 🔗 1. Octagonal values, numerical profiles and valid use shall apply. Supplied coordinate objects shall satisfy their own valid-use contracts. Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return; the receiver shall remain safely destructible, but preservation of its entry represented set shall not be inferred unless stated above.

    RATIONALE:

    Projection and a one-to-one coordinate relabeling preserve coordinate identity; a contiguous output image makes the resulting ambient dimension unambiguous.

    INTERFACE:

    Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Octagonal_Shape<T>:

    template <typename Partial_Function>
    void map_space_dimensions(const Partial_Function& mapping);
    
    VERIFICATION_CRITERIA:

    Compare independent projection followed by column permutation for every valid partial injection on small dimensions, including sparse domains, reversed and cyclic orders, all/none retention, correlated halfspaces and cache histories. Check the query protocol with a recording mapping, no queries for zero dimensions and no maximum/maps query for an empty image. Inject query exceptions and verify propagation, temporary cleanup and safe replacement/retry. Review invalid-map preconditions without invoking undefined mappings. Check verified identity maps without temporary C++ allocation, unchanged cached representations and owned capacity after copying and grow/shrink histories. Compare first/last/middle swaps, reversal, cycles and projections against literal coordinate oracles; preserve floating-point mode/flags. Inject every mapping-query exception and check propagation, safe replacement and temporary cleanup.

    BIBLIOGRAPHY:

    BagnaraHZ09FMSD | Whole work, journal background on signed octagonal bounds and closure.

    SOURCE:

    src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; tests/octagonalshapecoordinatesspec1.cc; tests/octagonalshapecoordinatespublic1.cc; tests/octagonalshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/octagonalshapecoordinateoracle.hh; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/Octagonal_Shape/mapspacedims1.cc. tests/coordinatemappingfixture.hh;

  • 1. Public partial coordinate-map type and valid use UID: PPL-SPEC-000001 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    The public C++ interface shall expose Partial_Function as a value type representing a finite injective partial map M from dimension indices to dimension indices. Each mapped source shall have exactly one image, and distinct mapped sources shall have distinct images. Neither a stored source nor a stored image shall equal the reserved value not_a_dimension(), the maximum value of dimension_type. An unmapped index shall have no image.

    The map shall impose no implicit ambient dimension, contiguity of mapped indices, or requirement that its images cover a contiguous range. Limits on achievable storage shall remain distinct from the index type's value range and from the coordinate limits of numerical objects consuming a map. In particular, the insertion range shall not be narrowed to the smaller range accepted by Variable formatting.

    Operations on existing objects shall require live, valid maps. Successful moves between distinct objects shall leave the source as a valid empty map, as defined by 🔗 9. Move construction and empty source and 🔗 10. Move assignment and empty source. Within the library's supported thread-use contexts, callers shall prevent unsynchronized mutation of an instance while another call observes, copies or prints it, and shall serialize mutations of that instance. No additional concurrent-use regime shall be inferred from the type being a value type.

    RATIONALE:

    A coordinate-map value has a meaning independent of its storage extent and of the domain that consumes it. Its index range, storage capacity, printing range and consumer limits are distinct.

    COMMENT:

    Map storage uses dimension indices independently of configured coefficient arithmetic and rounding modes. Diagnostic printing uses the formatter and thread state described by 🔗 8. Coordinate-map diagnostic printing and output failures.

    INTERFACE:

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

    namespace Parma_Polyhedra_Library {
      class Partial_Function;
    }
    

    Member declarations in the following contracts belong to this class. Indices use the public dimension_type and not_a_dimension() names.

    VERIFICATION_CRITERIA:

    Compile representative C++20 clients against the configured installed public header and matching library. Review the generated public exposure and configuration-dependent assertion layout. Compare valid maps against an independent finite collection of distinct source/image pairs, including sparse domains, noncontiguous images and image zero. Review the covered-use, post-failure and synchronization conditions against the operation contracts. Do not infer an achievable allocation for every value of dimension_type or unrestricted concurrency from successful sequential tests.

    SOURCE:

    src/Partial_Function_defs.hh: public type and member declarations. src/globals_types.hh and src/globals_inlines.hh: dimension_type and reserved index. src/Makefile.am: Partial_Function headers in generated public ppl.hh. tests/partialfunction2.cc: direct finite-map query and copying scenarios. tests/partialfunction3.cc: installed-public-header C++20 client.

  • PPL-SPEC-000002
    2. Empty partial-map construction UID: PPL-SPEC-000002 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Successful default construction shall create a valid Partial_Function whose domain and image are empty, with the meaning and use conditions of 🔗 1. Public partial coordinate-map type and valid use. No index shall initially be mapped. If construction fails through a supported C++ exception, resources acquired for the incomplete object shall be released and no constructed map shall be returned.

    RATIONALE:

    An empty initial map gives clients a defined starting point for incremental insertion and distinguishes an absent image from a maximum-image value.

    COMMENT:

    The constructor's private maximum-image bookkeeping is not an observable maximum for the empty map.

    INTERFACE:

    Public constructor declaration:

    Partial_Function();
    
    VERIFICATION_CRITERIA:

    After construction, check empty-codomain reporting and unsuccessful lookups at zero, ordinary absent indices and the reserved sentinel, preserving each caller's output value. Check the defined empty maximum-query exception. Inspect construction and member cleanup; use fault injection only where the selected construction path actually acquires resources that can fail.

    SOURCE:

    src/Partial_Function_defs.hh and src/Partial_Function_inlines.hh: default constructor. tests/partialfunction2.cc: partial_function_empty_queries_preserve_output.

  • 3. Injective insertion and failure atomicity UID: PPL-SPEC-000003 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a valid map as defined by 🔗 1. Public partial coordinate-map type and valid use, insertion shall require both indices to differ from not_a_dimension(), the source index to be absent from the current domain, and the proposed image to be absent from the current image set. A successfully completed insertion of i and j shall add exactly the pair M(i) = j, preserve every existing pair and leave every other absent source unmapped. Gaps introduced by storage growth shall not become mappings. The operation shall permit image zero and noncontiguous source and image sets.

    Storage-capacity or allocation failure shall be reported through the corresponding C++ exception, including std::length_error or std::bad_alloc where applicable. Such a failed insertion shall leave the represented map unchanged and valid for subsequent queries, insertion, assignment and destruction.

    Violation of the insertion preconditions shall be outside the supported contract. Assertion diagnostics shall not be required in every configuration, and no defined success or failure outcome shall be promised for such a call.

    RATIONALE:

    Unique sources and unique images maintain injectivity. Failure atomicity allows callers to retain and reuse a map after a storage failure.

    INTERFACE:

    Public member declaration:

    void insert(dimension_type i, dimension_type j);
    

    Index values alone do not guarantee feasible storage growth. Insertion preconditions are independent of the assertion regime selected for the library.

    VERIFICATION_CRITERIA:

    Build independent finite-map histories with distinct sources and images, including holes across storage boundaries, decreasing and increasing images, and zero as an image. After every successful insertion compare all stored pairs, absent lookups, emptiness and the largest image against the oracle. For available assertion regimes, inject failures at each actual allocation stage and verify exception propagation, preservation of the original pairs, absence of the proposed source, emptiness and maximum before retrying the same insertion. Check storage-capacity rejection with std::length_error using a source whose required extent exceeds the configured container's maximum size, without attempting a huge allocation; verify unchanged state and subsequent valid insertion. Inspect rollback and owned-resource cleanup. Review precondition enforcement separately without requiring release-build rejection of duplicate or reserved indices or attempting infeasible huge allocations.

    SOURCE:

    src/Partial_Function_defs.hh: insertion preconditions and invalid-call scope. src/Partial_Function_inlines.hh: insertion and rollback of codomain bookkeeping. tests/partialfunction2.cc: partial_function_sparse_growth_preserves_holes_and_maximum. tests/partialfunction1.cc: allocation-failure preservation and retry. tests/partialfunction1.cc: capacity_rejection_preserves_and_reuses_the_map. doc/definitions.dox: general public exception-safety description.

  • PPL-SPEC-000004
    4. Exact partial-map lookup and unchanged absent output UID: PPL-SPEC-000004 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a valid map under 🔗 1. Public partial coordinate-map type and valid use, lookup of i shall return true exactly when i ∈ dom(M). On true, it shall assign M(i) to j. On false, it shall leave j unchanged. The represented map shall remain unchanged. Every dimension_type value shall be admissible as a lookup index; in particular, lookup of not_a_dimension() shall return false without changing j. The same caller variable may supply the index value and receive the image; the index used for lookup shall be its value on entry to the call.

    RATIONALE:

    Absence must be distinguishable from a mapping to zero, and an unsuccessful lookup must not corrupt a caller's previously held value.

    COMMENT:

    Lookup is a complete membership-and-image query. It performs no numerical coefficient conversion and is independent of configured coefficient arithmetic and rounding modes.

    INTERFACE:

    Public const member declaration:

    bool maps(dimension_type i, dimension_type& j) const;
    

    The output reference shall designate a live writable dimension_type object.

    VERIFICATION_CRITERIA:

    Check mapped indices, holes below the largest stored source, indices beyond the stored extent, empty maps and the reserved sentinel. Initialize outputs to distinct known values and verify preservation on every false result. Check mapping to zero and calls using one variable for both arguments. Compare the map before and after queries using an independent pair collection.

    SOURCE:

    src/Partial_Function_defs.hh and src/Partial_Function_inlines.hh: maps. tests/partialfunction2.cc: partial_function_empty_queries_preserve_output and partial_function_sparse_growth_preserves_holes_and_maximum. tests/partialfunction2.cc: partial_function_aliased_lookup_and_zero_image.

  • 5. Exact empty-codomain query UID: PPL-SPEC-000005 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a valid map under 🔗 1. Public partial coordinate-map type and valid use, has_empty_codomain shall return true exactly when the represented partial map has no pairs, and shall leave the map unchanged. A nonempty map whose largest image is zero shall return false. Stored capacity or unused source positions shall not determine the mathematical answer.

    RATIONALE:

    The image is empty exactly when a partial function is nowhere defined; zero is an ordinary mapped value rather than an emptiness sentinel.

    INTERFACE:

    Public const member declaration:

    bool has_empty_codomain() const;
    
    VERIFICATION_CRITERIA:

    Check new and copied empty maps, maps containing a single image zero, and sparse nonempty maps. Compare with the independent pair collection before and after successful insertions and copy assignments. Check reporting after failed insertions and copy assignments.

    SOURCE:

    src/Partial_Function_defs.hh and src/Partial_Function_inlines.hh: has_empty_codomain. tests/partialfunction2.cc: partial_function_empty_queries_preserve_output and partial_function_sparse_growth_preserves_holes_and_maximum.

  • 6. Largest image and defined empty-map failure UID: PPL-SPEC-000006 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    For a nonempty valid map under 🔗 1. Public partial coordinate-map type and valid use, max_in_codomain shall return the largest image value, independently of insertion order and of the largest source index. If the valid map is empty, the call shall throw std::runtime_error rather than return a maximum value. The map shall remain unchanged on either outcome. The empty call shall be a defined failure case, not an excluded precondition. Exact exception-message text is not prescribed; ordinary C++ runtime/resource conditions for reporting the exception apply.

    RATIONALE:

    A maximum is meaningful only for a nonempty finite image, and callers must not mistake the private empty-state bookkeeping for an observable result.

    COMMENT:

    The empty-query exception and the absence outcome of maps are distinct outcomes, both of which preserve the map.

    INTERFACE:

    Public const member declaration:

    dimension_type max_in_codomain() const;
    
    VERIFICATION_CRITERIA:

    Compare with independently computed maxima after increasing, decreasing and sparse insertions, including a sole image zero and image values unrelated to the source ordering. Check std::runtime_error on an empty map, without an exact-message assertion, and verify subsequent permitted use of that map. Include a large permitted image with a small source so that testing the image range does not require an infeasible storage allocation.

    SOURCE:

    src/Partial_Function_defs.hh and src/Partial_Function_inlines.hh: max_in_codomain. tests/partialfunction2.cc: partial_function_empty_queries_preserve_output and partial_function_sparse_growth_preserves_holes_and_maximum.

  • PPL-SPEC-000007
    7. Independent copies, assignment and owned-storage cleanup UID: PPL-SPEC-000007 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Copy construction shall require a live, valid source map under 🔗 1. Public partial coordinate-map type and valid use. Successful copy construction shall create a distinct value with exactly the source's mapping. Copy assignment shall require live, valid source and target maps and, on success, shall replace the target's old map with exactly the source's mapping. Subsequent valid insertion into either distinct value shall not change the other's mapping. Successful self-copy-assignment shall preserve the map. Successful copy assignment shall return a reference to its target, including self-copy-assignment.

    Failed copy construction shall release resources acquired for the incomplete target and shall leave the source unchanged. Failed copy assignment shall leave both source and target unchanged and valid for subsequent use. Destruction of a live map shall release its owned storage without releasing another map's storage. The caller shall not access an object after its lifetime ends.

    RATIONALE:

    Independent values support reuse of a coordinate map without hidden changes to a consumer's other maps. Completing the copy before replacing the target preserves the target if acquisition of the copy's storage fails.

    INTERFACE:

    Public copy members and the callable form of the implicit destructor:

    Partial_Function(const Partial_Function& source) = default;
    Partial_Function& operator=(const Partial_Function& source);
    ~Partial_Function();
    
    VERIFICATION_CRITERIA:

    Copy empty and sparse nonempty maps by construction and assignment. Compare both values with independent pair collections, mutate each separately using valid insertions, and check self-copy-assignment. Use actual copy overloads rather than treating an assignment from a temporary as a copy test. Check returned-reference identity for ordinary and self-copy-assignment, and check chained copy assignments. Inspect member ownership and construction cleanup. Inject failures at actual copy-allocation stages, checking source and target preservation before retry. After failed assignment, check the target over the union of the old target's and source's positions, including absence at positions that belonged only to the source. Check successful retry after failed assignment.

    SOURCE:

    src/Partial_Function_defs.hh: copy members, implicit destructor and owned containers. src/Partial_Function_inlines.hh: copy assignment and representation exchange. tests/partialfunction2.cc: copy-construction, lvalue-assignment and self-copy-assignment portions of partial_function_copies_and_assignment_have_independent_storage. tests/partialfunction2.cc: partial_function_copy_assignment_returns_its_target. tests/partialfunction1.cc: copy construction and assignment under allocation failure. doc/definitions.dox: general public exception-safety description.

  • 8. Coordinate-map diagnostic printing and output failures UID: PPL-SPEC-000008 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection, Review LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Printing shall observe a valid map under 🔗 1. Public partial coordinate-map type and valid use without changing its represented mapping. Calls shall require the library and calling thread's applicable initialization protocol to have established a valid active Variable output function under 🔗 7. Active Variable formatter and initialized thread state and 🔗 3. Thread initialization, default state and finalization. Callers shall obey the supported thread regime and synchronize changes to the active formatter and access to a shared stream; the formatter shall not mutate the printed map during the call.

    When the map is empty and output succeeds, print shall write the literal text "empty", a newline and a flush. For a nonempty map whose source and image indices are all constructible as Variable objects, successful output shall process pairs in increasing source order. For each pair it shall write the source Variable using the Variable formatter active for that write, the literal separator " --> ", the image Variable using the formatter active for its write, and a trailing newline. Each Variable write shall use the formatter then active in the calling thread where formatting state is thread-specific; names shall not be fixed independently of it. A callback's permitted change to that formatting state may therefore affect subsequent Variable writes. Text insertions shall honor the stream's current formatting state. Specified literals identify the inserted character sequences, not a canonical byte layout independent of that state. Printing shall not promise restoration of formatting state changed by a formatter.

    A map index outside Variable's accepted identifier range shall be permitted to cause std::length_error during printing, without changing the map. Stream, formatter and resource failures may also propagate their C++ exceptions. Stream failure without an enabled exception shall be observable through the stream state; a normal void return shall not alone establish complete output. After any such failure the output may be partial, but the map shall remain valid and unchanged. Exact diagnostic messages are not prescribed.

    RATIONALE:

    Diagnostic printing depends on the map and active naming convention. Storage-valid map indices can exceed the printable Variable range. Stream failure can occur after earlier output, leaving partial output.

    COMMENT:

    Diagnostic output has no reloadability or cross-version stability guarantee. Formatting depends on the active output function and its thread context.

    INTERFACE:

    Public const member declaration:

    void print(std::ostream& s) const;
    

    The stream shall be live and usable under its own C++ contract. Complete output requires the stream to continue accepting output and the formatter to complete its writes. A Variable identifier shall be strictly smaller than Variable::max_space_dimension(); this additional print limit shall not change the valid insertion range in 🔗 3. Injective insertion and failure atomicity.

    VERIFICATION_CRITERIA:

    Check empty output including flush, and independently derive the ordered pair sequence for sparse maps. Check default formatting and configured field width and fill for both empty and nonempty maps, and integer formatting for nonempty maps, without assuming format-independent bytes. Exercise the default and a custom Variable formatter under the applicable initialization/thread protocol, including a callback that changes the formatter for subsequent writes. With a small source index, insert image not_a_dimension()-1 and check the admitted std::length_error without changing the map. Use failing streams with and without enabled exceptions and a throwing formatter; check stream state, allowed partial output and continued map validity. Review synchronization and restore any formatter/thread state used by verification activities.

    SOURCE:

    src/Partial_Function.cc: print ordering, separator, empty flush and Variable construction. src/Variable_inlines.hh and src/Variable.cc: accepted Variable identifiers and active output function. src/Init.cc and src/Init_inlines.hh: initialization of applicable Variable formatting state. tests/partialfunction2.cc: empty and default-name output checks in the direct Partial_Function scenarios. tests/partialfunction2.cc: partial_function_empty_print_flushes, partial_function_print_uses_current_variable_formatter, partial_function_print_honors_stream_formatting, partial_function_print_failures_preserve_map_and_formatter_state and partial_function_print_keeps_thread_formatters_independent.

  • PPL-SPEC-000009
    9. Move construction and empty source UID: PPL-SPEC-000009 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Move construction from a valid map under 🔗 1. Public partial coordinate-map type and valid use shall create a distinct valid map with exactly the source's mapping on entry and shall leave the source as a valid empty map. The source shall support the same queries, insertions, assignments and destruction as any other empty map. Subsequent valid changes to either object shall not change the other's map.

    If construction of the destination's empty storage fails, resources acquired for the incomplete destination shall be released and the source shall remain unchanged and valid. After the empty storage has been constructed, transferring the represented map shall not allocate storage or throw.

    The move constructor's exception specification shall be nonthrowing exactly when default construction of its configured storage containers is nonthrowing, as expressed by the declaration below. The debug codomain container shall contribute to that condition only when present.

    RATIONALE:

    Transferring a coordinate map avoids copying its stored pairs. An empty, reusable source preserves the value-type invariants after transfer. The exception specification accounts for the containers' actual construction guarantees instead of requiring every standard-library implementation to construct an empty container without throwing.

    INTERFACE:

    Public move constructor declaration:

    Partial_Function(Partial_Function&& source)
      noexcept(noexcept(std::vector<dimension_type>())
    #ifndef NDEBUG
               && noexcept(std::set<dimension_type>())
    #endif
               );
    
    VERIFICATION_CRITERIA:

    Move-construct empty and sparse nonempty maps, including image zero. Compare the destination with an independent pair collection and check source emptiness, absent-output preservation and the defined empty maximum-query exception. Insert into the source after transfer and check independence from the destination. Inspect member construction and representation exchange, including cleanup and source preservation if an actual empty-storage allocation fails. Compare allocation observations during move construction with those for default construction of the same configured empty storage, and check both empty and nonempty sources. Inject failures at any observed empty-storage allocation stage and check source preservation. Check the exception specification in configurations with and without the debug codomain container, against the configured containers' construction traits.

    SOURCE:

    src/Partial_Function_defs.hh and src/Partial_Function_inlines.hh: move constructor and representation exchange. tests/partialfunction2.cc: partial_function_move_construction_transfers_and_empties_source. tests/partialfunction1.cc: move_construction_allocates_only_for_empty_storage.

  • PPL-SPEC-000010
    10. Move assignment and empty source UID: PPL-SPEC-000010 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

    Move assignment between distinct valid maps under 🔗 1. Public partial coordinate-map type and valid use shall replace the target's mapping with exactly the source's mapping on entry and leave the source as a valid empty map. Both maps shall support subsequent queries, insertions, assignments and destruction. Subsequent changes to either map shall not change the other's represented value.

    Self-move-assignment shall leave the map unchanged. Move assignment shall return a reference to its target, including self-move-assignment. It shall not allocate storage or throw. Storage retained by an empty map shall remain owned by that map and shall not imply the presence of any mapped pair.

    RATIONALE:

    Move assignment permits reuse of an existing target without copying pairs. Defined empty-source and self-assignment behavior preserves map validity and allows continued use of both objects without inspecting storage internals.

    INTERFACE:

    Public move assignment declaration:

    Partial_Function& operator=(Partial_Function&& source) noexcept;
    
    VERIFICATION_CRITERIA:

    Move-assign empty and sparse maps into empty and nonempty targets. Check exact target replacement, source emptiness and returned-reference identity. Reuse both objects with valid insertions and queries, including a source that receives storage previously owned by the target. Check self-move-assignment through a reference alias and chained assignments whose selected overloads are move assignments. Check the nonthrowing exception specification and arm allocation failure during assignment to check absence of allocation, including self-assignment and empty and nonempty source/target combinations. Inspect clearing and representation exchange.

    SOURCE:

    src/Partial_Function_defs.hh and src/Partial_Function_inlines.hh: move assignment and representation exchange. tests/partialfunction2.cc: partial_function_move_assignment_replaces_and_empties_source. tests/partialfunction1.cc: move_assignment_does_not_allocate.

PPL-LLR-000142
2. Finite bit-set row semantics UID: PPL-LLR-000142 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

A bit row shall represent a finite set of nonnegative positions and preserve ordinary set semantics for membership, insertion, removal, union, intersection, difference, and inclusion. Ordered traversal shall return exactly the represented positions in the requested direction, with the documented absence indication when no qualifying position exists. Prefix updates shall preserve positions outside their specified update range.

RATIONALE:

Bit rows encode incidence and saturation information used by numerical algorithms; incorrect membership or traversal can change the represented relations.

COMMENT:

Verification covers bit-row set operations, traversal and prefix updates, including range and absence conventions. Verification uses independent finite-set models across storage boundaries and supported aliasing cases. Successful mathematical results assume valid inputs, documented caller preconditions, and arithmetic representable under the selected configuration; resource or arithmetic failures are not successful results.

VERIFICATION_CRITERIA:

Compare operations with an independent finite-set model across storage-limb boundaries, sparse high positions, empty sets, and aliased operands where supported. Check cardinality, inclusion, strict predecessor and successor behavior, prefix boundaries, and absence at the largest representable query positions without requiring infeasible allocations.

SOURCE:

src/Bit_Row_defs.hh and src/Bit_Row_inlines.hh: set operations, range updates, ordered traversal, and absence conventions. tests/bitrowprefix1.cc: independent finite-set checks, limb boundaries, and extreme traversal queries.

  • PPL-SPEC-000461
    1. Rectangular Boolean values and valid internal use UID: PPL-SPEC-000461 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Bit_Matrix shall own a rectangular Boolean array B with r rows and c columns. Its stored row i shall represent exactly {j ∣ 0 ≤ j < c∧Bij} under 🔗 1. Finite bit-set row values and valid use. Set bits outside the declared column range shall violate the matrix invariant, even though the corresponding Bit_Row value alone is valid.

    Operations shall require live valid objects and indices, counts and capacity calculations within their supported representable and storage limits, with sufficient resources. Callers shall prevent concurrent access conflicting with mutation. No library or thread initialization object or coefficient-constant stage shall be required. Allocation or interruption failure shall not constitute a successful matrix result. Failed C++ construction shall release resources owned by its incomplete object. Surviving owners shall remain destructible; rollback shall apply only where the individual contract promises it. Ordinary allocation-failure recovery shall not be promised for fatal GMP allocation failure.

    RATIONALE:

    Incidence and saturation matrices need explicit coordinate meaning and width invariants independent of the configured coefficient type.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    class Bit_Matrix;
    
    VERIFICATION_CRITERIA:

    Compare all entries and both extents with independent Boolean arrays, exercise row-width checks, preserve separate lifetimes, and run without initialization in threaded and non-thread-safe configurations. Inject observable C++ allocation failures during construction.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000468
    8. Row sorting and duplicate elimination UID: PPL-SPEC-000468 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    A successful sort_rows() shall preserve the column count and replace the row sequence by its distinct row values in increasing Bit_Row comparison order, as defined by 🔗 8. Least-significant differing-position total order. At the least position where two row values differ, the row without that bit shall precede the row with it. Sorting shall preserve each retained row's complete bit set, admit zero or one row, and be idempotent. Sorting shall not preserve former row-index associations.

    RATIONALE:

    Sorted row sets support exact binary search; bit-set order differs from comparison of binary integers.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void sort_rows();
    
    VERIFICATION_CRITERIA:

    Use an independent Boolean lexicographic comparator, compare the complete distinct sequence across permutations and duplicates, and include zero-column, one-row and empty matrices.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000469
    9. Membership in a sorted row sequence UID: PPL-SPEC-000469 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Given a matrix whose row sequence is actually nondecreasing under the order in 🔗 8. Row sorting and duplicate elimination, sorted_contains(row) shall return true exactly when one stored row has the same finite set of true positions as the query. It shall preserve the matrix and query and admit a query borrowed from the matrix. A query may contain positions beyond the matrix width, in which case it cannot equal a valid stored row. An empty matrix shall report absence.

    RATIONALE:

    Binary search requires actual sortedness rather than an unrecorded intention to sort.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    bool sorted_contains(const Bit_Row& row) const;
    
    VERIFICATION_CRITERIA:

    Check every small candidate row against an independent set of stored rows, duplicate sorted inputs, empty matrices, borrowed queries and absent high-position queries.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000470
    10. Recycled row insertion transfers ownership UID: PPL-SPEC-000470 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    A successful recycled-row insertion shall append the donor's previous bit set and preserve all earlier rows and the column count. The donor shall be a separate live row, not borrowed from the target matrix, with all set positions below the matrix width. The resulting row count shall fit the row-storage limit. After successful return the donor shall be empty and reusable; the appended row shall own its storage independently of subsequent assignment to or destruction of the donor.

    RATIONALE:

    Explicit ownership transfer avoids copying bit storage while retaining the matrix-width invariant.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void add_recycled_row(Bit_Row& row);
    
    VERIFICATION_CRITERIA:

    Append external empty and populated donors through repeated capacity growth and reuse, check that each donor is empty, assign new values to and destroy donors, and compare all earlier and appended rows with independent literal arrays.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/bitrowreuse1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • 1. Finite bit-set row values and valid use UID: PPL-SPEC-000441 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Bit_Row shall represent a finite set S of nonnegative bit positions, independently of the configured Coefficient type. It shall have no declared matrix width: an unset position beyond the highest stored position shall remain absent. ULONG_MAX shall be reserved as the absence indication for traversal, rather than an inserted member.

    Operations shall require live valid objects and sufficient resources, with mutating positions/counts within the supported GMP storage limits and nonoverflowing capacity calculations. Callers shall prevent concurrent access to a row while another operation modifies it. No library or thread initialization object or coefficient-constant stage shall be required. Storage allocation failure shall not be a successful set result. Failed C++ construction shall release resources owned by its incomplete object; ordinary allocation-failure recovery shall not be promised for a fatal GMP allocation failure. Successfully constructed owners shall remain independently destructible.

    RATIONALE:

    Incidence and saturation data need exact finite-set meaning without depending on coefficient width or an enclosing matrix shape.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    class Bit_Row;
    
    VERIFICATION_CRITERIA:

    Check literal sets and empty values across limb boundaries, preserve distinct owners, and run without initialization in threaded and non-thread-safe configurations.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000442
    2. Empty construction, owned copying and bit-row lifetime UID: PPL-SPEC-000442 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Default construction shall represent the empty set. Copy construction and assignment shall preserve the source set and establish independent owned storage. Assignment shall return its target and admit self-assignment. Copies shall remain usable after source mutation or destruction. Destruction shall release the GMP storage owned by the row. Copying an rvalue through these copy interfaces shall not change its source.

    RATIONALE:

    Owned bit storage must not be shared accidentally between matrices or temporary algorithm results.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    Bit_Row();
    Bit_Row(const Bit_Row& y);
    Bit_Row& operator=(const Bit_Row& y);
    ~Bit_Row();
    
    VERIFICATION_CRITERIA:

    Check empty/populated copies and assignments, self-assignment, source destruction, rvalue copying and independent high-position mutations.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000443
    3. Individual bit membership, insertion and removal UID: PPL-SPEC-000443 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For any admitted position k, set(k) shall replace S by S∪{k} and clear(k) by S⧵{k}. Repeating either operation shall be idempotent and preserve every other membership. operator[](k) shall return true exactly when k ∈ S. Membership queries shall admit every unsigned long argument, including ULONG_MAX, and shall not grow storage merely to inspect an absent high position. Querying shall preserve the row.

    RATIONALE:

    Bit-level updates must preserve every unrelated incidence relation.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    bool operator[](unsigned long k) const;
    void set(unsigned long k);
    void clear(unsigned long k);
    
    VERIFICATION_CRITERIA:

    Compare membership and updates with an independent set, including repeated insertion/removal, first/last positions, sparse high bits and maximum unsigned queries without huge allocations.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000444
    4. Bit prefixes, suffix removal and complete clearing UID: PPL-SPEC-000444 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    set_until(k) shall replace S by S∪{i ∣ 0 ≤ i < k}, retaining all entry members at or above k. clear_from(k) shall replace S by {i ∈ S ∣ i < k}. clear() shall replace S by the empty set. Setting a zero-length prefix shall do nothing; clearing from zero shall remove every member. Repeating these operations shall be idempotent. Mutation limits and resource conditions shall follow 🔗 1. Finite bit-set row values and valid use.

    RATIONALE:

    Prefix operations update a specified index range while preserving the complementary range.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    void set_until(unsigned long k);
    void clear_from(unsigned long k);
    void clear();
    
    VERIFICATION_CRITERIA:

    Check zero, exact limb boundaries, adjacent positions and repeated growth/shrink histories against explicit set insertion/removal, retaining distant members outside updated prefixes.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000445
    5. Set union, intersection and difference with aliased operands UID: PPL-SPEC-000445 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    The two-source constructor shall represent Y∪Z. union_assign(x,y), intersection_assign(x,y) and difference_assign(x,y) shall replace the target by X∪Y, X∩Y and X⧵Y, respectively, using both operand sets on entry. Either or both operands may designate the target, including all-three-equal calls. A distinct source shall remain unchanged.

    union_assign_and_count(x,y) shall replace the target by the same entry union and return its exact number of set bits, with the same source-alias and capacity-retention guarantees as union_assign.

    Union assignment shall retain the target's allocated bit capacity when it is sufficient for the result and shall not shrink that capacity.

    Difference shall use a lazily owned unbounded-integer temporary. In a non-thread-safe configuration, calls shall be serialized against other PPL arithmetic sharing that temporary machinery, even on distinct row objects. In a thread-safe configuration the pool shall belong to the calling thread. No explicit initialization shall be required for this temporary ownership.

    RATIONALE:

    Algorithms reuse bit rows as operands and targets; storage reuse must preserve entry-value set algebra.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    Bit_Row(const Bit_Row& y, const Bit_Row& z);
    void union_assign(const Bit_Row& x, const Bit_Row& y);
    unsigned long union_assign_and_count(const Bit_Row& x, const Bit_Row& y);
    void intersection_assign(const Bit_Row& x, const Bit_Row& y);
    void difference_assign(const Bit_Row& x, const Bit_Row& y);
    
    VERIFICATION_CRITERIA:

    Check union cardinality against an independent finite set across limb boundaries, including empty, aliased, preallocated and recycled targets. Exhaust independent small set masks spread over several limbs for distinct and aliased targets, both source orders, equal operands, empty/nonempty size asymmetry and unchanged distinct sources. Check that union assignment retains sufficient capacity when the result becomes smaller or empty.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc; tests/bitrowreuse1.cc; tests/bitrowunioncount1.cc.

  • PPL-SPEC-000446
    6. Ordered bit traversal, cardinality and absence UID: PPL-SPEC-000446 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    first() and last() shall return the minimum and maximum members of S, respectively. next(p) shall return the least member strictly greater than p; prev(p) shall return the greatest member strictly less than p. Each shall return ULONG_MAX when no such member exists. The position arguments shall admit the full unsigned long range: next(ULONG_MAX) and prev(0) shall report absence, while prev(ULONG_MAX) shall return the last member of a nonempty row.

    count_ones() shall return |S|, and empty() shall be true exactly for the empty set. These queries shall preserve the row and shall not allocate storage merely to inspect high positions.

    RATIONALE:

    Strict predecessor/successor semantics and a reserved absence value make sparse incidence enumeration unambiguous.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    unsigned long first() const;
    unsigned long last() const;
    unsigned long next(unsigned long position) const;
    unsigned long prev(unsigned long position) const;
    unsigned long count_ones() const;
    bool empty() const;
    
    VERIFICATION_CRITERIA:

    Compare complete ascending/descending enumerations, cardinality and all local query positions with an independent ordered set; include empty sets, internal zero limbs, exact limb boundaries and maximum unsigned queries.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000447
    7. Bit-set equality and inclusion predicates UID: PPL-SPEC-000447 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    operator== shall be true exactly when the operand sets are equal; operator!= shall be its negation. Both subset_or_equal forms shall return true exactly for X ⊆ Y. On a true result, the output strict_subset shall be true exactly for X ⊊ Y; its value after a false result shall be unspecified. The separate strict_subset function shall return true exactly for proper inclusion. All row operands shall remain unchanged, and they may designate the same object.

    RATIONALE:

    Set inclusion supplies a different relation from the total ordering used for row sorting.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    bool operator==(const Bit_Row& x, const Bit_Row& y);
    bool operator!=(const Bit_Row& x, const Bit_Row& y);
    bool subset_or_equal(const Bit_Row& x, const Bit_Row& y);
    bool subset_or_equal(const Bit_Row& x, const Bit_Row& y, bool& strict_subset);
    bool strict_subset(const Bit_Row& x, const Bit_Row& y);
    
    VERIFICATION_CRITERIA:

    Exhaust pairs of literal set masks with equal/unequal limb extents, proper inclusion, incomparable sets, both initial strict-output values and self operands; inspect the strict-output value only when inclusion succeeds.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000448
    8. Least-significant differing-position total order UID: PPL-SPEC-000448 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    compare(x,y) shall return zero for equal sets. Otherwise, let k = min(X△Y) be the smallest position whose membership differs. It shall return 1 when k ∈ X and  − 1 when k ∈ Y. The result shall define a total order in which a proper subset precedes its superset. It shall compare membership starting at the least significant differing position, including when that order differs from comparing the sets' binary integers numerically. Both operands shall remain unchanged and may designate the same row.

    RATIONALE:

    A precise row ordering supports deterministic sorting while retaining the inclusion-order extension property.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    int compare(const Bit_Row& x, const Bit_Row& y);
    
    VERIFICATION_CRITERIA:

    Use an independent ascending symmetric-difference oracle, exact return codes, all small mask pairs and triples for order properties, high-limb differences and a low-bit-versus-higher-bit example that distinguishes integer ordering.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000449
    9. Bit-row owner exchange and vector element exchange UID: PPL-SPEC-000449 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Member/free swaps shall exchange the complete represented sets and their owned storage without changing either owner object's identity. Self-swap shall preserve its value. iter_swap shall exchange the rows at two valid iterators into live std::vector<Bit_Row> objects, including equal iterators, and shall preserve all other vector elements and vector shape. The vector iterators shall remain valid when they were valid on entry. Subsequent mutation and destruction of an exchanged row shall remain independent of every other row.

    RATIONALE:

    Row permutation must transfer owners rather than leave shared or dangling bit storage.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

    void Bit_Row::m_swap(Bit_Row& y);
    void swap(Bit_Row& x, Bit_Row& y);
    void iter_swap(std::vector<Bit_Row>::iterator x,
                   std::vector<Bit_Row>::iterator y);
    
    VERIFICATION_CRITERIA:

    Check empty/nonempty/differently allocated swaps, self swaps, vector exchanges and cross-vector exchanges, then mutate exchanged owners and verify unrelated rows and vector positions.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-000450
    10. Bit-row validity and allocated-memory accounting UID: PPL-SPEC-000450 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For a valid row, OK() shall return true. The validity condition shall require nonnegative used-limb count no greater than allocated-limb count, and a nonzero highest used limb whenever any limb is used. external_memory_in_bytes() shall report the allocated GMP limb payload in bytes, including spare allocated limbs. total_memory_in_bytes() shall return sizeof(Bit_Row) + external_memory_in_bytes(). These queries shall preserve the row and its represented set. An empty set shall not require its owned allocation to have been released.

    RATIONALE:

    Logical emptiness and allocated capacity are distinct properties of an owned bit row.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Row.

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

    Check empty/populated/cleared/copied/swapped rows, exact total/external relation, a bit-position-based information-storage lower bound and invariants after every mutation history.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; src/Bit_Row.cc; tests/bitrowprefix1.cc; tests/bitrowspec1.cc.

  • PPL-SPEC-001648
    11. Translation of bit-row member positions UID: PPL-SPEC-001648 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    shift_left(count) shall replace the entry set S by {k + count ∣ k ∈ S}. Every resulting member shall be less than ULONG_MAX; the caller shall ensure this bound before the call. A zero shift shall preserve the set. An empty set shall remain empty for every unsigned long count, including ULONG_MAX, without growing its owned storage. Translation shall preserve the number of members and shall not change independently owned copies.

    Valid use and resource conditions shall follow 🔗 1. Finite bit-set row values and valid use.

    RATIONALE:

    Prepending unconstrained generator directions adds zero leading columns to a saturation matrix. Translating stored bit positions preserves the existing incidences in their new columns.

    INTERFACE:

    Internal source header: Bit_Row_defs.hh; namespace Parma_Polyhedra_Library. The signature belongs to Bit_Row.

    void shift_left(unsigned long count);
    
    VERIFICATION_CRITERIA:

    Compare literal finite-set translations and composed shifts across GMP limb boundaries. Check zero shifts, independent retained copies, cardinality, traversal and empty shifts by the maximum count without storage growth.

    SOURCE:

    src/Bit_Row_defs.hh; src/Bit_Row_inlines.hh; tests/bitrowspec1.cc.

PPL-LLR-000143
3. Bit-matrix coordinate preservation UID: PPL-LLR-000143 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

A bit matrix shall preserve the association between row and column positions when it is resized or transposed within supported dimensions. Resizing shall retain entries in the common old and new coordinate range, discard removed entries, and initialize newly introduced entries to false. Transposition shall exchange row and column positions and their dimensions without changing entry values.

RATIONALE:

Matrix shape changes must not corrupt the incidence relationships that the matrix records.

COMMENT:

Verification covers bit-matrix dimensions, resizing and transposition. Verification checks complete coordinate/value associations against an independent Boolean-array model, including removal followed by growth. Successful mathematical results assume valid inputs, documented caller preconditions, and arithmetic representable under the selected configuration; resource or arithmetic failures are not successful results.

VERIFICATION_CRITERIA:

Compare rectangular, empty, one-row, and one-column matrices with an independent Boolean-array model through growth, shrinkage, and transposition histories. Verify that transposing twice restores all dimensions and entries and that removed values do not reappear after later growth. Include changes that reallocate row storage.

SOURCE:

src/Bit_Matrix_defs.hh: resizing and transposition contracts. src/Bit_Matrix.cc: column truncation, row growth and removal, and transpose construction. tests/bitmatrixmemory1.cc: matrix-storage and lifecycle scenarios.

  • PPL-SPEC-000461
    1. Rectangular Boolean values and valid internal use UID: PPL-SPEC-000461 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Bit_Matrix shall own a rectangular Boolean array B with r rows and c columns. Its stored row i shall represent exactly {j ∣ 0 ≤ j < c∧Bij} under 🔗 1. Finite bit-set row values and valid use. Set bits outside the declared column range shall violate the matrix invariant, even though the corresponding Bit_Row value alone is valid.

    Operations shall require live valid objects and indices, counts and capacity calculations within their supported representable and storage limits, with sufficient resources. Callers shall prevent concurrent access conflicting with mutation. No library or thread initialization object or coefficient-constant stage shall be required. Allocation or interruption failure shall not constitute a successful matrix result. Failed C++ construction shall release resources owned by its incomplete object. Surviving owners shall remain destructible; rollback shall apply only where the individual contract promises it. Ordinary allocation-failure recovery shall not be promised for fatal GMP allocation failure.

    RATIONALE:

    Incidence and saturation matrices need explicit coordinate meaning and width invariants independent of the configured coefficient type.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    class Bit_Matrix;
    
    VERIFICATION_CRITERIA:

    Compare all entries and both extents with independent Boolean arrays, exercise row-width checks, preserve separate lifetimes, and run without initialization in threaded and non-thread-safe configurations. Inject observable C++ allocation failures during construction.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000462
    2. Empty and explicitly shaped construction and extent queries UID: PPL-SPEC-000462 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Default construction shall produce shape 0×0. Construction with row and column counts shall produce that exact shape with every entry false, including shapes with zero rows or zero columns. num_rows() and num_columns() shall return the corresponding extents without mutation. max_num_rows() shall report the row-vector storage limit; it shall not promise that every shape up to that row count is practically allocatable or impose an independent column bound.

    RATIONALE:

    An empty collection of rows and a collection of empty rows have different shapes that transposition must retain.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    Bit_Matrix();
    Bit_Matrix(dimension_type n_rows, dimension_type n_columns);
    static dimension_type max_num_rows();
    dimension_type num_rows() const;
    dimension_type num_columns() const;
    
    VERIFICATION_CRITERIA:

    Check zero, one and rectangular extents, zero initialization, the reported row limit and preservation of column count when the row count is zero.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000463
    3. Owned copies, assignment, exchange and lifetime UID: PPL-SPEC-000463 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Copy construction and assignment shall preserve both source extents and all entries while establishing independent storage. Assignment shall return its target and admit self-assignment. A copy shall remain usable after source mutation or destruction. Copying an rvalue through these copy interfaces shall preserve its source. Destruction shall release the row-vector storage and the bit storage owned by its rows.

    Member and free swaps shall exchange complete shapes and row contents, including storage ownership, and admit self-swap. The resulting owners shall remain independent.

    RATIONALE:

    Copied saturation data and temporary transposition results require separate ownership without accidental sharing.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

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

    Check copy and assignment for empty, zero-width and populated shapes, self-assignment, source destruction, rvalue copying, independent mutations, self/member/free swaps and observable copy-construction allocation failure.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000464
    4. Borrowed indexed row access UID: PPL-SPEC-000464 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For 0 ≤ i < r, indexed access shall return a borrowed reference to stored row i, with a const reference for a const matrix. Mutating that row shall affect exactly its represented entries. Callers shall retain no reference across owner destruction or a matrix operation that can replace, reallocate, remove or reorder its row storage. Before using other matrix operations, callers shall ensure that every set position in a mutated row is below the current column count; the validity query may inspect a live row that violates this width condition.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Algorithms update incidence rows directly, so borrowing and responsibility for the enclosing width must be explicit.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    Bit_Row& operator[](dimension_type k) &;
    const Bit_Row& operator[](dimension_type k) const &;
    
    VERIFICATION_CRITERIA:

    Compare const and mutable views with literal row sets, modify independent rows across limb boundaries, and check that an out-of-width insertion is detected before restoring the width invariant. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000465
    5. General resizing preserves the common rectangle UID: PPL-SPEC-000465 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    A successful resize(r2, c2) shall establish shape r2×c2. For each coordinate retained in both the old and new rectangles it shall preserve the previous entry. Every newly introduced entry shall be false. Removed rows and columns shall be discarded, so later growth shall not restore their former true values. The operation shall admit unchanged extents and all combinations of zero extents.

    RATIONALE:

    Growth and truncation must preserve coordinate associations rather than the incidental GMP capacity of retained rows.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void resize(dimension_type new_n_rows, dimension_type new_n_columns);
    
    VERIFICATION_CRITERIA:

    Compare complete Boolean arrays through all small shape pairs and larger limb-boundary histories, including simultaneous row growth and column shrinkage, retained vector capacity and reallocation.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000466
    6. Trailing removal and clearing UID: PPL-SPEC-000466 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    With a count no greater than the row count, trailing-row removal shall discard exactly that suffix and preserve all retained entries and the column count. With a count no greater than the column count, trailing-column removal shall decrease the width by that count and preserve the row count and remaining entries. This column operation shall require all removed columns to be false; it shall not replace the bit-clearing semantics of general resizing. Both removals shall admit a zero count.

    clear() shall release row-vector and owned bit storage and establish shape 0×0, from which ordinary construction by mutation shall remain possible.

    RATIONALE:

    Cheap removal of already-zero columns has a stronger caller precondition than truncating arbitrary columns.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void remove_trailing_rows(dimension_type n);
    void remove_trailing_columns(dimension_type n);
    void clear();
    
    VERIFICATION_CRITERIA:

    Check zero, partial and complete suffix removal with valid zero columns, preserve retained entries, and verify clear/rebuild histories and zero managed storage after clear.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000467
    7. Transposition and transposed assignment UID: PPL-SPEC-000467 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Transposition of a shape r×c shall produce shape c×r and satisfy B’ji = Bij at every original coordinate. Transposed assignment shall replace its target with the transpose of the source, preserving a distinct source. It shall also admit the source being its target. A recoverable failure before the replacement is installed shall preserve the target. Zero extents shall be exchanged exactly, and transposing twice shall restore the original shape and entries.

    RATIONALE:

    Transposition exchanges incidence coordinates and needs a complete temporary owner for safe replacement and self-aliasing.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void transpose();
    void transpose_assign(const Bit_Matrix& y);
    
    VERIFICATION_CRITERIA:

    Check rectangular, square, empty-row and empty-column shapes, individual true coordinates across limb boundaries, double transpose, distinct/source-target aliases and observable allocation failure before replacement.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000468
    8. Row sorting and duplicate elimination UID: PPL-SPEC-000468 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    A successful sort_rows() shall preserve the column count and replace the row sequence by its distinct row values in increasing Bit_Row comparison order, as defined by 🔗 8. Least-significant differing-position total order. At the least position where two row values differ, the row without that bit shall precede the row with it. Sorting shall preserve each retained row's complete bit set, admit zero or one row, and be idempotent. Sorting shall not preserve former row-index associations.

    RATIONALE:

    Sorted row sets support exact binary search; bit-set order differs from comparison of binary integers.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void sort_rows();
    
    VERIFICATION_CRITERIA:

    Use an independent Boolean lexicographic comparator, compare the complete distinct sequence across permutations and duplicates, and include zero-column, one-row and empty matrices.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000469
    9. Membership in a sorted row sequence UID: PPL-SPEC-000469 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Given a matrix whose row sequence is actually nondecreasing under the order in 🔗 8. Row sorting and duplicate elimination, sorted_contains(row) shall return true exactly when one stored row has the same finite set of true positions as the query. It shall preserve the matrix and query and admit a query borrowed from the matrix. A query may contain positions beyond the matrix width, in which case it cannot equal a valid stored row. An empty matrix shall report absence.

    RATIONALE:

    Binary search requires actual sortedness rather than an unrecorded intention to sort.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    bool sorted_contains(const Bit_Row& row) const;
    
    VERIFICATION_CRITERIA:

    Check every small candidate row against an independent set of stored rows, duplicate sorted inputs, empty matrices, borrowed queries and absent high-position queries.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000470
    10. Recycled row insertion transfers ownership UID: PPL-SPEC-000470 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    A successful recycled-row insertion shall append the donor's previous bit set and preserve all earlier rows and the column count. The donor shall be a separate live row, not borrowed from the target matrix, with all set positions below the matrix width. The resulting row count shall fit the row-storage limit. After successful return the donor shall be empty and reusable; the appended row shall own its storage independently of subsequent assignment to or destruction of the donor.

    RATIONALE:

    Explicit ownership transfer avoids copying bit storage while retaining the matrix-width invariant.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    void add_recycled_row(Bit_Row& row);
    
    VERIFICATION_CRITERIA:

    Append external empty and populated donors through repeated capacity growth and reuse, check that each donor is empty, assign new values to and destroy donors, and compare all earlier and appended rows with independent literal arrays.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/bitrowreuse1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000471
    11. Matrix equality includes both extents and all entries UID: PPL-SPEC-000471 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Equality shall return true exactly when both row and column counts agree and every corresponding entry agrees. Inequality shall be its logical negation. The result shall ignore unused allocated capacity and admit aliases. Distinct zero-row widths and distinct zero-column row counts shall remain unequal.

    RATIONALE:

    Finite bit-set rows alone cannot distinguish different declared rectangular shapes.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    bool operator==(const Bit_Matrix& x, const Bit_Matrix& 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 equal values reached through different allocation histories, every shape mismatch, individual entry changes and self-comparisons.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000472
    12. ASCII representation and loading UID: PPL-SPEC-000472 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    With decimal numeric formatting and numeric Boolean output selected on the stream, ASCII output shall emit the decimal row count, x and decimal column count, followed in row-major order by each entry as 0 or 1. Whitespace shall separate these tokens; each row shall have its own output line. No-argument output shall use the library diagnostic-output destination std::cerr. print() shall emit a diagnostic to std::cerr identifying that no user-level output operator is defined for Bit_Matrix.

    With decimal numeric input formatting, admissible dimensions and resources, loading shall read the shape header and exactly that many integer entry tokens, replace the target's complete shape and entries, and return true. Zero entry tokens shall denote false and nonzero integer tokens true. Invalid header tokens, invalid integer tokens or premature end of input shall return false; the target shall remain a live valid matrix, without a promise to preserve its preceding shape or entries. Tokens following a complete representation shall remain available to the caller. Successful dump/load round trips shall preserve both extents and every entry.

    RATIONALE:

    Reloadable matrix data needs explicit shape, Boolean interpretation and failure-state rules.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

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

    Check exact dump tokens and lines, round trips of zero and rectangular shapes, replacement of old true bits by false, nonzero integer entry interpretation, trailing tokens, each malformed header category and truncation at every token boundary.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

  • PPL-SPEC-000473
    13. Invariant, ordering and allocated-memory queries UID: PPL-SPEC-000473 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For live rows with valid bit-row storage, OK() shall return true exactly when every row is valid and no row has a set position at or beyond the declared column count. In builds with assertions enabled, check_sorted() shall return true exactly when the stored rows are nondecreasing under their comparison order; duplicates shall be allowed.

    External memory shall equal the allocated row-vector capacity in bytes plus the external memory owned by each live bit row. Total memory shall add sizeof(Bit_Matrix). These queries shall describe allocated storage, including unused capacity retained after shrinkage, and shall preserve the matrix.

    RATIONALE:

    Validity, sortedness and allocated capacity are distinct properties that algorithms and storage diagnostics inspect.

    INTERFACE:

    Internal source header: Bit_Matrix_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to Bit_Matrix.

    bool OK() const;
    #ifndef NDEBUG
    bool check_sorted() const;
    #endif
    memory_size_type external_memory_in_bytes() const;
    memory_size_type total_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Check valid and temporarily out-of-width rows, all adjacent-order outcomes and duplicates, memory identities and row-storage lower bounds through growth and shrinkage; compare exact row-vector payload with the allocation recorder in bitmatrixmemory1.

    SOURCE:

    src/Bit_Matrix_defs.hh; src/Bit_Matrix_inlines.hh; src/Bit_Matrix.cc; tests/bitmatrixspec1.cc; tests/matrix1.cc; tests/bitmatrixmemory1.cc.

PPL-LLR-000144
4. Ordered coefficient-map semantics UID: PPL-LLR-000144 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

Within supported key and capacity limits, the ordered coefficient map shall retain one coefficient value per stored dimension key and enumerate stored entries in increasing key order. Insertion of an existing key with an explicit value shall replace that value without creating a duplicate key; removal shall preserve all unrelated key-value associations. Stored values shall remain independent of the lifetime of the insertion argument.

RATIONALE:

Sparse numerical representations require stable associations between dimensions and coefficients even when storage is reorganized.

COMMENT:

Verification covers coefficient-map lookup, insertion, replacement, traversal and removal, including argument independence and iterator validity. Verification compares key/value histories with an independent ordered-map model. Successful mathematical results assume valid inputs, documented caller preconditions, and arithmetic representable under the selected configuration; resource or arithmetic failures are not successful results.

VERIFICATION_CRITERIA:

Compare valid insertion, replacement, lookup, traversal, and deletion histories with an independent ordered-map model. Include sparse keys, zero coefficients, insertion arguments that refer to a value already in the map when supported, storage growth and shrinkage, and documented iterator invalidation. Check equality of stored coefficients rather than storage addresses.

SOURCE:

src/CO_Tree_defs.hh: ordered key-coefficient entries, explicit-value replacement, argument independence, capacity limits, and iterator invalidation. src/CO_Tree.cc and src/CO_Tree_templates.hh: tree storage changes. tests/CO_Tree/cotree1.cc and tests/CO_Tree/memory1.cc: map operations and allocation-sensitive histories.

  • PPL-SPEC-000616
    1. Default-value insertion retains an existing coefficient UID: PPL-SPEC-000616 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Under 🔗 1. Ordered coefficient-map values and valid tree use, insertion of a valid key without an explicit value shall preserve an existing entry's coefficient and return its exact position. If the key is absent, it shall add one explicitly stored zero coefficient and return the new entry. Every other association shall be preserved. A new entry shall require the resulting count to be within max_size(). The library coefficient-zero constant shall be available where this form uses it. Ordinary entry iterators shall be reacquired after the call, except for its returned position; cached end references shall retain 🔗 9. Begin positions and owner-stable cached end references.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Ensuring that a sparse position exists differs from overwriting a coefficient with a supplied value.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator insert(dimension_type key) &;
    
    VERIFICATION_CRITERIA:

    Check absent and present keys across independent finite maps, including nonzero/zero existing values, sparse extremes, empty maps and capacity growth. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000617
    2. Explicit insertion and replacement capture the argument value UID: PPL-SPEC-000617 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Insertion with an explicit coefficient shall set the requested key to the argument's value on entry, creating the entry if absent or replacing its prior coefficient if present. The returned iterator shall denote that exact key and stored value. Every other association shall be preserved; zero shall remain an explicitly stored entry. A new entry shall require its resulting count to fit max_size().

    The argument may be an independent coefficient or a live coefficient borrowed from this tree, including the replaced entry. Its entry value shall be retained across rebalancing and backing-array relocation. No argument reference shall be retained by the stored coefficient. Clients shall reacquire ordinary iterators after insertion and shall not reuse old coefficient borrows after a new entry can invalidate them. Cached end references shall retain 🔗 9. Begin positions and owner-stable cached end references.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Sparse numerical updates need value copying even when a donor belongs to the target owner and insertion changes its layout.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator insert(dimension_type key, data_type_const_reference data) &;
    
    VERIFICATION_CRITERIA:

    Compare insertion/overwrite maps for independent arguments, every donor/receiver combination in small maps, and borrowed arguments across real capacity/rebalancing boundaries; check source destruction and multi-limb values where supported. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000618
    3. Hinted insertion preserves the unhinted map result UID: PPL-SPEC-000618 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Both hinted insertion forms shall admit any current valid iterator of the same tree, including end, as their hint. The hint shall not affect whether an entry is created or replaced, the returned key, or any resulting key/coefficient association. The default form shall satisfy 🔗 1. Default-value insertion retains an existing coefficient and the explicit-value form 🔗 2. Explicit insertion and replacement capture the argument value, including borrowed coefficient arguments. The hint shall be used only while valid within the call; clients shall reacquire ordinary iterators after return.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Locality hints can improve the search strategy but cannot alter coefficient-map semantics.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator insert(iterator itr, dimension_type key) &;
    iterator insert(iterator itr, dimension_type key, data_type_const_reference data) &;
    
    VERIFICATION_CRITERIA:

    For every occupied/end hint in small maps, compare default and explicit-value results with an independent dictionary, including near/far keys, overwrite, aliasing and empty-map end hints. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000619
    4. Erasure by key returns the strict successor UID: PPL-SPEC-000619 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Erasure by a valid key shall remove exactly that entry when present and otherwise preserve the map. It shall return the least remaining stored key strictly greater than the argument, or end if none exists. An empty tree shall return end. The reserved key value shall remain outside this mutation's key precondition even though it is an admitted absent lookup query. All surviving key/coefficient associations shall be preserved, including explicitly stored zeros. Ordinary iterators shall be reacquired after the call; cached end references shall remain valid.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    A sparse erasure’s continuation is a strict successor even when the requested key was absent.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator erase(dimension_type key) &;
    
    VERIFICATION_CRITERIA:

    Compare present/absent erasures against independent dictionaries and upper-bound successors, including both extremes, singleton/empty results, holes, compaction and backing shrinkage. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000620
    5. Erasure by occupied iterator removes exactly its entry UID: PPL-SPEC-000620 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Iterator erasure shall require a live occupied iterator from its target tree, rather than end. It shall remove exactly that iterator's entry and return the least remaining stored key greater than the removed key, or end if none exists. Every surviving association shall be preserved. Other ordinary iterators and coefficient references shall be reacquired after this structural mutation; the returned position and cached end references shall remain usable.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Removing a known occupied position must retain its successor meaning despite rebalancing or shrinking storage.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator erase(iterator itr) &;
    
    VERIFICATION_CRITERIA:

    Erase every occupied position in small maps, compare all survivors and the returned successor, and include first/last/singleton removal and later reuse. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000621
    6. Coordinate removal and order-preserving reindexing UID: PPL-SPEC-000621 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Coordinate removal shall admit a valid key k, remove its entry if present, and map every stored key q > k to q − 1 without changing its coefficient. Every key below k shall retain its key and value. This shall also apply when k is absent and to an empty map. The result shall contain exactly the transformed ordered map, including all surviving explicitly stored zeros. Ordinary iterators and coefficient references shall be reacquired; cached ends shall retain 🔗 9. Begin positions and owner-stable cached end references.

    erase_and_reindex(index_map) shall require a map covering every stored key. A value of not_a_dimension() shall select erasure; all other images of stored keys shall be valid and strictly increasing. The operation shall produce exactly those surviving entries with the mapped keys and unchanged coefficients, including explicitly stored zeroes. All erasures shall precede key renumbering. If an erasure allocation fails, the tree shall remain valid, possibly with some selected entries erased, and surviving keys shall retain their original numbering. Completed reindexing shall preserve cached-end behavior; ordinary iterators and coefficient references shall be reacquired.

    RATIONALE:

    Forgetting one coefficient-vector coordinate must shift later coordinates even if the removed coordinate had no stored entry.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    void erase_element_and_shift_left(dimension_type key);
    void erase_and_reindex(const std::vector<dimension_type>& index_map);
    
    VERIFICATION_CRITERIA:

    Compute an independent remove-and-decrement key transform for present/absent coordinates, zero and extreme valid keys, empty maps, stored zeros and repeated histories.

    Compare bulk erasure/reindexing with an independent ordered-map model for empty, identity, complete and partial removals, gaps in the images, absent entries and stored zeroes. Check cached ends, subsequent insertion and recoverable allocation failures after earlier erasures have completed.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000622
    7. Positive coordinate insertion shifts the complete selected suffix UID: PPL-SPEC-000622 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For threshold k and nonnegative amount n, the operation shall map each stored key q ≥ k to q + n and preserve its coefficient; all keys below k shall remain unchanged. Every actually transformed key shall remain a valid representable key, excluding the reserved value. If no key is affected, any representable threshold and amount shall be admitted without evaluating an overflowing key sum. Amount zero shall preserve the map.

    The operation shall retain the entry count, coefficient ownership, physical positions and current entry iterators. Existing iterators shall observe the transformed keys and unchanged coefficients. Cached ends shall remain valid.

    RATIONALE:

    Inserting coordinate positions must retain all suffix coefficient associations and avoid imposing artificial limits on unaffected sparse ranges.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    void increase_keys_from(dimension_type key, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Compare independent threshold/addition maps, all valid small amounts, zero, empty/unaffected suffixes and near-reserved key boundaries; check live iterators and coefficient addresses without using overflowing transforms.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000623
    8. Fast leftward key replacement preserves occupied positions UID: PPL-SPEC-000623 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Fast shifting shall require an occupied iterator at key q, a valid key i ≤ q, and no other stored key in [i, q). It shall replace exactly q by i, retaining its coefficient and every unrelated association. Choosing i = q shall be admitted. All current entry iterators and coefficient references shall remain valid; the selected iterator shall observe its new key at the same physical position. The map shall retain its entry count and owned storage, with no coefficient copying or allocation needed for the key replacement.

    RATIONALE:

    An order-preserving key correction can retain live iterator positions when the required gap is already empty.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    void fast_shift(dimension_type i, iterator itr);
    
    VERIFICATION_CRITERIA:

    Enumerate valid gap endpoints for every selected entry, compare independent single-key transforms, and retain all iterators/coefficient addresses across no-op and leftward replacements near zero and the reserved maximum.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000624
    9. Backing-array allocation failure preserves the prior map UID: PPL-SPEC-000624 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    When insertion or erasure requires replacement backing arrays, a recoverable failure allocating either replacement array shall preserve the prior complete map and its coefficient ownership, release incomplete replacement storage and retain valid cached ends. No insertion, removal or coordinate transformation shall be reported as a successful result when its required backing allocation fails. A retry with sufficient resources shall remain possible.

    This guarantee shall cover ordinary and hinted insertion, occupied/key erasure and erase-and-shift operations when they trigger a backing replacement. It shall not promise ordinary recovery after a fatal GMP allocation failure or after violation of a member's valid-input preconditions.

    RATIONALE:

    Relocation must not consume old coefficient owners until both replacement arrays are available.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator insert(dimension_type key);
    iterator insert(dimension_type key, data_type_const_reference data);
    iterator insert(iterator itr, dimension_type key);
    iterator insert(iterator itr, dimension_type key, data_type_const_reference data);
    iterator erase(dimension_type key);
    iterator erase(iterator itr);
    void erase_element_and_shift_left(dimension_type key);
    
    VERIFICATION_CRITERIA:

    Force growth and shrinkage and fail each replacement-array allocation for every applicable interface, preserving dictionary values and multi-limb owner identities; then retry and check the independent successful mutation.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • 1. Ordered coefficient-map values and valid tree use UID: PPL-SPEC-000601 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    CO_Tree shall own a finite map from distinct dimension_type keys to Coefficient values. Stored keys shall be strictly ordered and shall exclude not_a_dimension(). A stored zero coefficient shall remain a stored map entry. Physical array positions and holes shall not change the map's key/value associations.

    Calls shall require live valid owners, admitted keys/counts and supported nonoverflowing capacity calculations, with sufficient resources. Selected coefficient values and operations shall satisfy the configured arithmetic profile's prerequisites. Library initialization shall be active where coefficient constants or scratch storage are used, and synchronization shall follow 🔗 3. Thread initialization, default state and finalization. Recoverable failures shall not be successful map results. Failed construction shall release resources of the incomplete owner; failure-state guarantees shall follow the selected member, without a universal rollback promise.

    RATIONALE:

    Sparse numerical storage must preserve explicit key/value associations independently of the cache-oblivious array layout.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    class CO_Tree;
    
    VERIFICATION_CRITERIA:

    Compare complete ordered maps with independent integer dictionaries, including explicitly stored zeros and extreme valid keys, through valid lifetime and lookup histories.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000602
    2. Empty construction, entry counts and supported count limit UID: PPL-SPEC-000602 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Default construction shall produce an empty map with zero managed storage and equal begin/end positions. empty() shall report exactly whether no entries are stored, and size() their number, including stored zeros. max_size() shall report the supported element-count limit accounting for complete-tree capacities, density calculations and representable backing allocations; it shall not limit key magnitude to that count or promise that allocating the maximum is feasible.

    RATIONALE:

    Element count, sparse key magnitude and practical allocation availability are separate limits.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    CO_Tree();
    bool empty() const;
    dimension_type size() const;
    static dimension_type max_size();
    
    VERIFICATION_CRITERIA:

    Check empty/populated counts and zeros, sparse keys near the reserved maximum, and refusal of the first allocation at the advertised maximum without overflowing its capacity arithmetic.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000603
    3. Independent copying, assignment and destruction UID: PPL-SPEC-000603 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Copy construction and assignment shall preserve the source map and produce independently owned coefficient objects and backing arrays. Copies shall remain usable after source mutation or destruction. Assignment shall admit self-assignment and return its target. Copying a const rvalue through these copy interfaces shall preserve its source. Destruction shall release all live coefficients and both backing arrays.

    Recoverable copy-construction failure shall preserve the source and release the incomplete copy's resources. A recoverable assignment failure may discard the target's preceding contents, but shall leave a valid empty reusable target and preserve the source.

    Transfer construction from a non-const rvalue shall acquire the complete owned storage without allocating or throwing and leave its source empty and reusable. Move assignment shall exchange complete storage owners without allocation or exceptions, return its target and leave its source holding the preceding target value. Self-move shall preserve both value and storage. References to elements shall follow their storage; distinct-owner transfers shall invalidate element iterators. References to cached ends shall remain bound to their original tree owners and shall be refreshed after transfer. Explicitly stored zeroes and physical layout metadata shall be transferred with their arrays.

    RATIONALE:

    Tree copies need separate value ownership, while destructive replacement assignment has an explicit empty-target failure state.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    CO_Tree(const CO_Tree& y);
    CO_Tree& operator=(const CO_Tree& y);
    ~CO_Tree();
    CO_Tree(CO_Tree&& y) noexcept;
    CO_Tree& operator=(CO_Tree&& y) & noexcept;
    
    VERIFICATION_CRITERIA:

    Check nonthrowing move traits, zero C++/GMP allocation during transfers, exact values and storage ownership, empty and reserved-empty inputs, self-moves, const-rvalue copies, source reuse and independent mutations after exchange. Check independent populated/empty copies and assignments, self-assignment, source destruction, rvalue copying, multi-limb owners where available and both backing-allocation failures followed by retry.

    SOURCE:

    tests/rowmovespec1.cc; src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000604
    4. Construction from a counted increasing-key input sequence UID: PPL-SPEC-000604 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For a count not exceeding max_size(), sequence construction shall consume exactly that many entries from the input position. The sequence shall provide coefficient values by dereference and their keys through index(); keys shall be valid and strictly increasing. The new map shall contain exactly those key/value pairs, including zero values, as independently owned coefficient copies. No following input position shall be dereferenced or have its key requested. Count zero shall produce an empty map without dereferencing or advancing the input.

    If allocation, key access, dereference, coefficient construction or input advancement reports a recoverable exception, the incomplete tree shall release both backing arrays and every coefficient already constructed. The caller's input state shall follow its iterator's own copy and failure semantics; restoring a consumed input position shall not be promised.

    RATIONALE:

    Counted sparse ranges provide efficient construction and must clean partial ownership even when the input iterator reports a failure.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    template <typename Iterator>
    CO_Tree(Iterator i, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Compare every prefix of independent increasing-key sequences, include zero count and growth boundaries, and throw at each key/dereference/advance step after partial coefficient acquisition.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000605
    5. Clearing and swapping complete tree owners UID: PPL-SPEC-000605 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Clearing shall destroy all entries and release backing storage, producing an empty reusable tree. Member and free swaps shall exchange complete maps and owned allocations and admit self-swap. Both resulting owners shall remain valid and independently usable. Their cached end-iterator objects shall retain their owner identities and be refreshed for their new maps; ordinary entry iterators and coefficient borrows shall be reacquired after an ownership exchange.

    RATIONALE:

    Tree ownership includes coefficient storage and cached end positions, which must remain consistent after replacement.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    void clear();
    void m_swap(CO_Tree& x);
    void swap(CO_Tree& x, CO_Tree& y);
    
    VERIFICATION_CRITERIA:

    Check all empty/populated owner combinations, exchanged maps and storage counts, self-swaps and clear/rebuild histories using retained references to each owner’s cached end objects.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000606
    6. Iterator ownership, copying, const conversion and equality UID: PPL-SPEC-000606 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Tree iterators shall borrow positions in their owner. Copies and assignments shall preserve the borrowed position; assignment shall return its target and admit self-assignment. Mutable iterators shall convert or assign to const iterators without changing the position or entry. Member and free iterator swaps shall exchange their complete borrowed positions and admit self-swap, including positions in distinct live owners.

    Within one owner, equality shall report the same position and inequality its negation. Comparisons shall require live compatible positions; copied end values shall remain subject to ordinary structural invalidation. Default construction shall create an unbound iterator usable for copying, assignment, swapping and destruction, but not entry access or navigation before a live position is assigned. Iterators and coefficient references shall not outlive their owner or be used after a structural operation that invalidates them.

    RATIONALE:

    Borrowed iterator values need complete position and lifetime semantics independently of coefficient ownership.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    class CO_Tree::iterator;
    class CO_Tree::const_iterator;
    iterator();
    explicit const_iterator();
    iterator(const iterator& itr);
    const_iterator(const const_iterator& itr);
    const_iterator(const iterator& itr);
    iterator& iterator::operator=(const iterator& itr);
    const_iterator& const_iterator::operator=(const const_iterator& itr);
    const_iterator& const_iterator::operator=(const iterator& itr);
    void iterator::m_swap(iterator& itr);
    void const_iterator::m_swap(const_iterator& itr);
    bool iterator::operator==(const iterator& x) const;
    bool iterator::operator!=(const iterator& x) const;
    bool const_iterator::operator==(const const_iterator& x) const;
    bool const_iterator::operator!=(const const_iterator& x) const;
    void swap(CO_Tree::iterator& x, CO_Tree::iterator& y);
    void swap(CO_Tree::const_iterator& x, CO_Tree::const_iterator& y);
    
    VERIFICATION_CRITERIA:

    Check copied/assigned mutable and const positions, unbound-to-bound assignment, same/different positions, cross-owner iterator swaps and self-swaps without using invalidated positions.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000607
    7. Iterator key and coefficient access UID: PPL-SPEC-000607 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    At a dereferenceable occupied position, index() shall return the stored key and dereference shall return its associated coefficient value. A mutable iterator shall provide a mutable coefficient reference even when the cursor object itself is const; constness shall constrain the position rather than the referenced coefficient. Read-only access shall use const_iterator and Coefficient_traits::const_reference. Both iterator types shall meet C++20 bidirectional iterator requirements. These operations shall require an occupied entry, rather than an end or unbound iterator.

    Changing the coefficient through a live mutable reference shall update exactly that key's mapped value without changing keys, count, other entries or iterator positions. Assigning zero shall retain the entry. The new coefficient shall satisfy the configured profile's value and arithmetic prerequisites.

    RATIONALE:

    Sparse coefficient updates must preserve key identity and the stored-zero distinction.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    dimension_type iterator::index() const;
    dimension_type const_iterator::index() const;
    Coefficient& iterator::operator*() const;
    Coefficient_traits::const_reference const_iterator::operator*() const;
    
    VERIFICATION_CRITERIA:

    Check C++20 iterator concepts, constant-cursor reference identity and read-only non-writability. Compare all key/value pairs through mutable, const mutable-iterator and const-iterator access; update each value and zero through live borrows while retaining other iterator positions.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000608
    8. Bidirectional iterator movement follows stored-key order UID: PPL-SPEC-000608 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Increment of a dereferenceable iterator shall reach the next greater stored key or the owner's end after the last entry. Decrement shall require a preceding occupied entry and reach the next smaller stored key; decrementing end shall be admitted exactly for a nonempty owner. Physical holes shall be skipped. Prefix forms shall return the updated iterator by reference; postfix forms shall return its preceding value while advancing the original. These rules shall apply to mutable and const iterators, with no increment of end or decrement before begin.

    RATIONALE:

    Ordered traversal must expose every stored coefficient exactly once without exposing physical holes.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    iterator& iterator::operator++();
    iterator& iterator::operator--();
    iterator iterator::operator++(int);
    iterator iterator::operator--(int);
    const_iterator& const_iterator::operator++();
    const_iterator& const_iterator::operator--();
    const_iterator const_iterator::operator++(int);
    const_iterator const_iterator::operator--(int);
    
    VERIFICATION_CRITERIA:

    Compare complete forward/backward key sequences and prefix/postfix return positions over sparse layouts, singleton maps, and nonempty end decrements.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • 9. Begin positions and owner-stable cached end references UID: PPL-SPEC-000609 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Mutable and const begin construction and access shall point to the least stored key, or the corresponding end for an empty map. cbegin() shall equal const begin(). End access shall return references to owner-resident cached end objects; const end() and cend() shall refer to the same const cached object.

    References to these cached end objects shall remain valid throughout the owner's lifetime and observe updated end positions after structural changes, assignment, clearing and member/free owner swaps. This special reference guarantee shall not extend to copies of an end iterator or to ordinary entry iterators.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive. Direct iterator construction shall also reject a temporary tree owner.

    RATIONALE:

    Cached ends support traversal loops across tree storage replacement without retaining stale copied sentinels.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    explicit iterator(CO_Tree& tree);
    explicit const_iterator(const CO_Tree& tree);
    iterator begin() &;
    const iterator& end() &;
    const_iterator begin() const &;
    const const_iterator& end() const &;
    const_iterator cbegin() const &;
    const const_iterator& cend() const;
    
    VERIFICATION_CRITERIA:

    Check begin construction/access and the identity of cached end references across insertion growth, erase/shrink, clear, copy assignment and swaps, reacquiring ordinary iterators after each structural change. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    tests/rowmovespec1.cc; src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • 10. Whole-tree bisection returns an exact key or an adjacent entry UID: PPL-SPEC-000610 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Whole-tree bisection shall return end for an empty map. For a nonempty map it shall return the exact requested key when present. For an absent key it shall return either the immediate stored predecessor or the immediate stored successor, choosing the available extreme when the query lies outside stored keys. It shall not return end for a nonempty map or promise the lower_bound choice. Every dimension_type query shall be admitted, including the reserved value as an absent query. Mutable and const overloads shall preserve all entries and return positions with the corresponding mutability.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Tree insertion and sparse lookups use a neighboring candidate rather than a lower-bound/end convention.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    iterator bisect(dimension_type key) &;
    const_iterator bisect(dimension_type key) const &;
    
    VERIFICATION_CRITERIA:

    Compare every present and absent query against independent predecessor/successor sets for many sparse maps, including empty maps, both extremes, stored zeros and the maximum query value. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000611
    11. Closed-window bisection confines its candidate to that window UID: PPL-SPEC-000611 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Window bisection shall require an ordered nonempty closed iterator range [first, last] in the same live tree, with both endpoints occupied. It shall search only that window. A present key in the window shall be returned exactly; an absent key shall yield an immediate predecessor or successor within that window, using its available endpoint when the query lies outside the window's key interval. A singleton window shall always return its sole entry. The map and both endpoints shall be preserved.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Internal sparse operations need bounded searches whose inclusive last endpoint differs from conventional half-open ranges.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    iterator bisect_in(iterator first, iterator last, dimension_type key) &;
    const_iterator bisect_in(const_iterator first, const_iterator last,
                             dimension_type key) const &;
    
    VERIFICATION_CRITERIA:

    Enumerate every closed window in small sparse maps and all inside/outside queries; compare candidates with an independent submap and include singleton windows and exact endpoints. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000612
    12. Hinted bisection retains whole-tree lookup meaning UID: PPL-SPEC-000612 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Hinted bisection shall admit any current valid iterator of its tree as hint, including end. It shall satisfy the exact-key, adjacent-absent-key and empty-map guarantees of 🔗 10. Whole-tree bisection returns an exact key or an adjacent entry over the whole tree, regardless of the hint's location. It shall preserve the map and hint. The hint may affect search strategy and the permitted choice between two adjacent absent-key candidates; it shall not restrict the search window.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Locality hints are search aids and cannot exclude a valid exact key elsewhere in the tree.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    iterator bisect_near(iterator hint, dimension_type key) &;
    const_iterator bisect_near(const_iterator hint, dimension_type key) const &;
    
    VERIFICATION_CRITERIA:

    Check every occupied/end hint against all queries in independent sparse dictionaries, including searches far above/below the hint and empty-map end hints. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000613
    13. Managed storage counts backing arrays and live coefficient payloads UID: PPL-SPEC-000613 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    External-memory accounting shall return zero for a tree with no backing arrays. Otherwise it shall count the complete reserved key-array payload, including its two sentinel slots, the coefficient-array payload, including its unused leading slot, and the external storage of every live coefficient. Unoccupied coefficient slots shall not add coefficient payload. This shall describe owned allocated payload, excluding allocator bookkeeping, and preserve the map and all current iterators.

    RATIONALE:

    Sparse tree storage includes physical holes and sentinels as well as the coefficients visible during traversal.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    dimension_type external_memory_in_bytes() const;
    
    VERIFICATION_CRITERIA:

    Independently calculate reserved-array sizes and live coefficient allocation payloads across sparse layouts, multi-limb values where supported, copies, clear and ownership exchanges.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000614
    14. Diagnostic tree output reflects current stored pairs UID: PPL-SPEC-000614 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    dump_tree() shall write a diagnostic representation to std::cout without changing the tree. For an empty map it shall emit (empty tree) followed by a newline. For a nonempty tree the output shall identify all current stored key/coefficient pairs and may include physical-layout information and holes. A removed key/value pair shall not be reported as a live entry. This diagnostic representation shall not establish a reloadable serialization format.

    RATIONALE:

    Internal diagnostics must describe current sparse contents without being mistaken for an interchange encoding.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    void dump_tree() const;
    
    VERIFICATION_CRITERIA:

    Capture empty and populated output, match current pairs after removal and value replacement, and compare unchanged complete maps before and after output.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000615
    15. Physical-slot iterator construction preserves the selected live position UID: PPL-SPEC-000615 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Iterator construction from a tree and physical slot shall require a currently occupied slot or that tree's designated past-the-end slot. The argument shall denote a physical array slot, not a map key or an ordinal in the logical traversal. The resulting iterator shall borrow that same live position, with mutable/const access as selected.

    The tree's internal conversion from its live private node iterator to an ordinary mutable iterator, by construction or assignment, shall preserve the occupied node's key/value position. Such conversions shall require a valid occupied private node and shall not extend private node-layout access to clients without the corresponding access rights.

    Borrowing iterator constructors shall reject temporary backing owners. Copying temporary iterator values shall remain admitted when their backing storage remains alive.

    RATIONALE:

    Logical keys and physical DFS slots are different coordinates; the internal bridge must retain the selected stored entry.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree or its indicated nested iterator type.

    iterator(CO_Tree& tree, dimension_type i);
    const_iterator(const CO_Tree& tree, dimension_type i);
    explicit iterator(const tree_iterator& itr);
    iterator& iterator::operator=(const tree_iterator& itr);
    
    VERIFICATION_CRITERIA:

    Use permitted internal test access to obtain occupied slot identifiers and the true end slot, construct matching ordinary iterators, and check private-node conversions without manufacturing invalid slots. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree_templates.hh; src/CO_Tree.cc; tests/CO_Tree/cotreespec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc. tests/rowstoragespec1.cc.

  • PPL-SPEC-000283
    3. Sparse zero construction and storage limits UID: PPL-SPEC-000283 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Sparse construction shall retain the requested logical size, initially with no stored entries. The compatibility capacity argument shall be ignored. size() shall report logical size and num_stored_elements() shall count stored positions, including explicitly stored zeroes. max_size() shall return CO_Tree::max_size(), the supported number of stored elements; logical extent and admissible dimension keys shall remain distinct from that storage count. The type shall opt out of the C++20 sized-range customization so that standard range distances count iterated entries, including explicitly stored zeroes, rather than the logical extent.

    RATIONALE:

    Sparse vectors can carry a large zero extent while storing no coefficients.

    INTERFACE:
    explicit Sparse_Row(dimension_type size = 0);
    Sparse_Row(dimension_type size, dimension_type capacity);
    dimension_type Sparse_Row::size() const;
    dimension_type Sparse_Row::num_stored_elements() const;
    static dimension_type Sparse_Row::max_size();
    
    VERIFICATION_CRITERIA:

    Check logical-size independence from stored counts, standard range distances with explicit zeroes and empty support, ignored capacity, empty iteration and safe large logical zero extents.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc.

  • PPL-SPEC-000284
    4. Owning row copies, sized copies and storage conversion UID: PPL-SPEC-000284 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Ordinary row copies shall preserve size and every coefficient, own independent storage and survive source mutation/destruction. Dense copies shall retain source capacity unless supplied another admitted capacity. A copy with specified size/capacity shall retain the common source prefix, discard removed positions and zero-extend added positions. Explicit dense capacity shall be at least result size; sparse compatibility capacity shall be ignored. Cross-storage construction shall preserve that same complete coefficient vector. Dense-to-sparse construction may omit zero entries; sparse-to-dense construction shall materialize implicit zeroes. Const-rvalue forms selecting copy constructors shall retain the source value.

    RATIONALE:

    Copying and representation changes must preserve values independently of the source owner.

    INTERFACE:
    Dense_Row(const Dense_Row& y);
    Dense_Row(const Dense_Row& y, dimension_type capacity);
    Dense_Row(const Dense_Row& y, dimension_type size, dimension_type capacity);
    explicit Dense_Row(const Sparse_Row& y);
    Dense_Row(const Sparse_Row& y, dimension_type size, dimension_type capacity);
    Sparse_Row(const Sparse_Row& y); // Explicitly defaulted.
    Sparse_Row(const Sparse_Row& y, dimension_type capacity);
    Sparse_Row(const Sparse_Row& y, dimension_type size, dimension_type capacity);
    explicit Sparse_Row(const Dense_Row& y);
    Sparse_Row(const Dense_Row& y, dimension_type size, dimension_type capacity);
    
    VERIFICATION_CRITERIA:

    Check all copy forms with shorter/equal/longer sizes, explicit stored zeroes, source destruction, source mutation and both storage directions; inject recoverable backing-allocation failure.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/denserow1.cc.

  • PPL-SPEC-000285
    5. Row assignment, whole-row swaps and destruction UID: PPL-SPEC-000285 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Successful copy assignment shall replace the complete vector, return the target, preserve its distinct source and admit self-assignment. Cross-storage assignment shall preserve values while retaining the target's row type. Copies shall remain independently mutable. Whole-row swaps shall exchange full vectors, including their sizes and owned storage; mixed dense/sparse swaps shall convert storage while exchanging vector values. Self-swaps shall retain value. iter_swap for two vector positions shall swap the owning dense rows. Destruction shall release owned coefficient and backing storage.

    Replacement allocation failure shall preserve the source; target-state guarantees shall follow 🔗 1. Internal coefficient-row values and valid use.

    For trivially destructible coefficient types, Dense_Row transfer construction from a non-const rvalue shall acquire the complete owned storage without allocating or throwing and leave its source empty and reusable. References to dense elements shall follow their storage; distinct-owner transfers shall invalidate element iterators.

    For other coefficient types, dense construction from rvalues shall retain independent, source-preserving copy behavior. Dense assignment from rvalues shall retain independent, source-preserving copy behavior for every coefficient type; self-assignment shall preserve the value.

    Sparse_Row construction and assignment from rvalues shall retain independent, source-preserving copy behavior, including logical extent and explicit stored zeroes. Its copy declarations shall prevent new backing-tree transfer operations from implicitly changing the row-level interface.

    RATIONALE:

    Replacing or exchanging vector owners must not make coefficient values depend on another row lifetime.

    INTERFACE:
    Dense_Row& Dense_Row::operator=(const Dense_Row& y);
    Dense_Row& Dense_Row::operator=(const Sparse_Row& y);
    Sparse_Row& Sparse_Row::operator=(const Sparse_Row& y); // Explicitly defaulted.
    Sparse_Row& Sparse_Row::operator=(const Dense_Row& y);
    void Dense_Row::m_swap(Dense_Row& y);
    void Sparse_Row::m_swap(Sparse_Row& y);
    void swap(Dense_Row& x, Dense_Row& y);
    void swap(Sparse_Row& x, Sparse_Row& y);
    void swap(Dense_Row& x, Sparse_Row& y);
    void swap(Sparse_Row& x, Dense_Row& y);
    void iter_swap(std::vector<Dense_Row>::iterator x, std::vector<Dense_Row>::iterator y);
    Dense_Row::~Dense_Row();
    Sparse_Row::~Sparse_Row(); // Implicitly declared.
    // This transfer overload requires trivially destructible coefficients.
    Dense_Row(Dense_Row&& y) noexcept;
    
    VERIFICATION_CRITERIA:

    Check dense nonthrowing construction traits, zero C++/GMP allocation during construction transfers, exact values and storage ownership, empty and reserved-empty inputs, const-rvalue copies and source reuse. Check independently mutable source-preserving rvalue assignments and self-assignment. Check that sparse rvalue construction and assignment preserve their sources and create independently mutable copies. Verify the same source-preserving dense construction behavior for nontrivial coefficient types. Check chained/self/rvalue assignments, empty and different-sized sources, swaps in every storage pairing, vector iter_swap and destruction independence. Exercise allocation-failure paths.

    SOURCE:

    tests/rowmovespec1.cc; src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/denserow1.cc.

  • PPL-SPEC-000287
    7. Sparse resizing and removal of trailing stored positions UID: PPL-SPEC-000287 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Sparse resizing shall retain the common coefficient prefix, erase stored entries outside a shortened extent and zero-extend an enlarged extent without materializing the new zeroes. shrink(n) shall require n <= size(); expand_within_capacity(n) shall require size() <= n and need no reserved-capacity argument. Size zero shall erase all stored entries. Changing logical extent shall not change values at retained coordinates.

    RATIONALE:

    Sparse extent changes must not retain unreachable coefficients or turn zero extent into a stored-entry count.

    INTERFACE:
    void Sparse_Row::resize(dimension_type n);
    void Sparse_Row::shrink(dimension_type n);
    void Sparse_Row::expand_within_capacity(dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check shrink to interior, exact stored-key boundaries and zero; grow again and confirm removed coefficients do not reappear, including explicitly stored zeroes.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc.

  • PPL-SPEC-000288
    8. Indexed coefficient access and borrowed values UID: PPL-SPEC-000288 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Indexed access and get(i) shall require i < size() and return the coefficient at that position. Const access shall not materialize missing sparse entries. Mutable dense access shall borrow the owned coefficient; mutable sparse access shall retain an existing stored coefficient or insert a stored zero and return its mutable reference. Mutating that reference shall update only its indexed value. A reference to an absent sparse value shall borrow the library zero constant and require its lifetime.

    Borrowed references shall not outlive their owners or the documented storage invalidation of an operation. Sparse insertion/removal or reorganization may invalidate previously borrowed entries and iterators. Values must be copied before an operation that can invalidate their reference, except where entry argument capture is explicitly specified.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive. Const coefficient queries whose declared result type is an independent value shall also remain admitted for temporary owners.

    RATIONALE:

    Logical zero access can be allocation-free even though mutable access needs an addressable coefficient owner.

    INTERFACE:
    Coefficient& Dense_Row::operator[](dimension_type i) &;
    Coefficient_traits::const_reference Dense_Row::operator[](dimension_type i) const &;
    Coefficient_traits::const_reference Dense_Row::get(dimension_type i) const &;
    Coefficient& Sparse_Row::operator[](dimension_type i) &;
    Coefficient_traits::const_reference Sparse_Row::operator[](dimension_type i) const &;
    Coefficient_traits::const_reference Sparse_Row::get(dimension_type i) const &;
    
    VERIFICATION_CRITERIA:

    Compare const reads and mutable updates with independent vectors; check stored counts and owner-address identity, plus copied values across later mutation. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc.

  • PPL-SPEC-000290
    10. Sparse stored-entry traversal and cached end references UID: PPL-SPEC-000290 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    stored_entries() shall return a borrowed view bound to a live lvalue row. The view shall visit exactly the stored positions, including explicit zeroes, and expose their count through constant-time size() and empty() independently of logical width. Mutable and read-only views shall be sized bidirectional ranges; mutable cursors shall permit value updates without changing stored keys or count. A const view object shall retain its bound row's mutability. Temporary row owners shall be rejected.

    The view shall store the row binding without allocating or owning storage. Copies and queries shall follow the current row object through valid mutations and swaps; iterators already obtained retain the row's existing invalidation conditions. Iterators shall not depend on the view object's lifetime. The view need not have an unbound default state.

    Sparse iterators shall enumerate exactly stored entries in increasing index order, including explicitly stored zeroes. Implicit zeroes shall not appear. Dereference and index() shall report the stored coefficient and its key; mutable dereference shall permit replacement without changing the key. Bidirectional traversal and const conversion shall follow CO_Tree iterator contracts. A referenced end()/cend() sentinel shall belong to its live row and remain updated by mutations, while copied iterator values shall obey operation-specific invalidation. Swapping rows shall not transfer ownership of a cached reference to an end sentinel. Cached end references shall be available only from lvalue rows; mutable and const temporary owners shall be rejected. No sentinel shall be dereferenced.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Stored support differs from the logical vector and can change while a row-owned end sentinel remains observable.

    INTERFACE:

    The Sparse_Row stored-entry factories have the following signatures:

    Stored_Entries_View<false> stored_entries() &;
    Stored_Entries_View<true> stored_entries() const &;
    Stored_Entries_View<true> stored_entries() const && = delete;
    
    typedef CO_Tree::iterator Sparse_Row::iterator;
    typedef CO_Tree::const_iterator Sparse_Row::const_iterator;
    Sparse_Row::iterator Sparse_Row::begin() &;
    const Sparse_Row::iterator& Sparse_Row::end() &;
    const Sparse_Row::iterator& Sparse_Row::end() && = delete;
    Sparse_Row::const_iterator Sparse_Row::begin() const &;
    const Sparse_Row::const_iterator& Sparse_Row::end() const &;
    const Sparse_Row::const_iterator& Sparse_Row::end() const && = delete;
    Sparse_Row::const_iterator Sparse_Row::cbegin() const &;
    const Sparse_Row::const_iterator& Sparse_Row::cend() const &;
    const Sparse_Row::const_iterator& Sparse_Row::cend() const && = delete;
    
    VERIFICATION_CRITERIA:

    Check sized, bidirectional and borrowed range concepts; reject temporary row owners. Exercise stored zeroes, constant-cursor updates, reverse traversal, view copies, logical resizing and swaps; verify counts without conflating logical width or filtering stored zeroes.

    Check implicit/explicit zero distinction, increasing keys, copied positions, reverse traversal and cached end references after insertion, reset, clear and row swaps. Reject cached end-reference access from mutable and const temporary rows. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    tests/rowmovespec1.cc; src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/sparserow1.cc.

  • 11. Indexed row search, lower bounds and hint independence UID: PPL-SPEC-000291 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    find(i) shall require an in-size index. Dense rows shall return its position even when zero; sparse rows shall return the stored entry if present and end() otherwise. lower_bound(i) shall admit i <= size() and return the first dense/stored sparse position with index at least i, or end() if none. A hint shall be a valid position or end sentinel for the same unchanged row and shall not affect the result. Const and mutable forms shall agree; searches shall not materialize sparse zeroes.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Hints may improve search cost but cannot change the selected index or materialize a coefficient.

    INTERFACE:
    Dense_Row::iterator Dense_Row::find(dimension_type i) &;
    Dense_Row::const_iterator Dense_Row::find(dimension_type i) const &;
    Dense_Row::iterator Dense_Row::find(iterator hint, dimension_type i) &;
    Dense_Row::const_iterator Dense_Row::find(const_iterator hint, dimension_type i) const &;
    Dense_Row::iterator Dense_Row::lower_bound(dimension_type i) &;
    Dense_Row::const_iterator Dense_Row::lower_bound(dimension_type i) const &;
    Dense_Row::iterator Dense_Row::lower_bound(iterator hint, dimension_type i) &;
    Dense_Row::const_iterator Dense_Row::lower_bound(const_iterator hint, dimension_type i) const &;
    Sparse_Row::iterator Sparse_Row::find(dimension_type i) &;
    Sparse_Row::const_iterator Sparse_Row::find(dimension_type i) const &;
    Sparse_Row::iterator Sparse_Row::find(iterator hint, dimension_type i) &;
    Sparse_Row::const_iterator Sparse_Row::find(const_iterator hint, dimension_type i) const &;
    Sparse_Row::iterator Sparse_Row::lower_bound(dimension_type i) &;
    Sparse_Row::const_iterator Sparse_Row::lower_bound(dimension_type i) const &;
    Sparse_Row::iterator Sparse_Row::lower_bound(iterator hint, dimension_type i) &;
    Sparse_Row::const_iterator Sparse_Row::lower_bound(const_iterator hint, dimension_type i) const &;
    
    VERIFICATION_CRITERIA:

    Compare every valid target index and every live hint with an independent stored-key list; include holes, explicit zeroes, empty rows and lower_bound(size()). Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/sparserow1.cc.

  • PPL-SPEC-000292
    12. Insertion and replacement with argument-value independence UID: PPL-SPEC-000292 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Insertion shall require i < size() and return the indexed position. An explicit value shall replace that coefficient using its entry value, including when borrowed from another entry of the same row. No duplicate key shall be created. A value-free insertion shall retain an existing value, or create a stored zero in a missing sparse position. Dense value-free insertion shall return the existing logical slot unchanged. Hints shall have the validity and result-independence specified by 🔗 11. Indexed row search, lower bounds and hint independence. Sparse insertions may reorganize storage and invalidate earlier borrowed positions.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Inserting from a borrowed coefficient must preserve its value through storage growth or replacement.

    INTERFACE:
    Dense_Row::iterator Dense_Row::insert(dimension_type i, Coefficient_traits::const_reference x) &;
    Dense_Row::iterator Dense_Row::insert(iterator hint, dimension_type i, Coefficient_traits::const_reference x) &;
    Dense_Row::iterator Dense_Row::insert(dimension_type i) &;
    Dense_Row::iterator Dense_Row::insert(iterator hint, dimension_type i) &;
    Sparse_Row::iterator Sparse_Row::insert(dimension_type i, Coefficient_traits::const_reference x) &;
    Sparse_Row::iterator Sparse_Row::insert(iterator hint, dimension_type i, Coefficient_traits::const_reference x) &;
    Sparse_Row::iterator Sparse_Row::insert(dimension_type i) &;
    Sparse_Row::iterator Sparse_Row::insert(iterator hint, dimension_type i) &;
    
    VERIFICATION_CRITERIA:

    Check new/existing keys, zero/nonzero replacement, all hints, self-entry and other-entry arguments, including sparse growth and storage reorganization. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc.

  • PPL-SPEC-000293
    13. Reset and clear preserve logical size UID: PPL-SPEC-000293 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    clear() shall set every logical coefficient to zero while retaining size; sparse clear shall remove every stored entry. Indexed reset shall zero the chosen in-size coefficient, removing its sparse entry if any. Dense range reset shall require first <= last <= size() and change exactly that half-open range. Dense iterator reset shall zero its live slot and return the following logical slot. Sparse iterator reset shall erase its stored slot and return the following stored slot; an iterator range shall erase exactly its stored half-open interval and return the first retained successor. Sparse_Row::reset_after(i) shall require i < size() and remove every stored position at or after i. Empty ranges shall be admitted.

    Member overloads that return references, iterators or nonowning views into the owner shall require an lvalue owner. Matching rvalue calls that would produce such borrows shall be rejected during overload resolution. Temporary iterator and row-view values shall remain usable while their backing owner remains alive.

    RATIONALE:

    Resetting a coefficient changes value and support, while retaining the row extent.

    INTERFACE:
    void Dense_Row::clear();
    void Sparse_Row::clear();
    void Dense_Row::reset(dimension_type i);
    void Sparse_Row::reset(dimension_type i);
    void Dense_Row::reset(dimension_type first, dimension_type last);
    Dense_Row::iterator Dense_Row::reset(iterator i) &;
    Sparse_Row::iterator Sparse_Row::reset(iterator i) &;
    Sparse_Row::iterator Sparse_Row::reset(iterator first, iterator last) &;
    void Sparse_Row::reset_after(dimension_type i);
    
    VERIFICATION_CRITERIA:

    Compare every dense reset window and sparse stored-iterator window with independent vector/key models, checking returned successors, prefix/suffix preservation and unchanged logical size. Check lvalue admission and temporary-owner rejection with compile-time client expressions. Preserve temporary iterator/view use and lvalue storage identity in runtime checks.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc.

  • PPL-SPEC-000295
    15. Coefficient swaps and constrained sparse key relocation UID: PPL-SPEC-000295 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Indexed swaps shall require two in-size indices and exchange exactly their coefficient values, including implicit sparse zeroes. Iterator swaps shall require two live dereferenceable positions of the same row and exchange their values without exchanging their keys. Self-swaps shall retain value. Sparse fast_swap(i,pos) shall require an in-size index and lower_bound(i) == pos != end(); it shall move that stored entry to i, leaving its previous position implicitly zero. Its iterator shall remain valid and report the new index, and unrelated entries shall be retained.

    RATIONALE:

    Exchanging coefficient values differs from relocating a stored sparse key into an empty preceding interval.

    INTERFACE:
    void Dense_Row::swap_coefficients(dimension_type i, dimension_type j);
    void Sparse_Row::swap_coefficients(dimension_type i, dimension_type j);
    void Dense_Row::swap_coefficients(iterator i, iterator j);
    void Sparse_Row::swap_coefficients(iterator i, iterator j);
    void Sparse_Row::fast_swap(dimension_type i, iterator pos);
    
    VERIFICATION_CRITERIA:

    Check all indexed swaps across holes and stored zeroes, iterator swaps, self-swaps and valid fast relocations with unchanged intervening keys and live iterator association.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/sparserow1.cc.

  • PPL-SPEC-000300
    20. Row equality compares complete logical vectors UID: PPL-SPEC-000300 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Equality shall return true exactly when logical sizes and all corresponding coefficient values agree. Dense/sparse pairing, allocation capacity and explicit versus implicit sparse zeroes shall not affect equality. Inequality shall be its Boolean negation. Equality shall preserve both operands and shall not equate rows merely because one has additional trailing zeroes.

    RATIONALE:

    Raw vector equality includes its extent while excluding representation details.

    INTERFACE:
    bool operator==(const Dense_Row& x, const Dense_Row& y);
    // Inequality uses C++20 rewriting of operator==.
    bool operator==(const Dense_Row& x, const Sparse_Row& y);
    bool operator!=(const Dense_Row& x, const Sparse_Row& y);
    bool operator==(const Sparse_Row& x, const Dense_Row& y);
    bool operator!=(const Sparse_Row& x, const Dense_Row& y);
    bool operator==(const Sparse_Row& x, const Sparse_Row& y);
    bool operator!=(const Sparse_Row& x, const Sparse_Row& y);
    
    VERIFICATION_CRITERIA:

    Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Check all storage pairings, explicit zeroes, changed entries, extra zero extent, differing dense capacities, self comparison and empty rows.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc.

  • PPL-SPEC-000302
    22. Sparse-row ASCII export, stored entries and validation UID: PPL-SPEC-000302 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Sparse ASCII export shall report logical size, stored-element count and ascending indexed coefficients, including explicitly stored zeroes, in size n elements k [ i ]= a ... syntax with a terminating newline. Loading a complete compatible representation shall replace logical extent and stored entries and return true. Size zero with zero stored entries shall be valid. Malformed or missing keywords, counts, indices and coefficients, counts greater than the logical extent, and repeated, out-of-order or out-of-extent indices shall report false rather than successful construction of an invalid row. Trailing input shall remain available. No rollback shall be promised on failure; target ownership shall follow 🔗 1. Internal coefficient-row values and valid use. Diagnostic dump/print forms shall use this reloadable representation.

    RATIONALE:

    A sparse loader must preserve both extent and indexed coefficient associations without admitting keys outside the vector.

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

    Check round-trip stored zeroes, holes, count/size zero, exact syntax, malformed and truncated fields, out-of-extent keys, failure retry and trailing input.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/sparserow1.cc; tests/rowstoragebranches1.cc.

  • PPL-SPEC-000303
    23. Row invariants and memory-accounting queries UID: PPL-SPEC-000303 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    OK() shall report satisfaction of row structural invariants without changing values. Dense invariants shall include size <= capacity <= max_size() and backing-storage consistency; OK(n) shall additionally compare logical size with n. Sparse invariants shall require every stored index below logical size; its compatibility OK(capacity) shall ignore that argument.

    Memory queries shall return nonnegative accounting estimates without changing values. For both row types, total shall equal sizeof(row) + external. Dense external accounting shall include actual reserved coefficient slots and external storage owned by live coefficients. Sparse external accounting shall follow its coefficient tree. Compatibility capacity arguments shall not change the reported current storage; neither query shall promise exact allocator bookkeeping or available memory.

    RATIONALE:

    Current storage accounting and structural validity are observable checks rather than estimates of future allocation success.

    INTERFACE:
    bool Dense_Row::OK() const;
    bool Dense_Row::OK(dimension_type n) const;
    memory_size_type Dense_Row::external_memory_in_bytes() const;
    memory_size_type Dense_Row::external_memory_in_bytes(dimension_type capacity) const;
    memory_size_type Dense_Row::total_memory_in_bytes() const;
    memory_size_type Dense_Row::total_memory_in_bytes(dimension_type capacity) const;
    
    bool Sparse_Row::OK() const;
    bool Sparse_Row::OK(dimension_type n) const;
    memory_size_type Sparse_Row::external_memory_in_bytes() const;
    memory_size_type Sparse_Row::external_memory_in_bytes(dimension_type capacity) const;
    memory_size_type Sparse_Row::total_memory_in_bytes() const;
    memory_size_type Sparse_Row::total_memory_in_bytes(dimension_type capacity) const;
    
    VERIFICATION_CRITERIA:

    Check accounting identities for empty/reserved/populated rows and coefficient limbs, ignored compatibility capacity, matching dense size checks and unchanged values through const queries.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/denserow1.cc.

PPL-LLR-000145
5. Coordinate shifts preserve coefficient associations UID: PPL-LLR-000145 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: ALL VERIFICATION_METHODS: Test, Analysis RELATIONS (Parent): RELATIONS (Child): STATEMENT:

For valid dimension-shift operations on the ordered coefficient map, each surviving coefficient shall remain associated with the coordinate obtained by the specified key transformation. Removing a coordinate and shifting later coordinates down shall remove only that coordinate's entry; inserting coordinate positions shall shift affected keys without altering their coefficient values or relative order.

RATIONALE:

Sparse coordinate insertion and removal support variable-size numerical objects and must preserve the meaning of their remaining coordinates.

COMMENT:

Verification covers coefficient-map coordinate insertion, removal and shifts. Verification applies independently computed coordinate transformations within the documented ordering and capacity preconditions. Successful mathematical results assume valid inputs, documented caller preconditions, and arithmetic representable under the selected configuration; resource or arithmetic failures are not successful results.

VERIFICATION_CRITERIA:

Construct independent key-transformation oracles for coordinate removal and positive coordinate insertion. Compare complete key-value sequences before and after shifts, including absent removed keys, first and last positions, empty maps, and supported index-boundary cases. Apply only transformations satisfying the documented ordering, range, and capacity preconditions.

SOURCE:

src/CO_Tree_defs.hh: coordinate removal with left shift, key increases from a threshold, and constrained direct shifts. src/CO_Tree.cc: coordinate-key transformation implementations. tests/CO_Tree/cotree1.cc: ordered-map mutation scenarios.

  • PPL-SPEC-000621
    6. Coordinate removal and order-preserving reindexing UID: PPL-SPEC-000621 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Coordinate removal shall admit a valid key k, remove its entry if present, and map every stored key q > k to q − 1 without changing its coefficient. Every key below k shall retain its key and value. This shall also apply when k is absent and to an empty map. The result shall contain exactly the transformed ordered map, including all surviving explicitly stored zeros. Ordinary iterators and coefficient references shall be reacquired; cached ends shall retain 🔗 9. Begin positions and owner-stable cached end references.

    erase_and_reindex(index_map) shall require a map covering every stored key. A value of not_a_dimension() shall select erasure; all other images of stored keys shall be valid and strictly increasing. The operation shall produce exactly those surviving entries with the mapped keys and unchanged coefficients, including explicitly stored zeroes. All erasures shall precede key renumbering. If an erasure allocation fails, the tree shall remain valid, possibly with some selected entries erased, and surviving keys shall retain their original numbering. Completed reindexing shall preserve cached-end behavior; ordinary iterators and coefficient references shall be reacquired.

    RATIONALE:

    Forgetting one coefficient-vector coordinate must shift later coordinates even if the removed coordinate had no stored entry.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    void erase_element_and_shift_left(dimension_type key);
    void erase_and_reindex(const std::vector<dimension_type>& index_map);
    
    VERIFICATION_CRITERIA:

    Compute an independent remove-and-decrement key transform for present/absent coordinates, zero and extreme valid keys, empty maps, stored zeros and repeated histories.

    Compare bulk erasure/reindexing with an independent ordered-map model for empty, identity, complete and partial removals, gaps in the images, absent entries and stored zeroes. Check cached ends, subsequent insertion and recoverable allocation failures after earlier erasures have completed.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000622
    7. Positive coordinate insertion shifts the complete selected suffix UID: PPL-SPEC-000622 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    For threshold k and nonnegative amount n, the operation shall map each stored key q ≥ k to q + n and preserve its coefficient; all keys below k shall remain unchanged. Every actually transformed key shall remain a valid representable key, excluding the reserved value. If no key is affected, any representable threshold and amount shall be admitted without evaluating an overflowing key sum. Amount zero shall preserve the map.

    The operation shall retain the entry count, coefficient ownership, physical positions and current entry iterators. Existing iterators shall observe the transformed keys and unchanged coefficients. Cached ends shall remain valid.

    RATIONALE:

    Inserting coordinate positions must retain all suffix coefficient associations and avoid imposing artificial limits on unaffected sparse ranges.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    void increase_keys_from(dimension_type key, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Compare independent threshold/addition maps, all valid small amounts, zero, empty/unaffected suffixes and near-reserved key boundaries; check live iterators and coefficient addresses without using overflowing transforms.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000623
    8. Fast leftward key replacement preserves occupied positions UID: PPL-SPEC-000623 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Fast shifting shall require an occupied iterator at key q, a valid key i ≤ q, and no other stored key in [i, q). It shall replace exactly q by i, retaining its coefficient and every unrelated association. Choosing i = q shall be admitted. All current entry iterators and coefficient references shall remain valid; the selected iterator shall observe its new key at the same physical position. The map shall retain its entry count and owned storage, with no coefficient copying or allocation needed for the key replacement.

    RATIONALE:

    An order-preserving key correction can retain live iterator positions when the required gap is already empty.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    void fast_shift(dimension_type i, iterator itr);
    
    VERIFICATION_CRITERIA:

    Enumerate valid gap endpoints for every selected entry, compare independent single-key transforms, and retain all iterators/coefficient addresses across no-op and leftward replacements near zero and the reserved maximum.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000624
    9. Backing-array allocation failure preserves the prior map UID: PPL-SPEC-000624 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    When insertion or erasure requires replacement backing arrays, a recoverable failure allocating either replacement array shall preserve the prior complete map and its coefficient ownership, release incomplete replacement storage and retain valid cached ends. No insertion, removal or coordinate transformation shall be reported as a successful result when its required backing allocation fails. A retry with sufficient resources shall remain possible.

    This guarantee shall cover ordinary and hinted insertion, occupied/key erasure and erase-and-shift operations when they trigger a backing replacement. It shall not promise ordinary recovery after a fatal GMP allocation failure or after violation of a member's valid-input preconditions.

    RATIONALE:

    Relocation must not consume old coefficient owners until both replacement arrays are available.

    INTERFACE:

    Internal source header: CO_Tree_defs.hh. Names belong to Parma_Polyhedra_Library. Member signatures apply to CO_Tree; iterator and data_type_const_reference are its nested types.

    iterator insert(dimension_type key);
    iterator insert(dimension_type key, data_type_const_reference data);
    iterator insert(iterator itr, dimension_type key);
    iterator insert(iterator itr, dimension_type key, data_type_const_reference data);
    iterator erase(dimension_type key);
    iterator erase(iterator itr);
    void erase_element_and_shift_left(dimension_type key);
    
    VERIFICATION_CRITERIA:

    Force growth and shrinkage and fail each replacement-array allocation for every applicable interface, preserving dictionary values and multi-limb owner identities; then retry and check the independent successful mutation.

    SOURCE:

    src/CO_Tree_defs.hh; src/CO_Tree_inlines.hh; src/CO_Tree.cc; tests/CO_Tree/cotreemutationspec1.cc; tests/CO_Tree/cotree1.cc; tests/CO_Tree/memory1.cc.

  • PPL-SPEC-000414
    14. System dimension changes and coordinate removal UID: PPL-SPEC-000414 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Dimension setting shall require an admitted result dimension preserving every retained row kind's validity. It shall resize every row consistently, retaining low-index public coefficients and correctly relocating hidden fields. It shall zero-extend or truncate trailing public coordinates. Removing selected in-dimension variables shall apply each row's coordinate-removal operation, compact survivors in coordinate order and drop rows whose row-type transformation reports invalidity. No selected variables shall be a no-op. Removed rows shall update the pending partition as in 🔗 12. Removing individual, trailing and same-status row ranges.

    Both operations shall preserve common metadata consistency and retain only truthful sorted-prefix certificates, clearing them when needed. Dimension removal shall clear the certificate after a nonempty selection. Raw row normalization and geometric interpretation shall follow the row capability; no existential-elimination interpretation shall be added by this container.

    RATIONALE:

    All rows and hidden fields must follow the same coordinate transformation without retaining a false ordering certificate.

    INTERFACE:
    void Linear_System<Row>::set_space_dimension(dimension_type space_dim);
    void Linear_System<Row>::remove_space_dimensions(const Variables_Set& vars);
    
    VERIFICATION_CRITERIA:

    Check extension/truncation, interior/all variable removal, kind-specific collapsed-row removal, pending boundary updates and truthful ordering after shrink.

    SOURCE:

    src/Linear_System_defs.hh; src/Linear_System_inlines.hh; src/Linear_System_templates.hh; tests/linearsystemspec1.cc; tests/linearsystem1.cc; tests/linearsystembranches1.cc.

  • PPL-SPEC-000415
    15. Shared coordinate swaps, cycles and zero insertion UID: PPL-SPEC-000415 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    In-dimension swaps and cycles shall apply the same coordinate correspondence to every row. Cycles shall require distinct valid variables and admit empty or singleton cycles. Shifting shall require v.id() <= space_dimension() and admitted result size, insert n zero coordinates before that position and update system dimension. Zero shifting shall retain the represented row sequence. Row kinds, hidden fields and transformed coordinate meaning shall follow each row's contract. Pending status shall be retained. Coordinate changes shall retain only truthful processed-prefix certificates.

    RATIONALE:

    Shared coordinate operations must preserve row alignment and algorithm metadata across every retained descriptor.

    INTERFACE:
    void Linear_System<Row>::swap_space_dimensions(Variable a, Variable b);
    void Linear_System<Row>::permute_space_dimensions(const std::vector<Variable>& cycle);
    void Linear_System<Row>::shift_space_dimensions(Variable v, dimension_type n);
    
    VERIFICATION_CRITERIA:

    Check independent coefficient tuple swaps/cycles and front/interior/end zero insertion for processed/pending rows, all row types and both storage representations.

    SOURCE:

    src/Linear_System_defs.hh; src/Linear_System_inlines.hh; src/Linear_System_templates.hh; tests/linearsystemspec1.cc; tests/linearsystem1.cc.

  • PPL-SPEC-000370
    10. Inserting and removing matrix columns UID: PPL-SPEC-000370 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    add_zero_columns(n,i) shall require i <= num_columns() and an admitted nonoverflowing result shape. It shall insert n zero columns before i and shift all old columns at or after i up by n; zero insertion shall preserve the array. remove_column(i) shall require an in-width column, erase it from every row and shift later indices down by one. Trailing-column removal shall require n <= num_columns() and remove just the last n columns. Row count shall be retained, including zero rows. These transformations shall preserve every surviving coefficient association.

    RATIONALE:

    All rows must undergo the same coordinate renumbering even when they store different sparse supports.

    INTERFACE:
    void Matrix<Row>::add_zero_columns(dimension_type n, dimension_type i);
    void Matrix<Row>::remove_column(dimension_type i);
    void Matrix<Row>::remove_trailing_columns(dimension_type n);
    
    VERIFICATION_CRITERIA:

    Enumerate front/interior/end insertion, all individual and trailing removals, zero-width/no-row shapes and later regrowth against independent row-wise vector edits.

    SOURCE:

    src/Matrix_defs.hh; src/Matrix_inlines.hh; src/Matrix_templates.hh; src/Swapping_Vector_defs.hh; src/Swapping_Vector_inlines.hh; tests/matrixspec1.cc; tests/matrix1.cc.

  • PPL-SPEC-000371
    11. Column swaps and encoded nonzero-index permutation cycles UID: PPL-SPEC-000371 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Column swaps shall require two in-width indices and exchange their entries in every row; index zero and self-swaps shall be admitted. Encoded permutation cycles shall require a nonempty vector containing complete disjoint cycles of length at least two, each terminated by zero. Every listed index shall be nonzero and strictly below column count. The final element shall be a zero terminator. For each cycle, the old coefficient at each listed column shall move to the following listed column, with the last wrapping to the first. Unlisted columns, especially column zero, shall remain unchanged. Both operations shall retain shape; row-level borrowed positions may be invalidated.

    RATIONALE:

    Zero is an encoding delimiter for cycles rather than a permutable coordinate in that interface.

    INTERFACE:
    void Matrix<Row>::swap_columns(dimension_type i, dimension_type j);
    void Matrix<Row>::permute_columns(const std::vector<dimension_type>& cycles);
    
    VERIFICATION_CRITERIA:

    Check swaps including zero, disjoint two/long cycles, wrapping orientation, zero-valued cycle entries and untouched column zero in both row types. Apply only complete valid encodings.

    SOURCE:

    src/Matrix_defs.hh; src/Matrix_inlines.hh; src/Matrix_templates.hh; src/Swapping_Vector_defs.hh; src/Swapping_Vector_inlines.hh; tests/matrixspec1.cc; tests/matrix1.cc.

  • PPL-SPEC-000294
    14. Coordinate insertion and deletion preserve coefficient association UID: PPL-SPEC-000294 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    add_zeroes_and_shift(n,i) shall require i <= size() and admitted nonoverflowing result size/keys. It shall insert n zero positions before i and shift every old position at or after i upward by n. Zero insertion shall preserve the vector. delete_element_and_shift(i) shall require i < size(), remove just that coefficient and shift all later indices down by one. Dense deletion shall retain capacity. Implicit sparse zeroes shall stay implicit unless already explicitly represented. Dense shifts/deletions and sparse deletions shall invalidate prior iterators. Sparse insertion of zero positions shall preserve stored-entry iterator values and update affected indices, retaining their coefficient association.

    For erase_and_reindex(index_map,new_size), index_map shall contain size() entries. Selected coordinates shall be marked not_a_dimension(); the remaining images shall enumerate [0,new_size) in order. The result shall be the stable subsequence of retained coefficients with the specified size. Dense rows shall retain capacity. Sparse rows shall retain surviving explicit stored zeroes without materializing implicit zeroes. The operation shall invalidate ordinary iterators and coefficient references. If a sparse erasure allocation fails, the row shall remain valid at its old size and numbering, with possibly some selected stored entries already erased.

    RATIONALE:

    Coordinate renumbering must move the coefficient associated with each surviving position.

    INTERFACE:
    void Dense_Row::add_zeroes_and_shift(dimension_type n, dimension_type i);
    void Sparse_Row::add_zeroes_and_shift(dimension_type n, dimension_type i);
    void Dense_Row::delete_element_and_shift(dimension_type i);
    void Sparse_Row::delete_element_and_shift(dimension_type i);
    void Dense_Row::erase_and_reindex(
        const std::vector<dimension_type>& index_map, dimension_type new_size);
    void Sparse_Row::erase_and_reindex(
        const std::vector<dimension_type>& index_map, dimension_type new_size);
    
    VERIFICATION_CRITERIA:

    Enumerate front/interior/end insertion and all deletion indices against literal vector insertion/erase, including empty rows, holes, stored zeroes, spare dense capacity and sparse iterator index updates.

    Compare all removal subsets of small vectors, including empty/identity/all removed maps, signed coefficient boundaries, explicit sparse zeroes and spare dense capacity. Check retained stored entries and growth after compaction.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/sparserow1.cc.

  • PPL-SPEC-000295
    15. Coefficient swaps and constrained sparse key relocation UID: PPL-SPEC-000295 STATUS: APPROVED COMPONENT: CORE_DATA_STRUCTURES APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

    Indexed swaps shall require two in-size indices and exchange exactly their coefficient values, including implicit sparse zeroes. Iterator swaps shall require two live dereferenceable positions of the same row and exchange their values without exchanging their keys. Self-swaps shall retain value. Sparse fast_swap(i,pos) shall require an in-size index and lower_bound(i) == pos != end(); it shall move that stored entry to i, leaving its previous position implicitly zero. Its iterator shall remain valid and report the new index, and unrelated entries shall be retained.

    RATIONALE:

    Exchanging coefficient values differs from relocating a stored sparse key into an empty preceding interval.

    INTERFACE:
    void Dense_Row::swap_coefficients(dimension_type i, dimension_type j);
    void Sparse_Row::swap_coefficients(dimension_type i, dimension_type j);
    void Dense_Row::swap_coefficients(iterator i, iterator j);
    void Sparse_Row::swap_coefficients(iterator i, iterator j);
    void Sparse_Row::fast_swap(dimension_type i, iterator pos);
    
    VERIFICATION_CRITERIA:

    Check all indexed swaps across holes and stored zeroes, iterator swaps, self-swaps and valid fast relocations with unchanged intervening keys and live iterator association.

    SOURCE:

    src/Dense_Row_defs.hh; src/Dense_Row_inlines.hh; src/Dense_Row_templates.hh; src/Dense_Row.cc; src/Sparse_Row_defs.hh; src/Sparse_Row_inlines.hh; src/Sparse_Row_templates.hh; src/Sparse_Row.cc; tests/rowstoragespec1.cc; tests/sparserow1.cc.