Copyright | (c) Sirui Lu 2021-2023 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data GrisetteSMTConfig = GrisetteSMTConfig {}
- boolector :: GrisetteSMTConfig
- bitwuzla :: GrisetteSMTConfig
- cvc4 :: GrisetteSMTConfig
- cvc5 :: GrisetteSMTConfig
- yices :: GrisetteSMTConfig
- dReal :: GrisetteSMTConfig
- z3 :: GrisetteSMTConfig
- mathSAT :: GrisetteSMTConfig
- abc :: GrisetteSMTConfig
- newtype ExtraConfig = ExtraConfig {}
- withTimeout :: Int -> GrisetteSMTConfig -> GrisetteSMTConfig
- clearTimeout :: GrisetteSMTConfig -> GrisetteSMTConfig
- data SMTConfig = SMTConfig {
- verbose :: Bool
- timing :: Timing
- printBase :: Int
- printRealPrec :: Int
- crackNum :: Bool
- crackNumSurfaceVals :: [(String, Integer)]
- satCmd :: String
- allSatMaxModelCount :: Maybe Int
- allSatPrintAlong :: Bool
- allSatTrackUFs :: Bool
- isNonModelVar :: String -> Bool
- validateModel :: Bool
- optimizeValidateConstraints :: Bool
- transcript :: Maybe FilePath
- smtLibVersion :: SMTLibVersion
- dsatPrecision :: Maybe Double
- solver :: SMTSolver
- extraArgs :: [String]
- roundingMode :: RoundingMode
- solverSetOptions :: [SMTOption]
- ignoreExitCode :: Bool
- redirectVerbose :: Maybe FilePath
- data Logic
- data SMTOption
- = DiagnosticOutputChannel FilePath
- | ProduceAssertions Bool
- | ProduceAssignments Bool
- | ProduceProofs Bool
- | ProduceInterpolants Bool
- | ProduceUnsatAssumptions Bool
- | ProduceUnsatCores Bool
- | ProduceAbducts Bool
- | RandomSeed Integer
- | ReproducibleResourceLimit Integer
- | SMTVerbosity Integer
- | OptionKeyword String [String]
- | SetLogic Logic
- | SetInfo String [String]
- data Timing
- data SMTSolver = SMTSolver {
- name :: Solver
- executable :: String
- preprocess :: String -> String
- options :: SMTConfig -> [String]
- engine :: SMTEngine
- capabilities :: SolverCapabilities
SMT backend configuration
data GrisetteSMTConfig Source #
Solver configuration for the Grisette SBV backend.
A Grisette solver configuration consists of a SBV solver configuration and some extra configurations.
You should start with the predefined configurations.
Instances
ConfigurableSolver GrisetteSMTConfig SBVSolverHandle Source # | |
Defined in Grisette.Internal.Backend.Solving | |
MonadIO m => MonadicSolver (SBVIncrementalT m) Source # | |
Defined in Grisette.Internal.Backend.Solving monadicSolverPush :: Int -> SBVIncrementalT m () Source # monadicSolverPop :: Int -> SBVIncrementalT m () Source # monadicSolverResetAssertions :: SBVIncrementalT m () Source # monadicSolverAssert :: SymBool -> SBVIncrementalT m () Source # monadicSolverCheckSat :: SBVIncrementalT m (Either SolvingFailure Model) Source # |
boolector :: GrisetteSMTConfig Source #
Solver configuration for Boolector. https://boolector.github.io/
bitwuzla :: GrisetteSMTConfig Source #
Solver configuration for Bitwuzla. https://bitwuzla.github.io/
cvc4 :: GrisetteSMTConfig Source #
Solver configuration for CVC4. https://cvc4.github.io/
cvc5 :: GrisetteSMTConfig Source #
Solver configuration for CVC5. https://cvc5.github.io/
yices :: GrisetteSMTConfig Source #
Solver configuration for Yices. https://yices.csl.sri.com/
dReal :: GrisetteSMTConfig Source #
Solver configuration for DReal. http://dreal.github.io/
z3 :: GrisetteSMTConfig Source #
Solver configuration for Z3. https://github.com/Z3Prover/z3/
mathSAT :: GrisetteSMTConfig Source #
Solver configuration for MathSAT. http://mathsat.fbk.eu/
abc :: GrisetteSMTConfig Source #
Solver configuration for ABC. http://www.eecs.berkeley.edu/~alanmi/abc/
Changing the extra configurations
withTimeout :: Int -> GrisetteSMTConfig -> GrisetteSMTConfig Source #
Set the timeout for the solver configuration.
The timeout is in microseconds (1e-6 seconds). The timeout is applied to each individual solver query.
clearTimeout :: GrisetteSMTConfig -> GrisetteSMTConfig Source #
Clear the timeout for the solver configuration.
SBV backend solver configuration
Solver configuration. See also z3
, yices
, cvc4
, boolector
, mathSAT
, etc.
which are instantiations of this type for those solvers, with reasonable defaults. In particular, custom configuration can be
created by varying those values. (Such as z3{verbose=True}
.)
Most fields are self explanatory. The notion of precision for printing algebraic reals stems from the fact that such values does
not necessarily have finite decimal representations, and hence we have to stop printing at some depth. It is important to
emphasize that such values always have infinite precision internally. The issue is merely with how we print such an infinite
precision value on the screen. The field printRealPrec
controls the printing precision, by specifying the number of digits after
the decimal point. The default value is 16, but it can be set to any positive integer.
When printing, SBV will add the suffix ...
at the end of a real-value, if the given bound is not sufficient to represent the real-value
exactly. Otherwise, the number will be written out in standard decimal notation. Note that SBV will always print the whole value if it
is precise (i.e., if it fits in a finite number of digits), regardless of the precision limit. The limit only applies if the representation
of the real value is not finite, i.e., if it is not rational.
The printBase
field can be used to print numbers in base 2, 10, or 16.
The crackNum
field can be used to display numbers in detail, all its bits and how they are laid out in memory. Works with all bounded number types
(i.e., SWord and SInt), but also with floats. It is particularly useful with floating-point numbers, as it shows you how they are laid out in
memory following the IEEE754 rules.
SMTConfig | |
|
Instances
Show SMTConfig | We show the name of the solver for the config. Arguably this is misleading, but better than nothing. |
NFData SMTConfig | |
Defined in Data.SBV.Core.Symbolic |
SMT-Lib logics. If left unspecified SBV will pick the logic based on what it determines is needed. However, the
user can override this choice using a call to setLogic
This is especially handy if one is experimenting with custom
logics that might be supported on new solvers. See https://smt-lib.org/logics.shtml for the official list.
AUFLIA | Formulas over the theory of linear integer arithmetic and arrays extended with free sort and function symbols but restricted to arrays with integer indices and values. |
AUFLIRA | Linear formulas with free sort and function symbols over one- and two-dimentional arrays of integer index and real value. |
AUFNIRA | Formulas with free function and predicate symbols over a theory of arrays of arrays of integer index and real value. |
LRA | Linear formulas in linear real arithmetic. |
QF_ABV | Quantifier-free formulas over the theory of bitvectors and bitvector arrays. |
QF_AUFBV | Quantifier-free formulas over the theory of bitvectors and bitvector arrays extended with free sort and function symbols. |
QF_AUFLIA | Quantifier-free linear formulas over the theory of integer arrays extended with free sort and function symbols. |
QF_AX | Quantifier-free formulas over the theory of arrays with extensionality. |
QF_BV | Quantifier-free formulas over the theory of fixed-size bitvectors. |
QF_IDL | Difference Logic over the integers. Boolean combinations of inequations of the form x - y < b where x and y are integer variables and b is an integer constant. |
QF_LIA | Unquantified linear integer arithmetic. In essence, Boolean combinations of inequations between linear polynomials over integer variables. |
QF_LRA | Unquantified linear real arithmetic. In essence, Boolean combinations of inequations between linear polynomials over real variables. |
QF_NIA | Quantifier-free integer arithmetic. |
QF_NRA | Quantifier-free real arithmetic. |
QF_RDL | Difference Logic over the reals. In essence, Boolean combinations of inequations of the form x - y < b where x and y are real variables and b is a rational constant. |
QF_UF | Unquantified formulas built over a signature of uninterpreted (i.e., free) sort and function symbols. |
QF_UFBV | Unquantified formulas over bitvectors with uninterpreted sort function and symbols. |
QF_UFIDL | Difference Logic over the integers (in essence) but with uninterpreted sort and function symbols. |
QF_UFLIA | Unquantified linear integer arithmetic with uninterpreted sort and function symbols. |
QF_UFLRA | Unquantified linear real arithmetic with uninterpreted sort and function symbols. |
QF_UFNRA | Unquantified non-linear real arithmetic with uninterpreted sort and function symbols. |
QF_UFNIRA | Unquantified non-linear real integer arithmetic with uninterpreted sort and function symbols. |
UFLRA | Linear real arithmetic with uninterpreted sort and function symbols. |
UFNIA | Non-linear integer arithmetic with uninterpreted sort and function symbols. |
QF_FPBV | Quantifier-free formulas over the theory of floating point numbers, arrays, and bit-vectors. |
QF_FP | Quantifier-free formulas over the theory of floating point numbers. |
QF_FD | Quantifier-free finite domains. |
QF_S | Quantifier-free formulas over the theory of strings. |
Logic_ALL | The catch-all value. |
Logic_NONE | Use this value when you want SBV to simply not set the logic. |
CustomLogic String | In case you need a really custom string! |
Option values that can be set in the solver, following the SMTLib specification https://smt-lib.org/language.shtml.
Note that not all solvers may support all of these!
Furthermore, SBV doesn't support the following options allowed by SMTLib.
:interactive-mode
(Deprecated in SMTLib, useProduceAssertions
instead.):print-success
(SBV critically needs this to be True in query mode.):produce-models
(SBV always sets this option so it can extract models.):regular-output-channel
(SBV always requires regular output to come on stdout for query purposes.):global-declarations
(SBV always uses global declarations since definitions are accumulative.)
Note that SetLogic
and SetInfo
are, strictly speaking, not SMTLib options. However, we treat it as such here
uniformly, as it fits better with how options work.
Specify how to save timing information, if at all.
An SMT solver
SMTSolver | |
|