sbv-8.3: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.

Copyright(c) Brian Schroeder
Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.SBV.Trans

Contents

Description

More generalized alternative to Data.SBV for advanced client use

Synopsis

Symbolic types

Booleans

type SBool = SBV Bool Source #

A symbolic boolean/bit

Boolean values and functions

sTrue :: SBool Source #

Symbolic True

sNot :: SBool -> SBool Source #

Symbolic boolean negation

(.&&) :: SBool -> SBool -> SBool infixr 3 Source #

Symbolic conjunction

(.||) :: SBool -> SBool -> SBool infixr 2 Source #

Symbolic disjunction

(.<+>) :: SBool -> SBool -> SBool infixl 6 Source #

Symbolic logical xor

(.~&) :: SBool -> SBool -> SBool infixr 3 Source #

Symbolic nand

(.~|) :: SBool -> SBool -> SBool infixr 2 Source #

Symbolic nor

(.=>) :: SBool -> SBool -> SBool infixr 1 Source #

Symbolic implication

(.<=>) :: SBool -> SBool -> SBool infixr 1 Source #

Symbolic boolean equivalence

fromBool :: Bool -> SBool Source #

Conversion from Bool to SBool

oneIf :: (Ord a, Num a, SymVal a) => SBool -> SBV a Source #

Returns 1 if the boolean is sTrue, otherwise 0.

Logical functions

sAnd :: [SBool] -> SBool Source #

Generalization of and

sOr :: [SBool] -> SBool Source #

Generalization of or

sAny :: (a -> SBool) -> [a] -> SBool Source #

Generalization of any

sAll :: (a -> SBool) -> [a] -> SBool Source #

Generalization of all

Bit-vectors

Unsigned bit-vectors

type SWord8 = SBV Word8 Source #

8-bit unsigned symbolic value

type SWord16 = SBV Word16 Source #

16-bit unsigned symbolic value

type SWord32 = SBV Word32 Source #

32-bit unsigned symbolic value

type SWord64 = SBV Word64 Source #

64-bit unsigned symbolic value

Signed bit-vectors

type SInt8 = SBV Int8 Source #

8-bit signed symbolic value, 2's complement representation

type SInt16 = SBV Int16 Source #

16-bit signed symbolic value, 2's complement representation

type SInt32 = SBV Int32 Source #

32-bit signed symbolic value, 2's complement representation

type SInt64 = SBV Int64 Source #

64-bit signed symbolic value, 2's complement representation

Unbounded integers

type SInteger = SBV Integer Source #

Infinite precision signed symbolic value

Floating point numbers

type SFloat = SBV Float Source #

IEEE-754 single-precision floating point numbers

type SDouble = SBV Double Source #

IEEE-754 double-precision floating point numbers

Algebraic reals

type SReal = SBV AlgReal Source #

Infinite precision symbolic algebraic real value

data AlgReal Source #

Algebraic reals. Note that the representation is left abstract. We represent rational results explicitly, while the roots-of-polynomials are represented implicitly by their defining equation

Instances
Eq AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Methods

(==) :: AlgReal -> AlgReal -> Bool #

(/=) :: AlgReal -> AlgReal -> Bool #

Fractional AlgReal Source #

NB: Following the other types we have, we require `a/0` to be `0` for all a.

Instance details

Defined in Data.SBV.Core.AlgReals

Num AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Ord AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Real AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Show AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Arbitrary AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Random AlgReal Source # 
Instance details

Defined in Data.SBV.Core.AlgReals

Methods

randomR :: RandomGen g => (AlgReal, AlgReal) -> g -> (AlgReal, g) #

random :: RandomGen g => g -> (AlgReal, g) #

randomRs :: RandomGen g => (AlgReal, AlgReal) -> g -> [AlgReal] #

randoms :: RandomGen g => g -> [AlgReal] #

randomRIO :: (AlgReal, AlgReal) -> IO AlgReal #

randomIO :: IO AlgReal #

HasKind AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Kind

SymVal AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Model

SatModel AlgReal Source #

AlgReal as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (AlgReal, [CV]) Source #

cvtModel :: (AlgReal -> Maybe b) -> Maybe (AlgReal, [CV]) -> Maybe (b, [CV]) Source #

SMTValue AlgReal Source # 
Instance details

Defined in Data.SBV.Control.Utils

Methods

sexprToVal :: SExpr -> Maybe AlgReal Source #

Metric AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace AlgReal :: Type Source #

IEEEFloatConvertible AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Floating

type MetricSpace AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Model

sRealToSInteger :: SReal -> SInteger Source #

Convert an SReal to an SInteger. That is, it computes the largest integer n that satisfies sIntegerToSReal n <= r essentially giving us the floor.

For instance, 1.3 will be 1, but -1.3 will be -2.

Characters, Strings and Regular Expressions

type SChar = SBV Char Source #

A symbolic character. Note that, as far as SBV's symbolic strings are concerned, a character is currently an 8-bit unsigned value, corresponding to the ISO-8859-1 (Latin-1) character set: http://en.wikipedia.org/wiki/ISO/IEC_8859-1. A Haskell Char, on the other hand, is based on unicode. Therefore, there isn't a 1-1 correspondence between a Haskell character and an SBV character for the time being. This limitation is due to the SMT-solvers only supporting this particular subset. However, there is a pending proposal to add support for unicode, and SBV will track these changes to have full unicode support as solvers become available. For details, see: http://smtlib.cs.uiowa.edu/theories-UnicodeStrings.shtml

type SString = SBV String Source #

A symbolic string. Note that a symbolic string is not a list of symbolic characters, that is, it is not the case that SString = [SChar], unlike what one might expect following Haskell strings. An SString is a symbolic value of its own, of possibly arbitrary but finite length, and internally processed as one unit as opposed to a fixed-length list of characters.

Symbolic lists

type SList a = SBV [a] Source #

A symbolic list of items. Note that a symbolic list is not a list of symbolic items, that is, it is not the case that SList a = [a], unlike what one might expect following haskell lists/sequences. An SList is a symbolic value of its own, of possibly arbitrary but finite length, and internally processed as one unit as opposed to a fixed-length list of items. Note that lists can be nested, i.e., we do allow lists of lists of ... items.

Arrays of symbolic values

class SymArray array where Source #

Flat arrays of symbolic values An array a b is an array indexed by the type SBV a, with elements of type SBV b.

If a default value is supplied, then all the array elements will be initialized to this value. Otherwise, they will be left unspecified, i.e., a read from an unwritten location will produce an uninterpreted constant.

