Interface OptimizationProverEnvironment
- All Superinterfaces:
AutoCloseable,BasicProverEnvironment<Void>
- All Known Implementing Classes:
DebuggingOptimizationProverEnvironment
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumStatus of the optimization problem.Nested classes/interfaces inherited from interface org.sosy_lab.java_smt.api.BasicProverEnvironment
BasicProverEnvironment.AllSatCallback<R> -
Field Summary
Fields inherited from interface org.sosy_lab.java_smt.api.BasicProverEnvironment
NO_MODEL_HELP -
Method Summary
Methods inherited from interface org.sosy_lab.java_smt.api.BasicProverEnvironment
addConstraint, allSat, close, getEvaluator, getModelAssignments, getStatistics, getUnsatCore, isUnsat, isUnsatWithAssumptions, pop, push, push, registerUserPropagator, size, unsatCoreOverAssumptions
-
Method Details
-
maximize
Add the maximizationobjective.Note:
push/popmay be used for switching objectives- Returns:
- Objective handle, to be used for retrieving the value.
-
minimize
Add minimizationobjective.Note:
push/popmay be used for switching objectives- Returns:
- Objective handle, to be used for retrieving the value.
-
check
Optimize the objective function subject to the previously imposed constraints.- Returns:
- Status of the optimization problem.
- Throws:
InterruptedExceptionSolverException
-
upper
- Parameters:
epsilon- Value to substitute for theepsilon.- Returns:
- Upper approximation of the optimized value, or absent optional if the objective is unbounded.
-
lower
- Parameters:
epsilon- Value to substitute for theepsilon.- Returns:
- Lower approximation of the optimized value, or absent optional if the objective is unbounded.
-
getModel
Get a satisfying assignment. This method should be called only immediately after anBasicProverEnvironment.isUnsat()call that returnedfalse. The returned model is guaranteed to stay constant and valid as long as the solver context is available, even if constraints are added to, pushed or popped from the prover stack.A model might contain additional symbols with their evaluation, if a solver uses its own temporary symbols. There should be at least a value-assignment for each free symbol.
Please note that the prover is allowed to use standard numbers for any real variable in the model after a sat-query returned
OptimizationProverEnvironment.OptStatus.OPT. For integer formulas, we expect the optimal assignment.Example 1: For the constraint 'x<10' with a real x, the upper bound of x is '10-epsilon' (epsilon can even be set to zero). The model can return the assignment x=9. To get an optimal assignment, query the solver with an additional constraint 'x == 10-epsilon'.
Example 2: For the constraint 'x<10' with an integer x, the upper bound of x is '9' (epsilon is irrelevant here and can be zero). The model returns the optimal assignment x=9.
- Specified by:
getModelin interfaceBasicProverEnvironment<Void>- Throws:
SolverException
-