Parma Polyhedra Library requirements
C++ coordinate maps: Partial_Function
  • PPL-LLR-000141
    1. Injective partial coordinate maps PPL-LLR-000141

    Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

    • PPL-HLR-000009
      9. Semantics-preserving support for variable-size problems PPL-HLR-000009

      PPL shall support the representation and manipulation of finite-dimensional numerical data at variable problem sizes, preserving the association between coordinates and values when data are resized, reordered or transformed, subject to documented dimension and resource limits.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 6. Thread entry and shared-facility use PPL-LLR-000438

    For each supported thread configuration and language interface, the runtime shall provide the required library and thread initialization and finalization protocol. Correctly initialized threads shall use the thread-specific numerical state required by that configuration. Permitted concurrent use, object-sharing conditions and caller synchronization requirements for shared facilities shall be explicit, including restrictions on computational-weight monitoring and watchdog signal ownership.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

1. Public partial coordinate-map type and valid use PPL-SPEC-000001

The public C++ interface shall expose Partial_Function as a value type representing a finite injective partial map M from dimension indices to dimension indices. Each mapped source shall have exactly one image, and distinct mapped sources shall have distinct images. Neither a stored source nor a stored image shall equal the reserved value not_a_dimension(), the maximum value of dimension_type. An unmapped index shall have no image.

The map shall impose no implicit ambient dimension, contiguity of mapped indices, or requirement that its images cover a contiguous range. Limits on achievable storage shall remain distinct from the index type's value range and from the coordinate limits of numerical objects consuming a map. In particular, the insertion range shall not be narrowed to the smaller range accepted by Variable formatting.

Operations on existing objects shall require live, valid maps. Successful moves between distinct objects shall leave the source as a valid empty map, as defined by 🔗 9. Move construction and empty source and 🔗 10. Move assignment and empty source. Within the library's supported thread-use contexts, callers shall prevent unsynchronized mutation of an instance while another call observes, copies or prints it, and shall serialize mutations of that instance. No additional concurrent-use regime shall be inferred from the type being a value type.

  • PPL-LLR-000141
    1. Injective partial coordinate maps PPL-LLR-000141

    Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

    • PPL-HLR-000009
      9. Semantics-preserving support for variable-size problems PPL-HLR-000009

      PPL shall support the representation and manipulation of finite-dimensional numerical data at variable problem sizes, preserving the association between coordinates and values when data are resized, reordered or transformed, subject to documented dimension and resource limits.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 3. Failure and resource safety PPL-LLR-000133

    When a supported recoverable failure is reported through a documented error channel, the library shall release temporary resources it owns and leave surviving objects and outputs in the states permitted by the operation's documented failure guarantee. Failure during construction shall release resources acquired for the object whose construction failed. These obligations shall apply whether failure is reported by an exception, error status or host-language error mechanism.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

PPL-SPEC-000002
2. Empty partial-map construction PPL-SPEC-000002

Successful default construction shall create a valid Partial_Function whose domain and image are empty, with the meaning and use conditions of 🔗 1. Public partial coordinate-map type and valid use. No index shall initially be mapped. If construction fails through a supported C++ exception, resources acquired for the incomplete object shall be released and no constructed map shall be returned.

3. Injective insertion and failure atomicity PPL-SPEC-000003

For a valid map as defined by 🔗 1. Public partial coordinate-map type and valid use, insertion shall require both indices to differ from not_a_dimension(), the source index to be absent from the current domain, and the proposed image to be absent from the current image set. A successfully completed insertion of i and j shall add exactly the pair M(i) = j, preserve every existing pair and leave every other absent source unmapped. Gaps introduced by storage growth shall not become mappings. The operation shall permit image zero and noncontiguous source and image sets.

Storage-capacity or allocation failure shall be reported through the corresponding C++ exception, including std::length_error or std::bad_alloc where applicable. Such a failed insertion shall leave the represented map unchanged and valid for subsequent queries, insertion, assignment and destruction.

Violation of the insertion preconditions shall be outside the supported contract. Assertion diagnostics shall not be required in every configuration, and no defined success or failure outcome shall be promised for such a call.

PPL-SPEC-000004
4. Exact partial-map lookup and unchanged absent output PPL-SPEC-000004

For a valid map under 🔗 1. Public partial coordinate-map type and valid use, lookup of i shall return true exactly when i ∈ dom(M). On true, it shall assign M(i) to j. On false, it shall leave j unchanged. The represented map shall remain unchanged. Every dimension_type value shall be admissible as a lookup index; in particular, lookup of not_a_dimension() shall return false without changing j. The same caller variable may supply the index value and receive the image; the index used for lookup shall be its value on entry to the call.

5. Exact empty-codomain query PPL-SPEC-000005

For a valid map under 🔗 1. Public partial coordinate-map type and valid use, has_empty_codomain shall return true exactly when the represented partial map has no pairs, and shall leave the map unchanged. A nonempty map whose largest image is zero shall return false. Stored capacity or unused source positions shall not determine the mathematical answer.

