C++ rational-grid text, memory and invariants
|
Type
|
Level
|
MID
|
UID
|
REFS
|
Title
|
Statement
|
Rationale
|
Comment
|
BIBLIOGRAPHY
|
STATUS
|
COMPONENT
|
APPLICABILITY
|
VERIFICATION_METHODS
|
VERIFICATION_CRITERIA
|
SOURCE
|
LANGUAGE
|
VISIBILITY
|
INTERFACE
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SW_SPEC
|
1 |
|
|
Parents:
|
|
IO_Operators::operator<<(s, grid) shall write false for empty, true for universe, and a readable congruence description otherwise. Nontrivial output shall denote the same set and coordinate identities as the grid, using the installed variable formatter and descriptor output conventions. It shall return s by reference. Representation normalization shall be permitted, preserving set and ambient dimension. This display shall not promise an ascii_load input format or a fixed order of equivalent rows. Stream failure shall follow the stream's configured state/exception behavior. print() shall send the same readable presentation to std::cerr without adding a newline; it shall have the same source and arithmetic prerequisites. The initialization, selected arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including temporary calculations. Source descriptions and output streams shall remain live for their respective uses. Resource and numerical failures shall not imply a stronger surviving-object guarantee than the operation states. |
Grid display must distinguish empty, universe and periodic restrictions while allowing normal-form and variable-name changes. |
|
|
|
|
|
Check literal empty/universe and nontrivial equality/proper-congruence displays, custom variable names, return-stream identity, cache histories and stream failures. |
src/Grid_public.cc; src/Grid_inlines.hh; tests/gridpersistencespec1.cc; tests/gridpersistencepublic1.cc; tests/gridpersistencefailure1.cc; tests/Grid/asciidumpload1.cc through asciidumpload6.cc; tests/Grid/loadstatus1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library and signatures are Grid members unless indicated. std::ostream& IO_Operators::operator<<(std::ostream& s, const Grid& grid); void print() const; |
|
|
SW_SPEC
|
2 |
|
|
Parents:
|
|
ascii_dump(s) shall export a complete record of ambient dimension, distinguished-value/status information, stored congruence and generator systems with their current-description indicators, and dimension-kind data required by the encoded reduced descriptions. The no-argument overload shall write the same record to std::cerr. Export shall preserve the source value, dimension, stored descriptions, status and ownership. A compatible complete record shall support the loading contract in 🔗 3. Compatible rational-grid record loading and failure state. The scope shall be the corresponding supported producer/consumer format and representable selected coefficient profile; cross-version compatibility, fixed bytes across equivalent cache histories and compatibility with human-readable presentation shall not be implied. Stream failures and enabled stream exceptions shall propagate through the standard stream mechanism; incomplete output shall not be a complete record. The initialization, selected arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including temporary calculations. Source descriptions and output streams shall remain live for their respective uses. Resource and numerical failures shall not imply a stronger surviving-object guarantee than the operation states. The internal status contract shall follow 🔗 4. Grid internal status signed-keyword export. |
Text reproduction must include enough state to recover the mathematical grid without requiring prior normalization. |
BagnaraDHMZ07 | Section 3, grid and double-description definitions (PDF page indices 6–8, zero-based). |
|
|
|
|
Round-trip literal rational grids in cold, congruence-only, generator-only and dual-description states, including dense/sparse storage, zero dimensions, empty and retained inactive descriptions. Compare repeated dumps without intervening mutation and exercise stderr and failing streams. |
src/Grid_public.cc; src/Grid_inlines.hh; tests/gridpersistencespec1.cc; tests/gridpersistencepublic1.cc; tests/gridpersistencefailure1.cc; tests/Grid/asciidumpload1.cc through asciidumpload6.cc; tests/Grid/loadstatus1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library and signatures are Grid members unless indicated. void ascii_dump(std::ostream& s) const; void ascii_dump() const; |
|
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
ascii_load(s) shall return true on a trusted, compatible complete record produced by 🔗 2. Reloadable rational-grid record export, replacing the receiver's set and ambient dimension. Encoded storage shall be retained for the loaded descriptor systems. Cached normal forms may be invalidated and rebuilt under the current reduction rules; cache reconstruction shall preserve mathematical meaning. Trailing input shall remain available after the complete record. Malformed or truncated fields, unsupported ambient dimensions, invalid status/descriptor structures, incompatible current-description dimensions and nonempty-state generator descriptions lacking a point shall return false, with and without enabled assertions. For a successful load of a trusted record written by 🔗 2. Reloadable rational-grid record export, the receiver shall meet 🔗 5. Rational-grid representation invariant query. Its current descriptions shall define the same set, and an empty grid shall retain empty congruence and generator views. Structural checks can accept altered records whose descriptions contradict one another or disagree with the status. Further operations require a valid representation. Stream, allocation and selected numerical exceptions may propagate. After false or an exception, the receiver shall retain ownership sufficient for destruction; rollback and subsequent queries shall not be assumed. The initialization, selected arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including temporary calculations. Source descriptions and output streams shall remain live for their respective uses. Resource and numerical failures shall not imply a stronger surviving-object guarantee than the operation states. Storage for serialized dimension kinds shall grow with the accepted entries rather than the declared dimension alone. The internal status contract shall follow 🔗 5. Grid internal status signed-keyword loading and rejection. |
Loaded status and caches influence later query shortcuts. Successful parsing must not admit mutually contradictory descriptions or a supporting-point-free nonempty representation. |
BagnaraDHMZ07 | Section 3, grid and double-description definitions (PDF page indices 6–8, zero-based). |
|
|
|
|
Use independent literal round trips and every truncated prefix. Corrupt dimensions, distinguished states, active-description flags, generator topology and point presence. Combine individually valid but different current grids in both inclusion directions, including a proper sublattice with the same affine hull. Check false returns in optimized and assertion-enabled loader builds; exercise throwing streams and allocation failures against the destruction-only guarantee. |
src/Grid_public.cc; src/Grid_inlines.hh; tests/gridpersistencespec1.cc; tests/gridpersistencepublic1.cc; tests/gridpersistencefailure1.cc; tests/Grid/asciidumpload1.cc through asciidumpload6.cc; tests/Grid/loadstatus1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library and signatures are Grid members unless indicated. bool ascii_load(std::istream& s); |
|
|
SW_SPEC
|
4 |
|
|
Parents:
|
|
external_memory_in_bytes() shall report the owned external storage of the congruence system, generator system and dimension-kind vector. Descriptor system counts shall follow their component contracts; the vector count shall include its retained allocated capacity rather than only its live entries. Inactive or logically empty cached data shall remain counted while owned. Other objects, runtime scratch pools and allocator bookkeeping shall be excluded. total_memory_in_bytes() shall equal sizeof(Grid) plus that external count. The sums shall fit memory_size_type and use the selected build's sizes. Both queries shall preserve set, ambient dimension, caches, capacity, ownership and lifetimes; the observed storage shall remain unchanged during the query. The initialization, selected arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including temporary calculations. Source descriptions and output streams shall remain live for their respective uses. Resource and numerical failures shall not imply a stronger surviving-object guarantee than the operation states. |
Logical state changes do not release every retained allocation. Capacity owned by the dimension-kind cache contributes to the object footprint. |
|
|
|
|
|
Observe the actual allocation backing the dimension-kind vector and compare the reported count with that allocation plus independently specified descriptor-system counts. Include zero/nonzero dimensions, empty, normalization, dimension shrinkage, reuse and reserved spare capacity. Check total minus external equals sizeof(Grid), source preservation and absence of query allocations. |
src/Grid_public.cc; src/Grid_inlines.hh; tests/gridpersistencespec1.cc; tests/gridpersistencepublic1.cc; tests/gridpersistencefailure1.cc; tests/Grid/asciidumpload1.cc through asciidumpload6.cc; tests/Grid/loadstatus1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library and signatures are Grid members unless indicated. memory_size_type external_memory_in_bytes() const; memory_size_type total_memory_in_bytes() const; |
|
|
SW_SPEC
|
5 |
|
|
Parents:
|
Incoming link from:
3. Compatible rational-grid record loading and failure state
1 |
OK(false) shall return true for an admitted grid whose distinguished state, ambient dimension, status and current descriptions satisfy the representation invariants. OK(true) shall additionally require the grid to be nonempty. The ambient dimension shall be supported and every current system shall be structurally valid and have that dimension. An empty grid shall have empty generator views and a contradictory congruence view. Zero-dimensional universe shall have no defining congruences and one zero-dimensional point. A nonempty-state current generator system shall contain a point. If both descriptions are current, they shall define the same set, including affine restrictions and discrete periods. A congruence-only description may be inconsistent without already having the empty flag; in that case OK(false) shall be true and OK(true) false. The query shall preserve the receiver and may use independent temporary normalization to check consistency. It may allocate and propagate supported resource or numerical failures. On an invalid state it may emit diagnostic text; diagnostic wording shall not be a stable interface. The query shall operate only on live, destructible owned structures, not arbitrary invalid addresses or corrupted object representations. The initialization, selected arithmetic-profile, lifetime and synchronization conditions in 🔗 1. Rational-grid values, coefficient profile and valid use shall apply, including temporary calculations. Source descriptions and output streams shall remain live for their respective uses. Resource and numerical failures shall not imply a stronger surviving-object guarantee than the operation states. The internal status contract shall follow 🔗 3. Grid internal status consistency predicate. |
Public invariant checks must recognize states that invalidate the nonempty and dual-description shortcuts used by other operations. |
BagnaraDHMZ07 | Section 3, grid and double-description definitions (PDF page indices 6–8, zero-based). |
|
|
|
|
Check all valid construction and cache histories against literal grids, including latent emptiness. Use the existing focused test access for owned structural counterexamples, checking missing points, incompatible current descriptions in each direction, and distinguished-state or ambient-dimension mismatch. Verify source preservation and both check_not_empty values. |
src/Grid_public.cc; src/Grid_inlines.hh; tests/gridpersistencespec1.cc; tests/gridpersistencepublic1.cc; tests/gridpersistencefailure1.cc; tests/Grid/asciidumpload1.cc through asciidumpload6.cc; tests/Grid/loadstatus1.cc. |
|
|
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library and signatures are Grid members unless indicated. bool OK(bool check_not_empty = false) const; |