public class BasicProverWithAssumptionsWrapper<T,P extends BasicProverEnvironment<T>> extends Object implements BasicProverEnvironment<T>
BasicProverEnvironment.AllSatCallback<R>| Modifier and Type | Field and Description |
|---|---|
protected P |
delegate |
protected List<BooleanFormula> |
solverAssumptionsAsFormula |
NO_MODEL_HELP| Modifier and Type | Method and Description |
|---|---|
T |
addConstraint(BooleanFormula constraint)
Add constraint to the context.
|
<R> R |
allSat(BasicProverEnvironment.AllSatCallback<R> pCallback,
List<BooleanFormula> pImportant)
Get all satisfying assignments of the current environment with regards to a subset of terms,
and create a region representing all those models.
|
protected void |
clearAssumptions() |
void |
close()
Closes the prover environment.
|
Model |
getModel()
Get a satisfying assignment.
|
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.
|
protected void |
registerPushedFormula(T pPushResult)
overridden in sub-class.
|
Optional<List<BooleanFormula>> |
unsatCoreOverAssumptions(Collection<BooleanFormula> pAssumptions)
Returns an UNSAT core (if it exists, otherwise
Optional.empty()), over the chosen
assumptions. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpushprotected final P extends BasicProverEnvironment<T> delegate
protected final List<BooleanFormula> solverAssumptionsAsFormula
protected void clearAssumptions()
public void pop()
BasicProverEnvironmentpop in interface BasicProverEnvironment<T>public T addConstraint(BooleanFormula constraint) throws InterruptedException
BasicProverEnvironmentaddConstraint in interface BasicProverEnvironment<T>InterruptedExceptionpublic void push()
BasicProverEnvironmentpush in interface BasicProverEnvironment<T>public boolean isUnsat()
throws SolverException,
InterruptedException
BasicProverEnvironmentisUnsat in interface BasicProverEnvironment<T>SolverExceptionInterruptedExceptionpublic boolean isUnsatWithAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException
BasicProverEnvironmentisUnsatWithAssumptions in interface BasicProverEnvironment<T>assumptions - A list of literals.SolverExceptionInterruptedExceptionprotected void registerPushedFormula(T pPushResult)
public Model getModel() throws SolverException
BasicProverEnvironmentBasicProverEnvironment.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.getModel in interface BasicProverEnvironment<T>SolverExceptionpublic ImmutableList<Model.ValueAssignment> getModelAssignments() throws SolverException
BasicProverEnvironment
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 BasicProverEnvironment.getModel() (depending on the solver).
getModelAssignments in interface BasicProverEnvironment<T>SolverExceptionpublic List<BooleanFormula> getUnsatCore()
BasicProverEnvironmentBasicProverEnvironment.isUnsat() call that
returned false.getUnsatCore in interface BasicProverEnvironment<T>public Optional<List<BooleanFormula>> unsatCoreOverAssumptions(Collection<BooleanFormula> pAssumptions) throws SolverException, InterruptedException
BasicProverEnvironmentOptional.empty()), over the chosen
assumptions. Does NOT require the SolverContext.ProverOptions.GENERATE_UNSAT_CORE option to work.unsatCoreOverAssumptions in interface BasicProverEnvironment<T>pAssumptions - Selected assumptionsSolverExceptionInterruptedExceptionpublic void close()
BasicProverEnvironmentclose in interface AutoCloseableclose in interface BasicProverEnvironment<T>public <R> R allSat(BasicProverEnvironment.AllSatCallback<R> pCallback, List<BooleanFormula> pImportant) throws InterruptedException, SolverException
BasicProverEnvironmentallSat in interface BasicProverEnvironment<T>pImportant - A set of variables appearing in f. Only these variables will appear in the
region.InterruptedExceptionSolverException