Parma Polyhedra Library requirements
C++ determinate values

C++ determinate values

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-001388
PPL-SPEC-001388
Determinate values and copy-on-write ownership

Construction from a pointset, constraint system or congruence system shall embed the corresponding base-domain value. Copying may share its representation, but subsequent mutation through either adapter shall preserve the other value. In a thread-safe build each copy shall own its own representation so that const queries on different threads can update the embedded values' caches independently. Assignment shall support self-assignment and return its receiver. Exchange shall swap the embedded values. pointset() const shall return a borrowed const view. Both pointset() overloads shall require an lvalue wrapper; mutable and const temporary wrappers shall be rejected. Mutable pointset() and mutate() shall first detach shared storage. A retained mutable reference shall not be used across subsequent copying or other operations that can share or replace its representation. Destruction shall release the representation when its last owner is destroyed.

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.

Copy-on-write is an ownership mechanism, so value independence must survive every exposed mutation path.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check pointset/system construction, const sharing, detach, self-assignment/exchange and lifetime after an owner is destroyed. Admit mutable and const lvalue pointset borrows with unchanged reference types; reject mutable and const temporary wrappers.

src/Determinate_defs.hh; src/Determinate_inlines.hh; src/Determinate_types.hh; tests/Powerset/powerset1.cc; tests/determinatehistories1.cc.

CPP
Public

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

explicit Determinate(const PSET&);
explicit Determinate(const Constraint_System&);
explicit Determinate(const Congruence_System&);
Determinate(const Determinate&); ~Determinate();
Determinate& operator=(const Determinate&);
const PSET& pointset() const &;
const PSET& pointset() const && = delete;
PSET& pointset() &;
PSET& pointset() && = delete;
void mutate(); void m_swap(Determinate&);
template <typename PSET> void swap(Determinate<PSET>&, Determinate<PSET>&);
SW_SPEC
2
PPL-SPEC-001389
PPL-SPEC-001389
Determinate order and distinguished values

Entailment shall mean that the receiver's embedded pointset is contained in y; definite equivalence and equality shall use base equality. Shared representations may short-circuit these tests. Top and bottom shall mean base universe and empty, respectively. Inequality shall negate equality.

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.

The adapter must preserve the ordering direction expected by the powerset construction.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check equal shared and unshared values, proper inclusion in both directions and empty/universe.

src/Determinate_defs.hh; src/Determinate_inlines.hh; src/Determinate_types.hh; tests/Powerset/entails1.cc; tests/Powerset/equals1.cc; tests/determinatehistories1.cc.

CPP
Public

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

bool definitely_entails(const Determinate&) const;
bool is_definitely_equivalent_to(const Determinate&) const;
bool is_top() const; bool is_bottom() const;
template <typename PSET> bool operator==(const Determinate<PSET>&, const Determinate<PSET>&);
template <typename PSET> bool operator!=(const Determinate<PSET>&, const Determinate<PSET>&);
SW_SPEC
3
PPL-SPEC-001390
PPL-SPEC-001390
Determinate operations and binary lifting

Upper bound, meet and concatenation shall detach as needed and delegate to base upper bound, intersection and concatenation, respectively. Their mathematical precision and argument admission shall follow the corresponding base member. lift_op_assign(f) shall return a function object which invokes f on a writable detached first pointset and a const second pointset. Self-aliasing shall follow the corresponding base operation. The function object shall retain a copy of f.

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.

Lifting must route every mutation through detachment so shared disjuncts retain value semantics.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Compare each lifted operation with independent base calculations, including shared receivers and function-object state.

src/Determinate_defs.hh; src/Determinate_inlines.hh; src/Determinate_types.hh; tests/Powerset/concatenate1.cc; tests/Powerset/meet1.cc; tests/determinatehistories1.cc.

CPP
Public

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

void upper_bound_assign(const Determinate&);
void meet_assign(const Determinate&);
void concatenate_assign(const Determinate&);
template <typename Binary_Operator_Assign>
class Binary_Operator_Assign_Lifter;
template <typename Binary_Operator_Assign>
static Binary_Operator_Assign_Lifter<Binary_Operator_Assign>
lift_op_assign(Binary_Operator_Assign);
SW_SPEC
4
PPL-SPEC-001391
PPL-SPEC-001391
Determinate display, invariants and memory

OK shall return the embedded pointset's invariant result. External memory shall include the representation object and its base external storage; total memory shall add sizeof(*this). Shared storage may be counted for each adapter. Stream insertion shall display the embedded pointset 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.

The reference-counted representation occupies storage beyond the adapter itself.

APPROVED
DOMAIN_COMBINATIONS
IF_CPP
Test, Analysis, Inspection

Check valid shared/unshared values, byte relationships and stream identity.

src/Determinate_defs.hh; src/Determinate_inlines.hh; src/Determinate_types.hh; tests/Powerset/membytes1.cc.

CPP
Public

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

bool OK() const;
memory_size_type external_memory_in_bytes() const;
memory_size_type total_memory_in_bytes() const;
template <typename PSET>
std::ostream& IO_Operators::operator<<(std::ostream&, const Determinate<PSET>&);