Parma Polyhedra Library requirements
C++ bounded-difference coordinate transformations

C++ bounded-difference coordinate transformations

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-001102
PPL-SPEC-001102
Unrestricted bounded-difference coordinate extension

add_space_dimensions_and_embed(m) shall change an entry value X ⊆ ℝn into exactly X×ℝm in dimension n + m. Original coordinates shall keep their indices and relationships. The fresh coordinates shall have indices n, …, n + m − 1 and be unrestricted; no fresh-to-original or fresh-to-fresh equality shall be imposed. Empty input shall remain empty in the new ambient dimension. Zero-dimensional universe shall extend to universe. Adding zero coordinates shall preserve the value.

A requested final dimension above max_space_dimension() shall throw std::length_error before allocating the corresponding matrix. The rejection shall include counts whose mathematical sum with the current dimension exceeds the range of dimension_type; arithmetic wraparound shall not turn an excessive extension into a successful smaller one.

The supported coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

A rejected dimension request shall preserve the represented entry set and ambient dimension.

Unrestricted extension is an ordered Cartesian product with free axes, distinct from adjoining zero-valued coordinates.

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Compare independently lifted input halfspaces with all fresh coefficients zero. Include zero/one/multiple fresh coordinates, coupled old coordinates, empty/universe and both zero-dimensional values, cache histories, supported profiles, zero-count identity and oversized-count rejection. Check reduced and unreduced histories, repeated embedding, cached-record reload, independent lifted rows and resource failures during cache extension.

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/addspacedims1.cc; tests/BD_Shape/dimensionlimits1.cc.

CPP
Public

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

void add_space_dimensions_and_embed(dimension_type m);
SW_SPEC
2
PPL-SPEC-001103
PPL-SPEC-001103
Zero-fixed bounded-difference coordinate extension

add_space_dimensions_and_project(m) shall change an entry value X ⊆ ℝn into exactly X×{0}m in dimension n + m. Original coordinates shall keep their indices and relationships. Every fresh coordinate, with index n, …, n + m − 1, shall equal zero. Empty input shall remain empty in the new dimension; zero-dimensional universe shall extend to the origin. Adding zero coordinates shall preserve the value.

A requested final dimension above max_space_dimension() shall throw std::length_error before allocating the corresponding matrix. The rejection shall include a mathematical sum outside dimension_type's range, without accepting its wrapped value.

The supported coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

A rejected dimension request shall preserve the represented entry set and ambient dimension.

Zero-fixed extension preserves the old set while adding a distinguished origin in the new coordinates.

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Adjoin independent zero equations to lifted halfspaces; verify all unary and difference supports, old/fresh coupling, multiple zeros, empty and zero-dimensional cases, zero-count identity, cache histories and oversized-count rejection.

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/addspacedims1.cc; tests/BD_Shape/dimensionlimits1.cc.

CPP
Public

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

void add_space_dimensions_and_project(dimension_type m);
SW_SPEC
3
PPL-SPEC-001104
PPL-SPEC-001104
Ordered Cartesian concatenation of bounded-difference 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 coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use 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
BOUNDED_DIFFERENCES
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/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/concatenate1.cc; tests/BD_Shape/dimensionlimits1.cc.

CPP
Public

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

void concatenate_assign(const BD_Shape& other);
SW_SPEC
4
PPL-SPEC-001105
Existential bounded-difference coordinate removal

remove_space_dimensions(vars) shall existentially remove exactly the entry coordinates in vars. Remaining coordinates shall be compacted in ascending original-index order. remove_higher_space_dimensions(k) shall existentially remove the suffix with indices k, …, n − 1, retaining the original prefix order. Removal shall retain all implied relations among survivors, including relations whose proof uses removed coordinates.

With exact computational arithmetic, both operations shall give the exact existential projection, which is bounded-difference representable. Rounded computational profiles shall give a sound projection with the closure precision admitted by 🔗 1. Bounded-difference values, numerical profiles and valid use. Removing no coordinates shall preserve the entry value; removing every coordinate shall give zero-dimensional universe exactly when the entry value is nonempty, otherwise zero-dimensional empty. Empty inputs shall retain emptiness in the reduced dimension.

An element of vars outside the entry dimension, or k greater than that dimension, shall throw std::invalid_argument. Empty selections and a suffix length of zero shall also apply to zero-dimensional values.

The supported coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. The supplied Variables_Set shall retain its own valid-use contract and shall remain unchanged. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

Projection must preserve paths and equalities through eliminated coordinates, rather than simply deleting their explicitly stored restrictions.

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Eliminate selected columns from raw rational halfspaces independently, compact survivors and compare all primitive supports. Include nonadjacent selections, implied surviving relations, equalities, all/none removal, empty/lazy-empty and universe, cached/uncached descriptions, repeated removal and invalid dimensions.

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/removespacedims1.cc; tests/BD_Shape/addspacedims1.cc.

