Parma Polyhedra Library requirements
Native verification support

Native verification support

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-001719
PPL-SPEC-001719
Verification diagnostic routing

Test verbosity selection shall enable output when the named environment variable exists, where getenv is available; its value need not be nonempty. Otherwise, the configured NOISY and VERY_NOISY fallbacks shall govern the corresponding names. An unrecognized name shall be disabled in that fallback. A disabled noisy stream shall discard characters while reporting successful writes. An enabled stream shall use the supplied stream's buffer. nout and vnout shall select the ordinary and very-noisy channels independently. The C harness query functions shall expose the corresponding Boolean decisions. print_function shall print a nonempty introduction followed by a newline and then delegate to the partial function's print operation. These helpers shall not determine whether a numerical test passed.

Diagnostic verbosity must not change a test result or turn discarded output into a stream failure.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Analysis, Inspection

Inspect each environment/fallback branch, stream-buffer selection and EOF handling; exercise disabled and enabled channels and an empty/nonempty introduction.

tests/ppl_test.hh; tests/ppl_test.cc; interfaces/C/tests/ppl_c_test.h; interfaces/C/tests/ppl_c_test.cc.

CPP
Internal

Native test support in tests/ppl_test.hh, tests/ppl_test.cc and the C test harness.

SW_SPEC
2
PPL-SPEC-001720
PPL-SPEC-001720
Fatal test-process diagnostics

set_handlers shall install a terminate handler which reports an uncaught exception and exits unsuccessfully. Where sigaction is available it shall install the selected SIGFPE handler; installation failure shall diagnose and abort. SIGFPE handling shall report the available cause or exception flags and exit unsuccessfully. These are fatal test-process diagnostics, not a recoverable library exception or signal-safety guarantee.

Fatal fixture failures must produce a diagnostic and an unsuccessful process result instead of continuing with invalid test state.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Analysis, Inspection

Inspect platform branches and unsuccessful exit paths; exercise termination only in subprocesses and preserve the caller process.

tests/ppl_test.hh; tests/ppl_test.cc.

CPP
Internal

Test::set_handlers and its private terminate/SIGFPE callbacks.

SW_SPEC
3
PPL-SPEC-001721
PPL-SPEC-001721
Test file opening and closing

open shall open the supplied fstream with the requested path and mode. On failure it shall report the path, identify the ordinary read/write modes when recognized, and exit with status 1. close shall call the stream close operation only when its entry Boolean stream state is true; it shall not clear a failed stream or promise to close an already-failed stream. Paths and stream lifetimes shall be valid for the underlying standard-library operations.

A fixture must distinguish unusable input files from a failed library operation; the close helper preserves its existing failed-stream semantics.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Analysis, Inspection

Inspect exact mode diagnostics and failed-stream behavior; exercise a valid temporary path and a rejected path in a subprocess.

tests/files.hh; tests/files.cc.

CPP
Internal

The global open(fstream&, const char*, openmode) and close(fstream&) test helpers.

SW_SPEC
4
PPL-SPEC-001722
PPL-SPEC-001722
Test user-CPU timing observations

Where getrusage and timeval are configured, start_clock shall save process user-CPU time for a subsequent print_clock call. print_clock shall print the nonnegative elapsed user time rounded to centiseconds, carrying into the seconds field as needed and restoring the output stream's fill character. A getrusage failure shall diagnose and exit with status 1. Without that configured facility start_clock shall do nothing and print_clock shall emit "(no clock available)". Calls shall be ordered and synchronized appropriately for the configured thread-local or shared saved timestamp. This observation shall not be interpreted as wall-clock time or a performance acceptance test.

Timing output is interpretable only when its clock, units and rounding are explicit.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Analysis, Inspection

Inspect rounding/carry, failure and unavailable-clock branches; compare output format and restoration of a nondefault fill character.

utils/timings.hh; utils/timings.cc.

