public interface BasicProverEnvironment<T> extends AutoCloseable
ProverEnvironment and InterpolatingProverEnvironment that
provides only the common operations. In most cases, just use one of the two sub-interfaces| Modifier and Type | Interface and Description |
|---|---|
static interface |
BasicProverEnvironment.AllSatCallback<R>
|
| Modifier and Type | Field and Description |
|---|---|
static String |
NO_MODEL_HELP |
| Modifier and Type | Method and Description |
|---|---|
T |
addConstraint(BooleanFormula constraint)
Add constraint to the context.
|
<R> R |
allSat(BasicProverEnvironment.AllSatCallback<R> callback,
List<BooleanFormula> important)
Get all satisfying assignments of the current environment with regards to a subset of terms,
and create a region representing all those models.
|
void |
close()
Closes the prover environment.
|
Model |
getModel()
Get a satisfying assignment.
|
default ImmutableList<Model.ValueAssignment> |
getModelAssignments()
Get a list of satisfying assignments.
|
List<BooleanFormula> |
getUnsatCore()
Get an unsat core.
|
boolean |
isUnsat()
Check whether the conjunction of all formulas on the stack is unsatisfiable.
|
boolean |
isUnsatWithAssumptions(Collection<BooleanFormula> assumptions)
Check whether the conjunction of all formulas on the stack together with the list of
assumptions is satisfiable.
|
void |
pop()
Remove one formula from the environment stack.
|
void |
push()
Create backtracking point.
|
default T |
push(BooleanFormula f)
Push a backtracking point and add a formula to the environment stack, asserting it.
|
Optional<List<BooleanFormula>> |
unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions)
Returns an UNSAT core (if it exists, otherwise
Optional.empty()), over the chosen
assumptions. |
static final String NO_MODEL_HELP
@CanIgnoreReturnValue default T push(BooleanFormula f) throws InterruptedException
InterruptedExceptionvoid pop()
@CanIgnoreReturnValue T addConstraint(BooleanFormula constraint) throws InterruptedException
InterruptedExceptionvoid push()
boolean isUnsat()
throws SolverException,
InterruptedException
SolverExceptionInterruptedExceptionboolean isUnsatWithAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException
assumptions - A list of literals.SolverExceptionInterruptedExceptionModel getModel() throws SolverException
isUnsat()
call that returned false. A model might contain additional symbols with their
evaluation, if a solver uses its own temporary symbols. There should be at least an
value-assignment for each free symbol.SolverExceptiondefault ImmutableList<Model.ValueAssignment> getModelAssignments() throws SolverException
ImmutableList.copyOf(getModel()), but removes the need for calling Model.close().
Note that if you need to iterate multiple times over the model it may be more efficient to
use this method instead of getModel() (depending on the solver).
SolverExceptionList<BooleanFormula> getUnsatCore()
isUnsat() call that
returned false.Optional<List<BooleanFormula>> unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException
Optional.empty()), over the chosen
assumptions. Does NOT require the SolverContext.ProverOptions.GENERATE_UNSAT_CORE option to work.assumptions - Selected assumptionsSolverExceptionInterruptedExceptionvoid close()
close in interface AutoCloseable<R> R allSat(BasicProverEnvironment.AllSatCallback<R> callback, List<BooleanFormula> important) throws InterruptedException, SolverException
important - A set of variables appearing in f. Only these variables will appear in the
region.InterruptedExceptionSolverException