Parma Polyhedra Library requirements
Runtime low-level requirements

Runtime low-level requirements

1. Initialization and finalization lifecycle
UID: PPL-LLR-000131
STATUS: APPROVED
COMPONENT: RUNTIME
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

The runtime shall initialize shared library facilities before their first supported use and finalize them after their last supported use. Multiple participating translation units shall not cause premature finalization of shared facilities. Thread-specific numerical state shall be initialized and finalized according to the selected thread-support configuration. Each supported native or binding lifecycle protocol shall define the validity of existing objects and borrowed views across finalization and reinitialization, the permitted order of owned-object and managed cleanup, and the live-thread and interruption-state preconditions for those transitions.

RATIONALE:

Numerical constants, resource handlers, and per-thread state must be available throughout the supported lifetime of library objects. Library-level transitions and object-level cleanup are related but distinct: a new period of initialization does not by itself establish validity of an old handle or view.

COMMENT:

Verification covers native shared-facility initialization and finalization ownership, including coordination across translation units and the effects of lifecycle transitions on object and view validity. Lifecycle checks and initialization-path analysis verify availability over supported use periods. Interface-specific lifecycle entry protocols remain in their binding requirements; their object-lifetime rules and cleanup order must account for these transitions. Thread-specific protocols are complemented by 🔗 6. Thread entry and shared-facility use, and binding interruption state is covered by 🔗 4. Binding interruption support and state changes. No automatic stale-handle checks, prompt managed cleanup or detection of every invalid lifecycle use is implied.

VERIFICATION_CRITERIA:

Inspect initialization ownership and counter transitions. Exercise clients using several translation units, repeated object lifetimes, and supported thread configurations. Confirm that finalization occurs after the last participating initialization owner and that per-thread initialization establishes usable numerical state. Review native and binding protocols for the validity of owned objects and borrowed views, explicit and managed cleanup ordering, active threads and pending interruptions at finalization and reinitialization. Check permitted lifecycle sequences and cleanup effects without treating a stale handle as revived by reinitialization or requiring automatic diagnosis of use outside the stated preconditions.

SOURCE:

src/Init_defs.hh: initialization-counter and thread-initialization contracts. src/Init.cc and src/initializer.hh: first-owner initialization, last-owner finalization, and thread-specific initialization. tests/Polyhedron/threadsafe1.cc and tests/Polyhedron/threadsafe2.cc: thread-specific use scenarios.

PPL-LLR-000132
2. Floating-point rounding-state exchange
UID: PPL-LLR-000132
STATUS: APPROVED
COMPONENT: RUNTIME
APPLICABILITY: NATIVE_FP_AVAILABLE
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

On supported platforms with floating-point rounding control, initialization shall establish the rounding state required by PPL floating-point abstractions and preserve the preceding state for restoration. Restoring that preceding state shall permit the client to resume its own floating-point computations; before further use of affected PPL abstractions, the client shall be able to reestablish the PPL-required state.

RATIONALE:

The library and its client may require different floating-point environments, so ownership of rounding state must be explicit.

COMMENT:

Verification covers saving, establishing and restoring floating-point rounding state on supported platforms. Rounding-state tests and platform-path inspection verify the exchange. Clients must reestablish the PPL-required state before further affected PPL computations. Per-thread state ownership follows 🔗 6. Thread entry and shared-facility use; native floating-point availability alone does not imply that every platform provides every rounding-control facility.

VERIFICATION_CRITERIA:

Start from each supported rounding direction, initialize the runtime, exchange between the saved and PPL-required states, and check both the rounding state and representative directed-rounding computations. Inspect supported thread configurations for correct per-thread saved state. Treat platforms without rounding control according to their documented configuration restrictions.

SOURCE:

src/Init_defs.hh: rounding setup, restoration, and client-use preconditions. src/Init_inlines.hh: platform-conditional rounding exchange. src/Init.cc: saved thread rounding state and initialization/finalization changes.

3. Failure and resource safety
UID: PPL-LLR-000133
STATUS: APPROVED
COMPONENT: RUNTIME
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

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.

RATIONALE:

Clients must be able to recover from reported failures without leaking library-owned resources or relying on stronger object-state guarantees than the operation provides.

COMMENT:

Verification covers resource ownership, construction cleanup, output validity and surviving-object state for each supported recoverable failure path, including binding conversion failures. Failure injection and direct ownership/invariant analysis verify the allocated contracts. Failure-state guarantees are operation-specific. Failure-state guarantees do not imply universal rollback, strong exception safety, recovery from undefined behavior, or recovery after process termination.

VERIFICATION_CRITERIA:

Use allocation-failure injection and supported numerical or interruption failures to inspect temporary-resource cleanup, surviving object invariants, and output ownership and validity through the supported reporting channels. Check operations with a documented unchanged-state guarantee against that promise and other operations against their documented valid-state or destruction-only guarantee. Include failed construction or wrapper creation after partial acquisition and repeated cleanup after failure.

SOURCE:

doc/definitions.dox: main-feature exception-safety claim and the destruction-only postcondition for recycled constraint or congruence systems after successful or exceptional return. src/Threshold_Watcher_defs.hh and src/Threshold_Watcher_inlines.hh: failed-construction cleanup and preservation of existing pending watchers. src/Watchdog_defs.hh and src/Watchdog_inlines.hh: ownership of handlers, failed-construction cleanup, and documented exceptional paths. src/CO_Tree_templates.hh: partial-construction cleanup on exceptions.

