public class LoggingOptEnvironment extends Object implements OptEnvironment
OptEnvironment.OptStatus| Constructor and Description |
|---|
LoggingOptEnvironment(LogManager logger,
OptEnvironment oe) |
| Modifier and Type | Method and Description |
|---|---|
Void |
addConstraint(BooleanFormula constraint)
Add constraint to the context.
|
OptEnvironment.OptStatus |
check()
Optimize the objective function subject to the previously
imposed constraints.
|
void |
close()
Closes the prover environment.
|
String |
dump() |
<T extends Formula> |
evaluate(T f)
Evaluate the formula with the previously generated model.
|
Model |
getModel()
Get a satisfying assignment.
|
boolean |
isUnsat()
Check whether the conjunction of all formulas on the stack is unsatisfiable.
|
Optional<Rational> |
lower(int handle,
Rational epsilon) |
int |
maximize(Formula objective)
Add the maximization
objective. |
int |
minimize(Formula objective)
Add minimization
objective. |
void |
pop()
Remove one formula from the environment stack.
|
void |
push()
Create backtracking point.
|
Void |
push(BooleanFormula f)
Push a backtracking point and
add a formula to the environment stack, asserting it.
|
Optional<Rational> |
upper(int handle,
Rational epsilon) |
public LoggingOptEnvironment(LogManager logger, OptEnvironment oe)
public Void addConstraint(BooleanFormula constraint)
BasicProverEnvironmentaddConstraint in interface BasicProverEnvironment<Void>public int maximize(Formula objective)
OptEnvironmentobjective.
Note: push/pop may be used for switching objectivesmaximize in interface OptEnvironmentpublic int minimize(Formula objective)
OptEnvironmentobjective.
Note: push/pop may be used for switching objectivesminimize in interface OptEnvironmentpublic OptEnvironment.OptStatus check() throws InterruptedException, SolverException
OptEnvironmentcheck in interface OptEnvironmentInterruptedExceptionSolverExceptionpublic void push()
BasicProverEnvironmentpush in interface BasicProverEnvironment<Void>public boolean isUnsat()
throws SolverException,
InterruptedException
BasicProverEnvironmentisUnsat in interface BasicProverEnvironment<Void>SolverExceptionInterruptedException@Nullable public Void push(BooleanFormula f)
BasicProverEnvironmentpush in interface BasicProverEnvironment<Void>public void pop()
BasicProverEnvironmentpop in interface BasicProverEnvironment<Void>public Optional<Rational> upper(int handle, Rational epsilon)
upper in interface OptEnvironmentepsilon - Value to substitute for the epsilon.public Optional<Rational> lower(int handle, Rational epsilon)
lower in interface OptEnvironmentepsilon - Value to substitute for the epsilon.public Model getModel() throws SolverException
BasicProverEnvironmentBasicProverEnvironment.isUnsat() call
that returned false.getModel in interface BasicProverEnvironment<Void>SolverExceptionpublic <T extends Formula> T evaluate(T f)
BasicProverEnvironmentBasicProverEnvironment.getModel().
// TODO: provide a default for non-Z3 solvers.evaluate in interface BasicProverEnvironment<Void>public void close()
BasicProverEnvironmentclose in interface AutoCloseableclose in interface BasicProverEnvironment<Void>public String dump()
dump in interface OptEnvironment