Parma Polyhedra Library requirements
Internal geometric row systems and processing state

Internal geometric row systems and processing state

1. Internal geometric-row sequences and valid bookkeeping
UID: PPL-SPEC-000401
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

A Linear_System<Row> shall own an ordered finite sequence of geometric rows with common public space dimension, topology and storage representation. A boundary index p, with 0 ≤ p ≤ n, shall divide its n rows into a processed prefix [0, p) and pending suffix [p, n). A true sorted certificate shall require that processed prefix to be nondecreasing under compare(Row,Row). A false certificate shall make no assertion about actual ordering. Duplicate rows shall be permitted.

No conjunction, convex hull or grid-span meaning shall be added by this container; the public descriptor-system contracts shall supply those meanings. Calls shall require live rows with admitted coefficient values, kinds and layouts, valid container metadata and nonoverflowing dimensions/counts. Direct mutation through rows shall require restoring common metadata and applicable prefix ordering before a call requiring a valid system. Operations need not require already strong-normalized rows unless their individual contract says so. Stored rows shall otherwise meet their row-type validity conditions. Elimination contracts may explicitly admit live internal zero-direction intermediate rows for numeric-field inspection, metadata queries and prescribed cleanup; this shall not admit those rows as public geometric descriptors.

Initialization, representability of all evaluated coefficient steps and synchronization shall follow 🔗 1. Internal coefficient-row values and valid use. Failed construction shall release resources owned by its incomplete system. Recoverable failures may propagate; distinct unchanged sources shall survive and modified targets shall remain destructible without universal rollback or valid-bookkeeping guarantees.

RATIONALE:

The internal row container separates algorithm bookkeeping from the mathematical interpretation supplied by each public system.

INTERFACE:

Internal source header: Linear_System_defs.hh. Names belong to Parma_Polyhedra_Library. Member declarations below apply to supported Constraint, Generator and Grid_Generator row capabilities.

template <typename Row> class Linear_System;
Swapping_Vector<Row> Linear_System<Row>::rows;
VERIFICATION_CRITERIA:

Compare explicit row sequences and processed/pending partitions in all supported row/storage contexts. Inspect common metadata, mutation preconditions and resource failure states.

SOURCE:

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

PPL-SPEC-000402
2. Empty system construction with explicit topology and dimension
UID: PPL-SPEC-000402
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Construction shall create a system with no rows or pending rows, true sorted certificate and the supplied topology/representation. Its dimension shall be zero unless explicitly supplied. Both topologies shall be supported for constraints and polyhedral generators; grid generators shall require NECESSARILY_CLOSED. Empty systems shall retain admitted nonzero dimensions without manufacturing a point, constraint or line.

RATIONALE:

An empty internal sequence still needs defined coordinate and representation metadata.

INTERFACE:
Linear_System<Row>::Linear_System(Topology topology, Representation r);
Linear_System<Row>::Linear_System(Topology topology,
  dimension_type space_dim, Representation r);
VERIFICATION_CRITERIA:

Check empty/default-dimension and explicit-dimension construction for each admitted topology and storage, including nonzero empty extent.

SOURCE:

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

PPL-SPEC-000403
3. Owning copies with explicit pending-row policy
UID: PPL-SPEC-000403
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Every copy shall preserve row sequence, row values, dimension and topology, with independent storage. Ordinary copies shall make all copied rows processed; if any source row was pending they shall clear the sorted certificate, otherwise retain it. With_Pending copies shall preserve the pending boundary and sorted certificate. Explicit-storage copies shall use the supplied representation; other copies shall retain source representation. Explicit-storage copies shall construct converted rows directly, without constructing disposable default row backends. The source shall be preserved through successful copying and remain intact if construction fails. Copies shall survive source mutation/destruction.

RATIONALE:

Pending state is a deliberate copy policy rather than an accidental consequence of row-vector copying.

INTERFACE:
struct Linear_System<Row>::With_Pending {};
Linear_System<Row>::Linear_System(const Linear_System<Row>& y);
Linear_System<Row>::Linear_System(const Linear_System<Row>& y, Representation r);
Linear_System<Row>::Linear_System(const Linear_System<Row>& y, With_Pending);
Linear_System<Row>::Linear_System(const Linear_System<Row>& y,
  Representation r, With_Pending);
VERIFICATION_CRITERIA:

Check all four copy forms with empty, processed-only and mixed systems; compare exact boundaries/certificates, cross-storage ownership and source independence.

SOURCE:

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