While it's certainly possible for user to create instances of SymArray, the SArray and SFunArray instances already provided should cover most use cases in practice. Note that there are a few differences between these two models in terms of use models:

  • SArray produces SMTLib arrays, and requires a solver that understands the array theory. SFunArray is internally handled, and thus can be used with any solver. (Note that all solvers except abc support arrays, so this isn't a big decision factor.)
  • For both arrays, if a default value is supplied, then reading from uninitialized cell will return that value. If the default is not given, then reading from uninitialized cells is still OK for both arrays, and will produce an uninterpreted constant in both cases.
  • Only SArray supports checking equality of arrays. (That is, checking if an entire array is equivalent to another.) SFunArrays cannot be checked for equality. In general, checking wholesale equality of arrays is a difficult decision problem and should be avoided if possible.
  • Only SFunArray supports compilation to C. Programs using SArray will not be accepted by the C-code generator.
  • You cannot use quickcheck on programs that contain these arrays. (Neither SArray nor SFunArray.)
  • With SArray, SBV transfers all array-processing to the SMT-solver. So, it can generate programs more quickly, but they might end up being too hard for the solver to handle. With SFunArray, SBV only generates code for individual elements and the array itself never shows up in the resulting SMTLib program. This puts more onus on the SBV side and might have some performance impacts, but it might generate problems that are easier for the SMT solvers to handle.

As a rule of thumb, try SArray first. These should generate compact code. However, if the backend solver has hard time solving the generated problems, switch to SFunArray. If you still have issues, please report so we can see what the problem might be!

Methods

newArray_ :: (MonadSymbolic m, HasKind a, HasKind b) => Maybe (SBV b) -> m (array a b) Source #

Generalization of newArray_

newArray :: (MonadSymbolic m, HasKind a, HasKind b) => String -> Maybe (SBV b) -> m (array a b) Source #

Generalization of newArray

readArray :: array a b -> SBV a -> SBV b Source #

Read the array element at a

writeArray :: SymVal b => array a b -> SBV a -> SBV b -> array a b Source #

Update the element at a to be b

mergeArrays :: SymVal b => SBV Bool -> array a b -> array a b -> array a b Source #

Merge two given arrays on the symbolic condition Intuitively: mergeArrays cond a b = if cond then a else b. Merging pushes the if-then-else choice down on to elements

Instances
SymArray SFunArray Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

newArray_ :: (MonadSymbolic m, HasKind a, HasKind b) => Maybe (SBV b) -> m (SFunArray a b) Source #

newArray :: (MonadSymbolic m, HasKind a, HasKind b) => String -> Maybe (SBV b) -> m (SFunArray a b) Source #

readArray :: SFunArray a b -> SBV a -> SBV b Source #

writeArray :: SymVal b => SFunArray a b -> SBV a -> SBV b -> SFunArray a b Source #

mergeArrays :: SymVal b => SBV Bool -> SFunArray a b -> SFunArray a b -> SFunArray a b Source #

newArrayInState :: (HasKind a, HasKind b) => Maybe String -> Maybe (SBV b) -> State -> IO (SFunArray a b) Source #

SymArray SArray Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

newArray_ :: (MonadSymbolic m, HasKind a, HasKind b) => Maybe (SBV b) -> m (SArray a b) Source #

newArray :: (MonadSymbolic m, HasKind a, HasKind b) => String -> Maybe (SBV b) -> m (SArray a b) Source #

readArray :: SArray a b -> SBV a -> SBV b Source #

writeArray :: SymVal b => SArray a b -> SBV a -> SBV b -> SArray a b Source #

mergeArrays :: SymVal b => SBV Bool -> SArray a b -> SArray a b -> SArray a b Source #

newArrayInState :: (HasKind a, HasKind b) => Maybe String -> Maybe (SBV b) -> State -> IO (SArray a b) Source #

data SArray a b Source #

Arrays implemented in terms of SMT-arrays: http://smtlib.cs.uiowa.edu/theories-ArraysEx.shtml

  • Maps directly to SMT-lib arrays
  • Reading from an unintialized value is OK. If the default value is given in newArray, it will be the result. Otherwise, the read yields an uninterpreted constant.
  • Can check for equality of these arrays
  • Cannot be used in code-generation (i.e., compilation to C)
  • Cannot quick-check theorems using SArray values
  • Typically slower as it heavily relies on SMT-solving for the array theory
Instances
SymArray SArray Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

newArray_ :: (MonadSymbolic m, HasKind a, HasKind b) => Maybe (SBV b) -> m (SArray a b) Source #

newArray :: (MonadSymbolic m, HasKind a, HasKind b) => String -> Maybe (SBV b) -> m (SArray a b) Source #

readArray :: SArray a b -> SBV a -> SBV b Source #

writeArray :: SymVal b => SArray a b -> SBV a -> SBV b -> SArray a b Source #

mergeArrays :: SymVal b => SBV Bool -> SArray a b -> SArray a b -> SArray a b Source #

newArrayInState :: (HasKind a, HasKind b) => Maybe String -> Maybe (SBV b) -> State -> IO (SArray a b) Source #

(HasKind a, HasKind b, MProvable m p) => MProvable m (SArray a b -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: (SArray a b -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> (SArray a b -> p) -> SymbolicT m SBool Source #

forSome_ :: (SArray a b -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> (SArray a b -> p) -> SymbolicT m SBool Source #

prove :: (SArray a b -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> (SArray a b -> p) -> m ThmResult Source #

sat :: (SArray a b -> p) -> m SatResult Source #

satWith :: SMTConfig -> (SArray a b -> p) -> m SatResult Source #

allSat :: (SArray a b -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> (SArray a b -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> (SArray a b -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> (SArray a b -> p) -> m OptimizeResult Source #

isVacuous :: (SArray a b -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> (SArray a b -> p) -> m Bool Source #

isTheorem :: (SArray a b -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> (SArray a b -> p) -> m Bool Source #

isSatisfiable :: (SArray a b -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> (SArray a b -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> (SArray a b -> p) -> SMTResult -> m SMTResult Source #

(HasKind a, HasKind b) => Show (SArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

showsPrec :: Int -> SArray a b -> ShowS #

show :: SArray a b -> String #

showList :: [SArray a b] -> ShowS #

SymVal b => Mergeable (SArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> SArray a b -> SArray a b -> SArray a b Source #

select :: (Ord b0, SymVal b0, Num b0) => [SArray a b] -> SArray a b -> SBV b0 -> SArray a b Source #

EqSymbolic (SArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: SArray a b -> SArray a b -> SBool Source #

(./=) :: SArray a b -> SArray a b -> SBool Source #

(.===) :: SArray a b -> SArray a b -> SBool Source #

(./==) :: SArray a b -> SArray a b -> SBool Source #

distinct :: [SArray a b] -> SBool Source #

allEqual :: [SArray a b] -> SBool Source #

sElem :: SArray a b -> [SArray a b] -> SBool Source #

data SFunArray a b Source #

Arrays implemented internally, without translating to SMT-Lib functions:

  • Internally handled by the library and not mapped to SMT-Lib, hence can be used with solvers that don't support arrays. (Such as abc.)
  • Reading from an unintialized value is OK. If the default value is given in newArray, it will be the result. Otherwise, the read yields an uninterpreted constant.
  • Cannot check for equality of arrays.
  • Can be used in code-generation (i.e., compilation to C).
  • Can not quick-check theorems using SFunArray values
  • Typically faster as it gets compiled away during translation.
Instances
SymArray SFunArray Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

newArray_ :: (MonadSymbolic m, HasKind a, HasKind b) => Maybe (SBV b) -> m (SFunArray a b) Source #

newArray :: (MonadSymbolic m, HasKind a, HasKind b) => String -> Maybe (SBV b) -> m (SFunArray a b) Source #

readArray :: SFunArray a b -> SBV a -> SBV b Source #

writeArray :: SymVal b => SFunArray a b -> SBV a -> SBV b -> SFunArray a b Source #

mergeArrays :: SymVal b => SBV Bool -> SFunArray a b -> SFunArray a b -> SFunArray a b Source #

newArrayInState :: (HasKind a, HasKind b) => Maybe String -> Maybe (SBV b) -> State -> IO (SFunArray a b) Source #

(HasKind a, HasKind b, MProvable m p) => MProvable m (SFunArray a b -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

(HasKind a, HasKind b) => Show (SFunArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

showsPrec :: Int -> SFunArray a b -> ShowS #

show :: SFunArray a b -> String #

showList :: [SFunArray a b] -> ShowS #

SymVal b => Mergeable (SFunArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> SFunArray a b -> SFunArray a b -> SFunArray a b Source #

select :: (Ord b0, SymVal b0, Num b0) => [SFunArray a b] -> SFunArray a b -> SBV b0 -> SFunArray a b Source #

Creating symbolic values

Single value

sBool :: MonadSymbolic m => String -> m SBool Source #

Generalization of sBool

sWord8 :: MonadSymbolic m => String -> m SWord8 Source #

Generalization of sWord8

sWord16 :: MonadSymbolic m => String -> m SWord16 Source #

Generalization of sWord16

sWord32 :: MonadSymbolic m => String -> m SWord32 Source #

Generalization of sWord32

sWord64 :: MonadSymbolic m => String -> m SWord64 Source #

Generalization of sWord64

sInt8 :: MonadSymbolic m => String -> m SInt8 Source #

Generalization of sInt8

sInt16 :: MonadSymbolic m => String -> m SInt16 Source #

Generalization of sInt16

sInt32 :: MonadSymbolic m => String -> m SInt32 Source #

Generalization of sInt32

sInt64 :: MonadSymbolic m => String -> m SInt64 Source #

Generalization of sInt64

sInteger :: MonadSymbolic m => String -> m SInteger Source #

Generalization of sInteger

sReal :: MonadSymbolic m => String -> m SReal Source #

Generalization of sReal

sFloat :: MonadSymbolic m => String -> m SFloat Source #

Generalization of sFloat

sDouble :: MonadSymbolic m => String -> m SDouble Source #

Generalization of sDouble

sChar :: MonadSymbolic m => String -> m SChar Source #

Generalization of sChar

sString :: MonadSymbolic m => String -> m SString Source #

Generalization of sString

sList :: (SymVal a, MonadSymbolic m) => String -> m (SList a) Source #

Generalization of sList

List of values

sBools :: MonadSymbolic m => [String] -> m [SBool] Source #

Generalization of sBools

sWord8s :: MonadSymbolic m => [String] -> m [SWord8] Source #

Generalization of sWord8s

sWord16s :: MonadSymbolic m => [String] -> m [SWord16] Source #

Generalization of sWord16s

sWord32s :: MonadSymbolic m => [String] -> m [SWord32] Source #

Generalization of sWord32s

sWord64s :: MonadSymbolic m => [String] -> m [SWord64] Source #

Generalization of sWord64s

sInt8s :: MonadSymbolic m => [String] -> m [SInt8] Source #

Generalization of sInt8s

sInt16s :: MonadSymbolic m => [String] -> m [SInt16] Source #

Generalization of sInt16s

sInt32s :: MonadSymbolic m => [String] -> m [SInt32] Source #

Generalization of sInt32s

sInt64s :: MonadSymbolic m => [String] -> m [SInt64] Source #

Generalization of sInt64s

sIntegers :: MonadSymbolic m => [String] -> m [SInteger] Source #

Generalization of sIntegers

sReals :: MonadSymbolic m => [String] -> m [SReal] Source #

Generalization of sReals

sFloats :: MonadSymbolic m => [String] -> m [SFloat] Source #

Generalization of sFloats

sDoubles :: MonadSymbolic m => [String] -> m [SDouble] Source #

Generalization of sDoubles

sChars :: MonadSymbolic m => [String] -> m [SChar] Source #

Generalization of sChars

sStrings :: MonadSymbolic m => [String] -> m [SString] Source #

Generalization of sStrings

sLists :: (SymVal a, MonadSymbolic m) => [String] -> m [SList a] Source #

Generalization of sLists

Symbolic Equality and Comparisons

class EqSymbolic a where Source #

Symbolic Equality. Note that we can't use Haskell's Eq class since Haskell insists on returning Bool Comparing symbolic values will necessarily return a symbolic value.

Minimal complete definition

(.==)

Methods

(.==) :: a -> a -> SBool infix 4 Source #

Symbolic equality.

(./=) :: a -> a -> SBool infix 4 Source #

Symbolic inequality.

(.===) :: a -> a -> SBool infix 4 Source #

Strong equality. On floats ('SFloat'/'SDouble'), strong equality is object equality; that is NaN == NaN holds, but +0 == -0 doesn't. On other types, (.===) is simply (.==). Note that (.==) is the right notion of equality for floats per IEEE754 specs, since by definition +0 == -0 and NaN equals no other value including itself. But occasionally we want to be stronger and state NaN equals NaN and +0 and -0 are different from each other. In a context where your type is concrete, simply use fpIsEqualObject. But in a polymorphic context, use the strong equality instead.

NB. If you do not care about or work with floats, simply use (.==) and (./=).

(./==) :: a -> a -> SBool infix 4 Source #

Negation of strong equality. Equaivalent to negation of (.===) on all types.

distinct :: [a] -> SBool Source #

Returns (symbolic) sTrue if all the elements of the given list are different.

allEqual :: [a] -> SBool Source #

Returns (symbolic) sTrue if all the elements of the given list are the same.

sElem :: a -> [a] -> SBool Source #

Symbolic membership test.

Instances
EqSymbolic Bool Source # 
Instance details

Defined in Data.SBV.Core.Model

EqSymbolic a => EqSymbolic [a] Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: [a] -> [a] -> SBool Source #

(./=) :: [a] -> [a] -> SBool Source #

(.===) :: [a] -> [a] -> SBool Source #

(./==) :: [a] -> [a] -> SBool Source #

distinct :: [[a]] -> SBool Source #

allEqual :: [[a]] -> SBool Source #

sElem :: [a] -> [[a]] -> SBool Source #

EqSymbolic a => EqSymbolic (Maybe a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: Maybe a -> Maybe a -> SBool Source #

(./=) :: Maybe a -> Maybe a -> SBool Source #

(.===) :: Maybe a -> Maybe a -> SBool Source #

(./==) :: Maybe a -> Maybe a -> SBool Source #

distinct :: [Maybe a] -> SBool Source #

allEqual :: [Maybe a] -> SBool Source #

sElem :: Maybe a -> [Maybe a] -> SBool Source #

EqSymbolic (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: SBV a -> SBV a -> SBool Source #

(./=) :: SBV a -> SBV a -> SBool Source #

(.===) :: SBV a -> SBV a -> SBool Source #

(./==) :: SBV a -> SBV a -> SBool Source #

distinct :: [SBV a] -> SBool Source #

allEqual :: [SBV a] -> SBool Source #

sElem :: SBV a -> [SBV a] -> SBool Source #

EqSymbolic a => EqSymbolic (S a) Source #

Symbolic equality for S.

Instance details

Defined in Documentation.SBV.Examples.ProofTools.BMC

Methods

(.==) :: S a -> S a -> SBool Source #

(./=) :: S a -> S a -> SBool Source #

(.===) :: S a -> S a -> SBool Source #

(./==) :: S a -> S a -> SBool Source #

distinct :: [S a] -> SBool Source #

allEqual :: [S a] -> SBool Source #

sElem :: S a -> [S a] -> SBool Source #

(EqSymbolic a, EqSymbolic b) => EqSymbolic (Either a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: Either a b -> Either a b -> SBool Source #

(./=) :: Either a b -> Either a b -> SBool Source #

(.===) :: Either a b -> Either a b -> SBool Source #

(./==) :: Either a b -> Either a b -> SBool Source #

distinct :: [Either a b] -> SBool Source #

allEqual :: [Either a b] -> SBool Source #

sElem :: Either a b -> [Either a b] -> SBool Source #

(EqSymbolic a, EqSymbolic b) => EqSymbolic (a, b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: (a, b) -> (a, b) -> SBool Source #

(./=) :: (a, b) -> (a, b) -> SBool Source #

(.===) :: (a, b) -> (a, b) -> SBool Source #

(./==) :: (a, b) -> (a, b) -> SBool Source #

distinct :: [(a, b)] -> SBool Source #

allEqual :: [(a, b)] -> SBool Source #

sElem :: (a, b) -> [(a, b)] -> SBool Source #

EqSymbolic (SArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: SArray a b -> SArray a b -> SBool Source #

(./=) :: SArray a b -> SArray a b -> SBool Source #

(.===) :: SArray a b -> SArray a b -> SBool Source #

(./==) :: SArray a b -> SArray a b -> SBool Source #

distinct :: [SArray a b] -> SBool Source #

allEqual :: [SArray a b] -> SBool Source #

sElem :: SArray a b -> [SArray a b] -> SBool Source #

(EqSymbolic a, EqSymbolic b, EqSymbolic c) => EqSymbolic (a, b, c) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: (a, b, c) -> (a, b, c) -> SBool Source #

(./=) :: (a, b, c) -> (a, b, c) -> SBool Source #

(.===) :: (a, b, c) -> (a, b, c) -> SBool Source #

(./==) :: (a, b, c) -> (a, b, c) -> SBool Source #

distinct :: [(a, b, c)] -> SBool Source #

allEqual :: [(a, b, c)] -> SBool Source #

sElem :: (a, b, c) -> [(a, b, c)] -> SBool Source #

(EqSymbolic a, EqSymbolic b, EqSymbolic c, EqSymbolic d) => EqSymbolic (a, b, c, d) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

(./=) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

(.===) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

(./==) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

distinct :: [(a, b, c, d)] -> SBool Source #

allEqual :: [(a, b, c, d)] -> SBool Source #

sElem :: (a, b, c, d) -> [(a, b, c, d)] -> SBool Source #

(EqSymbolic a, EqSymbolic b, EqSymbolic c, EqSymbolic d, EqSymbolic e) => EqSymbolic (a, b, c, d, e) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

(./=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

(.===) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

(./==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

distinct :: [(a, b, c, d, e)] -> SBool Source #

allEqual :: [(a, b, c, d, e)] -> SBool Source #

sElem :: (a, b, c, d, e) -> [(a, b, c, d, e)] -> SBool Source #

(EqSymbolic a, EqSymbolic b, EqSymbolic c, EqSymbolic d, EqSymbolic e, EqSymbolic f) => EqSymbolic (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

(./=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

(.===) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

(./==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

distinct :: [(a, b, c, d, e, f)] -> SBool Source #

allEqual :: [(a, b, c, d, e, f)] -> SBool Source #

sElem :: (a, b, c, d, e, f) -> [(a, b, c, d, e, f)] -> SBool Source #

(EqSymbolic a, EqSymbolic b, EqSymbolic c, EqSymbolic d, EqSymbolic e, EqSymbolic f, EqSymbolic g) => EqSymbolic (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

(./=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

(.===) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

(./==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

distinct :: [(a, b, c, d, e, f, g)] -> SBool Source #

allEqual :: [(a, b, c, d, e, f, g)] -> SBool Source #

sElem :: (a, b, c, d, e, f, g) -> [(a, b, c, d, e, f, g)] -> SBool Source #

class (Mergeable a, EqSymbolic a) => OrdSymbolic a where Source #

Symbolic Comparisons. Similar to Eq, we cannot implement Haskell's Ord class since there is no way to return an Ordering value from a symbolic comparison. Furthermore, OrdSymbolic requires Mergeable to implement if-then-else, for the benefit of implementing symbolic versions of max and min functions.

Minimal complete definition

(.<)

Methods

(.<) :: a -> a -> SBool infix 4 Source #

Symbolic less than.

(.<=) :: a -> a -> SBool infix 4 Source #

Symbolic less than or equal to.

(.>) :: a -> a -> SBool infix 4 Source #

Symbolic greater than.

(.>=) :: a -> a -> SBool infix 4 Source #

Symbolic greater than or equal to.

smin :: a -> a -> a Source #

Symbolic minimum.

smax :: a -> a -> a Source #

Symbolic maximum.

inRange :: a -> (a, a) -> SBool Source #

Is the value withing the allowed inclusive range?

Instances
OrdSymbolic a => OrdSymbolic [a] Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: [a] -> [a] -> SBool Source #

(.<=) :: [a] -> [a] -> SBool Source #

(.>) :: [a] -> [a] -> SBool Source #

(.>=) :: [a] -> [a] -> SBool Source #

smin :: [a] -> [a] -> [a] Source #

smax :: [a] -> [a] -> [a] Source #

inRange :: [a] -> ([a], [a]) -> SBool Source #

OrdSymbolic a => OrdSymbolic (Maybe a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: Maybe a -> Maybe a -> SBool Source #

(.<=) :: Maybe a -> Maybe a -> SBool Source #

(.>) :: Maybe a -> Maybe a -> SBool Source #

(.>=) :: Maybe a -> Maybe a -> SBool Source #

smin :: Maybe a -> Maybe a -> Maybe a Source #

smax :: Maybe a -> Maybe a -> Maybe a Source #

inRange :: Maybe a -> (Maybe a, Maybe a) -> SBool Source #

(Ord a, SymVal a) => OrdSymbolic (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: SBV a -> SBV a -> SBool Source #

(.<=) :: SBV a -> SBV a -> SBool Source #

(.>) :: SBV a -> SBV a -> SBool Source #

(.>=) :: SBV a -> SBV a -> SBool Source #

smin :: SBV a -> SBV a -> SBV a Source #

smax :: SBV a -> SBV a -> SBV a Source #

inRange :: SBV a -> (SBV a, SBV a) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b) => OrdSymbolic (Either a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: Either a b -> Either a b -> SBool Source #

(.<=) :: Either a b -> Either a b -> SBool Source #

(.>) :: Either a b -> Either a b -> SBool Source #

(.>=) :: Either a b -> Either a b -> SBool Source #

smin :: Either a b -> Either a b -> Either a b Source #

smax :: Either a b -> Either a b -> Either a b Source #

inRange :: Either a b -> (Either a b, Either a b) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b) => OrdSymbolic (a, b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: (a, b) -> (a, b) -> SBool Source #

(.<=) :: (a, b) -> (a, b) -> SBool Source #

(.>) :: (a, b) -> (a, b) -> SBool Source #

(.>=) :: (a, b) -> (a, b) -> SBool Source #

smin :: (a, b) -> (a, b) -> (a, b) Source #

smax :: (a, b) -> (a, b) -> (a, b) Source #

inRange :: (a, b) -> ((a, b), (a, b)) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b, OrdSymbolic c) => OrdSymbolic (a, b, c) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: (a, b, c) -> (a, b, c) -> SBool Source #

(.<=) :: (a, b, c) -> (a, b, c) -> SBool Source #

(.>) :: (a, b, c) -> (a, b, c) -> SBool Source #

(.>=) :: (a, b, c) -> (a, b, c) -> SBool Source #

smin :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #

smax :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #

inRange :: (a, b, c) -> ((a, b, c), (a, b, c)) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b, OrdSymbolic c, OrdSymbolic d) => OrdSymbolic (a, b, c, d) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

(.<=) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

(.>) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

(.>=) :: (a, b, c, d) -> (a, b, c, d) -> SBool Source #

smin :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

smax :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

inRange :: (a, b, c, d) -> ((a, b, c, d), (a, b, c, d)) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b, OrdSymbolic c, OrdSymbolic d, OrdSymbolic e) => OrdSymbolic (a, b, c, d, e) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

(.<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

(.>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

(.>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> SBool Source #

smin :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

smax :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

inRange :: (a, b, c, d, e) -> ((a, b, c, d, e), (a, b, c, d, e)) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b, OrdSymbolic c, OrdSymbolic d, OrdSymbolic e, OrdSymbolic f) => OrdSymbolic (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

(.<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

(.>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

(.>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> SBool Source #

smin :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

smax :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

inRange :: (a, b, c, d, e, f) -> ((a, b, c, d, e, f), (a, b, c, d, e, f)) -> SBool Source #

(OrdSymbolic a, OrdSymbolic b, OrdSymbolic c, OrdSymbolic d, OrdSymbolic e, OrdSymbolic f, OrdSymbolic g) => OrdSymbolic (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

(.<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

(.>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

(.>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> SBool Source #

smin :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

smax :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

inRange :: (a, b, c, d, e, f, g) -> ((a, b, c, d, e, f, g), (a, b, c, d, e, f, g)) -> SBool Source #

class Equality a where Source #

Equality as a proof method. Allows for very concise construction of equivalence proofs, which is very typical in bit-precise proofs.

Methods

(===) :: a -> a -> IO ThmResult infix 4 Source #

Instances
(SymVal a, SymVal b, EqSymbolic z) => Equality ((SBV a, SBV b) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b) -> z) -> ((SBV a, SBV b) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c) -> z) -> ((SBV a, SBV b, SBV c) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d) -> z) -> ((SBV a, SBV b, SBV c, SBV d) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d, SBV e) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> z) -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> z) -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> z) -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> SBV g -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> SBV g -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> SBV g -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> z) -> (SBV a -> SBV b -> SBV c -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, EqSymbolic z) => Equality (SBV a -> SBV b -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> z) -> (SBV a -> SBV b -> z) -> IO ThmResult Source #

(SymVal a, EqSymbolic z) => Equality (SBV a -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> z) -> (SBV a -> z) -> IO ThmResult Source #

Conditionals: Mergeable values

class Mergeable a where Source #

Symbolic conditionals are modeled by the Mergeable class, describing how to merge the results of an if-then-else call with a symbolic test. SBV provides all basic types as instances of this class, so users only need to declare instances for custom data-types of their programs as needed.

A Mergeable instance may be automatically derived for a custom data-type with a single constructor where the type of each field is an instance of Mergeable, such as a record of symbolic values. Users only need to add Generic and Mergeable to the deriving clause for the data-type. See Status for an example and an illustration of what the instance would look like if written by hand.

The function select is a total-indexing function out of a list of choices with a default value, simulating array/list indexing. It's an n-way generalization of the ite function.

Minimal complete definition: None, if the type is instance of Generic. Otherwise symbolicMerge. Note that most types subject to merging are likely to be trivial instances of Generic.

Minimal complete definition

Nothing

Methods

symbolicMerge :: Bool -> SBool -> a -> a -> a Source #

Merge two values based on the condition. The first argument states whether we force the then-and-else branches before the merging, at the word level. This is an efficiency concern; one that we'd rather not make but unfortunately necessary for getting symbolic simulation working efficiently.

select :: (Ord b, SymVal b, Num b) => [a] -> a -> SBV b -> a Source #

Total indexing operation. select xs default index is intuitively the same as xs !! index, except it evaluates to default if index underflows/overflows.

symbolicMerge :: (Generic a, GMergeable (Rep a)) => Bool -> SBool -> a -> a -> a Source #

Merge two values based on the condition. The first argument states whether we force the then-and-else branches before the merging, at the word level. This is an efficiency concern; one that we'd rather not make but unfortunately necessary for getting symbolic simulation working efficiently.

Instances
Mergeable () Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> () -> () -> () Source #

select :: (Ord b, SymVal b, Num b) => [()] -> () -> SBV b -> () Source #

Mergeable Mostek Source # 
Instance details

Defined in Documentation.SBV.Examples.BitPrecise.Legato

Methods

symbolicMerge :: Bool -> SBool -> Mostek -> Mostek -> Mostek Source #

select :: (Ord b, SymVal b, Num b) => [Mostek] -> Mostek -> SBV b -> Mostek Source #

Mergeable Status Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

Methods

symbolicMerge :: Bool -> SBool -> Status -> Status -> Status Source #

select :: (Ord b, SymVal b, Num b) => [Status] -> Status -> SBV b -> Status Source #

Mergeable a => Mergeable [a] Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> [a] -> [a] -> [a] Source #

select :: (Ord b, SymVal b, Num b) => [[a]] -> [a] -> SBV b -> [a] Source #

Mergeable a => Mergeable (Maybe a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> Maybe a -> Maybe a -> Maybe a Source #

select :: (Ord b, SymVal b, Num b) => [Maybe a] -> Maybe a -> SBV b -> Maybe a Source #

Mergeable a => Mergeable (ZipList a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> ZipList a -> ZipList a -> ZipList a Source #

select :: (Ord b, SymVal b, Num b) => [ZipList a] -> ZipList a -> SBV b -> ZipList a Source #

SymVal a => Mergeable (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> SBV a -> SBV a -> SBV a Source #

select :: (Ord b, SymVal b, Num b) => [SBV a] -> SBV a -> SBV b -> SBV a Source #

Mergeable a => Mergeable (S a) Source # 
Instance details

Defined in Documentation.SBV.Examples.ProofTools.Fibonacci

Methods

symbolicMerge :: Bool -> SBool -> S a -> S a -> S a Source #

select :: (Ord b, SymVal b, Num b) => [S a] -> S a -> SBV b -> S a Source #

Mergeable a => Mergeable (S a) Source # 
Instance details

Defined in Documentation.SBV.Examples.ProofTools.Sum

Methods

symbolicMerge :: Bool -> SBool -> S a -> S a -> S a Source #

select :: (Ord b, SymVal b, Num b) => [S a] -> S a -> SBV b -> S a Source #

Mergeable a => Mergeable (Move a) Source #

Mergeable instance for Move simply pushes the merging the data after run of each branch starting from the same state.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

Methods

symbolicMerge :: Bool -> SBool -> Move a -> Move a -> Move a Source #

select :: (Ord b, SymVal b, Num b) => [Move a] -> Move a -> SBV b -> Move a Source #

SymVal a => Mergeable (AppS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Append

Methods

symbolicMerge :: Bool -> SBool -> AppS a -> AppS a -> AppS a Source #

select :: (Ord b, SymVal b, Num b) => [AppS a] -> AppS a -> SBV b -> AppS a Source #

Mergeable a => Mergeable (FibS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Fib

Methods

symbolicMerge :: Bool -> SBool -> FibS a -> FibS a -> FibS a Source #

select :: (Ord b, SymVal b, Num b) => [FibS a] -> FibS a -> SBV b -> FibS a Source #

Mergeable a => Mergeable (GCDS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.GCD

Methods

symbolicMerge :: Bool -> SBool -> GCDS a -> GCDS a -> GCDS a Source #

select :: (Ord b, SymVal b, Num b) => [GCDS a] -> GCDS a -> SBV b -> GCDS a Source #

Mergeable a => Mergeable (DivS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.IntDiv

Methods

symbolicMerge :: Bool -> SBool -> DivS a -> DivS a -> DivS a Source #

select :: (Ord b, SymVal b, Num b) => [DivS a] -> DivS a -> SBV b -> DivS a Source #

Mergeable a => Mergeable (SqrtS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.IntSqrt

Methods

symbolicMerge :: Bool -> SBool -> SqrtS a -> SqrtS a -> SqrtS a Source #

select :: (Ord b, SymVal b, Num b) => [SqrtS a] -> SqrtS a -> SBV b -> SqrtS a Source #

SymVal a => Mergeable (LenS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Length

Methods

symbolicMerge :: Bool -> SBool -> LenS a -> LenS a -> LenS a Source #

select :: (Ord b, SymVal b, Num b) => [LenS a] -> LenS a -> SBV b -> LenS a Source #

Mergeable a => Mergeable (SumS a) Source # 
Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Sum

Methods

symbolicMerge :: Bool -> SBool -> SumS a -> SumS a -> SumS a Source #

select :: (Ord b, SymVal b, Num b) => [SumS a] -> SumS a -> SBV b -> SumS a Source #

Mergeable b => Mergeable (a -> b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a -> b) -> (a -> b) -> a -> b Source #

select :: (Ord b0, SymVal b0, Num b0) => [a -> b] -> (a -> b) -> SBV b0 -> a -> b Source #

(Mergeable a, Mergeable b) => Mergeable (Either a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> Either a b -> Either a b -> Either a b Source #

select :: (Ord b0, SymVal b0, Num b0) => [Either a b] -> Either a b -> SBV b0 -> Either a b Source #

(Mergeable a, Mergeable b) => Mergeable (a, b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a, b) -> (a, b) -> (a, b) Source #

select :: (Ord b0, SymVal b0, Num b0) => [(a, b)] -> (a, b) -> SBV b0 -> (a, b) Source #

(Ix a, Mergeable b) => Mergeable (Array a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> Array a b -> Array a b -> Array a b Source #

select :: (Ord b0, SymVal b0, Num b0) => [Array a b] -> Array a b -> SBV b0 -> Array a b Source #

SymVal b => Mergeable (SFunArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> SFunArray a b -> SFunArray a b -> SFunArray a b Source #

select :: (Ord b0, SymVal b0, Num b0) => [SFunArray a b] -> SFunArray a b -> SBV b0 -> SFunArray a b Source #

SymVal b => Mergeable (SArray a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> SArray a b -> SArray a b -> SArray a b Source #

select :: (Ord b0, SymVal b0, Num b0) => [SArray a b] -> SArray a b -> SBV b0 -> SArray a b Source #

SymVal e => Mergeable (STree i e) Source # 
Instance details

Defined in Data.SBV.Tools.STree

Methods

symbolicMerge :: Bool -> SBool -> STree i e -> STree i e -> STree i e Source #

select :: (Ord b, SymVal b, Num b) => [STree i e] -> STree i e -> SBV b -> STree i e Source #

(Mergeable a, Mergeable b, Mergeable c) => Mergeable (a, b, c) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a, b, c) -> (a, b, c) -> (a, b, c) Source #

select :: (Ord b0, SymVal b0, Num b0) => [(a, b, c)] -> (a, b, c) -> SBV b0 -> (a, b, c) Source #

(Mergeable a, Mergeable b, Mergeable c, Mergeable d) => Mergeable (a, b, c, d) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

select :: (Ord b0, SymVal b0, Num b0) => [(a, b, c, d)] -> (a, b, c, d) -> SBV b0 -> (a, b, c, d) Source #

(Mergeable a, Mergeable b, Mergeable c, Mergeable d, Mergeable e) => Mergeable (a, b, c, d, e) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

select :: (Ord b0, SymVal b0, Num b0) => [(a, b, c, d, e)] -> (a, b, c, d, e) -> SBV b0 -> (a, b, c, d, e) Source #

(Mergeable a, Mergeable b, Mergeable c, Mergeable d, Mergeable e, Mergeable f) => Mergeable (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

select :: (Ord b0, SymVal b0, Num b0) => [(a, b, c, d, e, f)] -> (a, b, c, d, e, f) -> SBV b0 -> (a, b, c, d, e, f) Source #

(Mergeable a, Mergeable b, Mergeable c, Mergeable d, Mergeable e, Mergeable f, Mergeable g) => Mergeable (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

select :: (Ord b0, SymVal b0, Num b0) => [(a, b, c, d, e, f, g)] -> (a, b, c, d, e, f, g) -> SBV b0 -> (a, b, c, d, e, f, g) Source #

ite :: Mergeable a => SBool -> a -> a -> a Source #

If-then-else. This is by definition symbolicMerge with both branches forced. This is typically the desired behavior, but also see iteLazy should you need more laziness.

iteLazy :: Mergeable a => SBool -> a -> a -> a Source #

A Lazy version of ite, which does not force its arguments. This might cause issues for symbolic simulation with large thunks around, so use with care.

Symbolic integral numbers

class (SymVal a, Num a, Bits a, Integral a) => SIntegral a Source #

Symbolic Numbers. This is a simple class that simply incorporates all number like base types together, simplifying writing polymorphic type-signatures that work for all symbolic numbers, such as SWord8, SInt8 etc. For instance, we can write a generic list-minimum function as follows:

   mm :: SIntegral a => [SBV a] -> SBV a
   mm = foldr1 (a b -> ite (a .<= b) a b)

It is similar to the standard Integral class, except ranging over symbolic instances.

Instances
SIntegral Int8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Int16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Int32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Int64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Integer Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Word8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Word16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Word32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Word64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SIntegral Word4 Source #

SIntegral instance, using default methods

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Division and Modulus

class SDivisible a where Source #

The SDivisible class captures the essence of division. Unfortunately we cannot use Haskell's Integral class since the Real and Enum superclasses are not implementable for symbolic bit-vectors. However, quotRem and divMod both make perfect sense, and the SDivisible class captures this operation. One issue is how division by 0 behaves. The verification technology requires total functions, and there are several design choices here. We follow Isabelle/HOL approach of assigning the value 0 for division by 0. Therefore, we impose the following pair of laws:

     x sQuotRem 0 = (0, x)
     x sDivMod  0 = (0, x)

Note that our instances implement this law even when x is 0 itself.

NB. quot truncates toward zero, while div truncates toward negative infinity.

Minimal complete definition

sQuotRem, sDivMod

Methods

sQuotRem :: a -> a -> (a, a) Source #

sDivMod :: a -> a -> (a, a) Source #

sQuot :: a -> a -> a Source #

sRem :: a -> a -> a Source #

sDiv :: a -> a -> a Source #

sMod :: a -> a -> a Source #

Instances
SDivisible Int8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Int16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Int32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Int64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Integer Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Word8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Word16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Word32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible Word64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible CV Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

sQuotRem :: CV -> CV -> (CV, CV) Source #

sDivMod :: CV -> CV -> (CV, CV) Source #

sQuot :: CV -> CV -> CV Source #

sRem :: CV -> CV -> CV Source #

sDiv :: CV -> CV -> CV Source #

sMod :: CV -> CV -> CV Source #

SDivisible SInteger Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord4 Source #

SDvisible instance, using default methods

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

SDivisible Word4 Source #

SDvisible instance, using 0-extension

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Bit-vector operations

Conversions

sFromIntegral :: forall a b. (Integral a, HasKind a, Num a, SymVal a, HasKind b, Num b, SymVal b) => SBV a -> SBV b Source #

Conversion between integral-symbolic values, akin to Haskell's fromIntegral

Shifts and rotates

sShiftLeft :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a Source #

Generalization of shiftL, when the shift-amount is symbolic. Since Haskell's shiftL only takes an Int as the shift amount, it cannot be used when we have a symbolic amount to shift with.

sShiftRight :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a Source #

Generalization of shiftR, when the shift-amount is symbolic. Since Haskell's shiftR only takes an Int as the shift amount, it cannot be used when we have a symbolic amount to shift with.

NB. If the shiftee is signed, then this is an arithmetic shift; otherwise it's logical, following the usual Haskell convention. See sSignedShiftArithRight for a variant that explicitly uses the msb as the sign bit, even for unsigned underlying types.

sRotateLeft :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a Source #

Generalization of rotateL, when the shift-amount is symbolic. Since Haskell's rotateL only takes an Int as the shift amount, it cannot be used when we have a symbolic amount to shift with. The first argument should be a bounded quantity.

sBarrelRotateLeft :: (SFiniteBits a, SFiniteBits b) => SBV a -> SBV b -> SBV a Source #

An implementation of rotate-left, using a barrel shifter like design. Only works when both arguments are finite bitvectors, and furthermore when the second argument is unsigned. The first condition is enforced by the type, but the second is dynamically checked. We provide this implementation as an alternative to sRotateLeft since SMTLib logic does not support variable argument rotates (as opposed to shifts), and thus this implementation can produce better code for verification compared to sRotateLeft.

>>> prove $ \x y -> (x `sBarrelRotateLeft`  y) `sBarrelRotateRight` (y :: SWord32) .== (x :: SWord64)
Q.E.D.

sRotateRight :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a Source #

Generalization of rotateR, when the shift-amount is symbolic. Since Haskell's rotateR only takes an Int as the shift amount, it cannot be used when we have a symbolic amount to shift with. The first argument should be a bounded quantity.

sBarrelRotateRight :: (SFiniteBits a, SFiniteBits b) => SBV a -> SBV b -> SBV a Source #

An implementation of rotate-right, using a barrel shifter like design. See comments for sBarrelRotateLeft for details.

>>> prove $ \x y -> (x `sBarrelRotateRight` y) `sBarrelRotateLeft`  (y :: SWord32) .== (x :: SWord64)
Q.E.D.

sSignedShiftArithRight :: (SFiniteBits a, SIntegral b) => SBV a -> SBV b -> SBV a Source #

Arithmetic shift-right with a symbolic unsigned shift amount. This is equivalent to sShiftRight when the argument is signed. However, if the argument is unsigned, then it explicitly treats its msb as a sign-bit, and uses it as the bit that gets shifted in. Useful when using the underlying unsigned bit representation to implement custom signed operations. Note that there is no direct Haskell analogue of this function.

Finite bit-vector operations

class (Ord a, SymVal a, Num a, Bits a) => SFiniteBits a where Source #

Finite bit-length symbolic values. Essentially the same as SIntegral, but further leaves out Integer. Loosely based on Haskell's FiniteBits class, but with more methods defined and structured differently to fit into the symbolic world view. Minimal complete definition: sFiniteBitSize.

Minimal complete definition

sFiniteBitSize

Methods

sFiniteBitSize :: SBV a -> Int Source #

Bit size.

lsb :: SBV a -> SBool Source #

Least significant bit of a word, always stored at index 0.

msb :: SBV a -> SBool Source #

Most significant bit of a word, always stored at the last position.

blastBE :: SBV a -> [SBool] Source #

Big-endian blasting of a word into its bits.

blastLE :: SBV a -> [SBool] Source #

Little-endian blasting of a word into its bits.

fromBitsBE :: [SBool] -> SBV a Source #

Reconstruct from given bits, given in little-endian.

fromBitsLE :: [SBool] -> SBV a Source #

Reconstruct from given bits, given in little-endian.

sTestBit :: SBV a -> Int -> SBool Source #

Replacement for testBit, returning SBool instead of Bool.

sExtractBits :: SBV a -> [Int] -> [SBool] Source #

Variant of sTestBit, where we want to extract multiple bit positions.

sPopCount :: SBV a -> SWord8 Source #

Variant of popCount, returning a symbolic value.

setBitTo :: SBV a -> Int -> SBool -> SBV a Source #

A combo of setBit and clearBit, when the bit to be set is symbolic.

fullAdder :: SBV a -> SBV a -> (SBool, SBV a) Source #

Full adder, returns carry-out from the addition. Only for unsigned quantities.

fullMultiplier :: SBV a -> SBV a -> (SBV a, SBV a) Source #

Full multipler, returns both high and low-order bits. Only for unsigned quantities.

sCountLeadingZeros :: SBV a -> SWord8 Source #

Count leading zeros in a word, big-endian interpretation.

sCountTrailingZeros :: SBV a -> SWord8 Source #

Count trailing zeros in a word, big-endian interpretation.

Instances
SFiniteBits Int8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Int16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Int32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Int64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Word8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Word16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Word32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SFiniteBits Word64 Source # 
Instance details

Defined in Data.SBV.Core.Model

Splitting, joining, and extending

class Splittable a b | b -> a where Source #

Splitting an a into two b's and joining back. Intuitively, a is a larger bit-size word than b, typically double. The extend operation captures embedding of a b value into an a without changing its semantic value.

Methods

split :: a -> (b, b) Source #

(#) :: b -> b -> a infixr 5 Source #

extend :: b -> a Source #

Instances
Splittable Word8 Word4 Source #

Joiningsplitting tofrom Word8

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Splittable Word16 Word8 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable Word32 Word16 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable Word64 Word32 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable SWord64 SWord32 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable SWord32 SWord16 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable SWord16 SWord8 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Exponentiation

(.^) :: (Mergeable b, Num b, SIntegral e) => b -> SBV e -> b Source #

Symbolic exponentiation using bit blasting and repeated squaring.

N.B. The exponent must be unsigned/bounded if symbolic. Signed exponents will be rejected.

IEEE-floating point numbers

class (SymVal a, RealFloat a) => IEEEFloating a where Source #

A class of floating-point (IEEE754) operations, some of which behave differently based on rounding modes. Note that unless the rounding mode is concretely RoundNearestTiesToEven, we will not concretely evaluate these, but rather pass down to the SMT solver.

Minimal complete definition

Nothing

Methods

fpAbs :: SBV a -> SBV a Source #

Compute the floating point absolute value.

fpNeg :: SBV a -> SBV a Source #

Compute the unary negation. Note that 0 - x is not equivalent to -x for floating-point, since -0 and 0 are different.

fpAdd :: SRoundingMode -> SBV a -> SBV a -> SBV a Source #

Add two floating point values, using the given rounding mode

fpSub :: SRoundingMode -> SBV a -> SBV a -> SBV a Source #

Subtract two floating point values, using the given rounding mode

fpMul :: SRoundingMode -> SBV a -> SBV a -> SBV a Source #

Multiply two floating point values, using the given rounding mode

fpDiv :: SRoundingMode -> SBV a -> SBV a -> SBV a Source #

Divide two floating point values, using the given rounding mode

fpFMA :: SRoundingMode -> SBV a -> SBV a -> SBV a -> SBV a Source #

Fused-multiply-add three floating point values, using the given rounding mode. fpFMA x y z = x*y+z but with only one rounding done for the whole operation; not two. Note that we will never concretely evaluate this function since Haskell lacks an FMA implementation.

fpSqrt :: SRoundingMode -> SBV a -> SBV a Source #

Compute the square-root of a float, using the given rounding mode

fpRem :: SBV a -> SBV a -> SBV a Source #

Compute the remainder: x - y * n, where n is the truncated integer nearest to x/y. The rounding mode is implicitly assumed to be RoundNearestTiesToEven.

fpRoundToIntegral :: SRoundingMode -> SBV a -> SBV a Source #

Round to the nearest integral value, using the given rounding mode.

fpMin :: SBV a -> SBV a -> SBV a Source #

Compute the minimum of two floats, respects infinity and NaN values

fpMax :: SBV a -> SBV a -> SBV a Source #

Compute the maximum of two floats, respects infinity and NaN values

fpIsEqualObject :: SBV a -> SBV a -> SBool Source #

Are the two given floats exactly the same. That is, NaN will compare equal to itself, +0 will not compare equal to -0 etc. This is the object level equality, as opposed to the semantic equality. (For the latter, just use .==.)

fpIsNormal :: SBV a -> SBool Source #

Is the floating-point number a normal value. (i.e., not denormalized.)

fpIsSubnormal :: SBV a -> SBool Source #

Is the floating-point number a subnormal value. (Also known as denormal.)

fpIsZero :: SBV a -> SBool Source #

Is the floating-point number 0? (Note that both +0 and -0 will satisfy this predicate.)

fpIsInfinite :: SBV a -> SBool Source #

Is the floating-point number infinity? (Note that both +oo and -oo will satisfy this predicate.)

fpIsNaN :: SBV a -> SBool Source #

Is the floating-point number a NaN value?

fpIsNegative :: SBV a -> SBool Source #

Is the floating-point number negative? Note that -0 satisfies this predicate but +0 does not.

fpIsPositive :: SBV a -> SBool Source #

Is the floating-point number positive? Note that +0 satisfies this predicate but -0 does not.

fpIsNegativeZero :: SBV a -> SBool Source #

Is the floating point number -0?

fpIsPositiveZero :: SBV a -> SBool Source #

Is the floating point number +0?

fpIsPoint :: SBV a -> SBool Source #

Is the floating-point number a regular floating point, i.e., not NaN, nor +oo, nor -oo. Normals or denormals are allowed.

Instances
IEEEFloating Double Source #

SDouble instance

Instance details

Defined in Data.SBV.Core.Floating

IEEEFloating Float Source #

SFloat instance

Instance details

Defined in Data.SBV.Core.Floating

data RoundingMode Source #

Rounding mode to be used for the IEEE floating-point operations. Note that Haskell's default is RoundNearestTiesToEven. If you use a different rounding mode, then the counter-examples you get may not match what you observe in Haskell.

Constructors

RoundNearestTiesToEven

Round to nearest representable floating point value. If precisely at half-way, pick the even number. (In this context, even means the lowest-order bit is zero.)

RoundNearestTiesToAway

Round to nearest representable floating point value. If precisely at half-way, pick the number further away from 0. (That is, for positive values, pick the greater; for negative values, pick the smaller.)

RoundTowardPositive

Round towards positive infinity. (Also known as rounding-up or ceiling.)

RoundTowardNegative

Round towards negative infinity. (Also known as rounding-down or floor.)

RoundTowardZero

Round towards zero. (Also known as truncation.)

Instances
Bounded RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Enum RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Eq RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Data RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RoundingMode -> c RoundingMode #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RoundingMode #

toConstr :: RoundingMode -> Constr #

dataTypeOf :: RoundingMode -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RoundingMode) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RoundingMode) #

gmapT :: (forall b. Data b => b -> b) -> RoundingMode -> RoundingMode #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RoundingMode -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RoundingMode -> r #

gmapQ :: (forall d. Data d => d -> u) -> RoundingMode -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RoundingMode -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RoundingMode -> m RoundingMode #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RoundingMode -> m RoundingMode #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RoundingMode -> m RoundingMode #

Ord RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Read RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Show RoundingMode Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

HasKind RoundingMode Source #

RoundingMode kind

Instance details

Defined in Data.SBV.Core.Symbolic

SymVal RoundingMode Source #

RoundingMode can be used symbolically

Instance details

Defined in Data.SBV.Core.Data

SatModel RoundingMode Source #

A rounding mode, extracted from a model. (Default definition suffices)

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (RoundingMode, [CV]) Source #

cvtModel :: (RoundingMode -> Maybe b) -> Maybe (RoundingMode, [CV]) -> Maybe (b, [CV]) Source #

type SRoundingMode = SBV RoundingMode Source #

The symbolic variant of RoundingMode

nan :: Floating a => a Source #

Not-A-Number for Double and Float. Surprisingly, Haskell Prelude doesn't have this value defined, so we provide it here.

infinity :: Floating a => a Source #

Infinity for Double and Float. Surprisingly, Haskell Prelude doesn't have this value defined, so we provide it here.

sNaN :: (Floating a, SymVal a) => SBV a Source #

Symbolic variant of Not-A-Number. This value will inhabit both SDouble and SFloat.

sInfinity :: (Floating a, SymVal a) => SBV a Source #

Symbolic variant of infinity. This value will inhabit both SDouble and SFloat.

Rounding modes

Conversion to/from floats

class SymVal a => IEEEFloatConvertible a where Source #

Capture convertability from/to FloatingPoint representations.

Conversions to float: toSFloat and toSDouble simply return the nearest representable float from the given type based on the rounding mode provided.

Conversions from float: fromSFloat and fromSDouble functions do the reverse conversion. However some care is needed when given values that are not representable in the integral target domain. For instance, converting an SFloat to an SInt8 is problematic. The rules are as follows:

If the input value is a finite point and when rounded in the given rounding mode to an integral value lies within the target bounds, then that result is returned. (This is the regular interpretation of rounding in IEEE754.)

Otherwise (i.e., if the integral value in the float or double domain) doesn't fit into the target type, then the result is unspecified. Note that if the input is +oo, -oo, or NaN, then the result is unspecified.

Due to the unspecified nature of conversions, SBV will never constant fold conversions from floats to integral values. That is, you will always get a symbolic value as output. (Conversions from floats to other floats will be constant folded. Conversions from integral values to floats will also be constant folded.)

Note that unspecified really means unspecified: In particular, SBV makes no guarantees about matching the behavior between what you might get in Haskell, via SMT-Lib, or the C-translation. If the input value is out-of-bounds as defined above, or is NaN or oo or -oo, then all bets are off. In particular C and SMTLib are decidedly undefine this case, though that doesn't mean they do the same thing! Same goes for Haskell, which seems to convert via Int64, but we do not model that behavior in SBV as it doesn't seem to be intentional nor well documented.

You can check for NaN, oo and -oo, using the predicates fpIsNaN, fpIsInfinite, and fpIsPositive, fpIsNegative predicates, respectively; and do the proper conversion based on your needs. (0 is a good choice, as are min/max bounds of the target type.)

Currently, SBV provides no predicates to check if a value would lie within range for a particular conversion task, as this depends on the rounding mode and the types involved and can be rather tricky to determine. (See http://github.com/LeventErkok/sbv/issues/456 for a discussion of the issues involved.) In a future release, we hope to be able to provide underflow and overflow predicates for these conversions as well.

Minimal complete definition

Nothing

Methods

fromSFloat :: SRoundingMode -> SFloat -> SBV a Source #

Convert from an IEEE74 single precision float.

toSFloat :: SRoundingMode -> SBV a -> SFloat Source #

Convert to an IEEE-754 Single-precision float.

>>> :{
roundTrip :: forall a. (Eq a, IEEEFloatConvertible a) => SRoundingMode -> SBV a -> SBool
roundTrip m x = fromSFloat m (toSFloat m x) .== x
:}
>>> prove $ roundTrip @Int8
Q.E.D.
>>> prove $ roundTrip @Word8
Q.E.D.
>>> prove $ roundTrip @Int16
Q.E.D.
>>> prove $ roundTrip @Word16
Q.E.D.
>>> prove $ roundTrip @Int32
Falsifiable. Counter-example:
  s0 = RoundNearestTiesToEven :: RoundingMode
  s1 =            -2130176960 :: Int32

Note how we get a failure on Int32. The counter-example value is not representable exactly as a single precision float:

>>> toRational (-2130176960 :: Float)
(-2130177024) % 1

Note how the numerator is different, it is off by 64. This is hardly surprising, since floats become sparser as the magnitude increases to be able to cover all the integer values representable.

toSFloat :: Integral a => SRoundingMode -> SBV a -> SFloat Source #

Convert to an IEEE-754 Single-precision float.

>>> :{
roundTrip :: forall a. (Eq a, IEEEFloatConvertible a) => SRoundingMode -> SBV a -> SBool
roundTrip m x = fromSFloat m (toSFloat m x) .== x
:}
>>> prove $ roundTrip @Int8
Q.E.D.
>>> prove $ roundTrip @Word8
Q.E.D.
>>> prove $ roundTrip @Int16
Q.E.D.
>>> prove $ roundTrip @Word16
Q.E.D.
>>> prove $ roundTrip @Int32
Falsifiable. Counter-example:
  s0 = RoundNearestTiesToEven :: RoundingMode
  s1 =            -2130176960 :: Int32

Note how we get a failure on Int32. The counter-example value is not representable exactly as a single precision float:

>>> toRational (-2130176960 :: Float)
(-2130177024) % 1

Note how the numerator is different, it is off by 64. This is hardly surprising, since floats become sparser as the magnitude increases to be able to cover all the integer values representable.

fromSDouble :: SRoundingMode -> SDouble -> SBV a Source #

Convert from an IEEE74 double precision float.

toSDouble :: SRoundingMode -> SBV a -> SDouble Source #

Convert to an IEEE-754 Double-precision float.

>>> :{
roundTrip :: forall a. (Eq a, IEEEFloatConvertible a) => SRoundingMode -> SBV a -> SBool
roundTrip m x = fromSDouble m (toSDouble m x) .== x
:}
>>> prove $ roundTrip @Int8
Q.E.D.
>>> prove $ roundTrip @Word8
Q.E.D.
>>> prove $ roundTrip @Int16
Q.E.D.
>>> prove $ roundTrip @Word16
Q.E.D.
>>> prove $ roundTrip @Int32
Q.E.D.
>>> prove $ roundTrip @Word32
Q.E.D.
>>> prove $ roundTrip @Int64
Falsifiable. Counter-example:
  s0 = RoundNearestTiesToEven :: RoundingMode
  s1 =    4611686018427387902 :: Int64

Just like in the SFloat case, once we reach 64-bits, we no longer can exactly represent the integer value for all possible values:

>>> toRational (4611686018427387902 ::Double)
4611686018427387904 % 1

In this case the numerator is off by 2!

toSDouble :: Integral a => SRoundingMode -> SBV a -> SDouble Source #

Convert to an IEEE-754 Double-precision float.

>>> :{
roundTrip :: forall a. (Eq a, IEEEFloatConvertible a) => SRoundingMode -> SBV a -> SBool
roundTrip m x = fromSDouble m (toSDouble m x) .== x
:}
>>> prove $ roundTrip @Int8
Q.E.D.
>>> prove $ roundTrip @Word8
Q.E.D.
>>> prove $ roundTrip @Int16
Q.E.D.
>>> prove $ roundTrip @Word16
Q.E.D.
>>> prove $ roundTrip @Int32
Q.E.D.
>>> prove $ roundTrip @Word32
Q.E.D.
>>> prove $ roundTrip @Int64
Falsifiable. Counter-example:
  s0 = RoundNearestTiesToEven :: RoundingMode
  s1 =    4611686018427387902 :: Int64

Just like in the SFloat case, once we reach 64-bits, we no longer can exactly represent the integer value for all possible values:

>>> toRational (4611686018427387902 ::Double)
4611686018427387904 % 1

In this case the numerator is off by 2!

Instances
IEEEFloatConvertible Double Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Float Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Int8 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Int16 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Int32 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Int64 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Integer Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Word8 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Word16 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Word32 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible Word64 Source # 
Instance details

Defined in Data.SBV.Core.Floating

IEEEFloatConvertible AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Floating

Bit-pattern conversions

sFloatAsSWord32 :: SFloat -> SWord32 Source #

Convert an SFloat to an SWord32, preserving the bit-correspondence. Note that since the representation for NaNs are not unique, this function will return a symbolic value when given a concrete NaN.

Implementation note: Since there's no corresponding function in SMTLib for conversion to bit-representation due to partiality, we use a translation trick by allocating a new word variable, converting it to float, and requiring it to be equivalent to the input. In code-generation mode, we simply map it to a simple conversion.

sWord32AsSFloat :: SWord32 -> SFloat Source #

Reinterpret the bits in a 32-bit word as a single-precision floating point number

sDoubleAsSWord64 :: SDouble -> SWord64 Source #

Convert an SDouble to an SWord64, preserving the bit-correspondence. Note that since the representation for NaNs are not unique, this function will return a symbolic value when given a concrete NaN.

See the implementation note for sFloatAsSWord32, as it applies here as well.

sWord64AsSDouble :: SWord64 -> SDouble Source #

Reinterpret the bits in a 32-bit word as a single-precision floating point number

blastSFloat :: SFloat -> (SBool, [SBool], [SBool]) Source #

Extract the sign/exponent/mantissa of a single-precision float. The output will have 8 bits in the second argument for exponent, and 23 in the third for the mantissa.

blastSDouble :: SDouble -> (SBool, [SBool], [SBool]) Source #

Extract the sign/exponent/mantissa of a single-precision float. The output will have 11 bits in the second argument for exponent, and 52 in the third for the mantissa.

Enumerations

mkSymbolicEnumeration :: Name -> Q [Dec] Source #

Make an enumeration a symbolic type.

Uninterpreted sorts, constants, and functions

class Uninterpreted a where Source #

Uninterpreted constants and functions. An uninterpreted constant is a value that is indexed by its name. The only property the prover assumes about these values are that they are equivalent to themselves; i.e., (for functions) they return the same results when applied to same arguments. We support uninterpreted-functions as a general means of black-box'ing operations that are irrelevant for the purposes of the proof; i.e., when the proofs can be performed without any knowledge about the function itself.

Minimal complete definition: sbvUninterpret. However, most instances in practice are already provided by SBV, so end-users should not need to define their own instances.

Minimal complete definition

sbvUninterpret

Methods

uninterpret :: String -> a Source #

Uninterpret a value, receiving an object that can be used instead. Use this version when you do not need to add an axiom about this value.

cgUninterpret :: String -> [String] -> a -> a Source #

Uninterpret a value, only for the purposes of code-generation. For execution and verification the value is used as is. For code-generation, the alternate definition is used. This is useful when we want to take advantage of native libraries on the target languages.

sbvUninterpret :: Maybe ([String], a) -> String -> a Source #

Most generalized form of uninterpretation, this function should not be needed by end-user-code, but is rather useful for the library development.

Instances
HasKind a => Uninterpreted (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

(SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV c, SBV b) -> SBV a) -> String -> (SBV c, SBV b) -> SBV a Source #

(SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV d, SBV c, SBV b) -> SBV a) -> (SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV d -> SBV c -> SBV b -> SBV a) -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV c -> SBV b -> SBV a) -> String -> SBV c -> SBV b -> SBV a Source #

(SymVal b, HasKind a) => Uninterpreted (SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV b -> SBV a) -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV b -> SBV a) -> String -> SBV b -> SBV a Source #

addAxiom :: MonadSymbolic m => String -> [String] -> m () Source #

Generalization of addAxiom

Properties, proofs, and satisfiability

type Predicate = Symbolic SBool Source #

A predicate is a symbolic program that returns a (symbolic) boolean value. For all intents and purposes, it can be treated as an n-ary function from symbolic-values to a boolean. The Symbolic monad captures the underlying representation, and can/should be ignored by the users of the library, unless you are building further utilities on top of SBV itself. Instead, simply use the Predicate type when necessary.

type Goal = Symbolic () Source #

A goal is a symbolic program that returns no values. The idea is that the constraints/min-max goals will serve as appropriate directives for sat/prove calls.

class ExtractIO m => MProvable m a where Source #

A type a is provable if we can turn it into a predicate. Note that a predicate can be made from a curried function of arbitrary arity, where each element is either a symbolic type or up-to a 7-tuple of symbolic-types. So predicates can be constructed from almost arbitrary Haskell functions that have arbitrary shapes. (See the instance declarations below.)

Minimal complete definition

forAll_, forAll, forSome_, forSome

Methods

forAll_ :: a -> SymbolicT m SBool Source #

Generalization of forAll_

forAll :: [String] -> a -> SymbolicT m SBool Source #

Generalization of forAll

forSome_ :: a -> SymbolicT m SBool Source #

Generalization of forSome_

forSome :: [String] -> a -> SymbolicT m SBool Source #

Generalization of forSome

prove :: a -> m ThmResult Source #

Generalization of prove

proveWith :: SMTConfig -> a -> m ThmResult Source #

Generalization of proveWith

sat :: a -> m SatResult Source #

Generalization of sat

satWith :: SMTConfig -> a -> m SatResult Source #

Generalization of satWith

allSat :: a -> m AllSatResult Source #

Generalization of allSat

allSatWith :: SMTConfig -> a -> m AllSatResult Source #

Generalization of allSatWith

optimize :: OptimizeStyle -> a -> m OptimizeResult Source #

Generalization of optimize

optimizeWith :: SMTConfig -> OptimizeStyle -> a -> m OptimizeResult Source #

Generalization of optimizeWith

isVacuous :: a -> m Bool Source #

Generalization of isVacuous

isVacuousWith :: SMTConfig -> a -> m Bool Source #

Generalization of isVacuousWith

isTheorem :: a -> m Bool Source #

Generalization of isTheorem

isTheoremWith :: SMTConfig -> a -> m Bool Source #

Generalization of isTheoremWith

isSatisfiable :: a -> m Bool Source #

Generalization of isSatisfiable

isSatisfiableWith :: SMTConfig -> a -> m Bool Source #

Generalization of isSatisfiableWith

validate :: Bool -> SMTConfig -> a -> SMTResult -> m SMTResult Source #

Validate a model obtained from the solver

Instances
ExtractIO m => MProvable m SBool Source # 
Instance details

Defined in Data.SBV.Provers.Prover

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, MProvable m p) => MProvable m ((SBV a, SBV b) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b) -> p) -> SMTResult -> m SMTResult Source #

(HasKind a, HasKind b, MProvable m p) => MProvable m (SFunArray a b -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

(HasKind a, HasKind b, MProvable m p) => MProvable m (SArray a b -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: (SArray a b -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> (SArray a b -> p) -> SymbolicT m SBool Source #

forSome_ :: (SArray a b -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> (SArray a b -> p) -> SymbolicT m SBool Source #

prove :: (SArray a b -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> (SArray a b -> p) -> m ThmResult Source #

sat :: (SArray a b -> p) -> m SatResult Source #

satWith :: SMTConfig -> (SArray a b -> p) -> m SatResult Source #

allSat :: (SArray a b -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> (SArray a b -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> (SArray a b -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> (SArray a b -> p) -> m OptimizeResult Source #

isVacuous :: (SArray a b -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> (SArray a b -> p) -> m Bool Source #

isTheorem :: (SArray a b -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> (SArray a b -> p) -> m Bool Source #

isSatisfiable :: (SArray a b -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> (SArray a b -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> (SArray a b -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, MProvable m p) => MProvable m (SBV a -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: (SBV a -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> (SBV a -> p) -> SymbolicT m SBool Source #

forSome_ :: (SBV a -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> (SBV a -> p) -> SymbolicT m SBool Source #

prove :: (SBV a -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> (SBV a -> p) -> m ThmResult Source #

sat :: (SBV a -> p) -> m SatResult Source #

satWith :: SMTConfig -> (SBV a -> p) -> m SatResult Source #

allSat :: (SBV a -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> (SBV a -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> (SBV a -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> (SBV a -> p) -> m OptimizeResult Source #

isVacuous :: (SBV a -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> (SBV a -> p) -> m Bool Source #

isTheorem :: (SBV a -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> (SBV a -> p) -> m Bool Source #

isSatisfiable :: (SBV a -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> (SBV a -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> (SBV a -> p) -> SMTResult -> m SMTResult Source #

ExtractIO m => MProvable m (SymbolicT m SBool) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

ExtractIO m => MProvable m (SymbolicT m ()) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

type Provable = MProvable IO Source #

Provable is specialization of MProvable to the IO monad. Unless you are using transformers explicitly, this is the type you should prefer.

proveWithAll :: Provable a => [SMTConfig] -> a -> IO [(Solver, NominalDiffTime, ThmResult)] Source #

Prove a property with multiple solvers, running them in separate threads. The results will be returned in the order produced.

proveWithAny :: Provable a => [SMTConfig] -> a -> IO (Solver, NominalDiffTime, ThmResult) Source #

Prove a property with multiple solvers, running them in separate threads. Only the result of the first one to finish will be returned, remaining threads will be killed. Note that we send a ThreadKilled to the losing processes, but we do *not* actually wait for them to finish. In rare cases this can lead to zombie processes. In previous experiments, we found that some processes take their time to terminate. So, this solution favors quick turnaround.

satWithAll :: Provable a => [SMTConfig] -> a -> IO [(Solver, NominalDiffTime, SatResult)] Source #

Find a satisfying assignment to a property with multiple solvers, running them in separate threads. The results will be returned in the order produced.

satWithAny :: Provable a => [SMTConfig] -> a -> IO (Solver, NominalDiffTime, SatResult) Source #

Find a satisfying assignment to a property with multiple solvers, running them in separate threads. Only the result of the first one to finish will be returned, remaining threads will be killed. Note that we send a ThreadKilled to the losing processes, but we do *not* actually wait for them to finish. In rare cases this can lead to zombie processes. In previous experiments, we found that some processes take their time to terminate. So, this solution favors quick turnaround.

generateSMTBenchmark :: (MonadIO m, MProvable m a) => Bool -> a -> m String Source #

Create an SMT-Lib2 benchmark. The Bool argument controls whether this is a SAT instance, i.e., translate the query directly, or a PROVE instance, i.e., translate the negated query.

solve :: MonadSymbolic m => [SBool] -> m SBool Source #

Generalization of solve

Constraints

General constraints

constrain :: SolverContext m => SBool -> m () Source #

Add a constraint, any satisfying instance must satisfy this condition.

softConstrain :: SolverContext m => SBool -> m () Source #

Add a soft constraint. The solver will try to satisfy this condition if possible, but won't if it cannot.

Constraint Vacuity

Named constraints and attributes

namedConstraint :: SolverContext m => String -> SBool -> m () Source #

Add a named constraint. The name is used in unsat-core extraction.

constrainWithAttribute :: SolverContext m => [(String, String)] -> SBool -> m () Source #

Add a constraint, with arbitrary attributes. Used in interpolant generation.

Unsat cores

Cardinality constraints

pbAtMost :: [SBool] -> Int -> SBool Source #

sTrue if at most k of the input arguments are sTrue

pbAtLeast :: [SBool] -> Int -> SBool Source #

sTrue if at least k of the input arguments are sTrue

pbExactly :: [SBool] -> Int -> SBool Source #

sTrue if exactly k of the input arguments are sTrue

pbLe :: [(Int, SBool)] -> Int -> SBool Source #

sTrue if the sum of coefficients for sTrue elements is at most k. Generalizes pbAtMost.

pbGe :: [(Int, SBool)] -> Int -> SBool Source #

sTrue if the sum of coefficients for sTrue elements is at least k. Generalizes pbAtLeast.

pbEq :: [(Int, SBool)] -> Int -> SBool Source #

sTrue if the sum of coefficients for sTrue elements is exactly least k. Useful for coding exactly K-of-N constraints, and in particular mutex constraints.

pbMutexed :: [SBool] -> SBool Source #

sTrue if there is at most one set bit

pbStronglyMutexed :: [SBool] -> SBool Source #

sTrue if there is exactly one set bit

Checking safety

sAssert :: HasKind a => Maybe CallStack -> String -> SBool -> SBV a -> SBV a Source #

Symbolic assert. Check that the given boolean condition is always sTrue in the given path. The optional first argument can be used to provide call-stack info via GHC's location facilities.

isSafe :: SafeResult -> Bool Source #

Check if a safe-call was safe or not, turning a SafeResult to a Bool.

class ExtractIO m => SExecutable m a where Source #

Symbolically executable program fragments. This class is mainly used for safe calls, and is sufficently populated internally to cover most use cases. Users can extend it as they wish to allow safe checks for SBV programs that return/take types that are user-defined.

Minimal complete definition

sName_, sName

Methods

sName_ :: a -> SymbolicT m () Source #

Generalization of sName_

sName :: [String] -> a -> SymbolicT m () Source #

Generalization of sName

safe :: a -> m [SafeResult] Source #

Generalization of safe

safeWith :: SMTConfig -> a -> m [SafeResult] Source #

Generalization of safeWith

Instances
ExtractIO m => SExecutable m () Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: () -> SymbolicT m () Source #

sName :: [String] -> () -> SymbolicT m () Source #

safe :: () -> m [SafeResult] Source #

safeWith :: SMTConfig -> () -> m [SafeResult] Source #

ExtractIO m => SExecutable m [SBV a] Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: [SBV a] -> SymbolicT m () Source #

sName :: [String] -> [SBV a] -> SymbolicT m () Source #

safe :: [SBV a] -> m [SafeResult] Source #

safeWith :: SMTConfig -> [SBV a] -> m [SafeResult] Source #

ExtractIO m => SExecutable m (SBV a) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: SBV a -> SymbolicT m () Source #

sName :: [String] -> SBV a -> SymbolicT m () Source #

safe :: SBV a -> m [SafeResult] Source #

safeWith :: SMTConfig -> SBV a -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SExecutable m p) => SExecutable m ((SBV a, SBV b) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m [SafeResult] Source #

(SymVal a, SExecutable m p) => SExecutable m (SBV a -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a -> p) -> SymbolicT m () Source #

sName :: [String] -> (SBV a -> p) -> SymbolicT m () Source #

safe :: (SBV a -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a -> p) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b) => SExecutable m (SBV a, SBV b) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b) -> SymbolicT m () Source #

safe :: (SBV a, SBV b) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b) -> m [SafeResult] Source #

(ExtractIO m, NFData a) => SExecutable m (SymbolicT m a) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c) => SExecutable m (SBV a, SBV b, SBV c) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d) => SExecutable m (SBV a, SBV b, SBV c, SBV d) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d, NFData e, SymVal e) => SExecutable m (SBV a, SBV b, SBV c, SBV d, SBV e) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d, SBV e) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d, SBV e) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d, SBV e) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d, SBV e) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d, NFData e, SymVal e, NFData f, SymVal f) => SExecutable m (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d, NFData e, SymVal e, NFData f, SymVal f, NFData g, SymVal g) => SExecutable m (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> m [SafeResult] Source #

Quick-checking

sbvQuickCheck :: Symbolic SBool -> IO Bool Source #

Quick check an SBV property. Note that a regular quickCheck call will work just as well. Use this variant if you want to receive the boolean result.

Optimization

Multiple optimization goals

data OptimizeStyle Source #

Style of optimization. Note that in the pareto case the user is allowed to specify a max number of fronts to query the solver for, since there might potentially be an infinite number of them and there is no way to know exactly how many ahead of time. If Nothing is given, SBV will possibly loop forever if the number is really infinite.

Constructors

Lexicographic

Objectives are optimized in the order given, earlier objectives have higher priority.

Independent

Each objective is optimized independently.

Pareto (Maybe Int)

Objectives are optimized according to pareto front: That is, no objective can be made better without making some other worse.

Objectives

data Objective a Source #

Objective of optimization. We can minimize, maximize, or give a soft assertion with a penalty for not satisfying it.

Constructors

Minimize String a

Minimize this metric

Maximize String a

Maximize this metric

AssertWithPenalty String a Penalty

A soft assertion, with an associated penalty

Instances
Functor Objective Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

fmap :: (a -> b) -> Objective a -> Objective b #

(<$) :: a -> Objective b -> Objective a #

Show a => Show (Objective a) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

NFData a => NFData (Objective a) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

rnf :: Objective a -> () #

class Metric a where Source #

Class of metrics we can optimize for. Currently, booleans, bounded signed/unsigned bit-vectors, unbounded integers, algebraic reals and floats can be optimized. You can add your instances, but bewared that the MetricSpace should map your type to something the backend solver understands, which are limited to unsigned bit-vectors, reals, and unbounded integers for z3.

A good reference on these features is given in the following paper: http://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/nbjorner-scss2014.pdf.

Minimal completion: None. However, if MetricSpace is not identical to the type, you want to define toMetricSpace and possbly 'minimize'/'maximize' to add extra constraints as necessary.

Minimal complete definition

Nothing

Associated Types

type MetricSpace a :: * Source #

The metric space we optimize the goal over. Usually the same as the type itself, but not always! For instance, signed bit-vectors are optimized over their unsigned counterparts, floats are optimized over their Word32 comparable counterparts, etc.

Methods

toMetricSpace :: SBV a -> SBV (MetricSpace a) Source #

Compute the metric value to optimize.

fromMetricSpace :: SBV (MetricSpace a) -> SBV a Source #

Compute the value itself from the metric corresponding to it.

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV a -> m () Source #

Minimizing a metric space

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV a -> m () Source #

Maximizing a metric space

toMetricSpace :: a ~ MetricSpace a => SBV a -> SBV (MetricSpace a) Source #

Compute the metric value to optimize.

fromMetricSpace :: a ~ MetricSpace a => SBV (MetricSpace a) -> SBV a Source #

Compute the value itself from the metric corresponding to it.

Instances
Metric Bool Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Bool :: Type Source #

Metric Double Source #

Double instance for Metric goes through the lexicographic ordering on Word64. It implicitly makes sure that the value is not NaN.

Instance details

Defined in Data.SBV.Core.Floating

Associated Types

type MetricSpace Double :: Type Source #

Metric Float Source #

Float instance for Metric goes through the lexicographic ordering on Word32. It implicitly makes sure that the value is not NaN.

Instance details

Defined in Data.SBV.Core.Floating

Associated Types

type MetricSpace Float :: Type Source #

Metric Int8 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Int8 :: Type Source #

Metric Int16 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Int16 :: Type Source #

Metric Int32 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Int32 :: Type Source #

Metric Int64 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Int64 :: Type Source #

Metric Integer Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Integer :: Type Source #

Metric Word8 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Word8 :: Type Source #

Metric Word16 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Word16 :: Type Source #

Metric Word32 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Word32 :: Type Source #

Metric Word64 Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace Word64 :: Type Source #

Metric AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Model

Associated Types

type MetricSpace AlgReal :: Type Source #

Metric Day Source #

Make day an optimizable value, by mapping it to Word8 in the most obvious way. We can map it to any value the underlying solver can optimize, but Word8 is the simplest and it'll fit the bill.

Instance details

Defined in Documentation.SBV.Examples.Optimization.Enumerate

Associated Types

type MetricSpace Day :: Type Source #

(SymVal a, Metric a, SymVal b, Metric b) => Metric (a, b) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b) :: Type Source #

Methods

toMetricSpace :: SBV (a, b) -> SBV (MetricSpace (a, b)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b)) -> SBV (a, b) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b) -> m () Source #

(SymVal a, Metric a, SymVal b, Metric b, SymVal c, Metric c) => Metric (a, b, c) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b, c) :: Type Source #

Methods

toMetricSpace :: SBV (a, b, c) -> SBV (MetricSpace (a, b, c)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b, c)) -> SBV (a, b, c) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c) -> m () Source #

(SymVal a, Metric a, SymVal b, Metric b, SymVal c, Metric c, SymVal d, Metric d) => Metric (a, b, c, d) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b, c, d) :: Type Source #

Methods

toMetricSpace :: SBV (a, b, c, d) -> SBV (MetricSpace (a, b, c, d)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b, c, d)) -> SBV (a, b, c, d) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d) -> m () Source #

(SymVal a, Metric a, SymVal b, Metric b, SymVal c, Metric c, SymVal d, Metric d, SymVal e, Metric e) => Metric (a, b, c, d, e) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b, c, d, e) :: Type Source #

Methods

toMetricSpace :: SBV (a, b, c, d, e) -> SBV (MetricSpace (a, b, c, d, e)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b, c, d, e)) -> SBV (a, b, c, d, e) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e) -> m () Source #

(SymVal a, Metric a, SymVal b, Metric b, SymVal c, Metric c, SymVal d, Metric d, SymVal e, Metric e, SymVal f, Metric f) => Metric (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b, c, d, e, f) :: Type Source #

Methods

toMetricSpace :: SBV (a, b, c, d, e, f) -> SBV (MetricSpace (a, b, c, d, e, f)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b, c, d, e, f)) -> SBV (a, b, c, d, e, f) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e, f) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e, f) -> m () Source #

(SymVal a, Metric a, SymVal b, Metric b, SymVal c, Metric c, SymVal d, Metric d, SymVal e, Metric e, SymVal f, Metric f, SymVal g, Metric g) => Metric (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b, c, d, e, f, g) :: Type Source #

Methods

toMetricSpace :: SBV (a, b, c, d, e, f, g) -> SBV (MetricSpace (a, b, c, d, e, f, g)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b, c, d, e, f, g)) -> SBV (a, b, c, d, e, f, g) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e, f, g) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e, f, g) -> m () Source #

(SymVal a, Metric a, SymVal b, Metric b, SymVal c, Metric c, SymVal d, Metric d, SymVal e, Metric e, SymVal f, Metric f, SymVal g, Metric g, SymVal h, Metric h) => Metric (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Data.SBV.Tuple

Associated Types

type MetricSpace (a, b, c, d, e, f, g, h) :: Type Source #

Methods

toMetricSpace :: SBV (a, b, c, d, e, f, g, h) -> SBV (MetricSpace (a, b, c, d, e, f, g, h)) Source #

fromMetricSpace :: SBV (MetricSpace (a, b, c, d, e, f, g, h)) -> SBV (a, b, c, d, e, f, g, h) Source #

msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e, f, g, h) -> m () Source #

msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (a, b, c, d, e, f, g, h) -> m () Source #

Soft assumptions

data Penalty Source #

Penalty for a soft-assertion. The default penalty is 1, with all soft-assertions belonging to the same objective goal. A positive weight and an optional group can be provided by using the Penalty constructor.

Constructors

DefaultPenalty

Default: Penalty of 1 and no group attached

Penalty Rational (Maybe String)

Penalty with a weight and an optional group

Instances
Show Penalty Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

NFData Penalty Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

rnf :: Penalty -> () #

Field extensions

If an optimization results in an infinity/epsilon value, the returned CV value will be in the corresponding extension field.

data ExtCV Source #

A simple expression type over extendent values, covering infinity, epsilon and intervals.

Model extraction

Inspecting proof results

newtype AllSatResult Source #

An allSat call results in a AllSatResult. The first boolean says whether we hit the max-model limit as we searched. The second boolean says whether there were prefix-existentials. The third boolean says whether we stopped because the solver returned Unknown.

Constructors

AllSatResult (Bool, Bool, Bool, [SMTResult]) 
Instances
Show AllSatResult Source # 
Instance details

Defined in Data.SBV.SMT.SMT

newtype SafeResult Source #

A safe call results in a SafeResult

Instances
Show SafeResult Source # 
Instance details

Defined in Data.SBV.SMT.SMT

data OptimizeResult Source #

An optimize call results in a OptimizeResult. In the ParetoResult case, the boolean is True if we reached pareto-query limit and so there might be more unqueried results remaining. If False, it means that we have all the pareto fronts returned. See the Pareto OptimizeStyle for details.

data SMTResult Source #

The result of an SMT solver call. Each constructor is tagged with the SMTConfig that created it so that further tools can inspect it and build layers of results, if needed. For ordinary uses of the library, this type should not be needed, instead use the accessor functions on it. (Custom Show instances and model extractors.)

Constructors

Unsatisfiable SMTConfig (Maybe [String])

Unsatisfiable. If unsat-cores are enabled, they will be returned in the second parameter.

Satisfiable SMTConfig SMTModel

Satisfiable with model

SatExtField SMTConfig SMTModel

Prover returned a model, but in an extension field containing Infinite/epsilon

Unknown SMTConfig SMTReasonUnknown

Prover returned unknown, with the given reason

ProofError SMTConfig [String] (Maybe SMTResult)

Prover errored out, with possibly a bogus result

data SMTReasonUnknown Source #

Reason for reporting unknown.

Instances
Show SMTReasonUnknown Source #

Show instance for unknown

Instance details

Defined in Data.SBV.Control.Types

Generic SMTReasonUnknown Source # 
Instance details

Defined in Data.SBV.Control.Types

Associated Types

type Rep SMTReasonUnknown :: Type -> Type #

NFData SMTReasonUnknown Source # 
Instance details

Defined in Data.SBV.Control.Types

Methods

rnf :: SMTReasonUnknown -> () #

type Rep SMTReasonUnknown Source # 
Instance details

Defined in Data.SBV.Control.Types

type Rep SMTReasonUnknown = D1 (MetaData "SMTReasonUnknown" "Data.SBV.Control.Types" "sbv-8.3-KY4PN9PPbrH5uMg2KovlBp" False) ((C1 (MetaCons "UnknownMemOut" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "UnknownIncomplete" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "UnknownTimeOut" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "UnknownOther" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))

Observing expressions

observe :: SymVal a => String -> SBV a -> SBV a Source #

Observe the value of an expression, uncoditionally. See observeIf for a generalized version.

Programmable model extraction

class SatModel a where Source #

Instances of SatModel can be automatically extracted from models returned by the solvers. The idea is that the sbv infrastructure provides a stream of CV's (constant values) coming from the solver, and the type a is interpreted based on these constants. Many typical instances are already provided, so new instances can be declared with relative ease.

Minimum complete definition: parseCVs

Minimal complete definition

Nothing

Methods

parseCVs :: [CV] -> Maybe (a, [CV]) Source #

Given a sequence of constant-words, extract one instance of the type a, returning the remaining elements untouched. If the next element is not what's expected for this type you should return Nothing

cvtModel :: (a -> Maybe b) -> Maybe (a, [CV]) -> Maybe (b, [CV]) Source #

Given a parsed model instance, transform it using f, and return the result. The default definition for this method should be sufficient in most use cases.

parseCVs :: Read a => [CV] -> Maybe (a, [CV]) Source #

Given a sequence of constant-words, extract one instance of the type a, returning the remaining elements untouched. If the next element is not what's expected for this type you should return Nothing

Instances
SatModel Bool Source #

Bool as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Bool, [CV]) Source #

cvtModel :: (Bool -> Maybe b) -> Maybe (Bool, [CV]) -> Maybe (b, [CV]) Source #

SatModel Double Source #

Double as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Double, [CV]) Source #

cvtModel :: (Double -> Maybe b) -> Maybe (Double, [CV]) -> Maybe (b, [CV]) Source #

SatModel Float Source #

Float as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Float, [CV]) Source #

cvtModel :: (Float -> Maybe b) -> Maybe (Float, [CV]) -> Maybe (b, [CV]) Source #

SatModel Int8 Source #

Int8 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Int8, [CV]) Source #

cvtModel :: (Int8 -> Maybe b) -> Maybe (Int8, [CV]) -> Maybe (b, [CV]) Source #

SatModel Int16 Source #

Int16 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Int16, [CV]) Source #

cvtModel :: (Int16 -> Maybe b) -> Maybe (Int16, [CV]) -> Maybe (b, [CV]) Source #

SatModel Int32 Source #

Int32 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Int32, [CV]) Source #

cvtModel :: (Int32 -> Maybe b) -> Maybe (Int32, [CV]) -> Maybe (b, [CV]) Source #

SatModel Int64 Source #

Int64 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Int64, [CV]) Source #

cvtModel :: (Int64 -> Maybe b) -> Maybe (Int64, [CV]) -> Maybe (b, [CV]) Source #

SatModel Integer Source #

Integer as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Integer, [CV]) Source #

cvtModel :: (Integer -> Maybe b) -> Maybe (Integer, [CV]) -> Maybe (b, [CV]) Source #

SatModel Word8 Source #

Word8 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Word8, [CV]) Source #

cvtModel :: (Word8 -> Maybe b) -> Maybe (Word8, [CV]) -> Maybe (b, [CV]) Source #

SatModel Word16 Source #

Word16 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Word16, [CV]) Source #

cvtModel :: (Word16 -> Maybe b) -> Maybe (Word16, [CV]) -> Maybe (b, [CV]) Source #

SatModel Word32 Source #

Word32 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Word32, [CV]) Source #

cvtModel :: (Word32 -> Maybe b) -> Maybe (Word32, [CV]) -> Maybe (b, [CV]) Source #

SatModel Word64 Source #

Word64 as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (Word64, [CV]) Source #

cvtModel :: (Word64 -> Maybe b) -> Maybe (Word64, [CV]) -> Maybe (b, [CV]) Source #

SatModel () Source #

Base case for SatModel at unit type. Comes in handy if there are no real variables.

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((), [CV]) Source #

cvtModel :: (() -> Maybe b) -> Maybe ((), [CV]) -> Maybe (b, [CV]) Source #

SatModel AlgReal Source #

AlgReal as extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (AlgReal, [CV]) Source #

cvtModel :: (AlgReal -> Maybe b) -> Maybe (AlgReal, [CV]) -> Maybe (b, [CV]) Source #

SatModel CV Source #

CV as extracted from a model; trivial definition

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (CV, [CV]) Source #

cvtModel :: (CV -> Maybe b) -> Maybe (CV, [CV]) -> Maybe (b, [CV]) Source #

SatModel RoundingMode Source #

A rounding mode, extracted from a model. (Default definition suffices)

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe (RoundingMode, [CV]) Source #

cvtModel :: (RoundingMode -> Maybe b) -> Maybe (RoundingMode, [CV]) -> Maybe (b, [CV]) Source #

SatModel State Source #

Make State a symbolic enumeration

Instance details

Defined in Documentation.SBV.Examples.Lists.BoundedMutex

Methods

parseCVs :: [CV] -> Maybe (State, [CV]) Source #

cvtModel :: (State -> Maybe b) -> Maybe (State, [CV]) -> Maybe (b, [CV]) Source #

SatModel E Source #

Make E a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Misc.Enumerate

Methods

parseCVs :: [CV] -> Maybe (E, [CV]) Source #

cvtModel :: (E -> Maybe b) -> Maybe (E, [CV]) -> Maybe (b, [CV]) Source #

SatModel Word4 Source #

SatModel instance, merely uses the generic parsing method.

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Methods

parseCVs :: [CV] -> Maybe (Word4, [CV]) Source #

cvtModel :: (Word4 -> Maybe b) -> Maybe (Word4, [CV]) -> Maybe (b, [CV]) Source #

SatModel Day Source #

Make Day a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Optimization.Enumerate

Methods

parseCVs :: [CV] -> Maybe (Day, [CV]) Source #

cvtModel :: (Day -> Maybe b) -> Maybe (Day, [CV]) -> Maybe (b, [CV]) Source #

SatModel Color Source #

Make Color a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

parseCVs :: [CV] -> Maybe (Color, [CV]) Source #

cvtModel :: (Color -> Maybe b) -> Maybe (Color, [CV]) -> Maybe (b, [CV]) Source #

SatModel Nationality Source #

Make Nationality a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

parseCVs :: [CV] -> Maybe (Nationality, [CV]) Source #

cvtModel :: (Nationality -> Maybe b) -> Maybe (Nationality, [CV]) -> Maybe (b, [CV]) Source #

SatModel Beverage Source #

Make Beverage a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

parseCVs :: [CV] -> Maybe (Beverage, [CV]) Source #

cvtModel :: (Beverage -> Maybe b) -> Maybe (Beverage, [CV]) -> Maybe (b, [CV]) Source #

SatModel Pet Source #

Make Pet a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

parseCVs :: [CV] -> Maybe (Pet, [CV]) Source #

cvtModel :: (Pet -> Maybe b) -> Maybe (Pet, [CV]) -> Maybe (b, [CV]) Source #

SatModel Sport Source #

Make Sport a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

parseCVs :: [CV] -> Maybe (Sport, [CV]) Source #

cvtModel :: (Sport -> Maybe b) -> Maybe (Sport, [CV]) -> Maybe (b, [CV]) Source #

SatModel Color Source #

Make Color a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Garden

Methods

parseCVs :: [CV] -> Maybe (Color, [CV]) Source #

cvtModel :: (Color -> Maybe b) -> Maybe (Color, [CV]) -> Maybe (b, [CV]) Source #

SatModel Color Source #

Make Color a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.HexPuzzle

Methods

parseCVs :: [CV] -> Maybe (Color, [CV]) Source #

cvtModel :: (Color -> Maybe b) -> Maybe (Color, [CV]) -> Maybe (b, [CV]) Source #

SatModel U2Member Source #

Make U2Member a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

Methods

parseCVs :: [CV] -> Maybe (U2Member, [CV]) Source #

cvtModel :: (U2Member -> Maybe b) -> Maybe (U2Member, [CV]) -> Maybe (b, [CV]) Source #

SatModel Location Source #

Make Location a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

Methods

parseCVs :: [CV] -> Maybe (Location, [CV]) Source #

cvtModel :: (Location -> Maybe b) -> Maybe (Location, [CV]) -> Maybe (b, [CV]) Source #

SatModel Day Source #

Make Day a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Methods

parseCVs :: [CV] -> Maybe (Day, [CV]) Source #

cvtModel :: (Day -> Maybe b) -> Maybe (Day, [CV]) -> Maybe (b, [CV]) Source #

SatModel BinOp Source #

Make BinOp a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Queries.FourFours

Methods

parseCVs :: [CV] -> Maybe (BinOp, [CV]) Source #

cvtModel :: (BinOp -> Maybe b) -> Maybe (BinOp, [CV]) -> Maybe (b, [CV]) Source #

SatModel UnOp Source #

Make UnOp a symbolic value.

Instance details

Defined in Documentation.SBV.Examples.Queries.FourFours

Methods

parseCVs :: [CV] -> Maybe (UnOp, [CV]) Source #

cvtModel :: (UnOp -> Maybe b) -> Maybe (UnOp, [CV]) -> Maybe (b, [CV]) Source #

SatModel a => SatModel [a] Source #

A list of values as extracted from a model. When reading a list, we go as long as we can (maximal-munch). Note that this never fails, as we can always return the empty list!

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ([a], [CV]) Source #

cvtModel :: ([a] -> Maybe b) -> Maybe ([a], [CV]) -> Maybe (b, [CV]) Source #

(SatModel a, SatModel b) => SatModel (a, b) Source #

Tuples extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((a, b), [CV]) Source #

cvtModel :: ((a, b) -> Maybe b0) -> Maybe ((a, b), [CV]) -> Maybe (b0, [CV]) Source #

(SatModel a, SatModel b, SatModel c) => SatModel (a, b, c) Source #

3-Tuples extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((a, b, c), [CV]) Source #

cvtModel :: ((a, b, c) -> Maybe b0) -> Maybe ((a, b, c), [CV]) -> Maybe (b0, [CV]) Source #

(SatModel a, SatModel b, SatModel c, SatModel d) => SatModel (a, b, c, d) Source #

4-Tuples extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((a, b, c, d), [CV]) Source #

cvtModel :: ((a, b, c, d) -> Maybe b0) -> Maybe ((a, b, c, d), [CV]) -> Maybe (b0, [CV]) Source #

(SatModel a, SatModel b, SatModel c, SatModel d, SatModel e) => SatModel (a, b, c, d, e) Source #

5-Tuples extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((a, b, c, d, e), [CV]) Source #

cvtModel :: ((a, b, c, d, e) -> Maybe b0) -> Maybe ((a, b, c, d, e), [CV]) -> Maybe (b0, [CV]) Source #

(SatModel a, SatModel b, SatModel c, SatModel d, SatModel e, SatModel f) => SatModel (a, b, c, d, e, f) Source #

6-Tuples extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((a, b, c, d, e, f), [CV]) Source #

cvtModel :: ((a, b, c, d, e, f) -> Maybe b0) -> Maybe ((a, b, c, d, e, f), [CV]) -> Maybe (b0, [CV]) Source #

(SatModel a, SatModel b, SatModel c, SatModel d, SatModel e, SatModel f, SatModel g) => SatModel (a, b, c, d, e, f, g) Source #

7-Tuples extracted from a model

Instance details

Defined in Data.SBV.SMT.SMT

Methods

parseCVs :: [CV] -> Maybe ((a, b, c, d, e, f, g), [CV]) Source #

cvtModel :: ((a, b, c, d, e, f, g) -> Maybe b0) -> Maybe ((a, b, c, d, e, f, g), [CV]) -> Maybe (b0, [CV]) Source #

class Modelable a where Source #

Various SMT results that we can extract models out of.

Methods

modelExists :: a -> Bool Source #

Is there a model?

getModelAssignment :: SatModel b => a -> Either String (Bool, b) Source #

Extract assignments of a model, the result is a tuple where the first argument (if True) indicates whether the model was "probable". (i.e., if the solver returned unknown.)

getModelDictionary :: a -> Map String CV Source #

Extract a model dictionary. Extract a dictionary mapping the variables to their respective values as returned by the SMT solver. Also see getModelDictionaries.

getModelValue :: SymVal b => String -> a -> Maybe b Source #

Extract a model value for a given element. Also see getModelValues.

getModelUninterpretedValue :: String -> a -> Maybe String Source #

Extract a representative name for the model value of an uninterpreted kind. This is supposed to correspond to the value as computed internally by the SMT solver; and is unportable from solver to solver. Also see getModelUninterpretedValues.

extractModel :: SatModel b => a -> Maybe b Source #

A simpler variant of getModelAssignment to get a model out without the fuss.

getModelObjectives :: a -> Map String GeneralizedCV Source #

Extract model objective values, for all optimization goals.

getModelObjectiveValue :: String -> a -> Maybe GeneralizedCV Source #

Extract the value of an objective

getModelUIFuns :: a -> Map String (SBVType, ([([CV], CV)], CV)) Source #

Extract model uninterpreted-functions

getModelUIFunValue :: String -> a -> Maybe (SBVType, ([([CV], CV)], CV)) Source #

Extract the value of an uninterpreted-function as an association list

Instances
Modelable SMTResult Source #

SMTResult as a generic model provider

Instance details

Defined in Data.SBV.SMT.SMT

Modelable SatResult Source #

SatResult as a generic model provider

Instance details

Defined in Data.SBV.SMT.SMT

Modelable ThmResult Source #

ThmResult as a generic model provider

Instance details

Defined in Data.SBV.SMT.SMT

displayModels :: SatModel a => (Int -> (Bool, a) -> IO ()) -> AllSatResult -> IO Int Source #

Given an allSat call, we typically want to iterate over it and print the results in sequence. The displayModels function automates this task by calling disp on each result, consecutively. The first Int argument to disp 'is the current model number. The second argument is a tuple, where the first element indicates whether the model is alleged (i.e., if the solver is not sure, returing Unknown)

extractModels :: SatModel a => AllSatResult -> [a] Source #

Return all the models from an allSat call, similar to extractModel but is suitable for the case of multiple results.

getModelDictionaries :: AllSatResult -> [Map String CV] Source #

Get dictionaries from an all-sat call. Similar to getModelDictionary.

getModelValues :: SymVal b => String -> AllSatResult -> [Maybe b] Source #

Extract value of a variable from an all-sat call. Similar to getModelValue.

getModelUninterpretedValues :: String -> AllSatResult -> [Maybe String] Source #

Extract value of an uninterpreted variable from an all-sat call. Similar to getModelUninterpretedValue.

SMT Interface

data SMTConfig Source #

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 and 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. If base 2 or 16 is used, then floating-point values will be printed in their internal memory-layout format as well, which can come in handy for bit-precise analysis.

Constructors

SMTConfig 

Fields

Instances
NFData SMTConfig Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

rnf :: SMTConfig -> () #

data Timing Source #

Specify how to save timing information, if at all.

data SMTLibVersion Source #

Representation of SMTLib Program versions. As of June 2015, we're dropping support for SMTLib1, and supporting SMTLib2 only. We keep this data-type around in case SMTLib3 comes along and we want to support 2 and 3 simultaneously.

Constructors

SMTLib2 

data Solver Source #

Solvers that SBV is aware of

Constructors

Z3 
Yices 
Boolector 
CVC4 
MathSAT 
ABC 
Instances
Bounded Solver Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Enum Solver Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Show Solver Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

data SMTSolver Source #

An SMT solver

Constructors

SMTSolver 

Fields

Controlling verbosity

Solvers

boolector :: SMTConfig Source #

Default configuration for the Boolector SMT solver

cvc4 :: SMTConfig Source #

Default configuration for the CVC4 SMT Solver.

yices :: SMTConfig Source #

Default configuration for the Yices SMT Solver.

z3 :: SMTConfig Source #

Default configuration for the Z3 SMT solver

mathSAT :: SMTConfig Source #

Default configuration for the MathSAT SMT solver

abc :: SMTConfig Source #

Default configuration for the ABC synthesis and verification tool.

Configurations

defaultSolverConfig :: Solver -> SMTConfig Source #

The default configs corresponding to supported SMT solvers

defaultSMTCfg :: SMTConfig Source #

The default solver used by SBV. This is currently set to z3.

sbvCheckSolverInstallation :: SMTConfig -> IO Bool Source #

Check whether the given solver is installed and is ready to go. This call does a simple call to the solver to ensure all is well.

sbvAvailableSolvers :: IO [SMTConfig] Source #

Return the known available solver configs, installed on your machine.

setLogic :: SolverContext m => Logic -> m () Source #

Set the logic.

data Logic Source #

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 http://smtlib.cs.uiowa.edu/logics.shtml for the official list.

Constructors

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!

Instances
Show Logic Source # 
Instance details

Defined in Data.SBV.Control.Types

Methods

showsPrec :: Int -> Logic -> ShowS #

show :: Logic -> String #

showList :: [Logic] -> ShowS #

Generic Logic Source # 
Instance details

Defined in Data.SBV.Control.Types

Associated Types

type Rep Logic :: Type -> Type #

Methods

from :: Logic -> Rep Logic x #

to :: Rep Logic x -> Logic #

NFData Logic Source # 
Instance details

Defined in Data.SBV.Control.Types

Methods

rnf :: Logic -> () #

GShow Logic Source # 
Instance details

Defined in Data.SBV.Control.Types

type Rep Logic Source # 
Instance details

Defined in Data.SBV.Control.Types

type Rep Logic = D1 (MetaData "Logic" "Data.SBV.Control.Types" "sbv-8.3-KY4PN9PPbrH5uMg2KovlBp" False) ((((C1 (MetaCons "AUFLIA" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "AUFLIRA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "AUFNIRA" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "LRA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_ABV" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "QF_AUFBV" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_AUFLIA" PrefixI False) (U1 :: Type -> Type)))) :+: (((C1 (MetaCons "QF_AX" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_BV" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "QF_IDL" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_LIA" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "QF_LRA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_NIA" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "QF_NRA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_RDL" PrefixI False) (U1 :: Type -> Type))))) :+: ((((C1 (MetaCons "QF_UF" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_UFBV" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "QF_UFIDL" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_UFLIA" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "QF_UFLRA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_UFNRA" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "QF_UFNIRA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "UFLRA" PrefixI False) (U1 :: Type -> Type)))) :+: (((C1 (MetaCons "UFNIA" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_FPBV" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "QF_FP" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "QF_FD" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "QF_S" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Logic_ALL" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Logic_NONE" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CustomLogic" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))))))

setOption :: SolverContext m => SMTOption -> m () Source #

Set an option.

setInfo :: SolverContext m => String -> [String] -> m () Source #

Set info. Example: setInfo ":status" ["unsat"].

setTimeOut :: SolverContext m => Integer -> m () Source #

Set a solver time-out value, in milli-seconds. This function essentially translates to the SMTLib call (set-info :timeout val), and your backend solver may or may not support it! The amount given is in milliseconds. Also see the function timeOut for finer level control of time-outs, directly from SBV.

SBV exceptions

data SBVException Source #

An exception thrown from SBV. If the solver ever responds with a non-success value for a command, SBV will throw an SBVException, it so the user can process it as required. The provided Show instance will render the failure nicely. Note that if you ever catch this exception, the solver is no longer alive: You should either -- throw the exception up, or do other proper clean-up before continuing.

Instances
Show SBVException Source #

A fairly nice rendering of the exception, for display purposes.

Instance details

Defined in Data.SBV.SMT.Utils

Exception SBVException Source #

SBVExceptions are throwable. A simple "show" will render this exception nicely though of course you can inspect the individual fields as necessary.

Instance details

Defined in Data.SBV.SMT.Utils

Abstract SBV type

data SBV a Source #

The Symbolic value. The parameter a is phantom, but is extremely important in keeping the user interface strongly typed.

Instances
IsString SString Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

fromString :: String -> SString #

Testable SBool Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

property :: SBool -> Property #

propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> SBool) -> Property #

SDivisible SInteger Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SInt8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SDivisible SWord4 Source #

SDvisible instance, using default methods

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

Polynomial SWord64 Source # 
Instance details

Defined in Data.SBV.Tools.Polynomial

Polynomial SWord32 Source # 
Instance details

Defined in Data.SBV.Tools.Polynomial

Polynomial SWord16 Source # 
Instance details

Defined in Data.SBV.Tools.Polynomial

Polynomial SWord8 Source # 
Instance details

Defined in Data.SBV.Tools.Polynomial

ArithOverflow SInt64 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SInt32 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SInt16 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SInt8 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SWord64 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SWord32 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SWord16 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

ArithOverflow SWord8 Source # 
Instance details

Defined in Data.SBV.Tools.Overflow

RegExpMatchable SString Source #

Matching symbolic strings.

Instance details

Defined in Data.SBV.RegExp

Methods

match :: SString -> RegExp -> SBool Source #

RegExpMatchable SChar Source #

Matching a character simply means the singleton string matches the regex.

Instance details

Defined in Data.SBV.RegExp

Methods

match :: SChar -> RegExp -> SBool Source #

ExtractIO m => MProvable m SBool Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Splittable SWord64 SWord32 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable SWord32 SWord16 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Splittable SWord16 SWord8 Source # 
Instance details

Defined in Data.SBV.Core.Splittable

Fresh IO (S SInteger) Source #

Fresh instance for our state

Instance details

Defined in Documentation.SBV.Examples.ProofTools.BMC

Fresh IO (S SInteger) Source #

Fresh instance for our state

Instance details

Defined in Documentation.SBV.Examples.ProofTools.Fibonacci

Fresh IO (S SInteger) Source #

Fresh instance for our state

Instance details

Defined in Documentation.SBV.Examples.ProofTools.Strengthen

Fresh IO (S SInteger) Source #

Fresh instance for our state

Instance details

Defined in Documentation.SBV.Examples.ProofTools.Sum

(SymVal a, SMTValue a) => Fresh IO (FibS (SBV a)) Source #

Fresh instance for the program state

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Fib

Methods

fresh :: QueryT IO (FibS (SBV a)) Source #

(SymVal a, SMTValue a) => Fresh IO (GCDS (SBV a)) Source #

Fresh instance for the program state

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.GCD

Methods

fresh :: QueryT IO (GCDS (SBV a)) Source #

(SymVal a, SMTValue a) => Fresh IO (DivS (SBV a)) Source #

Fresh instance for the program state

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.IntDiv

Methods

fresh :: QueryT IO (DivS (SBV a)) Source #

(SymVal a, SMTValue a) => Fresh IO (SqrtS (SBV a)) Source #

Fresh instance for the program state

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.IntSqrt

Methods

fresh :: QueryT IO (SqrtS (SBV a)) Source #

(SymVal a, SMTValue a) => Fresh IO (SumS (SBV a)) Source #

Fresh instance for the program state

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Sum

Methods

fresh :: QueryT IO (SumS (SBV a)) Source #

ExtractIO m => SExecutable m [SBV a] Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: [SBV a] -> SymbolicT m () Source #

sName :: [String] -> [SBV a] -> SymbolicT m () Source #

safe :: [SBV a] -> m [SafeResult] Source #

safeWith :: SMTConfig -> [SBV a] -> m [SafeResult] Source #

ExtractIO m => SExecutable m (SBV a) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: SBV a -> SymbolicT m () Source #

sName :: [String] -> SBV a -> SymbolicT m () Source #

safe :: SBV a -> m [SafeResult] Source #

safeWith :: SMTConfig -> SBV a -> m [SafeResult] Source #

(MonadIO m, SymVal a, SMTValue a) => Queriable m (SBV a) a Source #

Generic Queriable instance for 'SymVal'/'SMTValue' values

Instance details

Defined in Data.SBV.Control.Utils

Methods

create :: QueryT m (SBV a) Source #

project :: SBV a -> QueryT m a Source #

embed :: a -> QueryT m (SBV a) Source #

(MonadIO m, SymVal a, SMTValue a, Foldable t, Traversable t, Fresh m (t (SBV a))) => Queriable m (t (SBV a)) (t a) Source #

Generic Queriable instance for things that are Fresh and look like containers:

Instance details

Defined in Data.SBV.Control.Utils

Methods

create :: QueryT m (t (SBV a)) Source #

project :: t (SBV a) -> QueryT m (t a) Source #

embed :: t a -> QueryT m (t (SBV a)) Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b, SBV c) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m [SafeResult] Source #

(SymVal a, SymVal b, SExecutable m p) => SExecutable m ((SBV a, SBV b) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: ((SBV a, SBV b) -> p) -> SymbolicT m () Source #

sName :: [String] -> ((SBV a, SBV b) -> p) -> SymbolicT m () Source #

safe :: ((SBV a, SBV b) -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m [SafeResult] Source #

(SymVal a, SExecutable m p) => SExecutable m (SBV a -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a -> p) -> SymbolicT m () Source #

sName :: [String] -> (SBV a -> p) -> SymbolicT m () Source #

safe :: (SBV a -> p) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a -> p) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b) => SExecutable m (SBV a, SBV b) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b) -> SymbolicT m () Source #

safe :: (SBV a, SBV b) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b) -> m [SafeResult] Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c, SBV d) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, SymVal c, MProvable m p) => MProvable m ((SBV a, SBV b, SBV c) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b, SBV c) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b, SBV c) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, SymVal b, MProvable m p) => MProvable m ((SBV a, SBV b) -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

forSome_ :: ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source #

prove :: ((SBV a, SBV b) -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m ThmResult Source #

sat :: ((SBV a, SBV b) -> p) -> m SatResult Source #

satWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m SatResult Source #

allSat :: ((SBV a, SBV b) -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> ((SBV a, SBV b) -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b) -> p) -> m OptimizeResult Source #

isVacuous :: ((SBV a, SBV b) -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source #

isTheorem :: ((SBV a, SBV b) -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source #

isSatisfiable :: ((SBV a, SBV b) -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> ((SBV a, SBV b) -> p) -> SMTResult -> m SMTResult Source #

(SymVal a, MProvable m p) => MProvable m (SBV a -> p) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

forAll_ :: (SBV a -> p) -> SymbolicT m SBool Source #

forAll :: [String] -> (SBV a -> p) -> SymbolicT m SBool Source #

forSome_ :: (SBV a -> p) -> SymbolicT m SBool Source #

forSome :: [String] -> (SBV a -> p) -> SymbolicT m SBool Source #

prove :: (SBV a -> p) -> m ThmResult Source #

proveWith :: SMTConfig -> (SBV a -> p) -> m ThmResult Source #

sat :: (SBV a -> p) -> m SatResult Source #

satWith :: SMTConfig -> (SBV a -> p) -> m SatResult Source #

allSat :: (SBV a -> p) -> m AllSatResult Source #

allSatWith :: SMTConfig -> (SBV a -> p) -> m AllSatResult Source #

optimize :: OptimizeStyle -> (SBV a -> p) -> m OptimizeResult Source #

optimizeWith :: SMTConfig -> OptimizeStyle -> (SBV a -> p) -> m OptimizeResult Source #

isVacuous :: (SBV a -> p) -> m Bool Source #

isVacuousWith :: SMTConfig -> (SBV a -> p) -> m Bool Source #

isTheorem :: (SBV a -> p) -> m Bool Source #

isTheoremWith :: SMTConfig -> (SBV a -> p) -> m Bool Source #

isSatisfiable :: (SBV a -> p) -> m Bool Source #

isSatisfiableWith :: SMTConfig -> (SBV a -> p) -> m Bool Source #

validate :: Bool -> SMTConfig -> (SBV a -> p) -> SMTResult -> m SMTResult Source #

ExtractIO m => MProvable m (SymbolicT m SBool) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c) => SExecutable m (SBV a, SBV b, SBV c) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d) => SExecutable m (SBV a, SBV b, SBV c, SBV d) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d, NFData e, SymVal e) => SExecutable m (SBV a, SBV b, SBV c, SBV d, SBV e) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d, SBV e) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d, SBV e) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d, SBV e) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d, SBV e) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d, NFData e, SymVal e, NFData f, SymVal f) => SExecutable m (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> m [SafeResult] Source #

(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c, NFData d, SymVal d, NFData e, SymVal e, NFData f, SymVal f, NFData g, SymVal g) => SExecutable m (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Methods

sName_ :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> SymbolicT m () Source #

sName :: [String] -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> SymbolicT m () Source #

safe :: (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> m [SafeResult] Source #

safeWith :: SMTConfig -> (SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> m [SafeResult] Source #

SymVal [a] => IsList (SList a) Source #

IsList instance allows list literals to be written compactly.

Instance details

Defined in Data.SBV.Core.Data

Associated Types

type Item (SList a) :: Type #

Methods

fromList :: [Item (SList a)] -> SList a #

fromListN :: Int -> [Item (SList a)] -> SList a #

toList :: SList a -> [Item (SList a)] #

(SymVal a, Bounded a) => Bounded (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

minBound :: SBV a #

maxBound :: SBV a #

(Show a, Bounded a, Integral a, Num a, SymVal a) => Enum (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

succ :: SBV a -> SBV a #

pred :: SBV a -> SBV a #

toEnum :: Int -> SBV a #

fromEnum :: SBV a -> Int #

enumFrom :: SBV a -> [SBV a] #

enumFromThen :: SBV a -> SBV a -> [SBV a] #

enumFromTo :: SBV a -> SBV a -> [SBV a] #

enumFromThenTo :: SBV a -> SBV a -> SBV a -> [SBV a] #

Eq (SBV a) Source #

This instance is only defined so that we can define an instance for Bits. == and /= simply throw an error. Use EqSymbolic instead.

Instance details

Defined in Data.SBV.Core.Data

Methods

(==) :: SBV a -> SBV a -> Bool #

(/=) :: SBV a -> SBV a -> Bool #

(Ord a, SymVal a, Fractional a, Floating a) => Floating (SBV a) Source #

Define Floating instance on SBV's; only for base types that are already floating; i.e., SFloat and SDouble Note that most of the fields are "undefined" for symbolic values, we add methods as they are supported by SMTLib. Currently, the only symbolicly available function in this class is sqrt.

Instance details

Defined in Data.SBV.Core.Model

Methods

pi :: SBV a #

exp :: SBV a -> SBV a #

log :: SBV a -> SBV a #

sqrt :: SBV a -> SBV a #

(**) :: SBV a -> SBV a -> SBV a #

logBase :: SBV a -> SBV a -> SBV a #

sin :: SBV a -> SBV a #

cos :: SBV a -> SBV a #

tan :: SBV a -> SBV a #

asin :: SBV a -> SBV a #

acos :: SBV a -> SBV a #

atan :: SBV a -> SBV a #

sinh :: SBV a -> SBV a #

cosh :: SBV a -> SBV a #

tanh :: SBV a -> SBV a #

asinh :: SBV a -> SBV a #

acosh :: SBV a -> SBV a #

atanh :: SBV a -> SBV a #

log1p :: SBV a -> SBV a #

expm1 :: SBV a -> SBV a #

log1pexp :: SBV a -> SBV a #

log1mexp :: SBV a -> SBV a #

(Ord a, SymVal a, Fractional a) => Fractional (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(/) :: SBV a -> SBV a -> SBV a #

recip :: SBV a -> SBV a #

fromRational :: Rational -> SBV a #

(Ord a, Num a, SymVal a) => Num (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(+) :: SBV a -> SBV a -> SBV a #

(-) :: SBV a -> SBV a -> SBV a #

(*) :: SBV a -> SBV a -> SBV a #

negate :: SBV a -> SBV a #

abs :: SBV a -> SBV a #

signum :: SBV a -> SBV a #

fromInteger :: Integer -> SBV a #

Show (SBV a) Source #

A Show instance is not particularly "desirable," when the value is symbolic, but we do need this instance as otherwise we cannot simply evaluate Haskell functions that return symbolic values and have their constant values printed easily!

Instance details

Defined in Data.SBV.Core.Data

Methods

showsPrec :: Int -> SBV a -> ShowS #

show :: SBV a -> String #

showList :: [SBV a] -> ShowS #

(SymVal a, Show a) => Show (FibS (SBV a)) Source #

Show instance for FibS. The above deriving clause would work just as well, but we want it to be a little prettier here, and hence the OVERLAPS directive.

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Fib

Methods

showsPrec :: Int -> FibS (SBV a) -> ShowS #

show :: FibS (SBV a) -> String #

showList :: [FibS (SBV a)] -> ShowS #

(SymVal a, Show a) => Show (GCDS (SBV a)) Source #

Show instance for GCDS. The above deriving clause would work just as well, but we want it to be a little prettier here, and hence the OVERLAPS directive.

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.GCD

Methods

showsPrec :: Int -> GCDS (SBV a) -> ShowS #

show :: GCDS (SBV a) -> String #

showList :: [GCDS (SBV a)] -> ShowS #

(SymVal a, Show a) => Show (DivS (SBV a)) Source #

Show instance for DivS. The above deriving clause would work just as well, but we want it to be a little prettier here, and hence the OVERLAPS directive.

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.IntDiv

Methods

showsPrec :: Int -> DivS (SBV a) -> ShowS #

show :: DivS (SBV a) -> String #

showList :: [DivS (SBV a)] -> ShowS #

(SymVal a, Show a) => Show (SqrtS (SBV a)) Source #

Show instance for SqrtS. The above deriving clause would work just as well, but we want it to be a little prettier here, and hence the OVERLAPS directive.

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.IntSqrt

Methods

showsPrec :: Int -> SqrtS (SBV a) -> ShowS #

show :: SqrtS (SBV a) -> String #

showList :: [SqrtS (SBV a)] -> ShowS #

(SymVal a, Show a) => Show (SumS (SBV a)) Source #

Show instance for SumS. The above deriving clause would work just as well, but we want it to be a little prettier here, and hence the OVERLAPS directive.

Instance details

Defined in Documentation.SBV.Examples.WeakestPreconditions.Sum

Methods

showsPrec :: Int -> SumS (SBV a) -> ShowS #

show :: SumS (SBV a) -> String #

showList :: [SumS (SBV a)] -> ShowS #

Generic (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

Associated Types

type Rep (SBV a) :: Type -> Type #

Methods

from :: SBV a -> Rep (SBV a) x #

to :: Rep (SBV a) x -> SBV a #

Testable (Symbolic SBool) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

property :: Symbolic SBool -> Property #

propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> Symbolic SBool) -> Property #

(SymVal a, Arbitrary a) => Arbitrary (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

arbitrary :: Gen (SBV a) #

shrink :: SBV a -> [SBV a] #

(Ord a, Num a, Bits a, SymVal a) => Bits (SBV a) Source #

Using popCount or testBit on non-concrete values will result in an error. Use sPopCount or sTestBit instead.

Instance details

Defined in Data.SBV.Core.Model

Methods

(.&.) :: SBV a -> SBV a -> SBV a #

(.|.) :: SBV a -> SBV a -> SBV a #

xor :: SBV a -> SBV a -> SBV a #

complement :: SBV a -> SBV a #

shift :: SBV a -> Int -> SBV a #

rotate :: SBV a -> Int -> SBV a #

zeroBits :: SBV a #

bit :: Int -> SBV a #

setBit :: SBV a -> Int -> SBV a #

clearBit :: SBV a -> Int -> SBV a #

complementBit :: SBV a -> Int -> SBV a #

testBit :: SBV a -> Int -> Bool #

bitSizeMaybe :: SBV a -> Maybe Int #

bitSize :: SBV a -> Int #

isSigned :: SBV a -> Bool #

shiftL :: SBV a -> Int -> SBV a #

unsafeShiftL :: SBV a -> Int -> SBV a #

shiftR :: SBV a -> Int -> SBV a #

unsafeShiftR :: SBV a -> Int -> SBV a #

rotateL :: SBV a -> Int -> SBV a #

rotateR :: SBV a -> Int -> SBV a #

popCount :: SBV a -> Int #

NFData (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

rnf :: SBV a -> () #

(Random a, SymVal a) => Random (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

randomR :: RandomGen g => (SBV a, SBV a) -> g -> (SBV a, g) #

random :: RandomGen g => g -> (SBV a, g) #

randomRs :: RandomGen g => (SBV a, SBV a) -> g -> [SBV a] #

randoms :: RandomGen g => g -> [SBV a] #

randomRIO :: (SBV a, SBV a) -> IO (SBV a) #

randomIO :: IO (SBV a) #

HasKind a => HasKind (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

Outputtable (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

Methods

output :: MonadSymbolic m => SBV a -> m (SBV a) Source #

(SymVal a, PrettyNum a) => PrettyNum (SBV a) Source # 
Instance details

Defined in Data.SBV.Utils.PrettyNum

Methods

hexS :: SBV a -> String Source #

binS :: SBV a -> String Source #

hexP :: SBV a -> String Source #

binP :: SBV a -> String Source #

hex :: SBV a -> String Source #

bin :: SBV a -> String Source #

HasKind a => Uninterpreted (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal a => Mergeable (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

symbolicMerge :: Bool -> SBool -> SBV a -> SBV a -> SBV a Source #

select :: (Ord b, SymVal b, Num b) => [SBV a] -> SBV a -> SBV b -> SBV a Source #

(Ord a, SymVal a) => OrdSymbolic (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.<) :: SBV a -> SBV a -> SBool Source #

(.<=) :: SBV a -> SBV a -> SBool Source #

(.>) :: SBV a -> SBV a -> SBool Source #

(.>=) :: SBV a -> SBV a -> SBool Source #

smin :: SBV a -> SBV a -> SBV a Source #

smax :: SBV a -> SBV a -> SBV a Source #

inRange :: SBV a -> (SBV a, SBV a) -> SBool Source #

EqSymbolic (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(.==) :: SBV a -> SBV a -> SBool Source #

(./=) :: SBV a -> SBV a -> SBool Source #

(.===) :: SBV a -> SBV a -> SBool Source #

(./==) :: SBV a -> SBV a -> SBool Source #

distinct :: [SBV a] -> SBool Source #

allEqual :: [SBV a] -> SBool Source #

sElem :: SBV a -> [SBV a] -> SBool Source #

(SymVal a, SymVal b, EqSymbolic z) => Equality ((SBV a, SBV b) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b) -> z) -> ((SBV a, SBV b) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c) -> z) -> ((SBV a, SBV b, SBV c) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d) -> z) -> ((SBV a, SBV b, SBV c, SBV d) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d, SBV e) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> z) -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> z) -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> z) -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> SBV g -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> SBV g -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> SBV g -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> SBV f -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> SBV e -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> SBV d -> z) -> (SBV a -> SBV b -> SBV c -> SBV d -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> SBV c -> z) -> (SBV a -> SBV b -> SBV c -> z) -> IO ThmResult Source #

(SymVal a, SymVal b, EqSymbolic z) => Equality (SBV a -> SBV b -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> SBV b -> z) -> (SBV a -> SBV b -> z) -> IO ThmResult Source #

(SymVal a, EqSymbolic z) => Equality (SBV a -> z) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

(===) :: (SBV a -> z) -> (SBV a -> z) -> IO ThmResult Source #

(SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV c, SBV b) -> SBV a) -> String -> (SBV c, SBV b) -> SBV a Source #

(SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV d, SBV c, SBV b) -> SBV a) -> (SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

cgUninterpret :: String -> [String] -> ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

sbvUninterpret :: Maybe ([String], (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source #

(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal e, SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal d, SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV d -> SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV d -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV d -> SBV c -> SBV b -> SBV a) -> SBV d -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV d -> SBV c -> SBV b -> SBV a) -> String -> SBV d -> SBV c -> SBV b -> SBV a Source #

(SymVal c, SymVal b, HasKind a) => Uninterpreted (SBV c -> SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV c -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV c -> SBV b -> SBV a) -> String -> SBV c -> SBV b -> SBV a Source #

(SymVal b, HasKind a) => Uninterpreted (SBV b -> SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

uninterpret :: String -> SBV b -> SBV a Source #

cgUninterpret :: String -> [String] -> (SBV b -> SBV a) -> SBV b -> SBV a Source #

sbvUninterpret :: Maybe ([String], SBV b -> SBV a) -> String -> SBV b -> SBV a Source #

SymVal e => Mergeable (STree i e) Source # 
Instance details

Defined in Data.SBV.Tools.STree

Methods

symbolicMerge :: Bool -> SBool -> STree i e -> STree i e -> STree i e Source #

select :: (Ord b, SymVal b, Num b) => [STree i e] -> STree i e -> SBV b -> STree i e Source #

type Rep (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

type Rep (SBV a) = D1 (MetaData "SBV" "Data.SBV.Core.Data" "sbv-8.3-KY4PN9PPbrH5uMg2KovlBp" True) (C1 (MetaCons "SBV" PrefixI True) (S1 (MetaSel (Just "unSBV") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SVal)))
type Item (SList a) Source # 
Instance details

Defined in Data.SBV.Core.Data

type Item (SList a) = a

class HasKind a where Source #

A class for capturing values that have a sign and a size (finite or infinite) minimal complete definition: kindOf, unless you can take advantage of the default signature: This class can be automatically derived for data-types that have a Data instance; this is useful for creating uninterpreted sorts. So, in reality, end users should almost never need to define any methods.

Minimal complete definition

Nothing

Instances
HasKind Bool Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Char Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Double Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Float Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Int8 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Int16 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Int32 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Int64 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Integer Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Word8 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Word16 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Word32 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Word64 Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind () Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind Kind Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind ExtCV Source #

Kind instance for Extended CV

Instance details

Defined in Data.SBV.Core.Concrete

HasKind GeneralizedCV Source #

Kind instance for generalized CV

Instance details

Defined in Data.SBV.Core.Concrete

HasKind CV Source #

Kind instance for CV

Instance details

Defined in Data.SBV.Core.Concrete

HasKind RoundingMode Source #

RoundingMode kind

Instance details

Defined in Data.SBV.Core.Symbolic

HasKind SVal Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

HasKind SV Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

HasKind State Source # 
Instance details

Defined in Documentation.SBV.Examples.Lists.BoundedMutex

HasKind E Source # 
Instance details

Defined in Documentation.SBV.Examples.Misc.Enumerate

HasKind Word4 Source #

HasKind instance; simply returning the underlying kind for the type

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

HasKind Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Optimization.Enumerate

HasKind Color Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

HasKind Nationality Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

HasKind Beverage Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

HasKind Pet Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

HasKind Sport Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

HasKind Color Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Garden

HasKind Color Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.HexPuzzle

HasKind U2Member Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

HasKind Location Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

HasKind Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

HasKind BinOp Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.FourFours

HasKind UnOp Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.FourFours

HasKind B Source # 
Instance details

Defined in Documentation.SBV.Examples.Uninterpreted.Deduce

HasKind Q Source # 
Instance details

Defined in Documentation.SBV.Examples.Uninterpreted.Sort

HasKind L Source #

Similarly, HasKinds default implementation is sufficient.

Instance details

Defined in Documentation.SBV.Examples.Uninterpreted.UISortAllSat

(Typeable a, HasKind a) => HasKind [a] Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: [a] -> Kind Source #

hasSign :: [a] -> Bool Source #

intSizeOf :: [a] -> Int Source #

isBoolean :: [a] -> Bool Source #

isBounded :: [a] -> Bool Source #

isReal :: [a] -> Bool Source #

isFloat :: [a] -> Bool Source #

isDouble :: [a] -> Bool Source #

isUnbounded :: [a] -> Bool Source #

isUninterpreted :: [a] -> Bool Source #

isChar :: [a] -> Bool Source #

isString :: [a] -> Bool Source #

isList :: [a] -> Bool Source #

isSet :: [a] -> Bool Source #

isTuple :: [a] -> Bool Source #

isMaybe :: [a] -> Bool Source #

isEither :: [a] -> Bool Source #

showType :: [a] -> String Source #

HasKind a => HasKind (Maybe a) Source # 
Instance details

Defined in Data.SBV.Core.Kind

HasKind a => HasKind (RCSet a) Source # 
Instance details

Defined in Data.SBV.Core.Concrete

HasKind a => HasKind (SBV a) Source # 
Instance details

Defined in Data.SBV.Core.Data

(HasKind a, HasKind b) => HasKind (Either a b) Source # 
Instance details

Defined in Data.SBV.Core.Kind

(HasKind a, HasKind b) => HasKind (a, b) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b) -> Kind Source #

hasSign :: (a, b) -> Bool Source #

intSizeOf :: (a, b) -> Int Source #

isBoolean :: (a, b) -> Bool Source #

isBounded :: (a, b) -> Bool Source #

isReal :: (a, b) -> Bool Source #

isFloat :: (a, b) -> Bool Source #

isDouble :: (a, b) -> Bool Source #

isUnbounded :: (a, b) -> Bool Source #

isUninterpreted :: (a, b) -> Bool Source #

isChar :: (a, b) -> Bool Source #

isString :: (a, b) -> Bool Source #

isList :: (a, b) -> Bool Source #

isSet :: (a, b) -> Bool Source #

isTuple :: (a, b) -> Bool Source #

isMaybe :: (a, b) -> Bool Source #

isEither :: (a, b) -> Bool Source #

showType :: (a, b) -> String Source #

HasKind a => HasKind (Proxy a) Source #

This instance allows us to use the `kindOf (Proxy @a)` idiom instead of the `kindOf (undefined :: a)`, which is safer and looks more idiomatic.

Instance details

Defined in Data.SBV.Core.Kind

(HasKind a, HasKind b, HasKind c) => HasKind (a, b, c) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b, c) -> Kind Source #

hasSign :: (a, b, c) -> Bool Source #

intSizeOf :: (a, b, c) -> Int Source #

isBoolean :: (a, b, c) -> Bool Source #

isBounded :: (a, b, c) -> Bool Source #

isReal :: (a, b, c) -> Bool Source #

isFloat :: (a, b, c) -> Bool Source #

isDouble :: (a, b, c) -> Bool Source #

isUnbounded :: (a, b, c) -> Bool Source #

isUninterpreted :: (a, b, c) -> Bool Source #

isChar :: (a, b, c) -> Bool Source #

isString :: (a, b, c) -> Bool Source #

isList :: (a, b, c) -> Bool Source #

isSet :: (a, b, c) -> Bool Source #

isTuple :: (a, b, c) -> Bool Source #

isMaybe :: (a, b, c) -> Bool Source #

isEither :: (a, b, c) -> Bool Source #

showType :: (a, b, c) -> String Source #

(HasKind a, HasKind b, HasKind c, HasKind d) => HasKind (a, b, c, d) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b, c, d) -> Kind Source #

hasSign :: (a, b, c, d) -> Bool Source #

intSizeOf :: (a, b, c, d) -> Int Source #

isBoolean :: (a, b, c, d) -> Bool Source #

isBounded :: (a, b, c, d) -> Bool Source #

isReal :: (a, b, c, d) -> Bool Source #

isFloat :: (a, b, c, d) -> Bool Source #

isDouble :: (a, b, c, d) -> Bool Source #

isUnbounded :: (a, b, c, d) -> Bool Source #

isUninterpreted :: (a, b, c, d) -> Bool Source #

isChar :: (a, b, c, d) -> Bool Source #

isString :: (a, b, c, d) -> Bool Source #

isList :: (a, b, c, d) -> Bool Source #

isSet :: (a, b, c, d) -> Bool Source #

isTuple :: (a, b, c, d) -> Bool Source #

isMaybe :: (a, b, c, d) -> Bool Source #

isEither :: (a, b, c, d) -> Bool Source #

showType :: (a, b, c, d) -> String Source #

(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e) => HasKind (a, b, c, d, e) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b, c, d, e) -> Kind Source #

hasSign :: (a, b, c, d, e) -> Bool Source #

intSizeOf :: (a, b, c, d, e) -> Int Source #

isBoolean :: (a, b, c, d, e) -> Bool Source #

isBounded :: (a, b, c, d, e) -> Bool Source #

isReal :: (a, b, c, d, e) -> Bool Source #

isFloat :: (a, b, c, d, e) -> Bool Source #

isDouble :: (a, b, c, d, e) -> Bool Source #

isUnbounded :: (a, b, c, d, e) -> Bool Source #

isUninterpreted :: (a, b, c, d, e) -> Bool Source #

isChar :: (a, b, c, d, e) -> Bool Source #

isString :: (a, b, c, d, e) -> Bool Source #

isList :: (a, b, c, d, e) -> Bool Source #

isSet :: (a, b, c, d, e) -> Bool Source #

isTuple :: (a, b, c, d, e) -> Bool Source #

isMaybe :: (a, b, c, d, e) -> Bool Source #

isEither :: (a, b, c, d, e) -> Bool Source #

showType :: (a, b, c, d, e) -> String Source #

(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e, HasKind f) => HasKind (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b, c, d, e, f) -> Kind Source #

hasSign :: (a, b, c, d, e, f) -> Bool Source #

intSizeOf :: (a, b, c, d, e, f) -> Int Source #

isBoolean :: (a, b, c, d, e, f) -> Bool Source #

isBounded :: (a, b, c, d, e, f) -> Bool Source #

isReal :: (a, b, c, d, e, f) -> Bool Source #

isFloat :: (a, b, c, d, e, f) -> Bool Source #

isDouble :: (a, b, c, d, e, f) -> Bool Source #

isUnbounded :: (a, b, c, d, e, f) -> Bool Source #

isUninterpreted :: (a, b, c, d, e, f) -> Bool Source #

isChar :: (a, b, c, d, e, f) -> Bool Source #

isString :: (a, b, c, d, e, f) -> Bool Source #

isList :: (a, b, c, d, e, f) -> Bool Source #

isSet :: (a, b, c, d, e, f) -> Bool Source #

isTuple :: (a, b, c, d, e, f) -> Bool Source #

isMaybe :: (a, b, c, d, e, f) -> Bool Source #

isEither :: (a, b, c, d, e, f) -> Bool Source #

showType :: (a, b, c, d, e, f) -> String Source #

(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e, HasKind f, HasKind g) => HasKind (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b, c, d, e, f, g) -> Kind Source #

hasSign :: (a, b, c, d, e, f, g) -> Bool Source #

intSizeOf :: (a, b, c, d, e, f, g) -> Int Source #

isBoolean :: (a, b, c, d, e, f, g) -> Bool Source #

isBounded :: (a, b, c, d, e, f, g) -> Bool Source #

isReal :: (a, b, c, d, e, f, g) -> Bool Source #

isFloat :: (a, b, c, d, e, f, g) -> Bool Source #

isDouble :: (a, b, c, d, e, f, g) -> Bool Source #

isUnbounded :: (a, b, c, d, e, f, g) -> Bool Source #

isUninterpreted :: (a, b, c, d, e, f, g) -> Bool Source #

isChar :: (a, b, c, d, e, f, g) -> Bool Source #

isString :: (a, b, c, d, e, f, g) -> Bool Source #

isList :: (a, b, c, d, e, f, g) -> Bool Source #

isSet :: (a, b, c, d, e, f, g) -> Bool Source #

isTuple :: (a, b, c, d, e, f, g) -> Bool Source #

isMaybe :: (a, b, c, d, e, f, g) -> Bool Source #

isEither :: (a, b, c, d, e, f, g) -> Bool Source #

showType :: (a, b, c, d, e, f, g) -> String Source #

(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e, HasKind f, HasKind g, HasKind h) => HasKind (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

kindOf :: (a, b, c, d, e, f, g, h) -> Kind Source #

hasSign :: (a, b, c, d, e, f, g, h) -> Bool Source #

intSizeOf :: (a, b, c, d, e, f, g, h) -> Int Source #

isBoolean :: (a, b, c, d, e, f, g, h) -> Bool Source #

isBounded :: (a, b, c, d, e, f, g, h) -> Bool Source #

isReal :: (a, b, c, d, e, f, g, h) -> Bool Source #

isFloat :: (a, b, c, d, e, f, g, h) -> Bool Source #

isDouble :: (a, b, c, d, e, f, g, h) -> Bool Source #

isUnbounded :: (a, b, c, d, e, f, g, h) -> Bool Source #

isUninterpreted :: (a, b, c, d, e, f, g, h) -> Bool Source #

isChar :: (a, b, c, d, e, f, g, h) -> Bool Source #

isString :: (a, b, c, d, e, f, g, h) -> Bool Source #

isList :: (a, b, c, d, e, f, g, h) -> Bool Source #

isSet :: (a, b, c, d, e, f, g, h) -> Bool Source #

isTuple :: (a, b, c, d, e, f, g, h) -> Bool Source #

isMaybe :: (a, b, c, d, e, f, g, h) -> Bool Source #

isEither :: (a, b, c, d, e, f, g, h) -> Bool Source #

showType :: (a, b, c, d, e, f, g, h) -> String Source #

data Kind Source #

Kind of symbolic value

Instances
Eq Kind Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

(==) :: Kind -> Kind -> Bool #

(/=) :: Kind -> Kind -> Bool #

Ord Kind Source # 
Instance details

Defined in Data.SBV.Core.Kind

Methods

compare :: Kind -> Kind -> Ordering #

(<) :: Kind -> Kind -> Bool #

(<=) :: Kind -> Kind -> Bool #

(>) :: Kind -> Kind -> Bool #

(>=) :: Kind -> Kind -> Bool #

max :: Kind -> Kind -> Kind #

min :: Kind -> Kind -> Kind #

Show Kind Source #

The interesting about the show instance is that it can tell apart two kinds nicely; since it conveniently ignores the enumeration constructors. Also, when we construct a KUninterpreted, we make sure we don't use any of the reserved names; see constructUKind for details.

Instance details

Defined in Data.SBV.Core.Kind

Methods

showsPrec :: Int -> Kind -> ShowS #

show :: Kind -> String #

showList :: [Kind] -> ShowS #

NFData Kind Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

rnf :: Kind -> () #

HasKind Kind Source # 
Instance details

Defined in Data.SBV.Core.Kind

class (HasKind a, Typeable a) => SymVal a where Source #

A SymVal is a potential symbolic value that can be created instances of to be fed to a symbolic program.

Minimal complete definition

Nothing

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV a) Source #

Generalization of mkSymVal

literal :: a -> SBV a Source #

Turn a literal constant to symbolic

fromCV :: CV -> a Source #

Extract a literal, from a CV representation

isConcretely :: SBV a -> (a -> Bool) -> Bool Source #

Does it concretely satisfy the given predicate?

mkSymVal :: (MonadSymbolic m, Read a, Data a) => Maybe Quantifier -> Maybe String -> m (SBV a) Source #

Generalization of mkSymVal

literal :: Show a => a -> SBV a Source #

Turn a literal constant to symbolic

fromCV :: Read a => CV -> a Source #

Extract a literal, from a CV representation

forall :: MonadSymbolic m => String -> m (SBV a) Source #

Generalization of forall

forall_ :: MonadSymbolic m => m (SBV a) Source #

Generalization of forall_

mkForallVars :: MonadSymbolic m => Int -> m [SBV a] Source #

Generalization of mkForallVars

exists :: MonadSymbolic m => String -> m (SBV a) Source #

Generalization of exists

exists_ :: MonadSymbolic m => m (SBV a) Source #

Generalization of exists_

mkExistVars :: MonadSymbolic m => Int -> m [SBV a] Source #

Generalization of mkExistVars

free :: MonadSymbolic m => String -> m (SBV a) Source #

Generalization of free

free_ :: MonadSymbolic m => m (SBV a) Source #

Generalization of free_

mkFreeVars :: MonadSymbolic m => Int -> m [SBV a] Source #

Generalization of mkFreeVars

symbolic :: MonadSymbolic m => String -> m (SBV a) Source #

Generalization of symbolic

symbolics :: MonadSymbolic m => [String] -> m [SBV a] Source #

Generalization of symbolics

unliteral :: SBV a -> Maybe a Source #

Extract a literal, if the value is concrete

isConcrete :: SBV a -> Bool Source #

Is the symbolic word concrete?

isSymbolic :: SBV a -> Bool Source #

Is the symbolic word really symbolic?

Instances
SymVal Bool Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Char Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Double Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Float Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Int8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Int16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Int32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Int64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Integer Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Word8 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Word16 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Word32 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal Word64 Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal () Source #

SymVal for 0-tuple (i.e., unit)

Instance details

Defined in Data.SBV.Core.Model

SymVal AlgReal Source # 
Instance details

Defined in Data.SBV.Core.Model

SymVal RoundingMode Source #

RoundingMode can be used symbolically

Instance details

Defined in Data.SBV.Core.Data

SymVal State Source # 
Instance details

Defined in Documentation.SBV.Examples.Lists.BoundedMutex

SymVal E Source # 
Instance details

Defined in Documentation.SBV.Examples.Misc.Enumerate

SymVal Word4 Source #

SymVal instance, allowing this type to be used in proofs/sat etc.

Instance details

Defined in Documentation.SBV.Examples.Misc.Word4

SymVal Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Optimization.Enumerate

SymVal Color Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

SymVal Nationality Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

SymVal Beverage Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

SymVal Pet Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

SymVal Sport Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

SymVal Color Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Garden

SymVal Color Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.HexPuzzle

SymVal U2Member Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

SymVal Location Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.U2Bridge

SymVal Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

SymVal BinOp Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.FourFours

SymVal UnOp Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.FourFours

SymVal B Source # 
Instance details

Defined in Documentation.SBV.Examples.Uninterpreted.Deduce

SymVal Q Source # 
Instance details

Defined in Documentation.SBV.Examples.Uninterpreted.Sort

SymVal L Source #

Declare instances to make L a usable uninterpreted sort. First we need the SymVal instance, with the default definition sufficing.

Instance details

Defined in Documentation.SBV.Examples.Uninterpreted.UISortAllSat

SymVal a => SymVal [a] Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV [a]) Source #

literal :: [a] -> SBV [a] Source #

fromCV :: CV -> [a] Source #

isConcretely :: SBV [a] -> ([a] -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV [a]) Source #

forall_ :: MonadSymbolic m => m (SBV [a]) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV [a]] Source #

exists :: MonadSymbolic m => String -> m (SBV [a]) Source #

exists_ :: MonadSymbolic m => m (SBV [a]) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV [a]] Source #

free :: MonadSymbolic m => String -> m (SBV [a]) Source #

free_ :: MonadSymbolic m => m (SBV [a]) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV [a]] Source #

symbolic :: MonadSymbolic m => String -> m (SBV [a]) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV [a]] Source #

unliteral :: SBV [a] -> Maybe [a] Source #

isConcrete :: SBV [a] -> Bool Source #

isSymbolic :: SBV [a] -> Bool Source #

SymVal a => SymVal (Maybe a) Source # 
Instance details

Defined in Data.SBV.Core.Model

(Ord a, SymVal a) => SymVal (RCSet a) Source # 
Instance details

Defined in Data.SBV.Core.Model

(SymVal a, SymVal b) => SymVal (Either a b) Source # 
Instance details

Defined in Data.SBV.Core.Model

(SymVal a, SymVal b) => SymVal (a, b) Source #

SymVal for 2-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b)) Source #

literal :: (a, b) -> SBV (a, b) Source #

fromCV :: CV -> (a, b) Source #

isConcretely :: SBV (a, b) -> ((a, b) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b)] Source #

unliteral :: SBV (a, b) -> Maybe (a, b) Source #

isConcrete :: SBV (a, b) -> Bool Source #

isSymbolic :: SBV (a, b) -> Bool Source #

(SymVal a, SymVal b, SymVal c) => SymVal (a, b, c) Source #

SymVal for 3-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b, c)) Source #

literal :: (a, b, c) -> SBV (a, b, c) Source #

fromCV :: CV -> (a, b, c) Source #

isConcretely :: SBV (a, b, c) -> ((a, b, c) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b, c)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b, c)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b, c)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b, c)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b, c)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b, c)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b, c)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b, c)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b, c)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b, c)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b, c)] Source #

unliteral :: SBV (a, b, c) -> Maybe (a, b, c) Source #

isConcrete :: SBV (a, b, c) -> Bool Source #

isSymbolic :: SBV (a, b, c) -> Bool Source #

(SymVal a, SymVal b, SymVal c, SymVal d) => SymVal (a, b, c, d) Source #

SymVal for 4-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b, c, d)) Source #

literal :: (a, b, c, d) -> SBV (a, b, c, d) Source #

fromCV :: CV -> (a, b, c, d) Source #

isConcretely :: SBV (a, b, c, d) -> ((a, b, c, d) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b, c, d)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b, c, d)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b, c, d)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b, c, d)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b, c, d)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b, c, d)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b, c, d)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b, c, d)] Source #

