Parma Polyhedra Library requirements
Internal equality, line and saturation algorithms

Internal equality, line and saturation algorithms

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-000425
PPL-SPEC-000425
Forward elimination and augmented equality/line rank

Constraint and polyhedral-generator instantiations shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping. The separate line-only Grid_Generator case below shall use its stated prerequisites.

For constraint or polyhedral-generator rows, gauss(k) shall require no pending rows and exactly k equality/line rows grouped at the beginning. It shall return the rational rank of their stored coefficient vectors, including ordinary constant and applicable epsilon columns. It shall retain the equality/line row span, choose pivots from higher columns toward lower columns, place an independent triangular basis in the returned-rank prefix and reduce the remaining equality/line rows to zero vectors. Row count and non-equality/non-line rows shall be retained. Constant-only independent equalities, including an inconsistent equality, shall participate in the rank.

Dependent zero line vectors may remain as internal intermediate rows until removed; their owned coefficient layouts and common container metadata shall remain valid. Internal metadata queries, numeric-field inspection, removal cleanup and back substitution with zero rows outside its basis shall admit these intermediates. They shall not be exposed as public line descriptors. Common dimension, topology, storage and no-pending state shall be retained, and the sorted certificate shall be cleared whenever its truth is no longer established. All coefficient calculations shall satisfy 🔗 1. Internal geometric-row sequences and valid bookkeeping. For a Linear_System<Grid_Generator> containing only grid lines, with no pending rows, the same rational direction-span and rank/basis guarantees shall hold. Grid points and integer-lattice parameters are outside this extension: these operations do not promise to preserve a parameter lattice. A zero residual line is an admitted internal intermediate and contributes no direction; it shall be removed or skipped before constructing public grid generators. The common stored dimensions and representation shall remain valid.

Forward elimination computes a basis of coefficient rows independently of whether affine equalities have a solution.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

Compare rank and coefficient-row spans with independent exact rational elimination using the opposite pivot direction. Check basis rank, descending pivot columns, zero dependent tails, unchanged other rows and constant-pivot cases. Check wide empty prefixes, early complete bases, full-column scans, dependent tails and unchanged nonbasis rows, processing state and sorted certificates.

src/Linear_System_defs.hh; src/Linear_System_templates.hh; src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; tests/linearsystemalgorithmsspec1.cc; tests/linearsystem1.cc; tests/Grid/linearelimination1.cc.

CPP
Internal
dimension_type Linear_System<Row>::gauss(dimension_type k);
SW_SPEC
2
PPL-SPEC-000426
PPL-SPEC-000426
Back substitution through a triangular nonconstant basis

Constraint and polyhedral-generator instantiations shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping. The separate line-only Grid_Generator case below shall use its stated prerequisites.

back_substitute(k) shall require no pending rows and a leading independent triangular equality/line basis of k rows, with nonzero pivots outside the ordinary constant column. Leading basis rows shall be line/equality rows, with pivots in strictly descending column order. Each pivot shall be eliminated from the other basis rows and from the remaining rows by exact linear combination, preserving the basis row span. Combining an inequality, ray or point with a basis row shall use positive scaling of that non-basis row.

For constraints this shall preserve the conjunction with the equality basis; for generators it shall preserve the generated combinations modulo the line span. Residual zero direction rows may remain as redundant internal rows. Zero direction rows shall require internal removal cleanup before public descriptor use. They shall remain admitted for numeric-field inspection and container metadata queries under 🔗 1. Internal geometric-row sequences and valid bookkeeping. Shape, topology, storage, row count and no-pending state shall be retained; certificates shall remain truthful. Numerical prerequisites shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping. For a Linear_System<Grid_Generator> containing only grid lines, with no pending rows, the same rational direction-span and rank/basis guarantees shall hold. Grid points and integer-lattice parameters are outside this extension: these operations do not promise to preserve a parameter lattice. A zero residual line is an admitted internal intermediate and contributes no direction; it shall be removed or skipped before constructing public grid generators. The common stored dimensions and representation shall remain valid.

A nonconstant triangular pivot permits substitution without negating an inequality or changing a one-sided generator combination.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

Check exact basis row-span preservation and independent rational constraint satisfaction, including inequalities and strict inequalities. For generators compare the line subspace and point/ray quotient coordinates, including negative pivots and zero residual directions.

src/Linear_System_defs.hh; src/Linear_System_templates.hh; src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; tests/linearsystemalgorithmsspec1.cc; tests/linearsystem1.cc; tests/Grid/linearelimination1.cc.

CPP
Internal
void Linear_System<Row>::back_substitute(dimension_type k);
SW_SPEC
3
PPL-SPEC-000427
PPL-SPEC-000427
Simplification of equality and line subsystems

Row shall be Constraint or Generator. Valid use shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping.

With no pending rows, simplify() shall establish a leading independent basis of the meaningful nonzero line/equality coefficient rows and back-substitute that basis into the remaining rows. It may remove dependent rows or retain them as redundant zero coefficient rows. The result shall preserve constraint conjunction or polyhedral-generator combinations modulo the line span. An inconsistent equality subsystem shall remain inconsistent rather than being treated as a consistent affine space. The nonzero basis rank shall be retained independently of the stored line/equality row count.

