Parma Polyhedra Library requirements
C++ octagonal set operations

C++ octagonal set operations

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-001171
PPL-SPEC-001171
Exact intersection of compatible octagonal values

For entry receiver X and source Y, intersection_assign(y) shall replace the receiver by the exact real set XโˆฉY. This equality shall hold for every admitted numeric profile under its numerical prerequisites, including integral bound storage with half-integral real points.

The operands shall have equal ambient dimensions; a mismatch shall throw std::invalid_argument before changing either represented set. Empty, universe, lower-dimensional and zero-dimensional values shall be admitted. Self-aliasing shall use the entry value for both operands. A distinct y shall preserve its entry represented set on normal return. Logically const normalization may change caches without changing the source set. The receiver shall own its result independently of a distinct source's later mutation or destruction.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use shall apply. All operands shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

The conjunction of two finite octagonal systems is itself octagonal. Intersection therefore has an exact set meaning even when ordinary rounded upper bounds have weaker precision guarantees.

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

Independently conjoin raw signed halfspaces and use exact rational elimination to compare represented sets. Include correlated equalities, contradictory signed cycles, half-integral points under integer storage, unbounded/empty/universe/zero-dimensional values, aliases, independent source lifetime, dimension errors and late representation normalization.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/intersection1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

CPP
Public

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

void intersection_assign(const Octagonal_Shape& y);
SW_SPEC
2
PPL-SPEC-001172
PPL-SPEC-001172
Conservative and exact-arithmetic octagonal upper bounds

For entry receiver X and source Y, upper_bound_assign(y) shall produce an octagonal value R satisfying XโˆชYโ€‰โІโ€‰R.

When the arithmetic used for normalization and rational strong closure is exact, including unbounded rational-bound profiles, R shall be the least octagonal enclosure of XโˆชY. For each admitted octagonal normal a, its finite support shall then be max(supxโ€‰โˆˆโ€‰Xaโ‹…x,โ€‰supyโ€‰โˆˆโ€‰Yaโ‹…y), with the doubled unary encoding and unbounded supports interpreted as in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use. When arithmetic rounds, a less precise containing octagon shall be permitted. An integer boundary type alone shall not imply exact rational strong closure, because half-sums can be inexact.

Self-union and union with an empty operand shall retain their mathematical identity meanings; union with universe shall give universe. These cases shall preserve the real carrier even for integral bound storage.

The operands shall have equal ambient dimensions; a mismatch shall throw std::invalid_argument before changing either represented set. Empty, universe, lower-dimensional and zero-dimensional values shall be admitted. Self-aliasing shall use the entry value for both operands. A distinct y shall preserve its entry represented set on normal return. Logically const normalization may change caches without changing the source set. The receiver shall own its result independently of a distinct source's later mutation or destruction.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use shall apply. All operands shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

The signed-normal hull is obtained from supports of the whole input sets. Rounded graph normalization can lose precision, so conservative containment and the exact-arithmetic least enclosure are separate promises.

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

Compute supports with exact rational elimination over each entry set, then take maxima for all signed primitive normals. Require the least enclosure for exact arithmetic and containment for rounded profiles. Include opposite-sign relations, disjoint/lower-dimensional inputs, rays, half-integral points, closure histories, all identity cases, aliases and dimension rejection.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/upperbound1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

CPP
Public

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

void upper_bound_assign(const Octagonal_Shape& y);
SW_SPEC
3
PPL-SPEC-001173
PPL-SPEC-001173
Certified real set-theoretic union of octagonal values

upper_bound_assign_if_exact(y) shall return true only when it replaces the receiver by the exact real union XโˆชY of the entry sets. On false, the receiver's represented set shall remain X; internal normalization of either argument may still occur.

With mpq_class boundaries, the decision shall be complete: it shall return true if and only if XโˆชY is an octagonal set. Other supported profiles may return false when rounded computation cannot certify exactness, even when the union is octagonal. This includes rational half-sum rounding with mpz_class boundaries. Such an inconclusive false shall not assert that a non-octagonal union has been found.

