Class DebuggingProverEnvironment
java.lang.Object
org.sosy_lab.java_smt.delegate.debugging.DebuggingProverEnvironment
- All Implemented Interfaces:
AutoCloseable,BasicProverEnvironment<Void>,ProverEnvironment
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.sosy_lab.java_smt.api.BasicProverEnvironment
BasicProverEnvironment.AllSatCallback<R> -
Field Summary
Fields inherited from interface org.sosy_lab.java_smt.api.BasicProverEnvironment
NO_MODEL_HELP -
Constructor Summary
ConstructorsConstructorDescriptionDebuggingProverEnvironment(BasicProverEnvironment<Void> pDelegate, org.sosy_lab.java_smt.delegate.debugging.DebuggingAssertions pDebugging) -
Method Summary
Modifier and TypeMethodDescriptionaddConstraint(BooleanFormula constraint) Add a constraint to the latest backtracking point.<R> RallSat(BasicProverEnvironment.AllSatCallback<R> callback, List<BooleanFormula> important) Get all satisfying assignments of the current environment with regard to a subset of terms, and create a region representing all those models.voidclose()Closes the prover environment.getModel()Get a satisfying assignment.Get an unsat core.booleanisUnsat()Check whether the conjunction of all formulas on the stack is unsatisfiable.booleanisUnsatWithAssumptions(Collection<BooleanFormula> assumptions) Check whether the conjunction of all formulas on the stack together with the list of assumptions is satisfiable.voidpop()Remove one backtracking point/level from the current stack.voidpush()Create a new backtracking point, i.e., a new level on the assertion stack.intsize()Get the number of backtracking points/levels on the current stack.unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions) Returns an UNSAT core (if it exists, otherwiseOptional.empty()), over the chosen assumptions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sosy_lab.java_smt.api.BasicProverEnvironment
addConstraint, allSat, close, getEvaluator, getModel, getModelAssignments, getStatistics, getUnsatCore, isUnsat, isUnsatWithAssumptions, pop, push, push, registerUserPropagator, size, unsatCoreOverAssumptions
-
Constructor Details
-
DebuggingProverEnvironment
public DebuggingProverEnvironment(BasicProverEnvironment<Void> pDelegate, org.sosy_lab.java_smt.delegate.debugging.DebuggingAssertions pDebugging)
-
-
Method Details
-
pop
public void pop()Description copied from interface:BasicProverEnvironmentRemove one backtracking point/level from the current stack. This removes the latest level including all of its formulas, i.e., all formulas that were added for this backtracking point.- Specified by:
popin interfaceBasicProverEnvironment<T>
-
addConstraint
Description copied from interface:BasicProverEnvironmentAdd a constraint to the latest backtracking point.- Specified by:
addConstraintin interfaceBasicProverEnvironment<T>- Throws:
InterruptedException
-
push
Description copied from interface:BasicProverEnvironmentCreate a new backtracking point, i.e., a new level on the assertion stack. Each level can hold several asserted formulas.If formulas are added before creating the first backtracking point, they can not be removed via a POP-operation.
- Specified by:
pushin interfaceBasicProverEnvironment<T>- Throws:
InterruptedException
-
size
public int size()Description copied from interface:BasicProverEnvironmentGet the number of backtracking points/levels on the current stack.Caution: This is the number of PUSH-operations, and not necessarily equal to the number of asserted formulas. On any level there can be an arbitrary number of asserted formulas. Even with size of 0, formulas can already be asserted (at bottom level).
- Specified by:
sizein interfaceBasicProverEnvironment<T>
-
isUnsat
Description copied from interface:BasicProverEnvironmentCheck whether the conjunction of all formulas on the stack is unsatisfiable.- Specified by:
isUnsatin interfaceBasicProverEnvironment<T>- Throws:
SolverExceptionInterruptedException
-
isUnsatWithAssumptions
public boolean isUnsatWithAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException Description copied from interface:BasicProverEnvironmentCheck whether the conjunction of all formulas on the stack together with the list of assumptions is satisfiable.- Specified by:
isUnsatWithAssumptionsin interfaceBasicProverEnvironment<T>- Parameters:
assumptions- A list of literals.- Throws:
SolverExceptionInterruptedException
-
getModel
Description copied from interface:BasicProverEnvironmentGet a satisfying assignment. This method should be called only immediately after anBasicProverEnvironment.isUnsat()call that returnedfalse. The returned model is guaranteed to stay constant and valid as long as the solver context is available, even if constraints are added to, pushed or popped from the prover stack.A model might contain additional symbols with their evaluation, if a solver uses its own temporary symbols. There should be at least a value-assignment for each free symbol.
- Specified by:
getModelin interfaceBasicProverEnvironment<T>- Throws:
SolverException
-
getUnsatCore
Description copied from interface:BasicProverEnvironmentGet an unsat core. This should be called only immediately after anBasicProverEnvironment.isUnsat()call that returnedfalse.- Specified by:
getUnsatCorein interfaceBasicProverEnvironment<T>
-
unsatCoreOverAssumptions
public Optional<List<BooleanFormula>> unsatCoreOverAssumptions(Collection<BooleanFormula> assumptions) throws SolverException, InterruptedException Description copied from interface:BasicProverEnvironmentReturns an UNSAT core (if it exists, otherwiseOptional.empty()), over the chosen assumptions. Does NOT require theSolverContext.ProverOptions.GENERATE_UNSAT_COREoption to work.- Specified by:
unsatCoreOverAssumptionsin interfaceBasicProverEnvironment<T>- Parameters:
assumptions- Selected assumptions- Returns:
- Empty optional if the constraints with assumptions are satisfiable, subset of assumptions which is unsatisfiable with the original constraints otherwise.
- Throws:
SolverExceptionInterruptedException
-
close
public void close()Description copied from interface:BasicProverEnvironmentCloses the prover environment. The object should be discarded, and should not be used after closing. The first call of this method will close the prover instance, further calls are ignored.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBasicProverEnvironment<T>
-
allSat
public <R> R allSat(BasicProverEnvironment.AllSatCallback<R> callback, List<BooleanFormula> important) throws InterruptedException, SolverException Description copied from interface:BasicProverEnvironmentGet all satisfying assignments of the current environment with regard to a subset of terms, and create a region representing all those models.- Specified by:
allSatin interfaceBasicProverEnvironment<T>important- A set of (positive) variables appearing in the asserted queries. Only these variables will appear in the region.- Returns:
- A region representing all satisfying models of the formula.
- Throws:
InterruptedExceptionSolverException
-