CPP
Public

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

void remove_space_dimensions(const Variables_Set& vars);
void remove_higher_space_dimensions(dimension_type k);
SW_SPEC
5
PPL-SPEC-001106
PPL-SPEC-001106
Injective partial remapping of bounded-difference coordinates

map_space_dimensions(mapping) shall existentially discard every entry coordinate outside the mapping domain and place each surviving coordinate i at target index f(i). For a positive-dimensional receiver, the admitted mapping shall be a partial injection from the entry indices 0, …, n − 1, with image exactly 0, …, m − 1 for some m ≤ n. The result shall have dimension m; an empty mapping shall project to the zero-dimensional value.

With exact computational arithmetic, the result shall equal the projected and relabeled entry set. Rounded profiles shall retain the projection precision of 🔗 4. Existential bounded-difference coordinate removal. Empty and universe values shall retain those meanings in the mapped dimension. An identity mapping shall preserve the value; a permutation shall retain all renamed relations.

The mapping type shall supply logically const has_empty_codomain(), max_in_codomain() and maps(i,j) queries with the meanings of [LINK: PPL-SPEC-000004], 🔗 5. Exact empty-codomain query and 🔗 6. Largest image and defined empty-map failure. A zero-dimensional input shall remain unchanged and require no mapping query; mapping-value restrictions shall apply only to positive-dimensional receivers. Otherwise has_empty_codomain() shall be queried first; when true, neither remaining query shall be called. When false, the maximum shall be queried before mappings are consumed. Queries shall describe one stable mapping throughout the call. No specific number or order of individual maps queries shall be required. Violating injectivity, source bounds, contiguous image or query consistency shall be outside the admitted interface.

The supported coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. The supplied mapping shall remain live and describe a stable partial function. Exceptions escaping its queries shall propagate. After a query exception, destruction shall release owned storage, and assigning a complete valid value to the destination shall be supported before further geometric use. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

Mapping combines existential projection with a permutation; its query protocol also permits lightweight user-supplied mapping objects.

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Independently eliminate and permute coordinates for every small contiguous-image injection, including nonadjacent domains, permutations, empty and identity maps, implied relations, empty/zero-dimensional and cached values. Use a custom query recorder to verify mandatory ordering and forbidden queries after an empty answer, and check source mapping preservation. Check verified identity maps without temporary C++ allocation, unchanged cached representations and owned capacity after copying and grow/shrink histories. Compare first/last/middle swaps, reversal, cycles and projections against literal coordinate oracles; preserve floating-point mode/flags. Inject every mapping-query exception and check propagation, safe replacement and temporary cleanup.

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/mapspacedims1.cc. tests/coordinatemappingfixture.hh;

CPP
Public

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

template <typename Partial_Function>
void map_space_dimensions(const Partial_Function& mapping);

The admitted Partial_Function type shall provide these const queries:

bool has_empty_codomain() const;
dimension_type max_in_codomain() const;
bool maps(dimension_type source, dimension_type& target) const;
SW_SPEC
6
PPL-SPEC-001107
PPL-SPEC-001107
Bounded-difference coordinate expansion by independent fibers

For an existing coordinate v < n, expand_space_dimension(var,m) shall append m coordinates in positions n, …, n + m − 1 and retain original coordinate positions. Let X ⊆ ℝn be the entry set and let u[v ← a] denote replacing coordinate v of the old-coordinate prefix of u by a. The declared bounded-difference result shall be the independent-fiber relation

{u ∈ ℝn + m  ∣ (u0, …, un − 1) ∈ X ∧n + m − 1⋀j = nu[v ← uj] ∈ X}.

Thus every replica shall reproduce the selected coordinate's restrictions against retained original coordinates. Neither equality with the original selected coordinate nor equality among replicas shall be imposed unless implied by those restrictions. This result shall contain the generic common-replica coordinate-expansion relation of 🔗 2. Concatenation, coordinate expansion and folding. Each new coordinate shall have independently owned storage.

The relation above is itself bounded-difference representable. Exact copying of admitted entry bounds shall preserve it; any delegated computational rounding shall retain the supported numerical guarantees of [LINK: PPL-SPEC-001056]. Empty input shall remain empty. Adding zero replicas shall preserve the value after checking that var is an existing coordinate. An invalid coordinate shall throw std::invalid_argument even for zero replicas or empty input. A final dimension above max_space_dimension() shall throw std::length_error.

The supported coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. The supplied Variable shall retain its own valid-use contract. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

Independent fibers preserve relationships with retained coordinates while allowing distinct choices for the original selected coordinate and its replicas.