Successful union shall retain every real point of either input, rather than only its integer points. No success result may fill a missing real point.

The operands shall have equal ambient dimensions; a mismatch shall throw std::invalid_argument before changing either represented set. Empty, universe, lower-dimensional and zero-dimensional values shall be admitted. Self-aliasing shall use the entry value for both operands. A distinct y shall preserve its entry represented set on normal return, including a Boolean false return. Logically const normalization may change caches without changing the source set. The receiver shall own its result independently of a distinct source's later mutation or destruction.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use shall apply. All operands shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

A least octagonal upper bound can fill a genuine gap. A successful exact-join certificate must exclude that possibility, while incomplete arithmetic may legitimately fail to produce a certificate.

BagnaraHZ10CGTA | Section 6.2, Theorem 6.3, exact join detection for rational octagonal shapes.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

Derive exact signed-support hulls and decide whether each point of the hull belongs to at least one entry set by independent strict-complement feasibility. Require complete decisions for unbounded rational profiles, exact real-union equality on every success and entry-set preservation on false. Include touching and separated intervals, signed relational slices, rays, half-integral integer-bound inputs, aliases, empty/zero dimensions and range-sensitive rounded certificates. Keep overflow and adjacent-floating-bound witnesses in arbitrary-precision test models, independently of the configured Coefficient range. Check exact representability of the typed inputs, midpoint gaps or literal cover proofs, source preservation and resulting sets.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/upperboundifexact1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

CPP
Public

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

bool upper_bound_assign_if_exact(const Octagonal_Shape& y);
SW_SPEC
4
PPL-SPEC-001174
PPL-SPEC-001174
Exact integer-point unions of octagonal values

integer_upper_bound_assign_if_exact(y) shall be available when T is a supported integral boundary type. Let Iโ€‰=โ€‰(XโˆชY)โˆฉZn for the entry real sets X,โ€‰Y, and let H(I) be their integer upper bound: the smallest rational octagonal set containing I. The call shall return true if and only if H(I)โˆฉZnโ€‰=โ€‰I; on true it shall replace the receiver by that integer upper bound. On false it shall preserve the receiver's entry represented set. Cache normalization shall not count as a set change.

Exactness shall concern integer valuations. The result may include nonintegral points absent from both operands and may remove fractional portions of the entry real sets. For example, the integer union of real singletons at zero and one shall have integer upper bound [0,โ€‰1]. A nonempty half-integral real input may contain no integer point; if neither operand has an integer point, the integer upper bound shall be empty and the decision shall be true. Integer storage shall continue to have the real carrier in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use.

The operands shall have equal ambient dimensions; a mismatch shall throw std::invalid_argument before changing either represented set. Empty, universe, lower-dimensional and zero-dimensional values shall be admitted. Self-aliasing shall use the entry value for both operands. A distinct y shall preserve its entry represented set on normal return, including a Boolean false return. Logically const normalization may change caches without changing the source set. The receiver shall own its result independently of a distinct source's later mutation or destruction.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use shall apply. All operands shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

Integer octagonal exactness differs from exact real union. Tightening unary parity removes fractional-only states without discarding any input integer point, and permits integer-exact unions that are not convex real unions.

BagnaraHZ10CGTA | Section 6.3, Definition 6.6 and Theorem 6.8, tight closure and exact integer-octagonal joins.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

For independently bounded examples enumerate every integer valuation in proved finite boxes, build the rational signed-support hull of the two integer sets, and enumerate every integer point of that candidate hull. Compare the exactness Boolean, required success hull and false preservation. Use analytic integer lattice models for selected unbounded cases. Include half-integral real singletons, odd and already-even unary bounds, empty integer hulls, cold and cached closure, idempotence, real-inexact/integer-exact joins, aliases and all supported integral profiles. Reject nonintegral template instantiations through a meaningful capability check.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/integerupperboundifexact1.cc; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

