Interface SolverContext
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractSolverContext,DebuggingSolverContext,LoggingSolverContext,StatisticsSolverContext,SynchronizedSolverContext
If you wish to use multiple contexts (even for the same solver), create one SolverContext per
each. Formulas can be transferred between different contexts using FormulaManager.translateFrom(BooleanFormula, FormulaManager).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumOptions for the prover environment. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the solver context.Get the formula manager, which is used for formula manipulation.Get solver name (MATHSAT5/Z3/etc...).default ImmutableMap<String,String> Get statistics for a complete solver context.Get version information out of the solver.Create a fresh newOptimizationProverEnvironmentwhich encapsulates an assertion stack and allows solving optimization queries.newProverEnvironment(SolverContext.ProverOptions... options) Create a fresh newProverEnvironmentwhich encapsulates an assertion stack and can be used to check formulas for unsatisfiability.Create a fresh newInterpolatingProverEnvironmentwhich encapsulates an assertion stack and allows generating and retrieve interpolants for unsatisfiable formulas.
-
Method Details
-
getFormulaManager
FormulaManager getFormulaManager()Get the formula manager, which is used for formula manipulation. -
newProverEnvironment
Create a fresh newProverEnvironmentwhich encapsulates an assertion stack and can be used to check formulas for unsatisfiability.- Parameters:
options- Options specified for the prover environment. All the options specified inSolverContext.ProverOptionsare turned off by default.
-
newProverEnvironmentWithInterpolation
InterpolatingProverEnvironment<?> newProverEnvironmentWithInterpolation(SolverContext.ProverOptions... options) Create a fresh newInterpolatingProverEnvironmentwhich encapsulates an assertion stack and allows generating and retrieve interpolants for unsatisfiable formulas. If the SMT solver is able to handle satisfiability tests with assumptions please consider implementing theInterpolatingProverEnvironmentinterface, and return an Object of this type here.- Parameters:
options- Options specified for the prover environment. All the options specified inSolverContext.ProverOptionsare turned off by default.
-
newOptimizationProverEnvironment
OptimizationProverEnvironment newOptimizationProverEnvironment(SolverContext.ProverOptions... options) Create a fresh newOptimizationProverEnvironmentwhich encapsulates an assertion stack and allows solving optimization queries.- Parameters:
options- Options specified for the prover environment. All the options specified inSolverContext.ProverOptionsare turned off by default.
-
getVersion
String getVersion()Get version information out of the solver.In most cases, the version contains the name of the solver followed by some numbers and additional info about the version, e.g., "SMTInterpol 2.5-12-g3d15a15c".
-
getSolverName
SolverContextFactory.Solvers getSolverName()Get solver name (MATHSAT5/Z3/etc...).This is an uppercase String matching the enum identifier from
SolverContextFactory.Solvers -
getStatistics
Get statistics for a complete solver context. The returned mapping is intended to provide the solver-internal statistics. The keys can differ between individual solvers.Calling the statistics several times for the same context returns accumulated number, i.e., we currently do not provide any possibility to reset the statistics.
We do not guarantee any specific key to be present, as this depends on the used solver. We might even return an empty mapping if the solver does not support calling this method or is in an invalid state.
- See Also:
-
close
void close()Close the solver context.After calling this method, further access to any object that had been returned from this context is not wanted, i.e., it depends on the solver. Java-based solvers might wait for the next garbage collection with any cleanup operation. Native solvers might even reference invalid memory and cause segmentation faults.
Necessary for the solvers implemented in native code, frees the associated memory.
- Specified by:
closein interfaceAutoCloseable
-