CPP
Internal

start_clock(), print_clock(ostream&) and saved_ru_utime.

SW_SPEC
5
PPL-SPEC-001723
PPL-SPEC-001723
Restricted foreign-runtime verification doubles

The OCaml integer fixture shall model only the tagged immediate-integer ABI used by the native conversion helpers. Its selected word types and tag operations shall agree on that encoding. Any attempted heap/custom-block access shall throw logic_error with the fixture diagnostic; it shall not return a plausible heap value. Its unsigned-argument error double shall throw invalid_argument with the supplied message. The fixture shall not claim to implement the OCaml collector, ownership protocol or exception runtime.

The SWI coefficient fixture shall model only the term and initialized-GMP exchange needed by its conversion tests. Its modern extraction double shall leave output untouched and fail when requested; on success it shall copy the selected integer and record the output address. Its legacy extraction double shall perform that copy without a result status. The unification and variable reset doubles shall supply only the successful/no-op behavior used by this fixture, not a complete Prolog term store.

Narrow runtime doubles must fail immediately outside their supported subset, so they cannot accidentally validate the complete foreign runtime.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Test, Analysis, Inspection

Exercise heap-access rejection, tagged-integer boundaries and both modern/legacy coefficient extraction paths. Inspect the deliberately restricted scope of every double.

tests/ocaml_integer_conversion1.cc; tests/swi_coefficient_conversion1.cc.

CPP
Internal

The private ABI doubles and state in tests/ocaml_integer_conversion1.cc and tests/swi_coefficient_conversion1.cc.

SW_SPEC
6
PPL-SPEC-001726
PPL-SPEC-001726
Compilation-only and unavailable-profile test drivers

An unavailable-profile test driver shall return the test harness skip status 77 without claiming to execute the disabled threaded verification. Its enabled branch shall retain that branch's actual verification allocations. The C_Expr compilation fixture shall include the authored expression header and provide a successful entry point. Successful compilation establishes only that the selected declarations are well formed in that build; returning zero shall not be treated as a mathematical test of every expression operation.

A compile-only or unavailable-profile driver is not evidence that the numerical operation was exercised.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Analysis, Inspection

Inspect conditional branches and exit statuses; compile the C_Expr fixture and verify skipped versus executed tests separately.

tests/atomicwatchdogspec1.cc; tests/ownedexpressionthreads1.cc; tests/threadsafepublic1.cc; tests/Concrete_Expression/C_Expr.cc.

CPP
Internal

The fallback entry points in atomicwatchdogspec1, ownedexpressionthreads1 and threadsafepublic1; tests/Concrete_Expression/C_Expr.cc.

SW_SPEC
7
PPL-SPEC-001736
PPL-SPEC-001736
Replacement allocation failure injection

The fixture shall initialize its failure countdown to a disabled state. When a replacement allocation is attempted with a nonnegative countdown, the allocation path shall decrement it. An entry value of zero shall throw std::bad_alloc before requesting storage. An entry value below zero shall leave the countdown unchanged and permit the ordinary replacement allocation path. That path shall request the given byte count, or one byte for a zero-size request. It shall throw std::bad_alloc when allocation fails. Array allocation shall use the same path. A countdown observation shall return the current countdown. Clients shall serialize control and observation of the fixture.

A known failing allocation attempt lets the test exercise cleanup and recovery paths without relying on actual resource exhaustion.

APPROVED
RUNTIME
IF_CPP
Analysis, Inspection

Inspect the initial state and follow negative, positive and zero entry values through the scalar path. Check array delegation and the zero-byte allocation and allocation-failure branches. Inspect the countdown read.

tests/throw_on_allocation.hh.

CPP
Internal

Test_Allocation::countdown, Test_Allocation::observed_countdown() and the replacement operator new and operator new[] in tests/throw_on_allocation.hh.

SW_SPEC
8
PPL-SPEC-001737
PPL-SPEC-001737
Replacement allocation observations

