public class ReusableStackTheoremProver extends Object implements ProverEnvironment
BasicProverEnvironment.AllSatCallback<R>NO_MODEL_HELP| Constructor and Description |
|---|
ReusableStackTheoremProver(ProverEnvironment pDelegate) |
| Modifier and Type | Method and Description |
|---|---|
Void |
addConstraint(BooleanFormula pConstraint)
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.
|
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> pAssumptions)
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.
|
Optional<List<BooleanFormula>> |
unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions)
Returns an UNSAT core (if it exists, otherwise
Optional.empty()), over the chosen
assumptions. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallSat, close, getModel, getModelAssignments, getUnsatCore, isUnsat, isUnsatWithAssumptions, pop, push, push, unsatCoreOverAssumptionspublic ReusableStackTheoremProver(ProverEnvironment pDelegate)
public Void addConstraint(BooleanFormula pConstraint) throws InterruptedException
BasicProverEnvironmentaddConstraint in interface BasicProverEnvironment<Void>InterruptedExceptionpublic boolean isUnsat()
throws SolverException,
InterruptedException
BasicProverEnvironmentisUnsat in interface BasicProverEnvironment<T>SolverExceptionInterruptedExceptionpublic boolean isUnsatWithAssumptions(Collection<BooleanFormula> pAssumptions) throws SolverException, InterruptedException
BasicProverEnvironmentisUnsatWithAssumptions in interface BasicProverEnvironment<T>pAssumptions - A list of literals.SolverExceptionInterruptedExceptionpublic final void push()
BasicProverEnvironmentpush in interface BasicProverEnvironment<T>public void pop()
BasicProverEnvironmentpop in interface BasicProverEnvironment<T>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> assumptions) 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>assumptions - Selected assumptionsSolverExceptionInterruptedExceptionpublic void close()
BasicProverEnvironmentclose in interface AutoCloseableclose in interface BasicProverEnvironment<T>public <R> R allSat(BasicProverEnvironment.AllSatCallback<R> callback, List<BooleanFormula> important) throws InterruptedException, SolverException
BasicProverEnvironmentallSat in interface BasicProverEnvironment<T>important - A set of variables appearing in f. Only these variables will appear in the
region.InterruptedExceptionSolverException