Parma Polyhedra Library requirements
Command-line solver contracts

Command-line solver contracts

PPL-SPEC-001705
1. MPS linear optimization command protocol
UID: PPL-SPEC-001705
STATUS: APPROVED
COMPONENT: COMMAND_LINE_TOOLS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis, Inspection
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

In a build providing ppl_lpsol and its GLPK input dependency, the tool shall interpret supported MPS input using the documented GLPK import semantics, including row relations, column bounds, integrality and objective constant. On completed computation within the selected mode's arithmetic/resource preconditions, it shall report infeasibility, unboundedness or the exact optimum of the interpreted problem. Mixed-integer restrictions apply only in modes supporting them. Batch, incremental and supported worker execution shall preserve numerical outcomes.

With GLPK comparison selected, an LP comparison shall preserve the imported coefficients and certify primal/dual feasibility and objective equality using exact arithmetic rather than treat a floating-point suggestion as proof. By default, the optimum comparison shall use a tolerance of 1e-9 for an exactly certified LP optimum and of 1e-9 times (1 + the absolute value of the GLPK optimum) for a MIP optimum. An explicit threshold shall set an absolute tolerance. Failed input or incomplete computation shall be observably distinguished from a completed numerical conclusion. Supported options, mode restrictions, diagnostics and exit conventions shall be those advertised by the tool.

RATIONALE:

Exact solving must retain every imported row, bound and objective term; optional comparison must assess that same mathematical problem.

COMMENT:

LANGUAGE is omitted because this is a language-neutral external protocol and artifact contract; it contains no implementation-language source.

INTERFACE:

Executable ppl_lpsol: documented options followed by the supported MPS input filename (or supported worker inputs). --help defines available options for the build. Observable outputs are status, exact rational optimum and requested witness/diagnostics; comparison options select an independent check rather than change the interpreted optimization problem. The GLPK-imported numerical values define the problem, including any rounding introduced by that input library.

VERIFICATION_CRITERIA:

Check literal infeasible/unbounded/optimal LP and MIP cases, column-only bounds, fractional objective constants and row permutations. Compare batch/incremental and serial/worker outcomes. Exercise exact certificates, invalid certificates, fallback and supported input/failure modes.

SOURCE:

demos/ppl_lpsol/ppl_lpsol.c; demos/ppl_lpsol/exact_lp.c; demos/ppl_lpsol/check_bounds_test.sh; demos/ppl_lpsol/check_objective_test.sh; demos/ppl_lpsol/exactlp1.c.

PPL-SPEC-001706
2. Parametric integer solver command protocol
UID: PPL-SPEC-001706
STATUS: APPROVED
COMPONENT: COMMAND_LINE_TOOLS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis, Inspection
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

With its PPL backend, ppl_pips shall accept the documented PolyLib format or selected PipLib format, preserving the integer constraints, context, variable/parameter split and designated big-parameter convention. In ordinary single-solve output mode, successful completion within native arithmetic and resource preconditions shall display the PIP solution tree: case guards select parameter regions and leaves describe the lexicographically least feasible integer variables; bottom denotes infeasibility. Benchmark iteration mode need not print a solution tree.

Both input formats shall reject a problem that declares more than 65536 variables and parameters in total with no matrix row listing them. Any constraint row shall count for all declared variables and parameters; any context row shall count for the parameters only. This input limit shall apply to the command's parsers.

Where semantic checking is configured, a reference shall be checked against the interpreted problem and computed tree. Failed reference checks shall not publish a verified result or overwrite the requested result output. Malformed or incomplete input and supported failures shall produce diagnostics distinct from a completed mathematical result. Options and available checking capability shall be identified by the configured command interface.

RATIONALE:

Lexicographic parametric solutions are functions of the declared parameters, so format interpretation and guarded output must agree.

COMMENT:

LANGUAGE is omitted because this is a language-neutral external protocol and artifact contract; it contains no implementation-language source.

INTERFACE:

Executable ppl_pips: documented options and input/output selection; --help defines the available switches. Default input is PolyLib format; the PipLib selection uses its documented index convention. Ordinary output is the textual PIP solution tree. Optional --check selects a reference-based semantic check and its documented distinct result statuses, requiring the configured checking dependency.

VERIFICATION_CRITERIA:

Check both parsers, context and equality handling, concrete parameter instances, infeasible leaves and literal expected trees. Check malformed/truncated input, reference mismatch and output isolation, parser bounds, declarations at and above the limit with and without context rows, benchmark mode and checking-disabled diagnostics.

SOURCE:

demos/ppl_pips/ppl_pips.cc; demos/ppl_pips/ppl_pips_check.cc; demos/ppl_pips/check_parser.sh; demos/ppl_pips/check_semantics.sh; demos/ppl_pips/check_pips_captures.sh; demos/ppl_pips/check_piplib_examples.sh.

PPL-SPEC-001734
3. Polyhedral conversion command protocol
UID: PPL-SPEC-001734
STATUS: APPROVED
COMPONENT: COMMAND_LINE_TOOLS
APPLICABILITY: ALL
VERIFICATION_METHODS: Test, Analysis, Inspection
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

With the PPL backend, ppl_lcdd shall interpret its supported cdd-style H or V representation and, on successful conversion within configured arithmetic and resource limits, emit the opposite representation of the same polyhedron. Input shall recognize representation selection, pre-begin linearity indices, row/column counts (including the supported unknown-row-count marker), number type, coefficient rows and end. Integer and rational coefficients shall keep their exact values; real input denotes the rational value obtained from the parsed host floating-point value. Rational row normalization shall preserve the represented constraints or generators. Invalid or incomplete input and output failures shall be reported distinctly from completed conversion.

The advertised build-specific options shall select input/output paths, supported CPU/memory limits, optional timing/verbose diagnostics, version/help and optional reference checking. Serial output-file mode appends; threaded named-input mode uses the output directory and pathname rule of 🔗 1. Native output pathname construction for polyhedral conversion. Standard input/output defaults and build-specific checking restrictions shall be those printed by --help. CPU-time and address-space limit availability shall be determined independently. Requests for an unavailable limit shall fail with a diagnostic before reading input. Supported limits shall accept zero to leave the inherited limit unchanged, reject malformed or unrepresentable values, and keep any stricter inherited limit. CPU expiration shall report TIMEOUT on standard error with status 124 to identify incomplete conversion.

RATIONALE:

A valid conversion result depends on matrix interpretation and completed computation, while diagnostics must distinguish malformed input and interrupted work.

COMMENT:

LANGUAGE is omitted because this contract specifies a command protocol rather than an implementation-language interface.

INTERFACE:

Executable ppl_lcdd with the PPL backend: --help defines supported options and serial/threaded filename arity. Input and output use the accepted cdd-style matrix representation; diagnostic/timing streams are separate from ordinary numerical output. Optional comparison backends retain their own supported formats, resource limits and arithmetic assumptions.

VERIFICATION_CRITERIA:

Convert empty, bounded and unbounded polyhedra in both directions and compare reconstructed mathematical sets. Exercise integer/rational/real rows, linearity, unknown row counts, malformed/truncated input, nonexistent files, output errors and supported resource interruption. Check that advertised limits allow the expected conversion on a small example and that unsupported limit requests report unavailability before opening a nonexistent input. Check named and stdin output paths and supported serial/reference and threaded execution modes.

SOURCE:

demos/ppl_lcdd/ppl_lcdd.cc; demos/ppl_lcdd/check_named_output.sh; demos/ppl_lcdd/check_stdin_output.sh; demos/ppl_lcdd/check_examples.sh.