Class SynchronizedSolverContext
- java.lang.Object
-
- org.sosy_lab.java_smt.delegate.synchronize.SynchronizedSolverContext
-
- All Implemented Interfaces:
AutoCloseable
,SolverContext
public class SynchronizedSolverContext extends Object implements SolverContext
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sosy_lab.java_smt.api.SolverContext
SolverContext.ProverOptions
-
-
Constructor Summary
Constructors Constructor Description SynchronizedSolverContext(Configuration pConfig, LogManager pLogger, ShutdownNotifier pShutdownNotifier, SolverContext pDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the solver context.FormulaManager
getFormulaManager()
Get the formula manager, which is used for formula manipulation.SolverContextFactory.Solvers
getSolverName()
Get solver name (MATHSAT5/Z3/etc...).ImmutableMap<String,String>
getStatistics()
Get statistics for a complete solver context.String
getVersion()
Get version information out of the solver.OptimizationProverEnvironment
newOptimizationProverEnvironment(SolverContext.ProverOptions... pOptions)
Create a fresh newOptimizationProverEnvironment
which encapsulates an assertion stack and allows solving optimization queries.ProverEnvironment
newProverEnvironment(SolverContext.ProverOptions... pOptions)
Create a fresh newProverEnvironment
which encapsulates an assertion stack and can be used to check formulas for unsatisfiability.InterpolatingProverEnvironment<?>
newProverEnvironmentWithInterpolation(SolverContext.ProverOptions... pOptions)
Create a fresh newInterpolatingProverEnvironment
which encapsulates an assertion stack and allows generating and retrieve interpolants for unsatisfiable formulas.
-
-
-
Constructor Detail
-
SynchronizedSolverContext
public SynchronizedSolverContext(Configuration pConfig, LogManager pLogger, ShutdownNotifier pShutdownNotifier, SolverContext pDelegate) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
-
Method Detail
-
getFormulaManager
public FormulaManager getFormulaManager()
Description copied from interface:SolverContext
Get the formula manager, which is used for formula manipulation.- Specified by:
getFormulaManager
in interfaceSolverContext
-
newProverEnvironment
public ProverEnvironment newProverEnvironment(SolverContext.ProverOptions... pOptions)
Description copied from interface:SolverContext
Create a fresh newProverEnvironment
which encapsulates an assertion stack and can be used to check formulas for unsatisfiability.- Specified by:
newProverEnvironment
in interfaceSolverContext
- Parameters:
pOptions
- Options specified for the prover environment. All the options specified inSolverContext.ProverOptions
are turned off by default.
-
newProverEnvironmentWithInterpolation
public InterpolatingProverEnvironment<?> newProverEnvironmentWithInterpolation(SolverContext.ProverOptions... pOptions)
Description copied from interface:SolverContext
Create a fresh newInterpolatingProverEnvironment
which 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 theInterpolatingProverEnvironment
interface, and return an Object of this type here.- Specified by:
newProverEnvironmentWithInterpolation
in interfaceSolverContext
- Parameters:
pOptions
- Options specified for the prover environment. All the options specified inSolverContext.ProverOptions
are turned off by default.
-
newOptimizationProverEnvironment
public OptimizationProverEnvironment newOptimizationProverEnvironment(SolverContext.ProverOptions... pOptions)
Description copied from interface:SolverContext
Create a fresh newOptimizationProverEnvironment
which encapsulates an assertion stack and allows solving optimization queries.- Specified by:
newOptimizationProverEnvironment
in interfaceSolverContext
- Parameters:
pOptions
- Options specified for the prover environment. All the options specified inSolverContext.ProverOptions
are turned off by default.
-
getVersion
public String getVersion()
Description copied from interface:SolverContext
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".
- Specified by:
getVersion
in interfaceSolverContext
-
getSolverName
public SolverContextFactory.Solvers getSolverName()
Description copied from interface:SolverContext
Get solver name (MATHSAT5/Z3/etc...).This is an uppercase String matching the enum identifier from
SolverContextFactory.Solvers
- Specified by:
getSolverName
in interfaceSolverContext
-
getStatistics
public ImmutableMap<String,String> getStatistics()
Description copied from interface:SolverContext
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.
- Specified by:
getStatistics
in interfaceSolverContext
- See Also:
BasicProverEnvironment.getStatistics()
-
close
public void close()
Description copied from interface:SolverContext
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSolverContext
-
-