The fixture shall initialize its allocation balance to zero. It shall increment the balance for each successful allocation through its replacement and decrement it for each nonnull pointer passed to its replacement deallocator. Sized and array forms shall use the same accounting path. A balance observation shall return the current balance. The balance measures only events that reach the replacements. Counts may include just one end of an allocation lifetime when interposition is incomplete.

The summary shall start with a zero count and zero extrema. Given two balance observations, it shall ignore equal values. Otherwise it shall count the observation and update the minimum and maximum of the signed difference, later minus earlier, over all recorded nonzero differences. The fixture assumes serialized use and representable counts and differences.

The test can distinguish an observed cleanup imbalance from an inference about every allocation in a process.

APPROVED
RUNTIME
IF_CPP
Analysis, Inspection

Follow successful and failed allocations, null and nonnull deallocation, and the delegates for array and sized operations. Inspect observation reads and check that equal, first nonzero, and subsequent positive or negative differences produce the stated count and extrema.

tests/throw_on_allocation.hh.

CPP
Internal

Test_Allocation::outstanding, Test_Allocation::observed_outstanding(), Test_Allocation::Balance_Observations and Balance_Observations::record(long, long). The replacement allocation and deallocation entry points supply the measured events.

SW_SPEC
9
PPL-SPEC-001738
PPL-SPEC-001738
Partial-function input and failure-scope fixtures

The reference pair shall hold source and image coordinates as separate dimension indices. The population helper shall insert the supplied pairs in sequence using that coordinate order and the library operation's valid insertion preconditions. The allocation-failure scope shall set the requested countdown at entry and disable injection at destruction, including during exception unwinding. Callers shall use the failure scopes without copying or nesting them.

Ordered setup fixes the tested insertion sequence. Disabling injection before the independent oracle runs keeps its own allocations outside the failure being checked.

APPROVED
CORE_DATA_STRUCTURES
IF_CPP
Analysis, Inspection

Inspect source-to-image insertion and the input iteration order. Follow normal and exceptional exits from the failure scope and locate where the test observes the map after injection has been disabled.

tests/partialfunction1.cc.

CPP
Internal

Mapping, populate and Allocation_Failure in tests/partialfunction1.cc.

SW_SPEC
10
PPL-SPEC-001739
PPL-SPEC-001739
Equivalent one-coordinate ranking countdown fixtures

The full fixture shall construct a two-dimensional closed polyhedron describing x ≥ 0,  x’ = x − 1 with after-state coordinate x’ at index zero and before-state coordinate x at index one. For the paired encoding, the guard fixture shall construct a one-dimensional closed polyhedron for x ≥ 0 at index zero. The update fixture shall construct the two-dimensional closed polyhedron for x’ = x − 1 in the same coordinate order as the full fixture. Their aligned conjunction shall equal the full fixture, using the coordinate interpretation in 🔗 1. Transition encoding and ranking interpretation.

Equivalent, explicit inputs let the tests validate the two entry points against the same reference transition.

APPROVED
TERMINATION_ANALYSIS
IF_CPP
Analysis, Inspection

Inspect the dimensions, coordinate positions and constraints of each fixture. Check that lifting the one-dimensional guard onto the before-state coordinate of the update yields exactly the two-dimensional relation.

tests/Polyhedron/termination2.cc.

CPP
Internal

ranking_valid_countdown_relation(), ranking_valid_countdown_before() and ranking_valid_countdown_after() in tests/Polyhedron/termination2.cc.

SW_SPEC
11
PPL-SPEC-001740
PPL-SPEC-001740
IBM hexadecimal rounding reference fixture

The reference quantizer shall model normalized hexadecimal rounding toward zero with six or fourteen stored fraction digits and a radix-16 exponent in the range -64 through 63. It shall use exact rational arithmetic. A magnitude below the smallest normalized value, 16 − 65, shall map to zero. Other inputs shall be within the modeled exponent range. Scaling by a power of 16 and truncating the magnitude to the selected number of hexadecimal digits shall preserve the sign of a nonzero result.

