public class ReusableStackTheoremProver extends Object implements ProverEnvironment
ProverEnvironment.AllSatCallback<T>| Constructor and Description |
|---|
ReusableStackTheoremProver(ProverEnvironment pDelegate) |
| Modifier and Type | Method and Description |
|---|---|
Void |
addConstraint(BooleanFormula pConstraint)
Add constraint to the context.
|
<T> T |
allSat(ProverEnvironment.AllSatCallback<T> 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> 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.
|
Optional<List<BooleanFormula>> |
unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions)
Returns an UNSAT core (if it exists, otherwise
Optional.absent()),
over the chosen assumptions. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getModel, getModelAssignments, isUnsat, pop, push, pushpublic ReusableStackTheoremProver(ProverEnvironment pDelegate)
public Void addConstraint(BooleanFormula pConstraint)
BasicProverEnvironmentaddConstraint in interface BasicProverEnvironment<Void>public List<BooleanFormula> getUnsatCore()
ProverEnvironmentBasicProverEnvironment.isUnsat() call
that returned false.getUnsatCore in interface ProverEnvironmentpublic <T> T allSat(ProverEnvironment.AllSatCallback<T> callback, List<BooleanFormula> important) throws InterruptedException, SolverException
ProverEnvironmentallSat in interface ProverEnvironmentimportant - A set of variables appearing in f.
Only these variables will appear in the region.InterruptedExceptionSolverExceptionpublic boolean isUnsatWithAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException
ProverEnvironmentisUnsatWithAssumptions in interface ProverEnvironmentassumptions - A list of literals.SolverExceptionInterruptedExceptionpublic Optional<List<BooleanFormula>> unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException
ProverEnvironmentOptional.absent()),
over the chosen assumptions.
Does NOT require the SolverContext.ProverOptions.GENERATE_UNSAT_CORE option to work.unsatCoreOverAssumptions in interface ProverEnvironmentassumptions - Selected assumptionsSolverExceptionInterruptedExceptionpublic boolean isUnsat()
throws SolverException,
InterruptedException
BasicProverEnvironmentisUnsat in interface BasicProverEnvironment<T>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.getModel in interface BasicProverEnvironment<T>SolverExceptionpublic ImmutableList<Model.ValueAssignment> getModelAssignments() throws SolverException
BasicProverEnvironmentImmutableList.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 void close()
BasicProverEnvironmentclose in interface AutoCloseableclose in interface BasicProverEnvironment<T>