6. Largest image and defined empty-map failure PPL-SPEC-000006

For a nonempty valid map under 🔗 1. Public partial coordinate-map type and valid use, max_in_codomain shall return the largest image value, independently of insertion order and of the largest source index. If the valid map is empty, the call shall throw std::runtime_error rather than return a maximum value. The map shall remain unchanged on either outcome. The empty call shall be a defined failure case, not an excluded precondition. Exact exception-message text is not prescribed; ordinary C++ runtime/resource conditions for reporting the exception apply.

  • PPL-LLR-000141
    1. Injective partial coordinate maps PPL-LLR-000141

    Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

    • PPL-HLR-000009
      9. Semantics-preserving support for variable-size problems PPL-HLR-000009

      PPL shall support the representation and manipulation of finite-dimensional numerical data at variable problem sizes, preserving the association between coordinates and values when data are resized, reordered or transformed, subject to documented dimension and resource limits.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 3. Failure and resource safety PPL-LLR-000133

    When a supported recoverable failure is reported through a documented error channel, the library shall release temporary resources it owns and leave surviving objects and outputs in the states permitted by the operation's documented failure guarantee. Failure during construction shall release resources acquired for the object whose construction failed. These obligations shall apply whether failure is reported by an exception, error status or host-language error mechanism.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

PPL-SPEC-000007
7. Independent copies, assignment and owned-storage cleanup PPL-SPEC-000007

Copy construction shall require a live, valid source map under 🔗 1. Public partial coordinate-map type and valid use. Successful copy construction shall create a distinct value with exactly the source's mapping. Copy assignment shall require live, valid source and target maps and, on success, shall replace the target's old map with exactly the source's mapping. Subsequent valid insertion into either distinct value shall not change the other's mapping. Successful self-copy-assignment shall preserve the map. Successful copy assignment shall return a reference to its target, including self-copy-assignment.

Failed copy construction shall release resources acquired for the incomplete target and shall leave the source unchanged. Failed copy assignment shall leave both source and target unchanged and valid for subsequent use. Destruction of a live map shall release its owned storage without releasing another map's storage. The caller shall not access an object after its lifetime ends.

  • PPL-LLR-000141
    1. Injective partial coordinate maps PPL-LLR-000141

    Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

    • PPL-HLR-000009
      9. Semantics-preserving support for variable-size problems PPL-HLR-000009

      PPL shall support the representation and manipulation of finite-dimensional numerical data at variable problem sizes, preserving the association between coordinates and values when data are resized, reordered or transformed, subject to documented dimension and resource limits.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 3. Failure and resource safety PPL-LLR-000133

    When a supported recoverable failure is reported through a documented error channel, the library shall release temporary resources it owns and leave surviving objects and outputs in the states permitted by the operation's documented failure guarantee. Failure during construction shall release resources acquired for the object whose construction failed. These obligations shall apply whether failure is reported by an exception, error status or host-language error mechanism.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

  • 6. Thread entry and shared-facility use PPL-LLR-000438

    For each supported thread configuration and language interface, the runtime shall provide the required library and thread initialization and finalization protocol. Correctly initialized threads shall use the thread-specific numerical state required by that configuration. Permitted concurrent use, object-sharing conditions and caller synchronization requirements for shared facilities shall be explicit, including restrictions on computational-weight monitoring and watchdog signal ownership.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

8. Coordinate-map diagnostic printing and output failures PPL-SPEC-000008

Printing shall observe a valid map under 🔗 1. Public partial coordinate-map type and valid use without changing its represented mapping. Calls shall require the library and calling thread's applicable initialization protocol to have established a valid active Variable output function under 🔗 7. Active Variable formatter and initialized thread state and 🔗 3. Thread initialization, default state and finalization. Callers shall obey the supported thread regime and synchronize changes to the active formatter and access to a shared stream; the formatter shall not mutate the printed map during the call.

When the map is empty and output succeeds, print shall write the literal text "empty", a newline and a flush. For a nonempty map whose source and image indices are all constructible as Variable objects, successful output shall process pairs in increasing source order. For each pair it shall write the source Variable using the Variable formatter active for that write, the literal separator " --> ", the image Variable using the formatter active for its write, and a trailing newline. Each Variable write shall use the formatter then active in the calling thread where formatting state is thread-specific; names shall not be fixed independently of it. A callback's permitted change to that formatting state may therefore affect subsequent Variable writes. Text insertions shall honor the stream's current formatting state. Specified literals identify the inserted character sequences, not a canonical byte layout independent of that state. Printing shall not promise restoration of formatting state changed by a formatter.

