C++ octagonal records and representation 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:
|
|
For a valid admitted source of ambient dimension n, ascii_dump(stream) shall write the literal "space_dim ", the ambient dimension and a newline. It shall then write the three stored status fields in ZE, EM, SC order, with each keyword prefixed by + or -. One space shall separate the first two fields, two spaces shall separate the last two fields, and one space and a newline shall follow the last field. The following payload shall be the pseudo-triangular matrix record of 🔗 1. Pseudo-triangular mathematical-value records, with matrix space dimension n. It shall contain its dimension line followed by its physical rows in their stored order, including diagonal positive-infinity sentinels. A zero-dimensional matrix shall have no coefficient rows. The status fields shall retain the stored zero-dimension, emptiness and strong-closure conventions; export shall not require first classifying emptiness or computing strong closure. Coefficient output shall retain the selected mathematical-value formatting of 🔗 5. Mathematical numeric output and stream delivery status and 🔗 6. Checked numeric stream policy integration, including exact finite native values independently of caller precision. Under compatible record, numeric-profile, locale and version conventions, the complete record shall retain enough information for 🔗 2. Compatible octagonal record loading and failure state to restore the same mathematical set and ambient dimension. Native object bytes and a floating zero sign shall not be part of this mathematical round-trip guarantee. Export shall preserve the source set, dimension, stored status, matrix and ownership. The no-argument ascii_dump() shall send the same record to the current std::cerr. Output failure shall follow the stream's selected state and exception behavior, retaining partial output without certifying successful delivery. The representation, numerical-runtime, lifetime and synchronization prerequisites of 🔗 1. Octagonal values, numerical profiles and valid use shall apply. The borrowed stream and its output callback environment shall remain live throughout the call. Recoverable resource exceptions may propagate; discarded owned temporaries shall be released. The internal status contract shall follow 🔗 4. Octagonal_Shape |
A reloadable record retains dimension, stored status and every bound value, including information that a readable constraint list may omit. |
|
|
|
|
|
Check independent header, status-spacing and matrix framing for empty, universal, constrained, cold and strongly closed values in zero and positive dimensions. Round-trip exact integer, rational and admitted native records, including signed zeros and positive infinities. Verify mathematical source preservation, unchanged raw records, following-token framing and the no-argument output destination. Exercise stream failure without assuming transactional delivery. |
src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_templates.hh; src/Og_Status_idefs.hh; src/Og_Status_inlines.hh; src/OR_Matrix_defs.hh; src/OR_Matrix_templates.hh; src/globals_defs.hh; tests/Octagonal_Shape/ascii_dump_load1.cc; tests/Octagonal_Shape/empty1.cc; tests/octagonalshapetextmemoryspec1.cc; tests/octagonalshapetextmemorypublic1.cc. |
|
|
Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library: void ascii_dump(std::ostream& stream) const; void ascii_dump() const; |
|
|
SW_SPEC
|
2 |
|
|
Parents:
|
|
For a complete valid record of 🔗 1. Reloadable octagonal record export under compatible representation, numeric formatting, profile, locale and resource conditions, ascii_load(stream) shall return true and replace any live valid receiver by the recorded ambient dimension and mathematical set. Previous receiver dimensions, emptiness and strong-closure status shall not affect successful restoration. The recorded status fields shall replace their previous conditions. One complete record shall be consumed while a following record or suffix remains available after permitted separating whitespace. The decoded ambient dimension shall not exceed max_space_dimension(), including for empty records. A greater value shall return false before the matrix payload is processed. A missing or incorrect space_dim keyword, rejected ambient dimension, missing or malformed required status word, or truncated or rejected matrix payload shall return false when the component extractions return normally. Each status word shall have its expected keyword and a + or - prefix. The loaded matrix space dimension shall equal the recorded ambient dimension; a mismatch shall return false even for empty or zero-dimensional records. Independently of the ambient dimension, an unsupported nested matrix dimension shall return false before matrix resizing or storage-size arithmetic, as specified by 🔗 2. Exact value-record loading and rejection states. Exact scalar acceptance and numerical-payload rejection shall retain that contract. Stream masks, numerical policies and recoverable resource failures shall retain their own exception channels. Successful restoration assumes a trusted, complete and dump-compatible record. After repair of any legacy rounded cache, the loaded representation shall satisfy the shape invariant. A detected inconsistency shall return false in every build. Semantic queries or further shape operations require a complete valid representation. For rounded or bounded coefficient profiles, a loaded nonempty status that certifies strong closure may have its feasibility rechecked against the stored bounds. An inconsistent bound system may then be classified empty; otherwise its closure certification may be restored. This compatibility repair shall preserve the stored matrix's exact represented set and ambient dimension; it shall not promise canonical or maximally precise rounded closure. A false return or exception may leave replaced dimension or status fields and a partially loaded matrix. It shall not promise rollback or a complete mathematical value. The receiver shall retain safely destructible ownership and may be replaced by a complete valid assignment before semantic queries or operations requiring a valid shape. Consumed input shall not be restored, and the library shall not take ownership of the stream. The representation, numerical-runtime, lifetime and synchronization prerequisites of 🔗 1. Octagonal values, numerical profiles and valid use shall apply. The borrowed stream and its callback environment shall remain live throughout the call. Discarded owned temporaries shall be released on reported failure. The internal status contract shall follow 🔗 5. Octagonal_Shape |
A compatible complete record determines the restored value independently of the receiver's former state. Local dimension agreement protects the matrix/ambient-space relationship without requiring a general semantic certification pass on every assertion-disabled load. Rejecting unsupported ambient dimensions before storage calculations prevents unsigned size wrap from being accepted as a small physical matrix. The independently encoded nested matrix extent also needs admission before its storage calculation. |
|
|
|
|
|
Load valid producer records into receivers of different dimensions, empty/nonempty and cache states; compare the restored set and dimension independently and check following-token framing. Exercise every missing or malformed header/status word, truncated matrix boundary, forbidden or inexact scalar value, and each matrix/ambient-dimension mismatch, including empty and zero-dimensional cases. Check rounded feasibility-cache repair, stream exceptions and allocation failures without imposing rollback. Reassign a complete valid value after rejected loads before ordinary value use. Distinguish local false-return checks from debug semantic invariant diagnostics on arbitrary complete text. Reject supported-profile records whose two dimension headers are replaced by 2w − 1 + k, for unsigned dimension width w and k ∈ {0, 1, 3}. Check maximum plus one and the reserved non-dimension, rational/integer/floating bound types, valid replacement after rejection and preserved following input. Keep the outer dimension valid while replacing only the nested matrix dimension by the reserved non-dimension; check empty and universe records at zero and small dimensions, all three bound categories and complete valid reloads. |
src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_templates.hh; src/Og_Status_idefs.hh; src/Og_Status_inlines.hh; src/OR_Matrix_defs.hh; src/OR_Matrix_templates.hh; tests/Octagonal_Shape/ascii_dump_load1.cc; tests/Octagonal_Shape/empty1.cc; tests/octagonalshapetextmemoryspec1.cc; tests/octagonalshapetextmemorypublic1.cc. |
|
|
Public header: <ppl.hh>; member of Octagonal_Shape<T> in Parma_Polyhedra_Library: bool ascii_load(std::istream& stream); |
|
|
SW_SPEC
|
3 |
|
|
Parents:
|
|
For a live, well-owned and safely indexable representation whose selected scalar operations are admitted, OK() shall check the pseudo-triangular matrix's storage and coefficient validity and the status-condition compatibility. The matrix space dimension shall equal the ambient dimension, including empty and zero-dimensional values. A violation of these checked conditions shall return false. Once those conditions hold, certified empty representations shall retain their inactive-geometric-data admission, and zero-dimensional representations shall require no coefficient-geometry checks. A positive-dimensional nonempty representation shall reject a stored negative-infinite bound or a diagonal entry other than positive infinity. For an unbounded coefficient base whose numeric traits declare exact arithmetic, certified strong closure shall be checked against matrix recomputation. For every exact coefficient base, including bounded integer storage, certified strong closure shall satisfy the native strong-coherence inequalities. The selected extended arithmetic, including its rounding and saturation, shall retain the prerequisites of 🔗 1. Octagonal values, numerical profiles and valid use. Bounded saturating closure shall not be required to pass an exact fixed-point test. Floating coefficient bases shall not be required to pass an exact fixed-point or exact strong-coherence test merely because their rounded closure is certified. Passing the applicable checks shall return true. The query shall preserve the receiver's represented set, ambient dimension, stored status, matrix and ownership. It may copy matrices and recompute derived data in temporary objects; resource and numerical exceptions may propagate through their selected channels. Debug builds may emit invariant-failure diagnostics to std::cerr without a fixed wording. Discarded owned temporaries shall be released. A true result shall not be an emptiness, semantic equality or minimal-storage answer. This query shall not be a corruption scanner for arbitrary pointers, broken object lifetimes or non-indexable fabricated storage. The numerical runtime, lifetime and synchronization prerequisites of 🔗 1. Octagonal values, numerical profiles and valid use shall apply. The internal status contract shall follow 🔗 3. Octagonal_Shape |
The matrix and ambient space must agree even when geometry is inactive. Native representation checks remain separate from mathematical property queries and from unsupported inspection of broken object ownership. Saturation can allow a further safe closure pass to tighten a stored bound; this does not make the preceding rounded representation invalid. Native strong coherence and exact unbounded fixed points therefore need separate checks. |
|
|
|
|
|
Check true on ordinary public histories across admitted profiles. Use safely owned fixture representations for dimension disagreement, incompatible status conditions, forbidden bounds, non-infinite diagonals, incorrect unbounded-exact closure certification and violated native strong coherence for exact bases. Check bounded saturating histories whose safe subsequent closure pass can tighten a bound without treating non-idempotence alone as an invariant failure. Verify both dimension mismatches for empty and zero-dimensional representations. Restore complete valid ownership before ordinary reuse. Observe receiver preservation, selected diagnostics and permitted temporary-allocation failures without requiring bounded saturating or floating-point closure idempotence. |
src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_templates.hh; src/Og_Status_idefs.hh; src/Og_Status_inlines.hh; src/OR_Matrix_defs.hh; src/OR_Matrix_templates.hh; src/DB_Row_templates.hh; tests/Octagonal_Shape/ascii_dump_load1.cc; tests/Octagonal_Shape/empty1.cc; tests/octagonalshapetextmemoryspec1.cc; tests/octagonalshapetextmemorypublic1.cc; tests/octagonalshapesaturationspec1.cc. |
|
|
Public header: <ppl.hh>; member of Octagonal_Shape<T> in Parma_Polyhedra_Library: bool OK() const; |