PPL-SPEC-000404
4. Assignment, swaps and lifecycle of linear-system owners
UID: PPL-SPEC-000404
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Ordinary assignment shall use the ordinary-copy pending policy, return its target and admit self-assignment. assign_with_pending shall preserve all pending metadata and admit self-assignment. Both shall preserve distinct sources and replace the target only after their replacement copy succeeds. Swaps shall exchange row owners and all dimension, topology, representation, pending and sorted metadata, including self-swap. Destruction shall release owned storage. Rvalue forms selecting these copy operations shall follow their copy/pending policy and preserve a distinct source.

RATIONALE:

An assignment must select a clear pending policy while exchanging complete metadata with the new owner.

INTERFACE:
Linear_System<Row>& Linear_System<Row>::operator=(const Linear_System<Row>& y);
void Linear_System<Row>::assign_with_pending(const Linear_System<Row>& y);
void Linear_System<Row>::m_swap(Linear_System<Row>& y);
template <typename Row> void swap(Linear_System<Row>& x, Linear_System<Row>& y);
Linear_System<Row>::~Linear_System(); // Implicitly declared.
VERIFICATION_CRITERIA:

Check ordinary/full/self/chained/rvalue assignments and swaps across differing dimensions, topologies, representations and pending boundaries; inject replacement-copy allocation failure.

SOURCE:

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

PPL-SPEC-000405
5. Row representation conversion
UID: PPL-SPEC-000405
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Representation queries shall report the common row storage choice. Successful conversion shall set the requested dense/sparse representation for every retained row and system metadata, while preserving row values/order, space dimension, topology, pending boundary and sorted certificate. Conversion of an empty system shall still update its representation. Failure shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping, without promising universal conversion rollback.

RATIONALE:

Container metadata and every row must agree on the selected representation.

INTERFACE:
Representation Linear_System<Row>::representation() const;
void Linear_System<Row>::set_representation(Representation r);
VERIFICATION_CRITERIA:

Check all row types through both conversion directions, with pending rows and empty nonzero-dimensional systems; compare literal row fields and bookkeeping.

SOURCE:

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

PPL-SPEC-000406
6. System extent, row access and read-only traversal
UID: PPL-SPEC-000406
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

The reported maximum dimension shall be Row::max_space_dimension(). Dimension queries shall report public coordinates independently of hidden constant, divisor or epsilon fields. Row count and has_no_rows() shall report the retained sequence, including pending rows and redundant rows. num_lines_or_equalities() shall require no pending rows and count rows whose row capability identifies them as lines or equalities. Indexed access shall require an in-range row and borrow it as const. Both iterator aliases shall be read-only random-access row-vector positions, enumerating the entire sequence in order, including the pending suffix. They shall borrow their owner and obey row-vector lifetime/invalidation; mutable container access shall not make iterator row references mutable.

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 traversal includes every retained row rather than the public facade iterator filtering policy.

INTERFACE:
static dimension_type Linear_System<Row>::max_space_dimension();
dimension_type Linear_System<Row>::space_dimension() const;
dimension_type Linear_System<Row>::num_rows() const;
bool Linear_System<Row>::has_no_rows() const;
dimension_type Linear_System<Row>::num_lines_or_equalities() const;
const Row& Linear_System<Row>::operator[](dimension_type k) const &;
typedef typename Swapping_Vector<Row>::const_iterator Linear_System<Row>::iterator;
typedef typename Swapping_Vector<Row>::const_iterator Linear_System<Row>::const_iterator;
Linear_System<Row>::iterator Linear_System<Row>::begin() &;
Linear_System<Row>::iterator Linear_System<Row>::end() &;
Linear_System<Row>::const_iterator Linear_System<Row>::begin() const &;
Linear_System<Row>::const_iterator Linear_System<Row>::end() const &;
VERIFICATION_CRITERIA:

Compare indexed, forward/reverse and random-access traversal with explicit sequence records, including duplicate and pending rows, and inspect const reference types. 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/Linear_System_defs.hh; src/Linear_System_inlines.hh; src/Linear_System_templates.hh; tests/linearsystemspec1.cc; tests/linearsystem1.cc. tests/rowstoragespec1.cc.

PPL-SPEC-000407
7. Pending-boundary queries and explicit status changes
UID: PPL-SPEC-000407
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Pending queries shall report boundary p and suffix count num_rows()-p. Setting the boundary shall require i <= num_rows() and set exactly that partition without changing row sequence/values. Unsetting pending rows shall make the entire sequence processed. If the sorted certificate is true, callers shall ensure the resulting processed prefix is sorted, or first clear the certificate. Empty, all-pending and all-processed partitions shall be admitted.