unliteral :: SBV (a, b, c, d) -> Maybe (a, b, c, d) Source #

isConcrete :: SBV (a, b, c, d) -> Bool Source #

isSymbolic :: SBV (a, b, c, d) -> Bool Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e) => SymVal (a, b, c, d, e) Source #

SymVal for 5-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b, c, d, e)) Source #

literal :: (a, b, c, d, e) -> SBV (a, b, c, d, e) Source #

fromCV :: CV -> (a, b, c, d, e) Source #

isConcretely :: SBV (a, b, c, d, e) -> ((a, b, c, d, e) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b, c, d, e)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b, c, d, e)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b, c, d, e)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b, c, d, e)] Source #

unliteral :: SBV (a, b, c, d, e) -> Maybe (a, b, c, d, e) Source #

isConcrete :: SBV (a, b, c, d, e) -> Bool Source #

isSymbolic :: SBV (a, b, c, d, e) -> Bool Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f) => SymVal (a, b, c, d, e, f) Source #

SymVal for 6-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b, c, d, e, f)) Source #

literal :: (a, b, c, d, e, f) -> SBV (a, b, c, d, e, f) Source #

fromCV :: CV -> (a, b, c, d, e, f) Source #

isConcretely :: SBV (a, b, c, d, e, f) -> ((a, b, c, d, e, f) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b, c, d, e, f)] Source #