CPP
Public

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

bool integer_upper_bound_assign_if_exact(const Octagonal_Shape& y);
SW_SPEC
5
PPL-SPEC-001175
PPL-SPEC-001175
Least closed octagonal abstraction of subtraction

difference_assign(y) shall replace the receiver by the least closed target-profile octagonal enclosure of the concrete real difference XโงตY of the entry sets. It shall retain every point of X absent from Y. Its precision shall concern the whole relational sets.

For each encoded octagonal normal, the result shall impose the strongest bound expressible in the target profile that is valid on the concrete difference. Finite support suprema shall be computed with their exact boundary meaning before outward target rounding, including doubled unary bounds. Closing a strict complement may retain boundary points removed by subtraction, and a convex enclosure may fill a gap between surviving pieces. For example, removing x0โ€‰+โ€‰x1โ€‰=โ€‰0 from 0โ€‰โ‰คโ€‰x0โ€‰+โ€‰x1โ€‰โ‰คโ€‰2 shall leave the same closed octagonal enclosure. The result shall not be required to be disjoint from Y.

Self-subtraction and subtraction of universe shall give empty. Subtraction of empty shall preserve the entry set. An empty receiver shall remain empty.

The operands shall have equal ambient dimensions; a mismatch shall throw std::invalid_argument before changing either represented set. Empty, universe, lower-dimensional and zero-dimensional values shall be admitted. Self-aliasing shall use the entry value for both operands. A distinct y shall preserve its entry represented set on normal return. Logically const normalization may change caches without changing the source set. The receiver shall own its result independently of a distinct source's later mutation or destruction.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use shall apply. All operands shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

Strict complements and disjunctions generally leave the closed convex octagonal domain. Least closed abstraction retains precise supports while allowing removed boundary points and gaps to be filled.

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

Represent the concrete difference as strict-complement branches of the second operand. Use independent rational elimination for branch feasibility and all signed support suprema, then outward-round the resulting primitive bounds. Verify the least target-profile hull, not just containment. Include interior removals, an equality, a boundary face, signed lower-dimensional sets, fractional witnesses, unbounded/empty/universe/zero-dimensional cases, self subtraction, source preservation and dimension errors. Compare dense and irredundant defining bases, cold and cached histories, and removal that leaves the original closed hull. Include disjointness, interior holes, boundary faces and complementary equality branches, with proper facet cuts as controls; preserve distinct-source geometry and ownership.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/difference1.cc; doc/definitions.dox; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

CPP
Public

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

void difference_assign(const Octagonal_Shape& y);
SW_SPEC
6
PPL-SPEC-001176
PPL-SPEC-001176
Meet-preserving octagonal simplification in a context

simplify_using_context_assign(y) shall replace entry receiver X by an octagonal simplification R using entry context Y, satisfying

RโˆฉYโ€‰=โ€‰XโˆฉY.

The cardinality of a minimized constraint representation of R shall not exceed that of X. An unchanged receiver shall be an admitted result; strict progress shall not be required on every call. The Boolean result shall satisfy: false implies the entry intersection is empty. A true return need not certify nonemptiness.

For self-aliasing, the context shall mean the entry receiver, so the meet-preservation equation shall be RโˆฉXโ€‰=โ€‰X. A distinct context shall preserve its entry denotation. Empty/disjoint contexts, empty receivers and zero-dimensional values shall be admitted.

The operands shall have equal ambient dimensions; a mismatch shall throw std::invalid_argument before changing either represented set. Empty, universe, lower-dimensional and zero-dimensional values shall be admitted. Self-aliasing shall use the entry value for both operands. A distinct y shall preserve its entry represented set on normal return, including a Boolean false return. Logically const normalization may change caches without changing the source set. The receiver shall own its result independently of a distinct source's later mutation or destruction.