RATIONALE:

Changing a bookkeeping boundary does not perform the processing or sorting it records.

INTERFACE:
dimension_type Linear_System<Row>::first_pending_row() const;
dimension_type Linear_System<Row>::num_pending_rows() const;
void Linear_System<Row>::set_index_first_pending_row(dimension_type i);
void Linear_System<Row>::unset_pending_rows();
VERIFICATION_CRITERIA:

Check every boundary of explicit sequences and preserved row fields, including all-pending/all-processed states and explicit certificate clearing before exposing an unsorted suffix.

SOURCE:

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

PPL-SPEC-000408
8. Sorted-prefix certificates and actual ordering inspection
UID: PPL-SPEC-000408
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

check_sorted() shall inspect only the processed prefix and report whether adjacent rows are nondecreasing under compare; it shall allow duplicates and prefixes shorter than two. is_sorted() shall report the certificate, with true implying actual processed-prefix ordering. Setting false shall clear the certificate without changing row sequence; setting true shall require an actually sorted processed prefix and shall not sort or deduplicate it. Pending rows shall not invalidate a true prefix certificate merely by being out of order.

RATIONALE:

A certificate records established knowledge; checking actual order and sorting are separate operations.

INTERFACE:
bool Linear_System<Row>::is_sorted() const;
bool Linear_System<Row>::check_sorted() const;
void Linear_System<Row>::set_sorted(bool b);
VERIFICATION_CRITERIA:

Check independent expected processed-prefix order, false certificates on sorted data, duplicate rows, unsorted pending suffixes and admissible true assignments.

SOURCE:

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

9. Inserting a processed row with dimension alignment
UID: PPL-SPEC-000409
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Processed insertion shall require matching row/system topology and no target pending rows. It shall append the row entry value, align all rows to the maximum input dimension by zero extension and retain target representation. Copy insertion shall preserve the source, including a borrowed target row captured before reallocation. Recycled insertion shall require a source not borrowed from the target and leave it destructible, without a retained-value promise. Every resulting row shall be processed. If the certificate was false it shall remain false; if true it shall remain true exactly when the new final adjacent pair is nondecreasing, or the resulting size is at most one. Duplicates shall be retained.

RATIONALE:

Appending a processed row can preserve a sorted prefix only when its boundary comparison succeeds.

INTERFACE:
void Linear_System<Row>::insert(const Row& row);
void Linear_System<Row>::insert(Row& row, Recycle_Input);
VERIFICATION_CRITERIA:

Check copied/borrowed/recycled inputs, dimension extension in both directions, duplicate retention, source independence and sorted/unsorted appends.

SOURCE:

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

PPL-SPEC-000410
10. Appending pending rows without certifying their order
UID: PPL-SPEC-000410
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Pending insertion shall require matching topology and append the source entry value to the pending suffix. It shall preserve the existing boundary, processed prefix and sorted certificate, align dimensions and retain target storage as in 🔗 9. Inserting a processed row with dimension alignment. Copy insertion shall capture borrowed target inputs before mutation; recycled input shall be independent of target storage and remain destructible. The appended row need not be sorted with other pending rows. An empty processed prefix shall be admitted.

RATIONALE:

A pending suffix records work still to be handled without weakening the established prefix certificate.

INTERFACE:
void Linear_System<Row>::insert_pending(const Row& row);
void Linear_System<Row>::insert_pending(Row& row, Recycle_Input);
VERIFICATION_CRITERIA:

Check all-pending and mixed systems, out-of-order suffixes, borrowed copies, recycled inputs and row/system dimension alignment.

SOURCE:

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

PPL-SPEC-000411
11. Copying and recycling whole system row sequences
UID: PPL-SPEC-000411
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Pending whole-system insertion shall require equal public dimensions even for an empty source. Processed insertion shall require equal dimensions when source rows are present; transferred rows shall have matching topology. Copies shall preserve their source and admit self-copy insertion by capturing its entry sequence. Recycled sources shall be distinct from the target and, when transferred, clear to an empty dimension-zero system retaining source topology/representation. Transferred rows shall retain their entry order and use target storage. For participating descriptor rows, the insert_pending_consume and insert_consume entry points shall prepare capacity and representation conversions before destructive transfers. They shall require a nonempty source, equal dimensions and matching topology. Prepared transfers shall reuse owned expression backends without constructing default row backends. An empty pending source shall still be cleared; an empty processed source shall retain the existing no-op behavior.

