Parma Polyhedra Library requirements
C++ geometric relation assertion values

C++ geometric relation assertion values

1. Constraint-relation assertion values and named factories
UID: PPL-SPEC-000541
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Poly_Con_Relation shall represent a finite set A of named assertions. nothing() shall return the empty assertion set. The factories is_disjoint(), strictly_intersects(), is_included(), saturates() shall return the corresponding singleton sets. The four atoms shall assert, respectively, disjointness from the constraint satisfying set, intersection without inclusion in that set, inclusion in that set, and vanishing of the constraint's affine expression at every represented point. A domain query shall supply the interpretation applicable to its accepted descriptor and domain.

Every subset of the named atoms shall be a valid value, including combinations that cannot describe a particular nonempty geometric object. An empty assertion set shall state no fact; absence of an atom shall not assert its negation. Operations on these values shall require live initialized objects and synchronized access against mutation. They shall require no library or thread initialization owner, coefficient-constant stage or FPU setup. Numerical coefficient limits shall not restrict the assertion algebra.

RATIONALE:

Named assertions communicate facts without confusing an absent assertion with a negative answer or closing the stored facts under geometric reasoning.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Con_Relation. Stream insertion belongs to IO_Operators.

class Poly_Con_Relation;
static Poly_Con_Relation nothing();
static Poly_Con_Relation is_disjoint();
static Poly_Con_Relation strictly_intersects();
static Poly_Con_Relation is_included();
static Poly_Con_Relation saturates();
VERIFICATION_CRITERIA:

Construct every subset from named factories, compare singleton memberships and empty values, and exercise the complete algebra without initialization owners in every selected configuration.

SOURCE:

src/Poly_Con_Relation_defs.hh; src/Poly_Con_Relation_inlines.hh; src/Poly_Con_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000542
2. Constraint-relation value copying and lifetime
UID: PPL-SPEC-000542
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Copy construction and assignment of Poly_Con_Relation shall preserve exactly the source assertion set. Assignment shall return the destination reference and admit self-assignment. Later assignment of either object shall leave the other unchanged, and either object shall remain usable after destruction of its source or copy. Destruction shall require no external lifetime owner. An rvalue may be copied; it shall not require an empty moved-from source. The validity and initialization prerequisites in 🔗 1. Constraint-relation assertion values and named factories shall apply.

RATIONALE:

Relation results are independent small values that callers retain after queries and temporary operands disappear.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Con_Relation. Stream insertion belongs to IO_Operators.

Poly_Con_Relation(const Poly_Con_Relation& y);
Poly_Con_Relation& operator=(const Poly_Con_Relation& y);
~Poly_Con_Relation();
VERIFICATION_CRITERIA:

Check every representable assertion set through copy construction, assignment, self-assignment, rvalue copying, independent subsequent assignments and destruction of a temporary source.

SOURCE:

src/Poly_Con_Relation_defs.hh; src/Poly_Con_Relation_inlines.hh; src/Poly_Con_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000543
3. Constraint-relation conjunction, subtraction and implication
UID: PPL-SPEC-000543
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For assertion sets A and B represented by x and y, x && y shall represent A∪B, and x - y shall represent A⧵B. x.implies(y) shall return true exactly when B ⊆ A. Equality shall return true exactly when A = B; inequality shall be its logical negation. These operations shall preserve both operands and admit the same object in both positions.

Implication shall inspect asserted membership only: it shall neither infer additional geometric facts from an atom nor use inconsistent combinations to infer unstored atoms. Subtracting an absent assertion shall have no effect; subtracting a value from itself shall yield nothing(). The prerequisites in 🔗 1. Constraint-relation assertion values and named factories shall apply.

RATIONALE:

The algebra combines and selects known assertions; it does not solve a new geometric relation problem.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Con_Relation. Stream insertion belongs to IO_Operators.

