C++ bounded-difference text, memory and invariant queries
- PPL-LLR-000051 Bounded-difference expressiveness (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
Stream insertion shall write true for a universe shape and false for an empty shape, including their zero-dimensional forms. Otherwise it shall list unary and coordinate-difference constraints in the upper triangular pair order of coordinates 0, …, n, with index 0 denoting the constant origin. Two opposite finite bounds that are additive inverses shall be displayed as one equality; other finite sides shall be displayed as non-strict inequalities. Positive-infinite sides shall not be displayed. Consecutive constraints shall be separated by ", " and no ambient-dimension header shall be inserted.
A unary equality shall use variable = value; an upper unary bound shall use variable <= value. A lower unary bound shall use variable >= value for signed or unbounded coefficients. For unsigned integer coefficients it shall use -variable <= value, retaining the stored nonnegative constant without numerical negation. Difference constraints shall use the orientation giving the selected nonnegative constant where available, retaining the corresponding relation and value. Variable names shall follow the active formatter and its live-callback prerequisites in 🔗 7. Active Variable formatter and initialized thread state and 🔗 8. Variable names, formatter dispatch and output failures. Bound values shall follow the admitted mathematical numeric stream output of 🔗 5. Mathematical numeric output and stream delivery status and 🔗 6. Checked numeric stream policy integration.
Insertion shall return the supplied stream reference without adding a newline or explicitly flushing it. print() shall deliver the same presentation to the current std::cerr. Display shall preserve the represented set and dimension; its const classification may refresh representation caches. Stream and formatter failures shall retain their applicable state, exception-mask and partial-output behavior. Rendering callbacks shall not mutate or invalidate traversed source objects.
The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. The borrowed stream and any output callback environment shall remain live throughout the call. Recoverable resource exceptions may propagate; discarded owned temporaries shall be released.
A readable constraint list must retain relation directions, variable identities and mathematical values while remaining distinct from a reloadable record.
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.
namespace IO_Operators { template <typename T> std::ostream& operator<<(std::ostream& stream, const BD_Shape<T>& value); } // Member of BD_Shape<T>: void print() const;
Check literal ordered strings for universe/empty, unary and difference equalities, both inequality orientations/signs, unsigned lower bounds including zero, infinite sides, zero constants, custom formatters and source/cache histories. Independently check that displayed unsigned inequalities denote the source set. Verify stream identity, no newline, stderr forwarding, locale/formatting, failed output buffers and throwing formatters.
src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; src/BDS_Status_idefs.hh; src/BDS_Status_inlines.hh; src/DB_Matrix_defs.hh; src/DB_Matrix_templates.hh; src/Bit_Matrix_defs.hh; src/Bit_Matrix.cc; src/globals_defs.hh; tests/bdshapetextspec1.cc; tests/bdshapefiltersoracle.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/BD_Shape/ascii_dump_load1.cc; tests/BD_Shape/writebdshape1.cc;
- PPL-LLR-000051 Bounded-difference expressiveness (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000446 Reloadable textual representations (Specifies)
For a valid admitted source, ascii_dump(stream) shall write its status fields, a newline, its square difference-bound matrix record, a newline, and its redundancy-bit matrix record of 🔗 12. ASCII representation and loading. Status fields shall identify the stored ZE, EM, SPC and SPR conditions in that order, using + or - prefixes. The bound-matrix dimension shall be one greater than the ambient dimension, including zero-dimensional shapes. The export shall write the stored redundancy matrix when reduction is certified, and a zero-row, zero-column redundancy matrix otherwise.
The matrix payload and mathematical numeric formatting shall follow 🔗 11. Reloadable ASCII records for admitted bound values, including exact finite native decimal values and admitted positive infinities. Compatible status, matrix, numeric policy, locale and version conventions shall retain enough information for 🔗 3. Compatible bounded-difference record loading and failure state to restore the same mathematical set and ambient dimension. Neither native object bytes nor a floating zero sign is part of this mathematical round-trip guarantee.
Export shall preserve the source value and ownership without requiring an initial emptiness, closure or reduction query. 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 and without certifying successful delivery.
The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. The borrowed stream and any 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. BD_Shape
A complete stored record includes dimension, numerical constraints and the status needed for continued use, not only a human-readable constraint list.
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.
void ascii_dump(std::ostream& stream) const; void ascii_dump() const;
Inspect independent status/size/row framing for empty, universe and correlated shapes in unclosed, closed and reduced states. Round-trip exact rational/integer/native records, signed zeros and infinities, verify source preservation, concatenation/suffixes and stderr forwarding, and test output failures without assuming transactional delivery.
src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; src/BDS_Status_idefs.hh; src/BDS_Status_inlines.hh; src/DB_Matrix_defs.hh; src/DB_Matrix_templates.hh; src/Bit_Matrix_defs.hh; src/Bit_Matrix.cc; src/globals_defs.hh; tests/bdshapetextspec1.cc; tests/bdshapefiltersoracle.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/BD_Shape/ascii_dump_load1.cc; tests/BD_Shape/writebdshape1.cc;
- PPL-LLR-000051 Bounded-difference expressiveness (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
- PPL-LLR-000446 Reloadable textual representations (Specifies)
For a complete valid record of 🔗 2. Reloadable bounded-difference record export under compatible representation, numeric formatting, profile, locale and resource conditions, ascii_load(stream) shall return true and replace any valid receiver by the recorded ambient dimension and mathematical set. The previous receiver's dimension, emptiness and cache flags shall not affect the result. All serialized status conditions shall replace their previous conditions. One complete record shall be consumed while a following record or suffix remains available after permitted separating whitespace.
Status-word rejection, a truncated or rejected bound matrix, or a truncated or rejected redundancy matrix shall return false when the component extractions return normally. An unsupported decoded bound-matrix row count shall return false before resizing or requesting storage for that extent, as specified by 🔗 12. Exact ASCII input, forbidden payloads and failure state. A zero-row bound matrix shall be rejected. When reduction certification is present, its matrix shall have the same row and column counts as the bound matrix. When reduction is uncertified, the loader shall consume the redundancy matrix without retaining its storage. That includes inactive matrices written by earlier compatible PPL versions. Inconsistent serialized status conditions shall be rejected. Numerical payload rejection shall retain 🔗 12. Exact ASCII input, forbidden payloads and failure state. Stream masks, numerical policy and recoverable resource exceptions shall retain their own propagation channels.
The successful restoration guarantee assumes a trusted, complete and dump-compatible record. The loaded matrix, status, and retained closure and reduction information shall satisfy 🔗 5. Bounded-difference representation invariant query. If these checks detect an inconsistency, the loader shall return false in every build. Semantic queries or further shape operations require a complete valid representation.
Rounded or bounded coefficient profiles may discard serialized reduction certification and recheck a serialized closed feasibility cache, preserving the stored matrix's exact represented set. This cache repair shall not alter the semantic meaning or ambient dimension of a compatible record.
A false return or exception may leave replaced status or partially loaded matrices. 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 selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. The borrowed stream and any 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 🔗 5. BD_Shape
A compatible valid dump establishes the recorded value independently of prior receiver state. Local rejection checks protect basic representation structure without requiring general cache recomputation on every assertion-disabled load. Debug invariant diagnostics and partial input failure retain their separate failure channels. Admission of the decoded square extent requires both supported row and column counts before resizing.
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.
bool ascii_load(std::istream& stream);
Load valid producer records into receivers of different dimensions, empty/nonempty and cache states; check exact independent set/dimension equality and suffix framing. Exercise each truncated/malformed status and component boundary, zero-row bound matrices, mismatched certified reduction dimensions, forbidden/inexact numeric values, configured stream exceptions and allocation frontiers. Check arbitrary semantic cache inconsistencies separately as debug invariant diagnostics, without requiring their rejection as a release parse guarantee. Reassign after failed loads before semantic queries; verify destruction and reuse. Replace only the nested bound-matrix row count by the reserved non-dimension in otherwise valid empty and universe records at zero and small dimensions. Check rational, integer and floating bound types, rejection without a size-allocation exception and complete reload with preserved following input.
src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; src/BDS_Status_idefs.hh; src/BDS_Status_inlines.hh; src/DB_Matrix_defs.hh; src/DB_Matrix_templates.hh; src/Bit_Matrix_defs.hh; src/Bit_Matrix.cc; src/globals_defs.hh; tests/bdshapetextspec1.cc; tests/bdshapefiltersoracle.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/BD_Shape/ascii_dump_load1.cc; tests/BD_Shape/writebdshape1.cc;
- PPL-LLR-000051 Bounded-difference expressiveness (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
external_memory_in_bytes() shall report the owned external storage of the difference-bound matrix plus that of the redundancy-bit matrix, counting live selected coefficient payloads and retained capacities according to 🔗 14. Matrix container and coefficient memory accounting and 🔗 13. Invariant, ordering and allocated-memory queries. Logically empty or currently inactive cache content shall not make owned allocated storage disappear from the count. Independently owned runtime temporaries, other objects and allocator bookkeeping shall be excluded.
total_memory_in_bytes() shall equal sizeof(BD_Shape<T>) plus the external count. Sizes shall be those of the selected build/profile and the sum shall fit memory_size_type. The selected live coefficient and bit-row memory hooks shall be well-formed. Both queries shall preserve the source set, dimension, caches, ownership and lifetimes.
The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. Live owned storage shall remain unchanged during either query.
Storage retained by matrices and caches can exceed that suggested by the mathematical dimension or emptiness of the current value.
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.
memory_size_type external_memory_in_bytes() const; memory_size_type total_memory_in_bytes() const;
Compare total/external identity and independent owned-allocation observations for native matrices without a reduction cache; separately account for live rational coefficient and bit-row payloads. Cover copies, assignment, exchange, growth/removal, empty values and retained cache capacities without counting allocator metadata or shared scratch.
src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; src/BDS_Status_idefs.hh; src/BDS_Status_inlines.hh; src/DB_Matrix_defs.hh; src/DB_Matrix_templates.hh; src/Bit_Matrix_defs.hh; src/Bit_Matrix.cc; src/globals_defs.hh; tests/bdshapetextspec1.cc; tests/bdshapefiltersoracle.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/BD_Shape/ascii_dump_load1.cc; tests/BD_Shape/writebdshape1.cc;
- PPL-LLR-000051 Bounded-difference expressiveness (Specifies)
- PPL-LLR-000052 Conservative bounded-difference constants (Specifies)
- PPL-LLR-000133 Failure and resource safety (Specifies)
- PPL-LLR-000301 Meaning of successful exact and approximate results (Specifies)
- PPL-LLR-000303 Preservation by representation-only changes (Specifies)
- PPL-LLR-000311 Public C++ access to supported facilities (Specifies)
- PPL-LLR-000442 Explicit numerical operation contracts (Specifies)
For a live, well-owned and safely indexable representation whose selected scalar operations are admitted, OK() shall check the matrix's storage and coefficient validity and the status-condition compatibility. Certified empty representations shall retain their inactive-geometric-data admission. A nonempty representation shall reject a stored negative-infinite bound or a diagonal entry other than positive infinity.
For exact unbounded coefficient profiles, certified closure shall be checked against recomputation and certified reduction against the corresponding canonical reduction mask, including rejection of an essential positive- infinite edge. Rounded or bounded profiles shall use the selected exact graph semantic invariant for a certified reduction, without requiring floating closure to be idempotent. A violation of a checked invariant shall return false; passing those checks shall return true. The query shall preserve the receiver's represented set, dimension and ownership.
The query may copy matrices, recompute derived data in temporary objects, and report resource or numerical exceptions through their selected channels. Debug builds may emit invariant-failure diagnostics to std::cerr; no fixed diagnostic wording is part of the result. A true result is not an emptiness, semantic equality or minimal-storage answer. The query shall not be a corruption scanner for arbitrary pointers, broken object lifetimes or non-indexable fabricated storage.
The selected representation, numerical runtime and synchronization prerequisites of 🔗 1. Bounded-difference values, numerical profiles and valid use shall hold. Discarded owned query temporaries shall be released on reported failure.
The internal status contract shall follow 🔗 3. BD_Shape
Representation checks need to distinguish valid rounded caches from exact canonical forms and remain separate from mathematical property queries.
Public header: <ppl.hh>; names belong to Parma_Polyhedra_Library. Member signatures apply to BD_Shape<T> except the indicated free operator and destination capabilities.
bool OK() const;
Check true on ordinary public histories across supported profiles. Using the existing friend fixture, create safe owned invariant negatives for selected status conditions, non-infinite diagonals, forbidden bounds and incoherent closure/reduction caches, then restore valid ownership before reuse. Observe source preservation and allowed diagnostics/exceptions; do not fabricate unsafe pointers or out-of-range storage.
src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; doc/definitions.dox; tests/bdshapefiltertextpublic1.cc; src/BDS_Status_idefs.hh; src/BDS_Status_inlines.hh; src/DB_Matrix_defs.hh; src/DB_Matrix_templates.hh; src/Bit_Matrix_defs.hh; src/Bit_Matrix.cc; src/globals_defs.hh; tests/bdshapetextspec1.cc; tests/bdshapefiltersoracle.hh; tests/bdshapeaffineoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/boxallocationfixture.hh; tests/BD_Shape/ascii_dump_load1.cc; tests/BD_Shape/writebdshape1.cc;