Processed insertion shall require no target pending rows and make all added source rows processed. It shall preserve a true certificate only when the source is certified without pending rows and the concatenation is ordered. An empty source shall leave the target unchanged. Pending insertion shall append every source row as pending and preserve the target prefix/boundary and certificate. These operations shall not apply geometric conjunction or hull operations beyond combining their internal row collections.

RATIONALE:

Whole-container insertion has distinct ownership and pending policies that must not be inferred from the source flags.

INTERFACE:
void Linear_System<Row>::insert(const Linear_System<Row>& y);
void Linear_System<Row>::insert(Linear_System<Row>& y, Recycle_Input);
void Linear_System<Row>::insert_pending(const Linear_System<Row>& y);
void Linear_System<Row>::insert_pending(Linear_System<Row>& y, Recycle_Input);
// Available for rows with nonthrowing container ownership transfer.
void Linear_System<Row>::insert_pending_consume(Linear_System<Row>& y);
void Linear_System<Row>::insert_consume(Linear_System<Row>& y);
VERIFICATION_CRITERIA:

Check source order, distinct/copy-self cases, all source pending states, target suffix state, empty source no-op and recycled-source reset across storage choices.

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; tests/systembulktransferspec1.cc.

PPL-SPEC-000412
12. Removing individual, trailing and same-status row ranges
UID: PPL-SPEC-000412
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Individual removal shall require an in-range row. Half-open range removal shall require first <= last <= num_rows() and, for a nonempty range, a single processed/pending status. Trailing removal shall require an admitted count not greater than row count. Exactly the selected entry rows shall be removed; processed and pending survivors shall retain their status, with the boundary decreased by the number of removed processed rows. Dimension, topology and storage shall be retained.

With keep_sorted true and a certified processed range, survivor order and certificate shall be retained. Otherwise survivor order may change within each status class; removing processed rows may clear the certificate, while pending-only removal shall retain the established prefix certificate. Empty ranges/counts shall be admitted.

RATIONALE:

Fast removal can reorder rows but must not mix processed rows with pending ones.

INTERFACE:
void Linear_System<Row>::remove_row(dimension_type i, bool keep_sorted = false);
void Linear_System<Row>::remove_rows(dimension_type first, dimension_type last,
  bool keep_sorted = false);
void Linear_System<Row>::remove_trailing_rows(dimension_type n);
VERIFICATION_CRITERIA:

Compare labelled processed/pending multisets through every valid range, individual index and trailing count; verify ordered survivors on certified keep_sorted paths.

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-000413
13. Ordered-index row removal preserves survivor sequence
UID: PPL-SPEC-000413
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Indexed-list removal shall require strictly increasing distinct in-range indices. It shall erase exactly those rows and preserve the relative order of all survivors, including removals spanning processed and pending parts. The boundary shall decrease by the number of selected processed rows. The certificate and other metadata shall be retained. An empty index list shall leave the system unchanged.

RATIONALE:

Stable list removal can select both status classes without losing the pending partition.

INTERFACE:
void Linear_System<Row>::remove_rows(const std::vector<dimension_type>& indexes);
VERIFICATION_CRITERIA:

Enumerate index subsets of small labelled mixed systems; compare literal survivor sequences, pending status and unchanged certificates.

SOURCE:

src/Linear_System_defs.hh; src/Linear_System_inlines.hh; src/Linear_System_templates.hh; tests/linearsystemspec1.cc; tests/linearsystem1.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-000416
16. Topology queries and hidden-epsilon layout conversion
UID: PPL-SPEC-000416
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Topology queries shall report the common row topology. Constraint/generator layout conversion shall set the requested topology for system and rows, retain public dimension, public homogeneous coefficients and ordinary constant or divisor fields, and add a zero hidden epsilon coefficient when entering NNC layout or discard it when entering closed layout. Repeating the current topology shall retain the system. Pending status and row sequence shall remain.

This is an internal layout operation: dropping epsilon changes a strict constraint to a nonstrict one and a closure point to an included point; adding zero epsilon changes a closed-layout included point to an NNC closure point. Callers shall select it according to the surrounding geometric algorithm and require valid resulting row kinds. Grid-generator systems shall require closed topology. Certificates shall remain truthful after any layout change.

RATIONALE:

Epsilon layout conversion has concrete boundary effects and must not be mistaken for a proof of topological closedness.

