Parma Polyhedra Library requirements
C++ compound persistence

C++ compound persistence

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-001431
PPL-SPEC-001431
Reloadable pointset-powerset representations

ascii_dump shall write the stored collection size, ambient dimension and each base representation, preserving enough information to reload the value with the matching coefficient/base configuration. ascii_load shall return true only for a complete admitted representation with matching disjunct dimensions and valid components; malformed, truncated or structurally invalid input shall return false. A successful round trip shall preserve union and dimension, without requiring canonical text or reduced decomposition. Stream and resource exceptions may propagate. A false return shall not promise rollback or further queries; surviving ownership shall remain destructible. Human-readable print shall remain distinct from the reloadable format.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

Persistence must reject incompatible structure rather than create an object whose dimension disagrees with its disjuncts.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check empty/universe and nonreduced round trips, every token truncation, bad labels/counts/dimensions and incompatible component encodings.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/contractvalues1.cc; tests/Powerset/powerset1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Pointset_Powerset unless qualified otherwise.

void ascii_dump(std::ostream&) const;
bool ascii_load(std::istream&);
void print() const;
SW_SPEC
2
PPL-SPEC-001432
PPL-SPEC-001432
Pointset-powerset diagnostics, display and hash

OK shall check disjunct dimensions and generic powerset invariants. Memory queries shall give lower bounds; total shall add sizeof(*this) to external bytes. Hash shall depend on ambient dimension, so equal values shall have equal hashes without promising collision resistance. Stream insertion shall use the inherited powerset display and return the supplied stream; printing may normalize redundant storage without changing the value.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

A cheap dimension hash is compatible with equality while allowing many collisions.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check dimensioned values, generic display, memory relationships and hash agreement after copy, reordering and reduction.

src/Pointset_Powerset.cc; src/Pointset_Powerset_defs.hh; src/Pointset_Powerset_inlines.hh; src/Pointset_Powerset_templates.hh; src/Pointset_Powerset_types.hh; tests/Powerset/contractvalues1.cc; tests/Powerset/membytes1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Pointset_Powerset unless qualified otherwise.

bool OK() const;
memory_size_type external_memory_in_bytes() const;
memory_size_type total_memory_in_bytes() const;
int32_t hash_code() const;
SW_SPEC
3
PPL-SPEC-001464
PPL-SPEC-001464
Reloadable product representations

Dumping shall write the product label, reduction marker and both base representations. Loading shall accept a complete representation only when both base loads succeed, component dimensions agree and component invariants hold. Malformed, truncated or structurally inconsistent input shall return false. A successful round trip shall preserve the component pair's intersection and common dimension. A loaded reduction marker shall not bypass the requirement that a pair be admitted by its selected policy. False shall not promise rollback or further queries; surviving owned storage shall remain destructible. Stream and resource exceptions may propagate. Human display shall be distinct from the reloadable format.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

Two individually valid component encodings do not form a valid product when their dimensions differ.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check every policy round trip, unlike component dimensions, marker/label errors, all token truncations and valid-prefix trailing content.

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/asciidumpload1.cc; tests/Partially_Reduced_Product/contractvalues1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

void ascii_dump(std::ostream&) const;
bool ascii_load(std::istream&);
void print() const;
SW_SPEC
4
PPL-SPEC-001465
PPL-SPEC-001465
Product diagnostics, display, memory and hash

OK shall require matching component dimensions and both component invariants, without certifying policy application or a reduction fixed point. External memory shall sum component external estimates; total shall add sizeof(*this). Hash shall depend on ambient dimension and agree for equal products without promising collision resistance. Stream insertion shall label and display both components and return the supplied stream.

The valid-use conditions in 🔗 1. Compound-domain values and valid use shall apply. Unless dimension-changing behavior is specified, ambient dimension shall be preserved. Deferred reduction and representation changes shall preserve the stated mathematical result. Borrowed views shall not be retained across an operation that can invalidate their underlying representation.

An invariant check is structural and must not silently strengthen a lazy reduction flag into a fixed-point claim.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check byte relationships, stream identity/labels, hash equality and diagnostics before/after policy application.

src/Partially_Reduced_Product_defs.hh; src/Partially_Reduced_Product_inlines.hh; src/Partially_Reduced_Product_templates.hh; src/Partially_Reduced_Product_types.hh; tests/Partially_Reduced_Product/directproduct1.cc.

CPP
Public

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of Partially_Reduced_Product unless qualified otherwise.

bool OK() const;
memory_size_type external_memory_in_bytes() const;
memory_size_type total_memory_in_bytes() const;
int32_t hash_code() const;
template <typename D1, typename D2, typename R>
std::ostream& IO_Operators::operator<<(std::ostream&,
                                     const Partially_Reduced_Product<D1,D2,R>&);