PPL-LLR-000134
4. Cooperative computation abandonment
UID: PPL-LLR-000134
STATUS: APPROVED
COMPONENT: RUNTIME
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

At documented native abandonment checkpoints, the runtime shall check pending computational-weight thresholds and caller-owned abandonment requests. A pending caller-owned request shall invoke its supplied exception mechanism without clearing that request; the caller shall remain responsible for clearing it. Binding-owned timeout notification and cleanup shall follow the binding's declared interruption protocol. Cancellation latency shall depend on checkpoint placement and computation progress rather than a promised elapsed-time bound.

RATIONALE:

Expensive computations need a way to return control while retaining a clear distinction between cooperative checks and hard real-time interruption.

COMMENT:

Verification covers native checkpoints, computational-weight monitoring and caller-owned request persistence. Interruption tests and checkpoint-path analysis verify those contracts. The low-level caller-owned request is distinct from binding-owned timeout state, whose cleanup follows 🔗 4. Binding interruption support and state changes. Queue ownership and concurrency preconditions follow 🔗 6. Thread entry and shared-facility use. No hard elapsed-time response bound is promised.

VERIFICATION_CRITERIA:

Exercise caller-owned abandonment requests during solver and polyhedral operations and check exception propagation and persistence until the caller clears the request. Check computational-weight handlers at abandonment checkpoints after their thresholds are reached. Assess binding-owned timeout reset and notification behavior separately under 🔗 4. Binding interruption support and state changes. Review the per-queue ownership and nonreentrancy restrictions for threshold queues under 🔗 6. Thread entry and shared-facility use.

SOURCE:

src/globals_defs.hh and src/globals_inlines.hh: abandonment request ownership, computational-weight checks, and exception dispatch. src/Threshold_Watcher_defs.hh and src/Threshold_Watcher_templates.hh: configured queue ownership and reached-threshold dispatch. tests/PIP_Problem/weightwatch1.cc and tests/Polyhedron/weightwatch1.cc: cooperative interruption scenarios.

5. Watchdog scheduling and cancellation scope
UID: PPL-LLR-000135
STATUS: APPROVED
COMPONENT: RUNTIME
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

Where watchdog support is available, the runtime shall accept supported positive timer durations, schedule notifications, and allow cancellation of pending notifications under the documented timer, signal, and thread-ownership restrictions. Failed construction shall not leave a pending event or invalidate existing watchdogs. Unsupported watchdog facilities and invalid durations shall be reported through the documented failure mechanism. Watchdog use shall not imply a hard elapsed-time deadline or a guarantee beyond the documented timer-state failure behavior.

RATIONALE:

Operating-system timer resolution, signal delivery, masked intervals, and scheduling failures constrain the guarantees that a watchdog can provide.

COMMENT:

Verification covers native watchdog availability, duration validation, scheduling, cancellation, construction cleanup and documented timer-failure behavior. Timer fault injection and signal/queue analysis verify those contracts. Platform resolution, signal delays, callback restrictions and documented process-termination paths remain material limits. Binding support is decided separately under 🔗 4. Binding interruption support and state changes; a thread-safe build does not remove the native watchdog's single-owner signal discipline.

VERIFICATION_CRITERIA:

Test positive, zero, negative, and large durations; simultaneous pending events; cancellation; and construction failures. Use controlled timer-system-call failures to verify queue consistency and handler release. Review stale-notification fallback behavior, callback restrictions, and signal-mask restoration without imposing a hard response-time limit.

SOURCE:

src/Watchdog_defs.hh: duration validation, unsupported configurations, construction cleanup, signal ownership, cancellation, and explicit timing limitations. src/Watchdog.cc and src/Watchdog_inlines.hh: timer queue and platform behavior. tests/Watchdog/watchdog1.cc and tests/Watchdog/watchdog2.cc: scheduling and cancellation checks.

6. Thread entry and shared-facility use
UID: PPL-LLR-000438
STATUS: APPROVED
COMPONENT: RUNTIME
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis, Review
RELATIONS (Parent): RELATIONS (Child):
STATEMENT:

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.

RATIONALE:

A thread-safe build can provide thread-specific state while retaining restrictions on mutable objects and process-wide interruption facilities.

COMMENT:

Verification covers thread entry and exit, state ownership and supported shared-facility protocols. Thread lifecycle checks and direct state/queue/signal analysis verify the contracts in each supported configuration. The caller must satisfy the declared preconditions; automatic detection of arbitrary sharing or initialization violations is not required. Thread entry and shared-facility conditions complement 🔗 1. Initialization and finalization lifecycle without relaxing 🔗 5. Watchdog scheduling and cancellation scope.

VERIFICATION_CRITERIA:

Review thread-entry and exit protocols across native, C and Java interfaces and the supported regimes of other bindings. Check initialization and finalization sequences and isolation of state promised to be thread-specific. Assess simultaneous-use and object-sharing preconditions and the per-thread computational-weight queues and single-owner native watchdog signals. Do not infer unrestricted sharing from a thread-safe configuration token.

SOURCE:

src/Init_defs.hh and src/Init.cc: library and thread-specific initialization; src/thread_safe.hh: configured thread-local state; src/Threshold_Watcher_defs.hh and src/globals_defs.hh: shared-trait restrictions and per-thread computational-weight queues; src/Watchdog_defs.hh: single-owner signal discipline; interfaces/C/ppl_c_header.h and interfaces/Java/parma_polyhedra_library/Parma_Polyhedra_Library.java: explicit thread entry and exit.