The fixture shall supply the two input intervals and the associated coordinates of each reference to the target-adapted linearizer. It shall decline constant and integer-expression queries. Given a bounded affine form with finite endpoints, the comparison shall evaluate its two coordinate contributions using exact rational conversions of the stored endpoints and check containment of the reference result. The reference quantizer shall not invoke the linearization operation being verified.

A reference independent of the linearizer can distinguish observed enclosure from an expected result derived with the same error in the implementation.

APPROVED
EXPRESSION_ANALYSIS
IF_CPP, NATIVE_FP_AVAILABLE
Test, Analysis, Inspection

Compare reference results with literal expectations for both precisions, truncation of both signs, the smallest normalized magnitude and underflow. Inspect exact rational conversion, coordinate association, and interval evaluation for positive and negative inputs. Confirm that the PPL arithmetic tests use the quantizer's result to check the returned form.

tests/Concrete_Expression/ibmroundoff1.cc.

CPP
Internal

The internal ITV and Form aliases, power16, exact, hfp_round, Oracle and encloses in tests/Concrete_Expression/ibmroundoff1.cc.

SW_SPEC
12
PPL-SPEC-001742
PPL-SPEC-001742
Parametric compatibility verification fixtures

The row and matrix fixtures shall preserve supplied constants, coordinate coefficients and logical widths when constructing variants with different capacities or explicit stored zeroes. The symmetric-equation fixture shall encode each supplied equation by both signs of its row. The protected test accessors shall expose the existing compatibility overloads without solving a public problem. Snapshot comparisons shall serialize source rows or compare their logical contents as appropriate to the test.

A scoped hook shall restore the preceding checkpoint callback on exit, including exceptional exit. The indexed interruption fixtures shall count calls and interrupt at the selected checkpoint. A one-shot client overflow shall disable further callback invocation before throwing. A nested call shall use the supplied inner workspace, context and row and shall suppress recursive reentry of that same hook.

The public-problem setup used with the zero-coordinate cases shall preserve the specified variable order, parameter identities and input-row meanings across variations of representation and insertion order. It shall set the selected solver controls before the assertions evaluate the public result.

The tests rely on controlled variations of the same mathematical context and a repeatable distinction between library failure and fixture injection.

APPROVED
PIP_SOLVER
IF_CPP
Analysis, Inspection

Compare constructed rows and parameter sets with the stated inputs. Inspect snapshot observers, the scoped callback lifetime and interruption and recursion paths. Review the separate test assertions that determine library results under 🔗 5. Integer feasibility of parametric compatibility contexts.

tests/PIP_Problem/compatibilityworkspace1.cc, tests/PIP_Problem/exactcontexts1.cc and tests/PIP_Problem/compatibilityzero1.cc.

CPP
Internal

Private compatibility accessors, coordinate and row setup, observation helpers and checkpoint hooks in the three test files below.

SW_SPEC
13
PPL-SPEC-001743
PPL-SPEC-001743
Exact reference calculations for bounded MIP tests

The model helpers shall supply the same affine rows, bounds, integer coordinates and objectives used by their comparison tests. Reference feasibility and objective values shall be computed with exact rational arithmetic independently of the MIP solver. Enumerate the admitted integer coordinates over the models' finite bounds. For a continuous coordinate remaining after the other coordinates are fixed, derive its closed feasible interval and test its endpoints. For the bounded real half-plane models, examine intersections of nonparallel boundary lines and retain only feasible points. In the integer and mixed half-plane cases, enumerate the bounded integer coordinates and use the corresponding feasible interval endpoints when a coordinate remains continuous.

