Parma Polyhedra Library requirements
Internal geometric row systems and processing state

Internal geometric row systems and processing state

UID:
VERSION:
CLASSIFICATION:
PREFIX:
Type
Level
MID
UID
REFS
Title
Statement
Rationale
Comment
BIBLIOGRAPHY
STATUS
COMPONENT
APPLICABILITY
VERIFICATION_METHODS
VERIFICATION_CRITERIA
SOURCE
LANGUAGE
VISIBILITY
INTERFACE
SW_SPEC
1
PPL-SPEC-000401

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal

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;
SW_SPEC
2
PPL-SPEC-000402
PPL-SPEC-000402
Empty system construction with explicit topology and dimension

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
Linear_System<Row>::Linear_System(Topology topology, Representation r);
Linear_System<Row>::Linear_System(Topology topology,
  dimension_type space_dim, Representation r);
SW_SPEC
3
PPL-SPEC-000403
PPL-SPEC-000403
Owning copies with explicit pending-row policy

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
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);
SW_SPEC
4
PPL-SPEC-000404
PPL-SPEC-000404
Assignment, swaps and lifecycle of linear-system owners

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
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.
SW_SPEC
5
PPL-SPEC-000405
PPL-SPEC-000405
Row representation conversion

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
Representation Linear_System<Row>::representation() const;
void Linear_System<Row>::set_representation(Representation r);
SW_SPEC
6
PPL-SPEC-000406
PPL-SPEC-000406
System extent, row access and read-only traversal

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.

Internal traversal includes every retained row rather than the public facade iterator filtering policy.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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.

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

CPP
Internal
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 &;
SW_SPEC
7
PPL-SPEC-000407
PPL-SPEC-000407
Pending-boundary queries and explicit status changes

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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.

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

CPP
Internal
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();
SW_SPEC
8
PPL-SPEC-000408
PPL-SPEC-000408
Sorted-prefix certificates and actual ordering inspection

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
bool Linear_System<Row>::is_sorted() const;
bool Linear_System<Row>::check_sorted() const;
void Linear_System<Row>::set_sorted(bool b);
SW_SPEC
9
PPL-SPEC-000409
Inserting a processed row with dimension alignment

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::insert(const Row& row);
void Linear_System<Row>::insert(Row& row, Recycle_Input);
SW_SPEC
10
PPL-SPEC-000410
PPL-SPEC-000410
Appending pending rows without certifying their order

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::insert_pending(const Row& row);
void Linear_System<Row>::insert_pending(Row& row, Recycle_Input);
SW_SPEC
11
PPL-SPEC-000411
PPL-SPEC-000411
Copying and recycling whole system row sequences

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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.

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.

CPP
Internal
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);
SW_SPEC
12
PPL-SPEC-000412
PPL-SPEC-000412
Removing individual, trailing and same-status row ranges

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
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);
SW_SPEC
13
PPL-SPEC-000413
PPL-SPEC-000413
Ordered-index row removal preserves survivor sequence

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::remove_rows(const std::vector<dimension_type>& indexes);
SW_SPEC
14
PPL-SPEC-000414
PPL-SPEC-000414
System dimension changes and coordinate removal

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::set_space_dimension(dimension_type space_dim);
void Linear_System<Row>::remove_space_dimensions(const Variables_Set& vars);
SW_SPEC
15
PPL-SPEC-000415
PPL-SPEC-000415
Shared coordinate swaps, cycles and zero insertion

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
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);
SW_SPEC
16
PPL-SPEC-000416
PPL-SPEC-000416
Topology queries and hidden-epsilon layout conversion

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
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();
SW_SPEC
17
PPL-SPEC-000417
PPL-SPEC-000417
Reinterpreting a coordinate as the epsilon field and back

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::mark_as_necessarily_closed();
void Linear_System<Row>::mark_as_not_necessarily_closed();
SW_SPEC
18
PPL-SPEC-000418
PPL-SPEC-000418
Row-wise normalization and certificate invalidation

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::strong_normalize();
void Linear_System<Row>::sign_normalize();
SW_SPEC
19
PPL-SPEC-000419
Sorting processed prefixes or single-status row windows

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::sort_rows();
void Linear_System<Row>::sort_rows(dimension_type first, dimension_type last);
SW_SPEC
20
PPL-SPEC-000420
PPL-SPEC-000420
Pending-row sorting and duplicates already in the prefix

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.

Pending duplicate cleanup retains which rows still need elaboration.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::sort_pending_and_remove_duplicates();
SW_SPEC
21
PPL-SPEC-000421
PPL-SPEC-000421
Merging sorted processed systems

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
void Linear_System<Row>::merge_rows_assign(const Linear_System<Row>& y);
SW_SPEC
22
PPL-SPEC-000422
Internal sequence equality and bookkeeping scope

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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.

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

CPP
Internal
template <typename Row>
bool operator==(const Linear_System<Row>& x, const Linear_System<Row>& y);
// Inequality uses C++20 rewriting of operator==.
SW_SPEC
23
PPL-SPEC-000423
PPL-SPEC-000423
Reloadable linear-system metadata and row sequences

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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.

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

CPP
Internal
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);
SW_SPEC
24
PPL-SPEC-000424
PPL-SPEC-000424
Linear-system invariants, accounting and clear state

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.

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

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

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

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

CPP
Internal
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();