INTERFACE:
Topology Linear_System<Row>::topology() const;
bool Linear_System<Row>::is_necessarily_closed() const;
void Linear_System<Row>::set_topology(Topology topology);
void Linear_System<Row>::set_necessarily_closed();
void Linear_System<Row>::set_not_necessarily_closed();
VERIFICATION_CRITERIA:

Check metadata and literal coordinate/divisor preservation, closed/NNC weak constraints and point-kind transitions, idempotence and row capability exclusions.

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-000417
17. Reinterpreting a coordinate as the epsilon field and back
UID: PPL-SPEC-000417
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

For constraint/generator rows, marking NNC storage as necessarily closed shall require NNC topology and admitted additional public dimension. It shall retain every stored coefficient and reinterpret the hidden epsilon column as the final ordinary coordinate, increasing public dimension by one. Marking closed storage as NNC shall require closed topology, positive public dimension and coefficients suitable for valid epsilon-bearing rows; it shall reinterpret the last ordinary coordinate as epsilon and decrease public dimension by one. Row order, pending status and storage shall be retained. These operations shall change interpretation without allocating an added coefficient column.

RATIONALE:

Reinterpreting an existing column differs from adding or discarding a hidden epsilon field.

INTERFACE:
void Linear_System<Row>::mark_as_necessarily_closed();
void Linear_System<Row>::mark_as_not_necessarily_closed();
VERIFICATION_CRITERIA:

Check exact round trips of admissible constraint/generator rows, exposed final coefficients, kind changes, dimensions and unchanged bookkeeping.

SOURCE:

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

PPL-SPEC-000418
18. Row-wise normalization and certificate invalidation
UID: PPL-SPEC-000418
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Normalization shall apply the corresponding row-type normalization to every retained row, including pending rows, without changing dimension, topology, storage or pending boundary. Strong normalization shall establish each row's common-factor/sign convention; sign normalization shall apply its sign rule. The certificate shall become true for at most one row and false otherwise, allowing a later explicit sort to establish row order. Numerical preconditions shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping.

RATIONALE:

Row normalization can change sort keys even when the represented relation is retained.

INTERFACE:
void Linear_System<Row>::strong_normalize();
void Linear_System<Row>::sign_normalize();
VERIFICATION_CRITERIA:

Check literal nonprimitive row coefficients after internal truncation, row-specific normalization, pending rows, repeated idempotence and certificate values.

SOURCE:

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

19. Sorting processed prefixes or single-status row windows
UID: PPL-SPEC-000419
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Full-prefix sorting shall order the processed prefix by compare and remove duplicate entries identified by Row::is_equal_to while retaining the pending suffix's entry sequence. It shall certify the resulting prefix. Window sorting shall require an admitted half-open window contained entirely in one status class. It shall sort/deduplicate just that window, preserve outside entry rows and adjust the pending boundary to account for removed processed rows. Windows shorter than two shall be no-ops. A window call shall not itself claim that an unrelated unsorted processed prefix is sorted. Neither operation shall decide geometric redundancy beyond the stated row equality predicate.

RATIONALE:

Ordering and duplicate elimination use defined row comparison/equality rather than a domain minimization algorithm.

INTERFACE:
void Linear_System<Row>::sort_rows();
void Linear_System<Row>::sort_rows(dimension_type first, dimension_type last);
VERIFICATION_CRITERIA:

Check independent labelled row order and duplicate multiplicity in full-prefix and every single-status window, preserving pending/outside sequences and boundary counts.

SOURCE:

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

PPL-SPEC-000420
20. Pending-row sorting and duplicates already in the prefix
UID: PPL-SPEC-000420
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

This operation shall require a true processed-prefix certificate and at least one pending row. It shall sort and deduplicate pending rows, remove pending entries comparing equal to a processed prefix row, preserve the processed prefix and retain the surviving rows as pending. It shall preserve dimension, topology and storage and retain a true prefix certificate. It shall not mark the surviving suffix processed or merge it into prefix order.

RATIONALE:

Pending duplicate cleanup retains which rows still need elaboration.

INTERFACE:
void Linear_System<Row>::sort_pending_and_remove_duplicates();
VERIFICATION_CRITERIA:

Compare sorted distinct pending labels minus prefix labels with independent sets, including no overlap, full overlap, duplicate pending rows and prefix duplicates.

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-000421
21. Merging sorted processed systems
UID: PPL-SPEC-000421
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Merge shall require matching topology, no pending rows in either input, actually sorted row sequences and target dimension at least source dimension. It shall replace the target by the ascending merge of both row collections, retaining one copy of matching rows under comparison, target dimension and target representation. Source rows shall be zero-extended to the target's dimension. Distinct sources shall retain their values; self-merge shall retain the target row sequence. The resulting system shall have no pending rows and a truthful sorted certificate. Inputs shall already be duplicate-free if a fully duplicate-free result is required.