It shall retain public dimension, topology, storage and no-pending state. Other rows need not be minimized for all geometric redundancy. Residual zero equality rows may remain as tautologies; zero direction rows shall require row-validity cleanup before public descriptor use. Internal numeric-field inspection, metadata queries and removal cleanup shall admit these intermediate rows. Sorted-prefix certificates shall be truthful. Numerical and resource prerequisites shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping.

Partial simplification establishes the meaningful basis while permitting redundant zero storage rows and separate public direction cleanup.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

Compare exact ranks and before/after conjunctions using independent rational valuations; compare generator line spans and quotient combinations. Check dependent equalities/lines, mixed row kinds, all-equality inputs, inconsistent equations and repeated simplification.

src/Linear_System_defs.hh; src/Linear_System_templates.hh; src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; tests/linearsystemalgorithmsspec1.cc; tests/linearsystem1.cc.

CPP
Internal
void Linear_System<Row>::simplify();
SW_SPEC
4
PPL-SPEC-000428
PPL-SPEC-000428
Sorting rows together with their saturation records

Row shall be Constraint or Generator. Valid use shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping.

sort_and_remove_with_sat(sat) shall require a valid bit matrix with one row for each processed system row, in matching order. It shall sort and deduplicate that processed prefix by the same row predicates as 🔗 19. Sorting processed prefixes or single-status row windows, moving each retained bit row with its corresponding geometric row. On duplicate elimination it shall retain one original paired record; callers shall require equivalent saturation records for duplicate geometric rows when that equivalence is needed by the consuming algorithm.

The matrix column count shall be retained and its resulting row count shall equal the new processed boundary. Pending rows shall remain pending with their multiset preserved, although their order may change. System dimensions, topology and storage shall be retained and the processed prefix certified sorted. Zero/one processed row shall be admitted.

A row permutation must preserve the association with the incidence information consumed by later numerical algorithms.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

Associate independent label-derived bit sets with rows, then check retained pairs through sorting/deduplication, empty/one-row prefixes and pending suffixes. Verify exact prefix/matrix dimensions and unchanged saturation columns.

src/Linear_System_defs.hh; src/Linear_System_templates.hh; src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; tests/linearsystemalgorithmsspec1.cc; tests/linearsystem1.cc.

CPP
Internal
void Linear_System<Row>::sort_and_remove_with_sat(Bit_Matrix& sat);
SW_SPEC
5
PPL-SPEC-000429
PPL-SPEC-000429
Adding processed rows for new coordinate axes

Row shall be Constraint or Generator. Valid use shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping.

For a positive admitted n, add_universe_rows_and_space_dimensions(n) shall append n zero-extended public coordinates to old rows and introduce n leading processed line/equality rows spanning exactly the new coordinate axes. Each new row shall have one positive unit coefficient at a distinct new axis, with all other public and ordinary constant coefficients zero. No new row shall add a supporting included point or a nonzero epsilon term.

Old rows shall retain their order, values at old coordinates and pending status. Row count, dimension and processed boundary shall each increase by n; topology and storage shall be retained and hidden epsilon fields shall remain hidden at the new layout location. Empty initial row collections shall be admitted. Certificates shall remain truthful. For constraints the new equalities fix the new coordinates to zero; for generators the new lines supply arbitrary real displacement in them.

The same new-axis row construction supplies equations or line directions according to its row type.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

Check new-axis unit vectors as an independent multiset, preserved old rows/pending status and relocated epsilon fields in both topologies. Include one/multiple added axes, empty initial collections and existing processed/pending rows.

src/Linear_System_defs.hh; src/Linear_System_templates.hh; src/Constraint_System_inlines.hh; src/Generator_System_inlines.hh; tests/linearsystemalgorithmsspec1.cc; tests/linearsystem1.cc.

CPP
Internal
void Linear_System<Row>::add_universe_rows_and_space_dimensions(dimension_type n);
SW_SPEC
6
PPL-SPEC-001649
PPL-SPEC-001649
Sparse equality and line pivot selection

gauss_sparse(k) shall require sparse representation, a positive leading line/equality count k and the valid no-pending grouping required by 🔗 1. Forward elimination and augmented equality/line rank. It shall return the augmented rational rank and establish the same ordered coefficient rows and common metadata as descending column elimination under that contract. Among remaining rows it shall choose the greatest nonzero column and the first row containing that column. Constant-only equality pivots shall participate; an all-zero remainder shall end elimination. A line's divisor column shall remain zero.

The equality/line row span, row count, topology, dimension, storage and nonbasis rows shall be preserved. The sorted certificate shall be cleared when rows are swapped or combined. Valid sparse expression storage shall satisfy 🔗 7. Backend row export, serialization, diagnostics and accounting; its stored entries shall be nonzero. Numerical and lifetime prerequisites shall follow 🔗 1. Internal geometric-row sequences and valid bookkeeping.

The greatest last-nonzero index of the remaining rows identifies the same pivot as a descending column scan while skipping columns that are all zero.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Test, Analysis, Inspection

Compare exact ordered rows with dense elimination and rank and spans with an independent rational oracle. Include tied tails, row swaps, sparse gaps, constant-only pivots, zero residuals, closed and NNC systems, and unchanged nonbasis rows, pending state and sorted certificates.

src/Linear_System_defs.hh; src/Linear_System_templates.hh; tests/linearsystemalgorithmsspec1.cc.

CPP
Internal

Internal source header: Linear_System_defs.hh; namespace Parma_Polyhedra_Library. The private member belongs to Linear_System<Row> for Row equal to Constraint or Generator.

dimension_type gauss_sparse(dimension_type k);