unliteral :: SBV (a, b, c, d, e, f) -> Maybe (a, b, c, d, e, f) Source #

isConcrete :: SBV (a, b, c, d, e, f) -> Bool Source #

isSymbolic :: SBV (a, b, c, d, e, f) -> Bool Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g) => SymVal (a, b, c, d, e, f, g) Source #

SymVal for 7-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b, c, d, e, f, g)) Source #

literal :: (a, b, c, d, e, f, g) -> SBV (a, b, c, d, e, f, g) Source #

fromCV :: CV -> (a, b, c, d, e, f, g) Source #

isConcretely :: SBV (a, b, c, d, e, f, g) -> ((a, b, c, d, e, f, g) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f, g)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f, g)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f, g)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f, g)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f, g)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f, g)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b, c, d, e, f, g)] Source #

unliteral :: SBV (a, b, c, d, e, f, g) -> Maybe (a, b, c, d, e, f, g) Source #

isConcrete :: SBV (a, b, c, d, e, f, g) -> Bool Source #

isSymbolic :: SBV (a, b, c, d, e, f, g) -> Bool Source #

(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h) => SymVal (a, b, c, d, e, f, g, h) Source #

SymVal for 8-tuples

Instance details

Defined in Data.SBV.Core.Model

Methods

mkSymVal :: MonadSymbolic m => Maybe Quantifier -> Maybe String -> m (SBV (a, b, c, d, e, f, g, h)) Source #