The valid-use, numerical-profile, initialization, supported native floating runtime and synchronization prerequisites in ๐Ÿ”— 1. Octagonal values, numerical profiles and valid use shall apply. All operands shall remain live and valid during the call. The implementation shall respect the preconditions of its selected numerical policies in intermediate operations on admitted inputs. The ambient dimension and coordinate identities shall be preserved.

Declared numerical, allocation and cooperative-abandonment exceptions may propagate. Temporary resources acquired by the operation shall be released on exceptional return. After these exceptions the receiver shall remain safely destructible; its entry represented set need not be preserved.

The caller needs exactly the behavior observable in the supplied context. A reduction in the minimum representation size is a simplification measure; intersection preservation alone does not specify the receiver's outside context points.

BagnaraHZ09FMSD | Section 4, Definition 4 and Definition 5, coherent signed-normal encoding and rational strong closure.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

Independently conjoin entry and result halfspaces with the unchanged context and compare their real denotations using rational elimination. For compact cases derive minimum octagonal representation counts from affine rank and independent signed supporting faces. Check cardinality nonincrease and false-result implication without requiring progress or equating true with nonempty. Include disjoint/empty/universe contexts, self alias, relational equalities, rounded half-sum cases, unchanged sources and dimension errors.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; src/Octagonal_Shape.cc; tests/octagonalshapeoperationsspec1.cc; tests/octagonalshapeoperationoracle.hh; tests/octagonalshapevalueoracle.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/boxrefinementoracle.hh; tests/boxsetoracle.hh; tests/octagonalshapeoperationspublic1.cc; tests/Octagonal_Shape/simplifyusingcontext1.cc; doc/definitions.dox; tests/octagonalshapeoperationsfailure1.cc; tests/boxallocationfixture.hh.

CPP
Public

Public header: <ppl.hh>; members of Octagonal_Shape<T> in Parma_Polyhedra_Library:

bool simplify_using_context_assign(const Octagonal_Shape& y);
SW_SPEC
7
PPL-SPEC-001181
PPL-SPEC-001181
Ordered Cartesian concatenation of octagonal values

concatenate_assign(other) shall replace an entry value Xโ€‰โІโ€‰โ„n with exactly Xร—Yโ€‰โІโ€‰โ„nโ€‰+โ€‰m, where Yโ€‰โІโ€‰โ„m is other's entry value. The first n coordinates shall belong to X, followed by Y's coordinates in their original order. Cross-block consequences shall follow from Cartesian independence, rather than identifying coordinates with equal indices in the two operands.

An empty operand shall give empty in dimension nโ€‰+โ€‰m. Zero-dimensional universe shall be an identity on either side; zero-dimensional empty shall be an annihilator while retaining the sum dimension. Self concatenation shall use two independent copies of the entry value. A requested sum dimension above max_space_dimension() shall throw std::length_error.

The supported profiles, real carrier, runtime initialization, numerical range and rounding, FPU, resource and synchronization prerequisites of [LINK: PPL-SPEC-001146] shall apply. A distinct other shall retain its represented entry value; logically const cache normalization may change its storage. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

Concatenation composes independently chosen valuations in a fixed coordinate order, including when the two source references coincide.

APPROVED
OCTAGONS
IF_CPP
Test, Analysis, Inspection

Compare disjointly lifted operand halfspaces, mixed dimensions, both zero-dimensional values, all empty positions, coupled operands, cross-block supports, repeated composition and self concatenation. Check a distinct right operand remains equivalent to its entry value and verify the dimension limit.

src/Octagonal_Shape_defs.hh; src/Octagonal_Shape_inlines.hh; src/Octagonal_Shape_templates.hh; tests/Octagonal_Shape/concatenate1.cc; tests/Octagonal_Shape/dimensionlimits1.cc.

CPP
Public

Public header: <ppl.hh>; members of Parma_Polyhedra_Library::Octagonal_Shape<T>:

void concatenate_assign(const Octagonal_Shape& other);