GopanDMDRS04 | Sections 4.3 and 4.5, expansion and weakly relational implementation (author PDF page indices 7-9, zero-based).

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Generate each replica relation by independently substituting its coordinate into source halfspaces. Check all primitive supports and common-replica containment separately, multiple replicas with distinct values, source/retained correlations, forced equalities, empty/universe, zero replicas and invalid/oversized requests.

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/expandspacedim1.cc; tests/BD_Shape/dimensioncontracts1.cc; tests/BD_Shape/dimensionlimits1.cc.

CPP
Public

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

void expand_space_dimension(Variable var, dimension_type m);
SW_SPEC
7
PPL-SPEC-001108
PPL-SPEC-001108
Alternative-coordinate folding of bounded-difference values

fold_space_dimensions(vars,dest) shall combine the alternatives obtained by keeping the original destination value or replacing it by the value of any entry coordinate in vars, then remove every folded coordinate. Surviving indices, including the destination's new index, shall be compacted in ascending original order. Other surviving coordinates shall keep their entry meanings within each alternative.

With exact computational arithmetic, the result shall be the least bounded-difference enclosure of that union of alternatives. In particular, its unary and difference bounds shall be the corresponding suprema over all alternatives. Rounded profiles shall retain a sound enclosure and their admitted closure and numerical precision under 🔗 1. Bounded-difference values, numerical profiles and valid use. The union need not be convex or itself bounded-difference representable. Empty input shall remain empty in the reduced dimension. Empty vars shall preserve the value after validating the destination coordinate.

The destination and every folded coordinate shall be inside the entry space, and the destination shall not belong to vars. An invalid coordinate or selection containing the destination shall throw std::invalid_argument. The Variables_Set selection shall remain unchanged.

The supported coefficient profiles, real-set interpretation, initialized runtime, numerical-intermediate, FPU, resource and synchronization conditions of 🔗 1. Bounded-difference values, numerical profiles and valid use shall apply. The supplied Variable and Variables_Set shall retain their own valid-use contracts. Underlying allocation and numerical failures may propagate; no additional rollback guarantee shall be inferred. Storage acquired by discarded temporaries shall be released.

Folding joins alternative destination values and then projects away source axes; it is neither simultaneous equality nor an injective renaming.

GopanDMDRS04 | Sections 4.2 and 4.5, folding and weakly relational implementation (author PDF page indices 6-9, zero-based).

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Project each destination-substitution alternative independently and maximize each supported normal over the alternatives. Include multiple folded coordinates, destination before/between/after removed indices, coupled/empty/universe and zero selections, representation histories, rounded profiles and all invalid selections.

src/BD_Shape_defs.hh; src/BD_Shape_inlines.hh; src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateoracle.hh; tests/bdshapecoordinateallocationsspec1.cc; tests/boxallocationfixture.hh; tests/bdshapeconversionoracle.hh; tests/bdshapevalueoracle.hh; tests/bdshapecoordinatespublic1.cc; tests/BD_Shape/foldspacedims1.cc; tests/BD_Shape/expandspacedim1.cc; tests/BD_Shape/dimensioncontracts1.cc.

CPP
Public

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

void fold_space_dimensions(const Variables_Set& vars, Variable dest);
SW_SPEC
8
PPL-SPEC-001655
PPL-SPEC-001655
Extension of bounded-difference redundancy bitmaps

Implementation::extend_bd_redundancy shall require a live valid square Bit_Matrix with n rows and new_rows representing N ≥ n in dimension_type. For an extent supported by the matrix row and bit-index types, it shall return true, set both dimensions to N, preserve each entry (i, j) with i, j < n, and set every other entry to one. A one bit denotes a redundant bound. No coefficient arithmetic shall be performed. An unsupported extent shall return false without changing the bitmap.

Allocation failures may propagate and leave a partially extended bitmap; owned resources shall remain safely destructible, without a rollback or valid-cache guarantee. The caller shall clear the reduction certificate before a potentially failing extension and restore it only on success. Initialization, lifetime and synchronized access shall follow the bitmap and bounded-difference value contracts.

Free coordinate extension adds isolated graph vertices. Every newly introduced bound is infinite and redundant, while the old selected basis continues to represent exactly the original restrictions.

APPROVED
BOUNDED_DIFFERENCES
IF_CPP
Test, Analysis, Inspection

Compare arbitrary old bit patterns and all newly introduced entries across zero sizes, unchanged extents and bit-word boundaries. Check unsupported extent rejection with unchanged input, public free embedding with cached and uncached histories, reloadable representations and allocation failure ownership.

src/BD_Shape_templates.hh; tests/bdshapecoordinatesspec1.cc; tests/bdshapecoordinateallocationsspec1.cc.

CPP
Internal

Internal source header: BD_Shape_templates.hh; namespace Parma_Polyhedra_Library::Implementation:

bool extend_bd_redundancy(Bit_Matrix& redundancy,
                          dimension_type new_rows);