module Ppl_ocaml_globals:sig..end
PPL interface types and operations shared by all configurations.
Coefficients are Zarith Z.t values. Native domain and solver handles are
managed by the OCaml garbage collector; they have no public deletion
function. Borrowed PIP and powerset views retain their owners but remain
subject to the documented mutation and invalidation rules.
The configured Ppl_ocaml module adds the selected numerical-domain API.
See the interface overview and
domain operation contracts for
native lifetimes, dimensions, result conventions and approximation rules.
exception PPL_arithmetic_overflow of string
A native arithmetic-overflow report with its diagnostic message.
exception PPL_domain_error of string
A native mathematical-domain error with its diagnostic message.
exception PPL_length_error of string
A native size or dimension-limit error with its diagnostic message.
exception PPL_logic_error of string
A native logic error with its diagnostic message. Invalid arguments, domain errors and size errors have their more specific translations.
exception PPL_timeout_exception
A native time-based or deterministic work-limit interruption.
exception PPL_internal_error of string
A native runtime-error report with its diagnostic message.
exception PPL_unknown_standard_exception of string
A native standard exception not covered by a more specific binding translation.
exception PPL_unexpected_error of string
An unexpected non-standard native exception with a diagnostic message.
type degenerate_element =
| |
Universe |
| |
Empty |
Selects the universe or empty value for a domain constructor.
type linear_expression =
| |
Variable of |
| |
Coefficient of |
| |
Unary_Plus of |
| |
Unary_Minus of |
| |
Plus of |
| |
Minus of |
| |
Times of |
An affine expression with integral Z.t coefficients and zero-based
coordinate indices. Times multiplies an expression by an integral
coefficient.
type linear_constraint =
| |
Less_Than of |
| |
Less_Or_Equal of |
| |
Equal of |
| |
Greater_Than of |
| |
Greater_Or_Equal of |
An equality or strict/non-strict inequality between affine expressions. Each operation determines which constraint forms it admits.
type linear_generator =
| |
Line of |
| |
Ray of |
| |
Point of |
| |
Closure_Point of |
A line, ray, point or closure point. Points and closure points represent the expression coordinates divided by their nonzero divisor. Native generator validity rules apply.
type linear_grid_generator =
| |
Grid_Line of |
| |
Grid_Parameter of |
| |
Grid_Point of |
A grid line, parameter or point. Grid parameters and points use the supplied nonzero rational divisor; native validity rules apply.
type poly_gen_relation =
| |
Subsumes |
A native relation flag between a domain value and a generator.
type poly_con_relation =
| |
Is_Disjoint |
| |
Strictly_Intersects |
| |
Is_Included |
| |
Saturates |
Native relation flags between a domain value and a constraint. Query results are lists of the applicable flags.
type relation_with_congruence =
| |
Is_Disjoint |
| |
Strictly_Intersects |
| |
Is_Included |
Native relation flags between a domain value and a congruence.
typelinear_congruence =linear_expression * linear_expression *
Z.t
(left, right, modulus) represents equality of the two expressions modulo
the modulus; zero modulus denotes an equality.
typeconstraint_system =linear_constraint list
An OCaml list of constraints. Lists do not carry a separate ambient-dimension field.
typegenerator_system =linear_generator list
An OCaml list of generators. Coordinate dimensions are carried by the contained expressions.
typegrid_generator_system =linear_grid_generator list
An OCaml list of grid generators.
typecongruence_system =linear_congruence list
An OCaml list of congruences.
type relation_symbol =
| |
Less_Than_RS |
| |
Less_Or_Equal_RS |
| |
Equal_RS |
| |
Greater_Than_RS |
| |
Greater_Or_Equal_RS |
A relation selector for generalized affine operations. The _RS suffix
distinguishes these constructors from constraint constructors.
type bounded_integer_type_overflow =
| |
Overflow_Wraps |
| |
Overflow_Undefined |
| |
Overflow_Impossible |
The native wrapping, undefined-overflow or impossible-overflow policy used
by wrap_assign operations.
type bounded_integer_type_representation =
| |
Unsigned |
| |
Signed_2_Complement |
Selects unsigned or signed two-complement integer representation.
type bounded_integer_type_width =
| |
Bits_8 |
| |
Bits_16 |
| |
Bits_32 |
| |
Bits_64 |
| |
Bits_128 |
Selects the machine-integer bit width for a wrapping operation.
type complexity_class =
| |
Polynomial_Complexity |
| |
Simplex_Complexity |
| |
Any_Complexity |
Selects polynomial, simplex or unrestricted native complexity. A policy does not make an approximate domain operation exact.
type optimization_mode =
| |
Minimization |
| |
Maximization |
Selects minimization or maximization of a linear objective.
type mip_problem_status =
| |
Unfeasible_Mip_Problem |
| |
Unbounded_Mip_Problem |
| |
Optimized_Mip_Problem |
The infeasible, unbounded-objective or finite-optimized outcome of an MIP solve.
type control_parameter_name =
| |
Pricing |
Selects the MIP pricing control-parameter family.
type control_parameter_value =
| |
Pricing_Steepest_Edge_Float |
| |
Pricing_Steepest_Edge_Exact |
| |
Pricing_Textbook |
Selects a supported native MIP pricing strategy.
type pip_problem_status =
| |
Unfeasible_Pip_Problem |
| |
Optimized_Pip_Problem |
The infeasible or solved outcome of a parametric integer problem.
type pip_problem_control_parameter_name =
| |
Cutting_Strategy |
| |
Pivot_Row_Strategy |
Selects the PIP cutting-strategy or pivot-row-strategy family.
type pip_problem_control_parameter_value =
| |
Cutting_Strategy_First |
| |
Cutting_Strategy_Deepest |
| |
Cutting_Strategy_All |
| |
Pivot_Row_Strategy_First |
| |
Pivot_Row_Strategy_Max_Column |
Selects a supported native PIP cutting or pivot strategy.
val ppl_version_major : unit -> intReturns the major component of the native PPL version.
val ppl_version_minor : unit -> intReturns the minor component of the native PPL version.
val ppl_version_revision : unit -> intReturns the revision component of the native PPL version.
val ppl_version_beta : unit -> intReturns the prerelease component of the native PPL version.
val ppl_version : unit -> stringReturns the complete native PPL version string. Check it against the versions supported by the application.
: unit -> stringReturns native version, licensing, build and project-contact information.
val ppl_io_wrap_string : string -> int -> int -> int -> stringppl_io_wrap_string text indent first_width later_width wraps text with
the requested indentation and preferred first/subsequent line widths,
using the native wrapping policy.
val ppl_max_space_dimension : unit -> intReturns the native maximum supported ambient dimension. Individual domains and operations can impose smaller limits.
val ppl_Coefficient_bits : unit -> intReturns the native coefficient bit width, or zero for an unbounded coefficient type.
val ppl_Coefficient_is_bounded : unit -> boolTests whether the native coefficient type has finite bounds. OCaml
coefficients are represented by Z.t independently of this native limit.
val ppl_Coefficient_max : unit -> Z.tReturns the largest native coefficient. Requires a bounded native
coefficient type; query ppl_Coefficient_is_bounded first.
val ppl_Coefficient_min : unit -> Z.tReturns the smallest native coefficient. Requires a bounded native
coefficient type; query ppl_Coefficient_is_bounded first.
val ppl_Linear_Expression_is_zero : linear_expression -> boolTests whether the complete affine expression, including its constant term, is zero.
val ppl_Linear_Expression_all_homogeneous_terms_are_zero : linear_expression -> boolTests whether all variable coefficients are zero. The constant term can be nonzero.
val ppl_set_rounding_for_PPL : unit -> unitSets the floating-point rounding direction required by the native PPL. Use the rounding and synchronization rules in the interface manual.
val ppl_restore_pre_PPL_rounding : unit -> unitRestores the floating-point rounding direction saved before native PPL initialization. Restore PPL rounding before subsequent computations that require it.
val ppl_irrational_precision : unit -> intReturns the native precision parameter used for rational approximations of irrational computations.
val ppl_set_irrational_precision : int -> unitSets that native precision parameter to the supplied nonnegative integer. The native admissibility and approximation rules apply.
val ppl_set_timeout : int -> unitRequests interruption after the supplied positive number of centiseconds.
Interrupted PPL work raises PPL_timeout_exception; native watchdog
availability and timing rules apply. Replaces an existing time-based
limit.
val ppl_reset_timeout : unit -> unitCancels the active time-based PPL timeout.
val ppl_set_deterministic_timeout : int -> int -> unitppl_set_deterministic_timeout weight scale requests interruption after
the native work threshold weight * 2^scale. Both arguments must satisfy
the native unsigned-range requirements. Replaces an existing deterministic
limit.
val ppl_reset_deterministic_timeout : unit -> unitCancels the active deterministic PPL timeout.
type mip_problem
An owned native MIP problem managed by the OCaml garbage collector.
val ppl_new_MIP_Problem_from_space_dimension : int -> mip_problemCreates a garbage-collected MIP problem with the given dimension, no constraints or integer coordinates, zero objective and maximization mode.
val ppl_new_MIP_Problem : int ->
constraint_system ->
linear_expression ->
optimization_mode -> mip_problemppl_new_MIP_Problem dimension constraints objective mode creates an
owned MIP problem. All rows and the objective must fit the ambient space.
Initially no coordinates are constrained to be integral; use
ppl_MIP_Problem_add_to_integer_space_dimensions for integrality.
val ppl_MIP_Problem_space_dimension : mip_problem -> intReturns the ambient dimension of the MIP problem.
val ppl_MIP_Problem_integer_space_dimensions : mip_problem -> int listReturns the indices of the coordinates currently required to be integral, as an independent OCaml list.
val ppl_MIP_Problem_constraints : mip_problem -> constraint_systemReturns an independent OCaml copy of the constraint system. Modifying the returned OCaml data does not update the problem.
val ppl_MIP_Problem_add_space_dimensions_and_embed : mip_problem -> int -> unitAdds the requested nonnegative number of unconstrained coordinates, preserving the old problem on its original coordinates.
val ppl_MIP_Problem_add_to_integer_space_dimensions : mip_problem -> int list -> unitRequires the listed existing coordinates to take integer values. Existing integrality requirements are retained.
val ppl_MIP_Problem_add_constraint : mip_problem -> linear_constraint -> unitAdds one admissible MIP constraint to the problem. Its dimension must fit the ambient space; native MIP admission rules apply.
val ppl_MIP_Problem_add_constraints : mip_problem -> constraint_system -> unitAdds all constraints in the list, subject to the same admission and dimension rules as the single-constraint operation.
val ppl_MIP_Problem_set_objective_function : mip_problem -> linear_expression -> unitReplaces the objective with the supplied affine expression. The expression must fit the ambient space.
val ppl_MIP_Problem_is_satisfiable : mip_problem -> boolTests exact feasibility with the current constraints and integer-coordinate set. The native solver may update its cached state.
val ppl_MIP_Problem_solve : mip_problem -> mip_problem_statusSolves the current mixed-integer optimization problem and returns
Unfeasible_Mip_Problem, Unbounded_Mip_Problem or
Optimized_Mip_Problem.
val ppl_MIP_Problem_optimization_mode : mip_problem -> optimization_modeReturns the current minimization or maximization mode.
val ppl_MIP_Problem_feasible_point : mip_problem -> linear_generatorReturns an independent OCaml point witnessing feasibility. Requires a satisfiable problem; the native solver is queried for its feasible point.
val ppl_MIP_Problem_optimizing_point : mip_problem -> linear_generatorReturns an independent OCaml point attaining the optimum. Requires a problem with a finite optimum.
val ppl_MIP_Problem_objective_function : mip_problem -> linear_expressionReturns an independent OCaml representation of the current objective.
val ppl_MIP_Problem_optimal_value : mip_problem -> Z.t * Z.tReturns the exact finite optimum as (numerator, denominator). Requires a
problem with a finite optimum.
val ppl_MIP_Problem_evaluate_objective_function : mip_problem ->
linear_generator -> Z.t * Z.tEvaluates the objective at the supplied Point and returns the exact
rational value as (numerator, denominator). The point must be
dimension-compatible; rays, lines and closure points are not admitted.
val ppl_MIP_Problem_OK : mip_problem -> boolTests the native MIP representation invariants. This is a diagnostic query, not a feasibility or optimality test.
val ppl_MIP_Problem_clear : mip_problem -> unitResets the problem to the trivial zero-dimensional MIP problem.
val ppl_MIP_Problem_set_optimization_mode : mip_problem -> optimization_mode -> unitSelects minimization or maximization for subsequent optimization.
val ppl_MIP_Problem_set_control_parameter : mip_problem ->
control_parameter_value -> unitSelects the supplied native pricing strategy.
val ppl_MIP_Problem_get_control_parameter : mip_problem ->
control_parameter_name ->
control_parameter_valueReturns the current strategy for the requested control-parameter family.
val ppl_MIP_Problem_swap : mip_problem -> mip_problem -> unitExchanges the complete states of the two MIP problems. Their dimensions can differ.
val ppl_MIP_Problem_ascii_dump : mip_problem -> stringReturns the native ASCII diagnostic representation of the MIP problem.
type pip_problem
An owned native parametric integer problem managed by the OCaml garbage collector.
type pip_tree_node
A checked view of a PIP solution tree. Root and child handles retain
the owning problem, so they remain usable after its OCaml handle and
parent-node handles have been collected. Calls to problem mutators
invalidate all existing tree handles; swap invalidates both problems.
Even a no-op or failed update may invalidate handles. Any tree operation
on an invalidated handle raises Invalid_argument, including predicates
and operations on bottom handles. Obtain a new solution handle after
an update. Repeated solving queries without updates preserve handles.
typeartificial_parameter =linear_expression * Z.t
(expression, divisor) defines an artificial parameter by the native
integer floor-division convention. Tree-local parameters are interpreted
after inherited parameters.
val ppl_new_PIP_Problem_from_space_dimension : int -> pip_problemCreates a garbage-collected PIP problem of the given dimension, initially without constraints or parameter coordinates.
val ppl_new_PIP_Problem : int ->
constraint_system ->
int list -> pip_problemppl_new_PIP_Problem dimension constraints parameters creates an owned
parametric integer problem. The last argument lists parameter-coordinate
indices; all indices and constraints must fit the ambient space.
val ppl_PIP_Problem_space_dimension : pip_problem -> intReturns the ambient dimension of the PIP problem.
val ppl_PIP_Problem_parameter_space_dimensions : pip_problem -> int listReturns the parameter-coordinate indices as an independent OCaml list.
val ppl_PIP_Problem_constraints : pip_problem -> constraint_systemReturns an independent OCaml copy of the problem constraints.
val ppl_PIP_Problem_add_space_dimensions_and_embed : pip_problem -> int -> int -> unitppl_PIP_Problem_add_space_dimensions_and_embed problem variables
parameters adds the requested nonnegative numbers of decision-variable
and parameter coordinates. Existing tree views are invalidated as
described by pip_tree_node.
val ppl_PIP_Problem_add_to_parameter_space_dimensions : pip_problem -> int list -> unitAdds existing coordinates to the parameter set. Tree-view invalidation
follows pip_tree_node.
val ppl_PIP_Problem_add_constraint : pip_problem -> linear_constraint -> unitAdds an admissible PIP constraint fitting the ambient space. Tree-view
invalidation follows pip_tree_node.
val ppl_PIP_Problem_add_constraints : pip_problem -> constraint_system -> unitAdds the admissible PIP constraints in the list. Tree-view invalidation
follows pip_tree_node.
val ppl_PIP_Problem_is_satisfiable : pip_problem -> boolReturns true exactly for the native optimized status in the selected mode. A designated big parameter is treated as arbitrarily large. Infeasibility in that mode may coexist with feasibility at finite values outside the solver's sign assumptions. A solving query without an intervening update preserves existing tree views.
val ppl_PIP_Problem_solve : pip_problem -> pip_problem_statusSolves the parametric integer problem and returns Unfeasible_Pip_Problem
or Optimized_Pip_Problem. This query without updates preserves existing
tree views.
val ppl_PIP_Problem_solution : pip_problem -> pip_tree_nodeReturns a checked borrowed root of the native solution tree, retaining the
owner. A bottom handle denotes infeasibility in the selected mode.
A finite assignment used to interpret a tree must satisfy the initial
context and any big-parameter sign assumptions. Observe the lifetime
rules of pip_tree_node.
val ppl_PIP_Problem_optimizing_solution : pip_problem -> pip_tree_nodeReturns a checked borrowed root of the lexicographically optimizing
tree with the assignment scope and lifetime of ppl_PIP_Problem_solution.
val ppl_PIP_Problem_get_big_parameter_dimension : pip_problem -> intReturns the selected big-parameter coordinate. Raises Invalid_argument
when no big parameter has been selected; query
ppl_PIP_Problem_has_big_parameter_dimension first.
val ppl_PIP_Problem_set_big_parameter_dimension : pip_problem -> int -> unitSelects an admissible parameter coordinate as the native big parameter.
Tree-view invalidation follows pip_tree_node.
val ppl_PIP_Problem_has_big_parameter_dimension : pip_problem -> boolTests whether a big-parameter coordinate has been selected.
val ppl_PIP_Problem_OK : pip_problem -> boolTests the native PIP representation invariants. This does not solve the problem.
val ppl_PIP_Problem_clear : pip_problem -> unitResets the native problem and invalidates all existing tree views.
val ppl_PIP_Problem_set_control_parameter : pip_problem ->
pip_problem_control_parameter_value -> unitSets the cutting or pivot strategy selected by the supplied control value.
Tree-view invalidation follows pip_tree_node.
val ppl_PIP_Problem_get_control_parameter : pip_problem ->
pip_problem_control_parameter_name ->
pip_problem_control_parameter_valueReturns the value of the requested PIP control-parameter family.
val ppl_PIP_Problem_swap : pip_problem -> pip_problem -> unitExchanges the complete problem states and invalidates existing tree views from both problems. Dimensions can differ.
val ppl_PIP_Problem_ascii_dump : pip_problem -> stringReturns the native ASCII diagnostic representation of the PIP problem.
val ppl_PIP_Tree_Node_constraints : pip_tree_node -> constraint_systemReturns an independent OCaml copy of the constraints attached to a non-bottom node.
val ppl_PIP_Tree_Node_artificials : pip_tree_node ->
artificial_parameter listLocal artificial parameters in native introduction order. Their coordinate indices follow the original coordinates and inherited artificials.
val ppl_PIP_Tree_Node_ascii_dump : pip_tree_node -> stringReturns the diagnostic ASCII representation of a valid tree handle, including a valid bottom handle.
val ppl_PIP_Tree_Node_OK : pip_tree_node -> boolChecks the native node invariants; a valid bottom handle passes. Invalidated handles are rejected before this test.
val ppl_PIP_Tree_Node_is_bottom : pip_tree_node -> boolTests whether a valid handle denotes bottom. An invalidated handle raises
Invalid_argument instead.
val ppl_PIP_Tree_Node_is_solution : pip_tree_node -> boolTests whether a valid, non-bottom handle denotes a solution node. A valid bottom handle gives false; invalidated handles are rejected.
val ppl_PIP_Tree_Node_parametric_values : pip_tree_node -> int -> linear_expressionReturns an independent OCaml expression for the requested decision coordinate at a solution node. Requires a valid solution node and an admissible non-parameter coordinate. Expressions can refer to inherited and local artificial parameters.
val ppl_PIP_Tree_Node_is_decision : pip_tree_node -> boolTests whether a valid, non-bottom handle denotes a decision node. A valid bottom handle gives false; invalidated handles are rejected.
val ppl_PIP_Tree_Node_true_child : pip_tree_node -> pip_tree_nodeReturns a checked view of the true branch of a valid decision node. The
child independently retains the owning problem; observe pip_tree_node
lifetimes.
val ppl_PIP_Tree_Node_false_child : pip_tree_node -> pip_tree_nodeReturns a checked view of the false branch of a valid decision node. The
child independently retains the owning problem; observe pip_tree_node
lifetimes.
val ppl_is_mixed_integer_satisfiable : int -> constraint_system -> int list -> boolExact strict mixed-integer feasibility in an explicit ambient space. Inputs are preserved; out-of-space rows and integer indices are errors.