literal :: (a, b, c, d, e, f, g, h) -> SBV (a, b, c, d, e, f, g, h) Source #

fromCV :: CV -> (a, b, c, d, e, f, g, h) Source #

isConcretely :: SBV (a, b, c, d, e, f, g, h) -> ((a, b, c, d, e, f, g, h) -> Bool) -> Bool Source #

forall :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g, h)) Source #

forall_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f, g, h)) Source #

mkForallVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f, g, h)] Source #

exists :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g, h)) Source #

exists_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f, g, h)) Source #

mkExistVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f, g, h)] Source #

free :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g, h)) Source #

free_ :: MonadSymbolic m => m (SBV (a, b, c, d, e, f, g, h)) Source #

mkFreeVars :: MonadSymbolic m => Int -> m [SBV (a, b, c, d, e, f, g, h)] Source #

symbolic :: MonadSymbolic m => String -> m (SBV (a, b, c, d, e, f, g, h)) Source #

symbolics :: MonadSymbolic m => [String] -> m [SBV (a, b, c, d, e, f, g, h)] Source #

unliteral :: SBV (a, b, c, d, e, f, g, h) -> Maybe (a, b, c, d, e, f, g, h) Source #

isConcrete :: SBV (a, b, c, d, e, f, g, h) -> Bool Source #