A reference result shall distinguish absence of a feasible point from a feasible exact extremum. The coefficient adapters shall supply exact integer or rational values for the comparisons. An adapter that returns a conversion status shall indicate whether the conversion is exact. A borrowed GMP value shall be used only while its coefficient remains live.

Independently derived feasibility and optimum values allow the tests to check the solver's statuses and witnesses without using solver arithmetic as the expected result.

APPROVED
MIP_SOLVER
IF_CPP
Analysis, Inspection

Review equivalence of the scalar inequalities and solver inputs for each family, including the parity cut and coordinate padding. Check that the integer bounds, interval endpoints and real vertices cover every family's possible feasibility and extremum outcomes. Inspect exact coefficient conversion and confirm the reference does not call the MIP solver.

tests/MIP_Problem/enumeratedmodels1.cc and tests/MIP_Problem/coefficient_test.hh.

CPP
Internal

The private model, row, exact arithmetic and oracle helpers in tests/MIP_Problem/enumeratedmodels1.cc and MIP_Coefficient_Test::integer in tests/MIP_Problem/coefficient_test.hh.

SW_SPEC
14
PPL-SPEC-001744
PPL-SPEC-001744
Exact PIP tree interpretation in tests

The interpreter shall take a live solution tree and supplied finite parameter values in the scope of that tree. It shall read the native guards, artificial-parameter definitions and leaf expressions and evaluate them with unbounded integer arithmetic. It shall append artificial parameters in introduction order using mathematical floor with a positive denominator. It shall require referenced coordinates to be in scope and refuse to interpret an original decision coordinate as a parameter.

A decision shall select its true child only when all local guards hold. A missing node or failed solution guard shall yield false. A feasible solution node shall yield one value per requested decision coordinate in the supplied order. The coefficient-input adapter shall convert to GMP before evaluation and shall require a result representable by the requested answer type. The mode fixture shall call the supplied test with both input representations, both insertion orders and every supported cutting and pivot choice, stopping if the test returns false.

The test observer must interpret returned trees with exact arithmetic even when the stored coefficient type is bounded. Separate solver assertions compare those interpreted results with expected tuples and feasibility.

APPROVED
PIP_SOLVER
IF_CPP
Analysis, Inspection

Inspect the artificial scope and floor calculation, guard tests, branch selection and result order. Check the distinction between evaluation in GMP and conversion of an admitted answer. Inspect the discrete modes passed to the callback and the propagation of a false test result.

tests/PIP_Problem/pip_test_oracle.hh.

CPP
Internal

PIP_Test_Oracle::affine_value, evaluate_exact, evaluate and for_all_modes in tests/PIP_Problem/pip_test_oracle.hh.

SW_SPEC
15
PPL-SPEC-001745
PPL-SPEC-001745
MIP regression fixture coefficient-profile handling

A regression fixture shall have a stated coefficient width for completion. GMP and bounded profiles meeting that width shall propagate the callback's Boolean result and exceptions. A narrower checked profile shall preserve a returned Boolean result and propagate exceptions other than arithmetic overflow. It may report an allowed arithmetic overflow with the corresponding diagnostic. A narrower native profile shall record a skip before the fixture callback is invoked. These paths shall retain the distinction between a completed solver result, a checked overflow and a skipped native fixture.

A test completion profile limits the expected arithmetic range without converting a wrong numerical result into a successful regression check.

APPROVED
BUILD_DISTRIBUTION
IF_CPP
Test, Analysis, Inspection

Exercise false and true callbacks, an overflow and an unrelated exception. Verify callback invocation in the supported and checked cases and its absence for native profiles below the declared width. Inspect diagnostic and harness reporting paths.

tests/MIP_Problem/coefficient_test.hh and tests/MIP_Problem/enumeratedmodels1.cc.

CPP
Internal

MIP_Coefficient_Test::coefficient_case and DO_TEST_COEFFICIENT_PROFILE in tests/MIP_Problem/coefficient_test.hh.