A map index outside Variable's accepted identifier range shall be permitted to cause std::length_error during printing, without changing the map. Stream, formatter and resource failures may also propagate their C++ exceptions. Stream failure without an enabled exception shall be observable through the stream state; a normal void return shall not alone establish complete output. After any such failure the output may be partial, but the map shall remain valid and unchanged. Exact diagnostic messages are not prescribed.

  • PPL-LLR-000141
    1. Injective partial coordinate maps PPL-LLR-000141

    Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

    • PPL-HLR-000009
      9. Semantics-preserving support for variable-size problems PPL-HLR-000009

      PPL shall support the representation and manipulation of finite-dimensional numerical data at variable problem sizes, preserving the association between coordinates and values when data are resized, reordered or transformed, subject to documented dimension and resource limits.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 3. Failure and resource safety PPL-LLR-000133

    When a supported recoverable failure is reported through a documented error channel, the library shall release temporary resources it owns and leave surviving objects and outputs in the states permitted by the operation's documented failure guarantee. Failure during construction shall release resources acquired for the object whose construction failed. These obligations shall apply whether failure is reported by an exception, error status or host-language error mechanism.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

  • 6. Thread entry and shared-facility use PPL-LLR-000438

    For each supported thread configuration and language interface, the runtime shall provide the required library and thread initialization and finalization protocol. Correctly initialized threads shall use the thread-specific numerical state required by that configuration. Permitted concurrent use, object-sharing conditions and caller synchronization requirements for shared facilities shall be explicit, including restrictions on computational-weight monitoring and watchdog signal ownership.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

PPL-SPEC-000009
9. Move construction and empty source PPL-SPEC-000009

Move construction from a valid map under 🔗 1. Public partial coordinate-map type and valid use shall create a distinct valid map with exactly the source's mapping on entry and shall leave the source as a valid empty map. The source shall support the same queries, insertions, assignments and destruction as any other empty map. Subsequent valid changes to either object shall not change the other's map.

If construction of the destination's empty storage fails, resources acquired for the incomplete destination shall be released and the source shall remain unchanged and valid. After the empty storage has been constructed, transferring the represented map shall not allocate storage or throw.

The move constructor's exception specification shall be nonthrowing exactly when default construction of its configured storage containers is nonthrowing, as expressed by the declaration below. The debug codomain container shall contribute to that condition only when present.

  • PPL-LLR-000141
    1. Injective partial coordinate maps PPL-LLR-000141

    Within the documented insertion preconditions, a partial coordinate map shall represent an injective mapping from selected dimension indices to dimension indices. Lookup of a mapped coordinate shall return its associated image; lookup of an unmapped coordinate shall report absence without changing the caller's output value. Empty-codomain and maximum-image queries shall distinguish the empty map from a nonempty map.

    • PPL-HLR-000009
      9. Semantics-preserving support for variable-size problems PPL-HLR-000009

      PPL shall support the representation and manipulation of finite-dimensional numerical data at variable problem sizes, preserving the association between coordinates and values when data are resized, reordered or transformed, subject to documented dimension and resource limits.

  • PPL-LLR-000311
    1. Public C++ access to supported facilities PPL-LLR-000311

    The public C++ interface shall expose the configured library's supported numerical facilities and their public value types through the documented public headers, preserving the declared numerical meanings and public type contracts of those facilities.

    • PPL-HLR-000007
      7. Access through supported language interfaces PPL-HLR-000007

      PPL shall expose its numerical facilities through its C++ interface and expose selected facilities through the supported C, Java, OCaml and Prolog interfaces. Each interface shall preserve the declared semantics of the facilities it exposes.

  • 3. Failure and resource safety PPL-LLR-000133

    When a supported recoverable failure is reported through a documented error channel, the library shall release temporary resources it owns and leave surviving objects and outputs in the states permitted by the operation's documented failure guarantee. Failure during construction shall release resources acquired for the object whose construction failed. These obligations shall apply whether failure is reported by an exception, error status or host-language error mechanism.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

  • 6. Thread entry and shared-facility use PPL-LLR-000438

    For each supported thread configuration and language interface, the runtime shall provide the required library and thread initialization and finalization protocol. Correctly initialized threads shall use the thread-specific numerical state required by that configuration. Permitted concurrent use, object-sharing conditions and caller synchronization requirements for shared facilities shall be explicit, including restrictions on computational-weight monitoring and watchdog signal ownership.

    • PPL-HLR-000008
      8. Controlled runtime operation and resource use PPL-HLR-000008

      PPL shall define its initialization, cleanup, runtime configuration and failure behavior, and shall provide the supported mechanisms for controlling long-running computations, so that clients can use the library without violating its documented object and resource-lifetime rules.

PPL-SPEC-000010
10. Move assignment and empty source PPL-SPEC-000010

Move assignment between distinct valid maps under 🔗 1. Public partial coordinate-map type and valid use shall replace the target's mapping with exactly the source's mapping on entry and leave the source as a valid empty map. Both maps shall support subsequent queries, insertions, assignments and destruction. Subsequent changes to either map shall not change the other's represented value.

Self-move-assignment shall leave the map unchanged. Move assignment shall return a reference to its target, including self-move-assignment. It shall not allocate storage or throw. Storage retained by an empty map shall remain owned by that map and shall not imply the presence of any mapped pair.