isSymbolic :: SBV (a, b, c, d, e, f, g, h) -> Bool Source #

class MonadIO m => MonadSymbolic m where Source #

A Symbolic computation. Represented by a reader monad carrying the state of the computation, layered on top of IO for creating unique references to hold onto intermediate results.

Computations which support symbolic operations

Minimal complete definition

Nothing

Methods

symbolicEnv :: m State Source #

symbolicEnv :: (MonadTrans t, MonadSymbolic m', m ~ t m') => m State Source #

Instances
MonadSymbolic Query Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

MonadSymbolic SBVCodeGen Source # 
Instance details

Defined in Data.SBV.Compilers.CodeGen

MonadSymbolic Alloc Source # 
Instance details

Defined in Documentation.SBV.Examples.Transformers.SymbolicEval

MonadSymbolic m => MonadSymbolic (MaybeT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

MonadIO m => MonadSymbolic (SymbolicT m) Source #

MonadSymbolic instance for `SymbolicT m`

Instance details

Defined in Data.SBV.Core.Symbolic

MonadSymbolic m => MonadSymbolic (ExceptT e m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

MonadSymbolic m => MonadSymbolic (StateT s m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

MonadSymbolic m => MonadSymbolic (StateT s m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

(MonadSymbolic m, Monoid w) => MonadSymbolic (WriterT w m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

(MonadSymbolic m, Monoid w) => MonadSymbolic (WriterT w m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

MonadSymbolic m => MonadSymbolic (ReaderT r m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

type Symbolic = SymbolicT IO Source #

Symbolic is specialization of SymbolicT to the IO monad. Unless you are using transformers explicitly, this is the type you should prefer.

data SymbolicT m a Source #

A generalization of Symbolic.

Instances
MonadTrans SymbolicT Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

lift :: Monad m => m a -> SymbolicT m a #

MonadWriter w m => MonadWriter w (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

writer :: (a, w) -> SymbolicT m a #

tell :: w -> SymbolicT m () #

listen :: SymbolicT m a -> SymbolicT m (a, w) #

pass :: SymbolicT m (a, w -> w) -> SymbolicT m a #

MonadState s m => MonadState s (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

get :: SymbolicT m s #

put :: s -> SymbolicT m () #

state :: (s -> (a, s)) -> SymbolicT m a #

MonadReader r m => MonadReader r (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

ask :: SymbolicT m r #

local :: (r -> r) -> SymbolicT m a -> SymbolicT m a #

reader :: (r -> a) -> SymbolicT m a #

MonadError e m => MonadError e (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

throwError :: e -> SymbolicT m a #

catchError :: SymbolicT m a -> (e -> SymbolicT m a) -> SymbolicT m a #

(ExtractIO m, NFData a) => SExecutable m (SymbolicT m a) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

ExtractIO m => MProvable m (SymbolicT m SBool) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

ExtractIO m => MProvable m (SymbolicT m ()) Source # 
Instance details

Defined in Data.SBV.Provers.Prover

Monad m => Monad (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

(>>=) :: SymbolicT m a -> (a -> SymbolicT m b) -> SymbolicT m b #

(>>) :: SymbolicT m a -> SymbolicT m b -> SymbolicT m b #

return :: a -> SymbolicT m a #

fail :: String -> SymbolicT m a #

Functor m => Functor (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

fmap :: (a -> b) -> SymbolicT m a -> SymbolicT m b #

(<$) :: a -> SymbolicT m b -> SymbolicT m a #

MonadFail m => MonadFail (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

fail :: String -> SymbolicT m a #

Applicative m => Applicative (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

pure :: a -> SymbolicT m a #

(<*>) :: SymbolicT m (a -> b) -> SymbolicT m a -> SymbolicT m b #

liftA2 :: (a -> b -> c) -> SymbolicT m a -> SymbolicT m b -> SymbolicT m c #

(*>) :: SymbolicT m a -> SymbolicT m b -> SymbolicT m b #

(<*) :: SymbolicT m a -> SymbolicT m b -> SymbolicT m a #

Testable (Symbolic SVal) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

property :: Symbolic SVal -> Property #

propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> Symbolic SVal) -> Property #

Testable (Symbolic SBool) Source # 
Instance details

Defined in Data.SBV.Core.Model

Methods

property :: Symbolic SBool -> Property #

propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> Symbolic SBool) -> Property #

MonadIO m => MonadIO (SymbolicT m) Source # 
Instance details

Defined in Data.SBV.Core.Symbolic

Methods

liftIO :: IO a -> SymbolicT m a #

MonadIO m => MonadSymbolic (SymbolicT m) Source #

MonadSymbolic instance for `SymbolicT m`

Instance details

Defined in Data.SBV.Core.Symbolic

MonadIO m => SolverContext (SymbolicT m) Source #

Symbolic computations provide a context for writing symbolic programs.

Instance details

Defined in Data.SBV.Core.Model

label :: SymVal a => String -> SBV a -> SBV a Source #

label: Label the result of an expression. This is essentially a no-op, but useful as it generates a comment in the generated C/SMT-Lib code. Note that if the argument is a constant, then the label is dropped completely, per the usual constant folding strategy. Compare this to observe which is good for printing counter-examples.

output :: (Outputtable a, MonadSymbolic m) => a -> m a Source #

Generalization of output

runSMT :: MonadIO m => SymbolicT m a -> m a Source #

Generalization of runSMT

runSMTWith :: MonadIO m => SMTConfig -> SymbolicT m a -> m a Source #

Generalization of runSMTWith

Module exports

module Data.Bits

module Data.Word

module Data.Int

module Data.Ratio