Poly_Con_Relation operator&&(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
Poly_Con_Relation operator-(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
bool implies(const Poly_Con_Relation& y) const;
bool operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
bool operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
VERIFICATION_CRITERIA:

Compare every pair of assertion subsets with an independent finite-set union, difference, reverse-inclusion and equality model. Check aliases, unchanged operands, empty identities and self subtraction.

SOURCE:

src/Poly_Con_Relation_defs.hh; src/Poly_Con_Relation_inlines.hh; src/Poly_Con_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000544
4. Constraint-relation flag encoding and validity
UID: PPL-SPEC-000544
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

get_flags() shall return the unsigned bitwise union of the masks of exactly the stored atoms. nothing() shall have mask zero. is_disjoint(), strictly_intersects(), is_included() and saturates() shall have masks 1, 2, 4 and 8, respectively. OK() shall return true for every value obtained from named factories, copying, assignment and the assertion algebra. Both queries shall preserve the value. Their prerequisites shall follow 🔗 1. Constraint-relation assertion values and named factories.

RATIONALE:

Language bindings need a stable encoding of the named assertions. Geometric realizability is separate from the validity of a result value.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Con_Relation. Stream insertion belongs to IO_Operators.

unsigned int get_flags() const;
bool OK() const;
VERIFICATION_CRITERIA:

Check literal singleton masks, zero and every combined mask against independent membership, and check validity after all factory, ownership and algebra histories.

SOURCE:

src/Poly_Con_Relation_defs.hh; src/Poly_Con_Relation_inlines.hh; src/Poly_Con_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000545
5. Constraint-relation textual output and stream failures
UID: PPL-SPEC-000545
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Stream output and ascii_dump(s) shall emit exactly the stored assertion names in the order IS_DISJOINT, STRICTLY_INTERSECTS, IS_INCLUDED, SATURATES, separated by `` & `` when more than one is present. The empty set shall emit NOTHING. No trailing separator, newline or numeric flag mask shall be added. The insertion operator shall return the same stream reference. No-argument ascii_dump() and print() shall emit the same representation to std::cerr.

Output shall preserve the relation value and stream formatting flags and precision; any pending field width shall follow ordinary string-insertion semantics. Stream errors shall follow the stream's error-state and exception-mask rules; a reported stream failure need not roll back bytes already emitted. Calls shall require valid live streams and the prerequisites in 🔗 1. Constraint-relation assertion values and named factories, with caller synchronization for shared output streams. Text output shall not provide a corresponding relation-value input operation.

RATIONALE:

Stable names make compound answers readable while ordinary C++ stream failures remain visible to the caller.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Con_Relation. Stream insertion belongs to IO_Operators.

void ascii_dump(std::ostream& s) const;
void ascii_dump() const;
void print() const;
std::ostream& operator<<(std::ostream& s, const Poly_Con_Relation& r);
VERIFICATION_CRITERIA:

Check exact text for every assertion subset through stream insertion and ASCII output, capture both no-argument outputs, retain stream identity and formatting, and inject returning and throwing stream-buffer failures with unchanged source values.

SOURCE:

src/Poly_Con_Relation_defs.hh; src/Poly_Con_Relation_inlines.hh; src/Poly_Con_Relation.cc; tests/relationvaluesspec1.cc.

6. Generator-relation assertion values and named factories
UID: PPL-SPEC-000546
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Poly_Gen_Relation shall represent a finite set A of named assertions. nothing() shall return the empty assertion set. The factories subsumes() shall return the corresponding singleton sets. The atom shall assert that adding the generator would not change the represented set, under the applicable domain and generator-kind interpretation.

The empty assertion set and the singleton subsumption assertion shall both be valid values. The empty set shall state no fact; absence of the subsumption assertion shall not assert its negation. Operations on these values shall require live initialized objects and synchronized access against mutation. They shall require no library or thread initialization owner, coefficient-constant stage or FPU setup. Numerical coefficient limits shall not restrict the assertion algebra.

RATIONALE:

Named assertions communicate facts without confusing an absent assertion with a negative answer or closing the stored facts under geometric reasoning.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Gen_Relation. Stream insertion belongs to IO_Operators.

class Poly_Gen_Relation;
static Poly_Gen_Relation nothing();
static Poly_Gen_Relation subsumes();
VERIFICATION_CRITERIA:

Construct every subset from named factories, compare singleton memberships and empty values, and exercise the complete algebra without initialization owners in every selected configuration.

SOURCE:

src/Poly_Gen_Relation_defs.hh; src/Poly_Gen_Relation_inlines.hh; src/Poly_Gen_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000547
7. Generator-relation value copying and lifetime
UID: PPL-SPEC-000547
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Copy construction and assignment of Poly_Gen_Relation shall preserve exactly the source assertion set. Assignment shall return the destination reference and admit self-assignment. Later assignment of either object shall leave the other unchanged, and either object shall remain usable after destruction of its source or copy. Destruction shall require no external lifetime owner. An rvalue may be copied; it shall not require an empty moved-from source. The validity and initialization prerequisites in 🔗 6. Generator-relation assertion values and named factories shall apply.

RATIONALE:

Relation results are independent small values that callers retain after queries and temporary operands disappear.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Gen_Relation. Stream insertion belongs to IO_Operators.

Poly_Gen_Relation(const Poly_Gen_Relation& y);
Poly_Gen_Relation& operator=(const Poly_Gen_Relation& y);
~Poly_Gen_Relation();
VERIFICATION_CRITERIA:

Check every representable assertion set through copy construction, assignment, self-assignment, rvalue copying, independent subsequent assignments and destruction of a temporary source.

SOURCE:

src/Poly_Gen_Relation_defs.hh; src/Poly_Gen_Relation_inlines.hh; src/Poly_Gen_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000548
8. Generator-relation conjunction, subtraction and implication
UID: PPL-SPEC-000548
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

For assertion sets A and B represented by x and y, x && y shall represent A∪B, and x - y shall represent A⧵B. x.implies(y) shall return true exactly when B ⊆ A. Equality shall return true exactly when A = B; inequality shall be its logical negation. These operations shall preserve both operands and admit the same object in both positions.

Implication shall inspect asserted membership only: it shall neither infer additional geometric facts from an atom nor use inconsistent combinations to infer unstored atoms. Subtracting an absent assertion shall have no effect; subtracting a value from itself shall yield nothing(). The prerequisites in 🔗 6. Generator-relation assertion values and named factories shall apply.

RATIONALE:

The algebra combines and selects known assertions; it does not solve a new geometric relation problem.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Gen_Relation. Stream insertion belongs to IO_Operators.

Poly_Gen_Relation operator&&(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);
Poly_Gen_Relation operator-(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);
bool implies(const Poly_Gen_Relation& y) const;
bool operator==(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);
bool operator!=(const Poly_Gen_Relation& x, const Poly_Gen_Relation& y);
VERIFICATION_CRITERIA:

Compare every pair of assertion subsets with an independent finite-set union, difference, reverse-inclusion and equality model. Check aliases, unchanged operands, empty identities and self subtraction.

SOURCE:

src/Poly_Gen_Relation_defs.hh; src/Poly_Gen_Relation_inlines.hh; src/Poly_Gen_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000549
9. Generator-relation flag encoding and validity
UID: PPL-SPEC-000549
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

get_flags() shall return the unsigned bitwise union of the masks of exactly the stored atoms. nothing() shall have mask zero. subsumes() shall have mask 1. OK() shall return true for every value obtained from named factories, copying, assignment and the assertion algebra. Both queries shall preserve the value. Their prerequisites shall follow 🔗 6. Generator-relation assertion values and named factories.

RATIONALE:

Language bindings need a stable encoding of the named assertions. Geometric realizability is separate from the validity of a result value.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Gen_Relation. Stream insertion belongs to IO_Operators.

unsigned int get_flags() const;
bool OK() const;
VERIFICATION_CRITERIA:

Check literal singleton masks, zero and every combined mask against independent membership, and check validity after all factory, ownership and algebra histories.

SOURCE:

src/Poly_Gen_Relation_defs.hh; src/Poly_Gen_Relation_inlines.hh; src/Poly_Gen_Relation.cc; tests/relationvaluesspec1.cc.

PPL-SPEC-000550
10. Generator-relation textual output and stream failures
UID: PPL-SPEC-000550
STATUS: APPROVED
COMPONENT: LIBRARY_WIDE
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Stream output and ascii_dump(s) shall emit exactly the stored assertion as SUBSUMES for the singleton subsumption assertion. The empty set shall emit NOTHING. No trailing separator, newline or numeric flag mask shall be added. The insertion operator shall return the same stream reference. No-argument ascii_dump() and print() shall emit the same representation to std::cerr.

Output shall preserve the relation value and stream formatting flags and precision; any pending field width shall follow ordinary string-insertion semantics. Stream errors shall follow the stream's error-state and exception-mask rules; a reported stream failure need not roll back bytes already emitted. Calls shall require valid live streams and the prerequisites in 🔗 6. Generator-relation assertion values and named factories, with caller synchronization for shared output streams. Text output shall not provide a corresponding relation-value input operation.

RATIONALE:

Stable names make compound answers readable while ordinary C++ stream failures remain visible to the caller.

INTERFACE:

Public header: <ppl.hh>. Names belong to Parma_Polyhedra_Library; member signatures apply to Poly_Gen_Relation. Stream insertion belongs to IO_Operators.

void ascii_dump(std::ostream& s) const;
void ascii_dump() const;
void print() const;
std::ostream& operator<<(std::ostream& s, const Poly_Gen_Relation& r);
VERIFICATION_CRITERIA:

Check exact text for every assertion subset through stream insertion and ASCII output, capture both no-argument outputs, retain stream identity and formatting, and inject returning and throwing stream-buffer failures with unchanged source values.

SOURCE:

src/Poly_Gen_Relation_defs.hh; src/Poly_Gen_Relation_inlines.hh; src/Poly_Gen_Relation.cc; tests/relationvaluesspec1.cc.