RATIONALE:

Merging established row orders is a storage operation with dimension and duplicate preconditions.

INTERFACE:
void Linear_System<Row>::merge_rows_assign(const Linear_System<Row>& y);
VERIFICATION_CRITERIA:

Compare sorted unique label unions, disjoint/interleaved/overlapping and empty systems, source dimension extension, source ownership and self-merge.

SOURCE:

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

22. Internal sequence equality and bookkeeping scope
UID: PPL-SPEC-000422
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

Equality shall compare public dimension, row count, pending boundary and corresponding row values through Row::operator==. Inequality shall negate that result. Storage choice and sorted certificate shall not affect equality; container topology shall not be compared separately from its effect on row comparison. In particular, row-empty systems of the same dimension and boundary may compare equal across topologies. Equality shall not reorder rows or decide equivalence of generated geometric sets.

RATIONALE:

This equality answers an internal sequence/pending-state question rather than complete container-metadata identity or general domain equivalence.

INTERFACE:
template <typename Row>
bool operator==(const Linear_System<Row>& x, const Linear_System<Row>& y);
// Inequality uses C++20 rewriting of operator==.
VERIFICATION_CRITERIA:

Check Boolean inequality expressions in both operand orders through C++20 equality rewriting, retaining the stated equality and mismatch behavior. Check dimensions, row order/count, pending boundaries, equal values across storage/certificates and empty systems with different topology.

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-000423
23. Reloadable linear-system metadata and row sequences
UID: PPL-SPEC-000423
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

ASCII export shall include topology, row count, public dimension, representation, sorted certificate, pending boundary and all row encodings in sequence. Loading a complete compatible encoding shall restore those fields and row values and return true only for a valid common-metadata system. Malformed/missing tokens, an out-of-range pending boundary, a false sorted claim or row metadata incompatible with the declared system shall report false. The stored sorted flag shall remain a certificate, not a request to sort input. Empty and all-pending systems shall be admitted. Trailing input shall remain available. Failure need not roll back the target; resource states shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping. Diagnostic dump/print shall emit the same reloadable representation. The decoded header dimension shall not exceed max_space_dimension(), including when the record contains no rows; not_a_dimension() shall be rejected as an unsupported extent.

RATIONALE:

Successful reload must reestablish bookkeeping and common row metadata, not merely parse each row independently.

INTERFACE:
void Linear_System<Row>::ascii_dump(std::ostream& s) const;
void Linear_System<Row>::ascii_dump() const;
void Linear_System<Row>::print() const;
bool Linear_System<Row>::ascii_load(std::istream& s);
VERIFICATION_CRITERIA:

Round-trip exact row records, pending partitions, both topologies/storage choices and empty extents; check malformed/truncated input, inconsistent metadata/certificates and preserved trailing input. Check zero, positive and maximum admitted header dimensions, maximum plus one and the reserved non-dimension, even for empty row sequences. Exercise both storage choices, preserved trailing input and complete valid replacement after rejection.

SOURCE:

src/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-000424
24. Linear-system invariants, accounting and clear state
UID: PPL-SPEC-000424
STATUS: APPROVED
COMPONENT: CORE_DATA_STRUCTURES
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Internal
RELATIONS (Parent):
STATEMENT:

OK() shall check common row representation/dimension/topology, an admitted pending boundary and truth of an asserted sorted-prefix certificate. Separate row invariants shall remain the responsibility of the row capability. Memory queries shall preserve values and metadata; external accounting shall include reserved row-vector slots and each live row's external storage, and total shall equal sizeof(system) + external. No allocator-overhead or future-availability guarantee shall be inferred. clear() shall remove all rows, set dimension and pending boundary to zero and certificate true, while retaining topology and representation.

RATIONALE:

Clearing and inspecting the internal container must leave a defined reusable bookkeeping state.

INTERFACE:
bool Linear_System<Row>::OK() const;
memory_size_type Linear_System<Row>::external_memory_in_bytes() const;
memory_size_type Linear_System<Row>::total_memory_in_bytes() const;
void Linear_System<Row>::clear();
VERIFICATION_CRITERIA:

Check metadata inspections, accounting identities for reserved/populated rows and clear/reuse in each admitted context without changing geometric row values.

SOURCE:

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