Copyright | (c) Levent Erkok |
---|---|
License | BSD3 |
Maintainer | erkokl@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Data.SBV
Contents
- Symbolic types
- Arrays of symbolic values
- Creating symbolic values
- Symbolic Equality and Comparisons
- Conditionals: Mergeable values
- Symbolic integral numbers
- Division and Modulus
- Bit-vector operations
- IEEE-floating point numbers
- Enumerations
- Uninterpreted sorts, constants, and functions
- Stopping unrolling: Defined functions
- Special relations
- Properties, proofs, and satisfiability
- Constraints and Quantifiers
- Checking safety
- Quick-checking
- Optimization
- Model extraction
- SMT Interface
- Abstract SBV type
- Queriable values
- Module exports
Description
(The sbv library is hosted at http://github.com/LeventErkok/sbv. Comments, bug reports, and patches are always welcome.)
SBV: SMT Based Verification
Express properties about Haskell programs and automatically prove them using SMT solvers.
>>>
prove $ \x -> x `shiftL` 2 .== 4 * (x :: SWord8)
Q.E.D.
>>>
prove $ \x -> x `shiftL` 2 .== 2 * (x :: SWord8)
Falsifiable. Counter-example: s0 = 64 :: Word8
And similarly, sat
finds a satisfying instance. The types involved are:
prove
::Provable
a => a ->IO
ThmResult
sat
::Satisfiable
a => a ->IO
SatResult
The classes Provable
and Satisfiable
come with instances for n-ary predicates, for arbitrary n.
The predicates are just regular Haskell functions over symbolic types listed below.
Functions for checking satisfiability (sat
and allSat
) are also
provided.
Symbolic Types
The sbv library introduces the following symbolic types:
SBool
: Symbolic Booleans (bits).SWord8
,SWord16
,SWord32
,SWord64
: Symbolic Words (unsigned).SInt8
,SInt16
,SInt32
,SInt64
: Symbolic Ints (signed).SWord
n
: Generalized symbolic words of arbitrary bit-size.SInt
n
: Generalized symbolic ints of arbitrary bit-size.SInteger
: Unbounded signed integers.SReal
: Algebraic-real numbers.SFloat
: IEEE-754 single-precision floating point values.SDouble
: IEEE-754 double-precision floating point values.SRational
: Rationals. (Ratio of two symbolic integers.)SFloatingPoint
: Generalized IEEE-754 floating point values, with user specified exponent and mantissa widths.SChar
,SString
,RegExp
: Characters, strings and regular expressions.SList
: Symbolic lists (which can be nested)STuple
,STuple2
,STuple3
, ..,STuple8
: Symbolic tuples (upto 8-tuples, can be nested)SEither
: Symbolic sumsSMaybe
: Symbolic optional values.SSet
: Symbolic sets.SArray
: Arrays of symbolic values.- Symbolic polynomials over GF(2^n), polynomial arithmetic, and CRCs.
- Uninterpreted constants and functions over symbolic values, with user defined SMT-Lib axioms.
- Uninterpreted sorts, and proofs over such sorts, potentially with axioms.
- Ability to define SMTLib functions, generated directly from Haskell versions, including support for recursive and mutually recursive functions.
- Express quantified formulas (both universals and existentials, including alternating quantifiers), covering first-order logic.
- Model validation: SBV can validate models returned by solvers, which allows
for protection against bugs in SMT solvers and SBV itself. (See the
validateModel
parameter.)
The user can construct ordinary Haskell programs using these types, which behave
very similar to their concrete counterparts. In particular these types belong to the
standard classes Num
, Bits
, custom versions of Eq
(EqSymbolic
)
and Ord
(OrdSymbolic
), along with several other custom classes for simplifying
programming with symbolic values. The framework takes full advantage of Haskell's type
inference to avoid many common mistakes.
Furthermore, predicates (i.e., functions that return SBool
) built out of
these types can also be:
- proven correct via an external SMT solver (the
prove
function) - checked for satisfiability (the
sat
,allSat
functions) - used in synthesis (the
sat
function with existentials) - quick-checked
If a predicate is not valid, prove
will return a counterexample: An
assignment to inputs such that the predicate fails. The sat
function will
return a satisfying assignment, if there is one. The allSat
function returns
all satisfying assignments.
Solvers
The sbv library uses third-party SMT solvers via the standard SMT-Lib interface: https://smt-lib.org
The SBV library is designed to work with any SMT-Lib compliant SMT-solver. Currently, we support the following SMT-Solvers out-of-the box:
- ABC from University of Berkeley: http://www.eecs.berkeley.edu/~alanmi/abc/
- CVC4, and CVC5 from Stanford University and the University of Iowa. https://cvc4.github.io/ and https://cvc5.github.io
- Boolector from Johannes Kepler University: https://boolector.github.io and its successor Bitwuzla from Stanford university: https://bitwuzla.github.io
- MathSAT from Fondazione Bruno Kessler and DISI-University of Trento: http://mathsat.fbk.eu/
- Yices from SRI: http://yices.csl.sri.com/
- DReal from CMU: http://dreal.github.io/
- OpenSMT from Università della Svizzera italiana https://verify.inf.usi.ch/opensmt
- Z3 from Microsoft: http://github.com/Z3Prover/z3/wiki
SBV requires recent versions of these solvers; please see the file
SMTSolverVersions.md
in the source distribution for specifics.
SBV also allows calling these solvers in parallel, either getting results from multiple solvers
or returning the fastest one. (See proveWithAll
, proveWithAny
, etc.)
Support for other compliant solvers can be added relatively easily, please get in touch if there is a solver you'd like to see included.
Semi-automated theorem proving
While SMT solvers are quite powerful, there is a certain class of problems that they are just not well suited for. In particular, SMT solvers are not good at proofs that require induction, or those that require complex chains of reasoning. Induction is necessary to reason about any recursive algorithm, and most such proofs require carefully constructed equational steps. SBV allows for a style of semi-automated theorem proving, called KnuckleDragger, that can be used to construct such proofs. The documentation includes example proofs for many list functions, and even inductive proofs for the familiar insertion and merge-sort algorithms, along with a proof that the square-root of 2 is irrational. While a proper theorem prover (such as Lean, Isabelle etc.) is a more appropriate choice for such proofs, with some guidance (and acceptance of a much larger trusted code base!), SBV can be used to establish correctness of various mathematical claims and algorithms that are usually beyond the scope of SMT solvers alone. See Data.SBV.Tools.KnuckleDragger for the API, and
- Documentation.SBV.Examples.KnuckleDragger.InsertionSort
- Documentation.SBV.Examples.KnuckleDragger.MergeSort
- Documentation.SBV.Examples.KnuckleDragger.Sqrt2IsIrrational
- Documentation.SBV.Examples.KnuckleDragger.ShefferStroke
- Documentation.SBV.Examples.KnuckleDragger.Lists
for various proofs performed in this style.
Synopsis
- type SBool = SBV Bool
- sTrue :: SBool
- sFalse :: SBool
- sNot :: SBool -> SBool
- (.&&) :: SBool -> SBool -> SBool
- (.||) :: SBool -> SBool -> SBool
- (.<+>) :: SBool -> SBool -> SBool
- (.~&) :: SBool -> SBool -> SBool
- (.~|) :: SBool -> SBool -> SBool
- (.=>) :: SBool -> SBool -> SBool
- (.<=>) :: SBool -> SBool -> SBool
- fromBool :: Bool -> SBool
- oneIf :: (Ord a, Num (SBV a), SymVal a) => SBool -> SBV a
- sAnd :: [SBool] -> SBool
- sOr :: [SBool] -> SBool
- sAny :: (a -> SBool) -> [a] -> SBool
- sAll :: (a -> SBool) -> [a] -> SBool
- type SWord8 = SBV Word8
- type SWord16 = SBV Word16
- type SWord32 = SBV Word32
- type SWord64 = SBV Word64
- type SWord (n :: Nat) = SBV (WordN n)
- data WordN (n :: Nat)
- type SInt8 = SBV Int8
- type SInt16 = SBV Int16
- type SInt32 = SBV Int32
- type SInt64 = SBV Int64
- type SInt (n :: Nat) = SBV (IntN n)
- data IntN (n :: Nat)
- type family BVIsNonZero (arg :: Nat) where ...
- type family FromSized t where ...
- type family ToSized t where ...
- fromSized :: FromSizedBV a => a -> FromSized a
- toSized :: ToSizedBV a => a -> ToSized a
- type SInteger = SBV Integer
- type family ValidFloat (eb :: Nat) (sb :: Nat) where ...
- type SFloat = SBV Float
- type SDouble = SBV Double
- type SFloatingPoint (eb :: Nat) (sb :: Nat) = SBV (FloatingPoint eb sb)
- data FloatingPoint (eb :: Nat) (sb :: Nat)
- type SFPHalf = SBV FPHalf
- type FPHalf = FloatingPoint 5 11
- type SFPBFloat = SBV FPBFloat
- type FPBFloat = FloatingPoint 8 8
- type SFPSingle = SBV FPSingle
- type FPSingle = FloatingPoint 8 24
- type SFPDouble = SBV FPDouble
- type FPDouble = FloatingPoint 11 53
- type SFPQuad = SBV FPQuad
- type FPQuad = FloatingPoint 15 113
- fpFromInteger :: Int -> Int -> Integer -> FP
- type SRational = SBV Rational
- type SReal = SBV AlgReal
- data AlgReal
- sRealToSInteger :: SReal -> SInteger
- algRealToRational :: AlgReal -> RationalCV
- data RealPoint a
- = OpenPoint a
- | ClosedPoint a
- realPoint :: RealPoint a -> a
- data RationalCV
- type SChar = SBV Char
- type SString = SBV String
- type SList a = SBV [a]
- class SymTuple a
- type STuple a b = SBV (a, b)
- type STuple2 a b = SBV (a, b)
- type STuple3 a b c = SBV (a, b, c)
- type STuple4 a b c d = SBV (a, b, c, d)
- type STuple5 a b c d e = SBV (a, b, c, d, e)
- type STuple6 a b c d e f = SBV (a, b, c, d, e, f)
- type STuple7 a b c d e f g = SBV (a, b, c, d, e, f, g)
- type STuple8 a b c d e f g h = SBV (a, b, c, d, e, f, g, h)
- type SMaybe a = SBV (Maybe a)
- type SEither a b = SBV (Either a b)
- data RCSet a
- = RegularSet (Set a)
- | ComplementSet (Set a)
- type SSet a = SBV (RCSet a)
- type SArray a b = SBV (ArrayModel a b)
- sArray :: (SymVal a, SymVal b) => String -> Symbolic (SArray a b)
- sArray_ :: (SymVal a, SymVal b) => Symbolic (SArray a b)
- sArrays :: (SymVal a, SymVal b) => [String] -> Symbolic [SArray a b]
- readArray :: (Eq key, SymVal key, SymVal val, HasKind val) => SArray key val -> SBV key -> SBV val
- writeArray :: (HasKind key, SymVal key, SymVal val, HasKind val) => SArray key val -> SBV key -> SBV val -> SArray key val
- lambdaArray :: (SymVal a, HasKind b) => (SBV a -> SBV b) -> SArray a b
- listArray :: (SymVal a, SymVal b) => [(a, b)] -> b -> SArray a b
- sBool :: String -> Symbolic SBool
- sBool_ :: Symbolic SBool
- sWord8 :: String -> Symbolic SWord8
- sWord8_ :: Symbolic SWord8
- sWord16 :: String -> Symbolic SWord16
- sWord16_ :: Symbolic SWord16
- sWord32 :: String -> Symbolic SWord32
- sWord32_ :: Symbolic SWord32
- sWord64 :: String -> Symbolic SWord64
- sWord64_ :: Symbolic SWord64
- sWord :: forall (n :: Nat). (KnownNat n, BVIsNonZero n) => String -> Symbolic (SWord n)
- sWord_ :: forall (n :: Nat). (KnownNat n, BVIsNonZero n) => Symbolic (SWord n)
- sInt8 :: String -> Symbolic SInt8
- sInt8_ :: Symbolic SInt8
- sInt16 :: String -> Symbolic SInt16
- sInt16_ :: Symbolic SInt16
- sInt32 :: String -> Symbolic SInt32
- sInt32_ :: Symbolic SInt32
- sInt64 :: String -> Symbolic SInt64
- sInt64_ :: Symbolic SInt64
- sInt :: forall (n :: Nat). (KnownNat n, BVIsNonZero n) => String -> Symbolic (SInt n)
- sInt_ :: forall (n :: Nat). (KnownNat n, BVIsNonZero n) => Symbolic (SInt n)
- sInteger :: String -> Symbolic SInteger
- sInteger_ :: Symbolic SInteger
- sReal :: String -> Symbolic SReal
- sReal_ :: Symbolic SReal
- sRational :: String -> Symbolic SRational
- sRational_ :: Symbolic SRational
- sFloat :: String -> Symbolic SFloat
- sFloat_ :: Symbolic SFloat
- sDouble :: String -> Symbolic SDouble
- sDouble_ :: Symbolic SDouble
- sFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => String -> Symbolic (SFloatingPoint eb sb)
- sFloatingPoint_ :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => Symbolic (SFloatingPoint eb sb)
- sFPHalf :: String -> Symbolic SFPHalf
- sFPHalf_ :: Symbolic SFPHalf
- sFPBFloat :: String -> Symbolic SFPBFloat
- sFPBFloat_ :: Symbolic SFPBFloat
- sFPSingle :: String -> Symbolic SFPSingle
- sFPSingle_ :: Symbolic SFPSingle
- sFPDouble :: String -> Symbolic SFPDouble
- sFPDouble_ :: Symbolic SFPDouble
- sFPQuad :: String -> Symbolic SFPQuad
- sFPQuad_ :: Symbolic SFPQuad
- sChar :: String -> Symbolic SChar
- sChar_ :: Symbolic SChar
- sString :: String -> Symbolic SString
- sString_ :: Symbolic SString
- sList :: SymVal a => String -> Symbolic (SList a)
- sList_ :: SymVal a => Symbolic (SList a)
- sTuple :: (SymTuple tup, SymVal tup) => String -> Symbolic (SBV tup)
- sTuple_ :: (SymTuple tup, SymVal tup) => Symbolic (SBV tup)
- sEither :: (SymVal a, SymVal b) => String -> Symbolic (SEither a b)
- sEither_ :: (SymVal a, SymVal b) => Symbolic (SEither a b)
- sMaybe :: SymVal a => String -> Symbolic (SMaybe a)
- sMaybe_ :: SymVal a => Symbolic (SMaybe a)
- sSet :: (Ord a, SymVal a) => String -> Symbolic (SSet a)
- sSet_ :: (Ord a, SymVal a) => Symbolic (SSet a)
- sBools :: [String] -> Symbolic [SBool]
- sWord8s :: [String] -> Symbolic [SWord8]
- sWord16s :: [String] -> Symbolic [SWord16]
- sWord32s :: [String] -> Symbolic [SWord32]
- sWord64s :: [String] -> Symbolic [SWord64]
- sWords :: forall (n :: Nat). (KnownNat n, BVIsNonZero n) => [String] -> Symbolic [SWord n]
- sInt8s :: [String] -> Symbolic [SInt8]
- sInt16s :: [String] -> Symbolic [SInt16]
- sInt32s :: [String] -> Symbolic [SInt32]
- sInt64s :: [String] -> Symbolic [SInt64]
- sInts :: forall (n :: Nat). (KnownNat n, BVIsNonZero n) => [String] -> Symbolic [SInt n]
- sIntegers :: [String] -> Symbolic [SInteger]
- sReals :: [String] -> Symbolic [SReal]
- sRationals :: [String] -> Symbolic [SRational]
- sFloats :: [String] -> Symbolic [SFloat]
- sDoubles :: [String] -> Symbolic [SDouble]
- sFloatingPoints :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => [String] -> Symbolic [SFloatingPoint eb sb]
- sFPHalfs :: [String] -> Symbolic [SFPHalf]
- sFPBFloats :: [String] -> Symbolic [SFPBFloat]
- sFPSingles :: [String] -> Symbolic [SFPSingle]
- sFPDoubles :: [String] -> Symbolic [SFPDouble]
- sFPQuads :: [String] -> Symbolic [SFPQuad]
- sChars :: [String] -> Symbolic [SChar]
- sStrings :: [String] -> Symbolic [SString]
- sLists :: SymVal a => [String] -> Symbolic [SList a]
- sTuples :: (SymTuple tup, SymVal tup) => [String] -> Symbolic [SBV tup]
- sEithers :: (SymVal a, SymVal b) => [String] -> Symbolic [SEither a b]
- sMaybes :: SymVal a => [String] -> Symbolic [SMaybe a]
- sSets :: (Ord a, SymVal a) => [String] -> Symbolic [SSet a]
- class EqSymbolic a where
- class (Mergeable a, EqSymbolic a) => OrdSymbolic a where
- class Equality a where
- class Mergeable a where
- ite :: Mergeable a => SBool -> a -> a -> a
- iteLazy :: Mergeable a => SBool -> a -> a -> a
- class (SymVal a, Num a, Num (SBV a), Bits a, Integral a) => SIntegral a
- class SDivisible a where
- sEDivMod :: SInteger -> SInteger -> (SInteger, SInteger)
- sEDiv :: SInteger -> SInteger -> SInteger
- sEMod :: SInteger -> SInteger -> SInteger
- sDivides :: Integer -> SInteger -> SBool
- sFromIntegral :: (Integral a, HasKind a, Num a, SymVal a, HasKind b, Num b, SymVal b) => SBV a -> SBV b
- sShiftLeft :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a
- sShiftRight :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a
- sRotateLeft :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a
- sBarrelRotateLeft :: (SFiniteBits a, SFiniteBits b) => SBV a -> SBV b -> SBV a
- sRotateRight :: (SIntegral a, SIntegral b) => SBV a -> SBV b -> SBV a
- sBarrelRotateRight :: (SFiniteBits a, SFiniteBits b) => SBV a -> SBV b -> SBV a
- sSignedShiftArithRight :: (SFiniteBits a, SIntegral b) => SBV a -> SBV b -> SBV a
- class (Ord a, SymVal a, Num a, Num (SBV a), Bits a) => SFiniteBits a where
- sFiniteBitSize :: SBV a -> Int
- lsb :: SBV a -> SBool
- msb :: SBV a -> SBool
- blastBE :: SBV a -> [SBool]
- blastLE :: SBV a -> [SBool]
- fromBitsBE :: [SBool] -> SBV a
- fromBitsLE :: [SBool] -> SBV a
- sTestBit :: SBV a -> Int -> SBool
- sExtractBits :: SBV a -> [Int] -> [SBool]
- sPopCount :: SBV a -> SWord8
- setBitTo :: SBV a -> Int -> SBool -> SBV a
- sSetBitTo :: SBV a -> SBV a -> SBool -> SBV a
- fullAdder :: SBV a -> SBV a -> (SBool, SBV a)
- fullMultiplier :: SBV a -> SBV a -> (SBV a, SBV a)
- sCountLeadingZeros :: SBV a -> SWord8
- sCountTrailingZeros :: SBV a -> SWord8
- bvExtract :: forall (i :: Nat) (j :: Nat) (n :: Nat) bv proxy. (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat i, KnownNat j, (i + 1) <= n, j <= i, BVIsNonZero ((i - j) + 1)) => proxy i -> proxy j -> SBV (bv n) -> SBV (bv ((i - j) + 1))
- (#) :: forall (n :: Nat) bv (m :: Nat). (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat m, BVIsNonZero m, SymVal (bv m)) => SBV (bv n) -> SBV (bv m) -> SBV (bv (n + m))
- zeroExtend :: forall (n :: Nat) (m :: Nat) bv. (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat m, BVIsNonZero m, SymVal (bv m), (n + 1) <= m, SIntegral (bv (m - n)), BVIsNonZero (m - n)) => SBV (bv n) -> SBV (bv m)
- signExtend :: forall (n :: Nat) (m :: Nat) bv. (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat m, BVIsNonZero m, SymVal (bv m), (n + 1) <= m, SFiniteBits (bv n), SIntegral (bv (m - n)), BVIsNonZero (m - n)) => SBV (bv n) -> SBV (bv m)
- bvDrop :: forall (i :: Nat) (n :: Nat) (m :: Natural) bv proxy. (KnownNat n, BVIsNonZero n, KnownNat i, (i + 1) <= n, ((i + m) - n) <= 0, BVIsNonZero (n - i)) => proxy i -> SBV (bv n) -> SBV (bv m)
- bvTake :: forall (i :: Nat) (n :: Nat) bv proxy. (KnownNat n, BVIsNonZero n, KnownNat i, BVIsNonZero i, i <= n) => proxy i -> SBV (bv n) -> SBV (bv i)
- class ByteConverter a where
- (.^) :: (Mergeable b, Num b, SIntegral e) => b -> SBV e -> b
- class (SymVal a, RealFloat a) => IEEEFloating a where
- fpAbs :: SBV a -> SBV a
- fpNeg :: SBV a -> SBV a
- fpAdd :: SRoundingMode -> SBV a -> SBV a -> SBV a
- fpSub :: SRoundingMode -> SBV a -> SBV a -> SBV a
- fpMul :: SRoundingMode -> SBV a -> SBV a -> SBV a
- fpDiv :: SRoundingMode -> SBV a -> SBV a -> SBV a
- fpFMA :: SRoundingMode -> SBV a -> SBV a -> SBV a -> SBV a
- fpSqrt :: SRoundingMode -> SBV a -> SBV a
- fpRem :: SBV a -> SBV a -> SBV a
- fpRoundToIntegral :: SRoundingMode -> SBV a -> SBV a
- fpMin :: SBV a -> SBV a -> SBV a
- fpMax :: SBV a -> SBV a -> SBV a
- fpIsEqualObject :: SBV a -> SBV a -> SBool
- fpIsNormal :: SBV a -> SBool
- fpIsSubnormal :: SBV a -> SBool
- fpIsZero :: SBV a -> SBool
- fpIsInfinite :: SBV a -> SBool
- fpIsNaN :: SBV a -> SBool
- fpIsNegative :: SBV a -> SBool
- fpIsPositive :: SBV a -> SBool
- fpIsNegativeZero :: SBV a -> SBool
- fpIsPositiveZero :: SBV a -> SBool
- fpIsPoint :: SBV a -> SBool
- data RoundingMode
- type SRoundingMode = SBV RoundingMode
- nan :: Floating a => a
- infinity :: Floating a => a
- sNaN :: (Floating a, SymVal a) => SBV a
- sInfinity :: (Floating a, SymVal a) => SBV a
- sRoundNearestTiesToEven :: SRoundingMode
- sRoundNearestTiesToAway :: SRoundingMode
- sRoundTowardPositive :: SRoundingMode
- sRoundTowardNegative :: SRoundingMode
- sRoundTowardZero :: SRoundingMode
- sRNE :: SRoundingMode
- sRNA :: SRoundingMode
- sRTP :: SRoundingMode
- sRTN :: SRoundingMode
- sRTZ :: SRoundingMode
- class SymVal a => IEEEFloatConvertible a where
- fromSFloat :: SRoundingMode -> SFloat -> SBV a
- toSFloat :: SRoundingMode -> SBV a -> SFloat
- fromSDouble :: SRoundingMode -> SDouble -> SBV a
- toSDouble :: SRoundingMode -> SBV a -> SDouble
- fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV a
- toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV a -> SFloatingPoint eb sb
- sFloatAsSWord32 :: SFloat -> SWord32
- sWord32AsSFloat :: SWord32 -> SFloat
- sDoubleAsSWord64 :: SDouble -> SWord64
- sWord64AsSDouble :: SWord64 -> SDouble
- sFloatingPointAsSWord :: forall (eb :: Nat) (sb :: Nat). (ValidFloat eb sb, KnownNat (eb + sb), BVIsNonZero (eb + sb)) => SFloatingPoint eb sb -> SWord (eb + sb)
- sWordAsSFloatingPoint :: forall (eb :: Natural) (sb :: Natural). (KnownNat (eb + sb), BVIsNonZero (eb + sb), ValidFloat eb sb) => SWord (eb + sb) -> SFloatingPoint eb sb
- blastSFloat :: SFloat -> (SBool, [SBool], [SBool])
- blastSDouble :: SDouble -> (SBool, [SBool], [SBool])
- blastSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). (ValidFloat eb sb, KnownNat (eb + sb), BVIsNonZero (eb + sb)) => SFloatingPoint eb sb -> (SBool, [SBool], [SBool])
- crack :: Bool -> SBV a -> String
- mkSymbolicEnumeration :: Name -> Q [Dec]
- mkUninterpretedSort :: Name -> Q [Dec]
- class SMTDefinable a where
- smtFunction :: String -> a -> a
- registerFunction :: a -> Symbolic ()
- uninterpret :: String -> a
- uninterpretWithArgs :: String -> [String] -> a
- cgUninterpret :: String -> [String] -> a -> a
- sbvDefineValue :: UIName -> Maybe [String] -> UIKind a -> a
- sym :: String -> a
- sbv2smt :: ExtractIO m => a -> m String
- registerType :: forall a m. (MonadIO m, SolverContext m, HasKind a) => Proxy a -> m ()
- type Relation a = (SBV a, SBV a) -> SBool
- isPartialOrder :: SymVal a => String -> Relation a -> SBool
- isLinearOrder :: SymVal a => String -> Relation a -> SBool
- isTreeOrder :: SymVal a => String -> Relation a -> SBool
- isPiecewiseLinearOrder :: SymVal a => String -> Relation a -> SBool
- mkTransitiveClosure :: SymVal a => String -> Relation a -> Relation a
- type Predicate = Symbolic SBool
- type ConstraintSet = Symbolic ()
- type Provable = ProvableM IO
- type Satisfiable = SatisfiableM IO
- prove :: Provable a => a -> IO ThmResult
- proveWith :: Provable a => SMTConfig -> a -> IO ThmResult
- dprove :: Provable a => a -> IO ThmResult
- dproveWith :: Provable a => SMTConfig -> a -> IO ThmResult
- sat :: Satisfiable a => a -> IO SatResult
- satWith :: Satisfiable a => SMTConfig -> a -> IO SatResult
- dsat :: Satisfiable a => a -> IO SatResult
- dsatWith :: Satisfiable a => SMTConfig -> a -> IO SatResult
- allSat :: Satisfiable a => a -> IO AllSatResult
- allSatWith :: Satisfiable a => SMTConfig -> a -> IO AllSatResult
- isVacuousProof :: Provable a => a -> IO Bool
- isVacuousProofWith :: Provable a => SMTConfig -> a -> IO Bool
- isTheorem :: Provable a => a -> IO Bool
- isTheoremWith :: Provable a => SMTConfig -> a -> IO Bool
- isSatisfiable :: Satisfiable a => a -> IO Bool
- isSatisfiableWith :: Satisfiable a => SMTConfig -> a -> IO Bool
- proveWithAny :: Provable a => [SMTConfig] -> a -> IO (Solver, NominalDiffTime, ThmResult)
- proveWithAll :: Provable a => [SMTConfig] -> a -> IO [(Solver, NominalDiffTime, ThmResult)]
- proveConcurrentWithAny :: Provable a => SMTConfig -> [Query b] -> a -> IO (Solver, NominalDiffTime, ThmResult)
- proveConcurrentWithAll :: Provable a => SMTConfig -> [Query b] -> a -> IO [(Solver, NominalDiffTime, ThmResult)]
- satWithAny :: Satisfiable a => [SMTConfig] -> a -> IO (Solver, NominalDiffTime, SatResult)
- satWithAll :: Satisfiable a => [SMTConfig] -> a -> IO [(Solver, NominalDiffTime, SatResult)]
- satConcurrentWithAny :: Satisfiable a => SMTConfig -> [Query b] -> a -> IO (Solver, NominalDiffTime, SatResult)
- satConcurrentWithAll :: Satisfiable a => SMTConfig -> [Query b] -> a -> IO [(Solver, NominalDiffTime, SatResult)]
- generateSMTBenchmarkSat :: SatisfiableM m a => a -> m String
- generateSMTBenchmarkProof :: ProvableM m a => a -> m String
- solve :: [SBool] -> Symbolic SBool
- allSatPartition :: SymVal a => String -> SBV a -> Symbolic ()
- constrain :: (SolverContext m, QuantifiedBool a) => a -> m ()
- softConstrain :: (SolverContext m, QuantifiedBool a) => a -> m ()
- class QuantifiedBool a
- quantifiedBool :: QuantifiedBool a => a -> SBool
- newtype Forall (nm :: Symbol) a = Forall (SBV a)
- newtype Exists (nm :: Symbol) a = Exists (SBV a)
- newtype ExistsUnique (nm :: Symbol) a = ExistsUnique (SBV a)
- newtype ForallN (n :: Nat) (nm :: Symbol) a = ForallN [SBV a]
- newtype ExistsN (n :: Nat) (nm :: Symbol) a = ExistsN [SBV a]
- class QNot a where
- class Skolemize a where
- namedConstraint :: (SolverContext m, QuantifiedBool a) => String -> a -> m ()
- constrainWithAttribute :: (SolverContext m, QuantifiedBool a) => [(String, String)] -> a -> m ()
- pbAtMost :: [SBool] -> Int -> SBool
- pbAtLeast :: [SBool] -> Int -> SBool
- pbExactly :: [SBool] -> Int -> SBool
- pbLe :: [(Int, SBool)] -> Int -> SBool
- pbGe :: [(Int, SBool)] -> Int -> SBool
- pbEq :: [(Int, SBool)] -> Int -> SBool
- pbMutexed :: [SBool] -> SBool
- pbStronglyMutexed :: [SBool] -> SBool
- sAssert :: HasKind a => Maybe CallStack -> String -> SBool -> SBV a -> SBV a
- isSafe :: SafeResult -> Bool
- class ExtractIO m => SExecutable (m :: Type -> Type) a
- sName :: SExecutable IO a => a -> Symbolic ()
- safe :: SExecutable IO a => a -> IO [SafeResult]
- safeWith :: SExecutable IO a => SMTConfig -> a -> IO [SafeResult]
- sbvQuickCheck :: Symbolic SBool -> IO Bool
- optimize :: Satisfiable a => OptimizeStyle -> a -> IO OptimizeResult
- optimizeWith :: Satisfiable a => SMTConfig -> OptimizeStyle -> a -> IO OptimizeResult
- optLexicographic :: Satisfiable a => a -> IO SMTResult
- optLexicographicWith :: Satisfiable a => SMTConfig -> a -> IO SMTResult
- optPareto :: Satisfiable a => Maybe Int -> a -> IO (Bool, [SMTResult])
- optParetoWith :: Satisfiable a => SMTConfig -> Maybe Int -> a -> IO (Bool, [SMTResult])
- optIndependent :: Satisfiable a => a -> IO [(String, SMTResult)]
- optIndependentWith :: Satisfiable a => SMTConfig -> a -> IO [(String, SMTResult)]
- data OptimizeStyle
- = Lexicographic
- | Independent
- | Pareto (Maybe Int)
- data Objective a
- class Metric a where
- type MetricSpace a
- toMetricSpace :: SBV a -> SBV (MetricSpace a)
- fromMetricSpace :: SBV (MetricSpace a) -> SBV a
- annotateForMS :: Proxy a -> String -> String
- msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV a -> m ()
- msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV a -> m ()
- minimize :: Metric a => String -> SBV a -> Symbolic ()
- maximize :: Metric a => String -> SBV a -> Symbolic ()
- assertWithPenalty :: String -> SBool -> Penalty -> Symbolic ()
- data Penalty
- data ExtCV
- data GeneralizedCV
- newtype ThmResult = ThmResult SMTResult
- newtype SatResult = SatResult SMTResult
- data AllSatResult = AllSatResult {}
- newtype SafeResult = SafeResult (Maybe String, String, SMTResult)
- data OptimizeResult
- data SMTResult
- data SMTReasonUnknown
- observe :: SymVal a => String -> SBV a -> SBV a
- observeIf :: SymVal a => (a -> Bool) -> String -> SBV a -> SBV a
- sObserve :: SymVal a => String -> SBV a -> Symbolic ()
- class Modelable a where
- modelExists :: a -> Bool
- getModelAssignment :: SatModel b => a -> Either String (Bool, b)
- getModelDictionary :: a -> Map String CV
- getModelValue :: SymVal b => String -> a -> Maybe b
- getModelUninterpretedValue :: String -> a -> Maybe String
- extractModel :: SatModel b => a -> Maybe b
- getModelObjectives :: a -> Map String GeneralizedCV
- getModelObjectiveValue :: String -> a -> Maybe GeneralizedCV
- getModelUIFuns :: a -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV))
- getModelUIFunValue :: String -> a -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV))
- displayModels :: SatModel a => ([(Bool, a)] -> [(Bool, a)]) -> (Int -> (Bool, a) -> IO ()) -> AllSatResult -> IO Int
- extractModels :: SatModel a => AllSatResult -> [a]
- getModelDictionaries :: AllSatResult -> [Map String CV]
- getModelValues :: SymVal b => String -> AllSatResult -> [Maybe b]
- getModelUninterpretedValues :: String -> AllSatResult -> [Maybe String]
- data SMTConfig = SMTConfig {
- verbose :: Bool
- timing :: Timing
- printBase :: Int
- printRealPrec :: Int
- crackNum :: Bool
- crackNumSurfaceVals :: [(String, Integer)]
- satCmd :: String
- allSatMaxModelCount :: Maybe Int
- allSatPrintAlong :: Bool
- allSatTrackUFs :: Bool
- isNonModelVar :: String -> Bool
- validateModel :: Bool
- optimizeValidateConstraints :: Bool
- transcript :: Maybe FilePath
- smtLibVersion :: SMTLibVersion
- dsatPrecision :: Maybe Double
- solver :: SMTSolver
- extraArgs :: [String]
- roundingMode :: RoundingMode
- solverSetOptions :: [SMTOption]
- ignoreExitCode :: Bool
- redirectVerbose :: Maybe FilePath
- generateHOEquivs :: Bool
- kdOptions :: KDOptions
- data KDOptions = KDOptions {
- ribbonLength :: Int
- firstifyUniqueLen :: Int
- quiet :: Bool
- measureTime :: Bool
- data Timing
- data SMTLibVersion = SMTLib2
- data Solver
- data SMTSolver = SMTSolver {
- name :: Solver
- executable :: String
- preprocess :: String -> String
- options :: SMTConfig -> [String]
- engine :: SMTEngine
- capabilities :: SolverCapabilities
- boolector :: SMTConfig
- bitwuzla :: SMTConfig
- cvc4 :: SMTConfig
- cvc5 :: SMTConfig
- yices :: SMTConfig
- dReal :: SMTConfig
- z3 :: SMTConfig
- mathSAT :: SMTConfig
- abc :: SMTConfig
- openSMT :: SMTConfig
- defaultSolverConfig :: Solver -> SMTConfig
- defaultSMTCfg :: SMTConfig
- defaultDeltaSMTCfg :: SMTConfig
- sbvCheckSolverInstallation :: SMTConfig -> IO Bool
- getAvailableSolvers :: IO [SMTConfig]
- setLogic :: SolverContext m => Logic -> m ()
- data Logic
- setOption :: SolverContext m => SMTOption -> m ()
- setInfo :: SolverContext m => String -> [String] -> m ()
- setTimeOut :: SolverContext m => Integer -> m ()
- data SBVException = SBVException {
- sbvExceptionDescription :: String
- sbvExceptionSent :: Maybe String
- sbvExceptionExpected :: Maybe String
- sbvExceptionReceived :: Maybe String
- sbvExceptionStdOut :: Maybe String
- sbvExceptionStdErr :: Maybe String
- sbvExceptionExitCode :: Maybe ExitCode
- sbvExceptionConfig :: SMTConfig
- sbvExceptionReason :: Maybe [String]
- sbvExceptionHint :: Maybe [String]
- data SBV a
- class HasKind a where
- kindOf :: a -> Kind
- hasSign :: a -> Bool
- intSizeOf :: a -> Int
- isBoolean :: a -> Bool
- isBounded :: a -> Bool
- isReal :: a -> Bool
- isFloat :: a -> Bool
- isDouble :: a -> Bool
- isRational :: a -> Bool
- isFP :: a -> Bool
- isUnbounded :: a -> Bool
- isUserSort :: a -> Bool
- isChar :: a -> Bool
- isString :: a -> Bool
- isList :: a -> Bool
- isSet :: a -> Bool
- isTuple :: a -> Bool
- isMaybe :: a -> Bool
- isEither :: a -> Bool
- isArray :: a -> Bool
- showType :: a -> String
- data Kind
- class (HasKind a, Typeable a) => SymVal a
- free :: SymVal a => String -> Symbolic (SBV a)
- free_ :: SymVal a => Symbolic (SBV a)
- mkFreeVars :: SymVal a => Int -> Symbolic [SBV a]
- symbolic :: SymVal a => String -> Symbolic (SBV a)
- symbolics :: SymVal a => [String] -> Symbolic [SBV a]
- literal :: SymVal a => a -> SBV a
- unliteral :: SymVal a => SBV a -> Maybe a
- fromCV :: SymVal a => CV -> a
- isConcrete :: SymVal a => SBV a -> Bool
- isSymbolic :: SymVal a => SBV a -> Bool
- isConcretely :: SymVal a => SBV a -> (a -> Bool) -> Bool
- mkSymVal :: SymVal a => VarContext -> Maybe String -> Symbolic (SBV a)
- class MonadIO m => MonadSymbolic (m :: Type -> Type) where
- symbolicEnv :: m State
- type Symbolic = SymbolicT IO
- data SymbolicT (m :: Type -> Type) a
- label :: SymVal a => String -> SBV a -> SBV a
- output :: Outputtable a => a -> Symbolic a
- runSMT :: Symbolic a -> IO a
- runSMTWith :: SMTConfig -> Symbolic a -> IO a
- some :: (SymVal a, HasKind a) => String -> (SBV a -> SBool) -> SBV a
- class Queriable (m :: Type -> Type) a where
- type QueryResult a
- create :: QueryT m a
- project :: a -> QueryT m (QueryResult a)
- embed :: QueryResult a -> QueryT m a
- freshVar :: forall a m. (MonadIO m, MonadQuery m, SymVal a) => String -> m (SBV a)
- freshVar_ :: forall a m. (MonadIO m, MonadQuery m, SymVal a) => m (SBV a)
- module Data.Bits
- module Data.Word
- module Data.Int
- module Data.Ratio
Documentation
The SBV library is really two things:
- A framework for writing symbolic programs in Haskell, i.e., programs operating on symbolic values along with the usual concrete counterparts.
- A framework for proving properties of such programs using SMT solvers.
The programming goal of SBV is to provide a seamless experience, i.e., let people program
in the usual Haskell style without distractions of symbolic coding. While Haskell helps
in some aspects (the Num
and Bits
classes simplify coding), it makes life harder
in others. For instance, if-then-else
only takes Bool
as a test in Haskell, and
comparisons (>
etc.) only return Bool
s. Clearly we would like these values to be
symbolic (i.e., SBool
), thus stopping us from using some native Haskell constructs.
When symbolic versions of operators are needed, they are typically obtained by prepending a dot,
for instance ==
becomes .==
. Care has been taken to make the transition painless. In
particular, any Haskell program you build out of symbolic components is fully concretely
executable within Haskell, without the need for any custom interpreters. (They are truly
Haskell programs, not AST's built out of pieces of syntax.) This provides for an integrated
feel of the system, one of the original design goals for SBV.
Incremental query mode: SBV provides a wide variety of ways to utilize SMT-solvers, without requiring the user to deal with the solvers themselves. While this mode is convenient, advanced users might need access to the underlying solver at a lower level. For such use cases, SBV allows users to have an interactive session: The user can issue commands to the solver, inspect the values/results, and formulate new constraints. This advanced feature is available through the Data.SBV.Control module, where most SMTLib features are made available via a typed-API.
Symbolic types
Booleans
Boolean values and functions
oneIf :: (Ord a, Num (SBV a), SymVal a) => SBool -> SBV a Source #
Returns 1 if the boolean is sTrue
, otherwise 0.
Logical aggregations
Bit-vectors
Unsigned bit-vectors
data WordN (n :: Nat) Source #
An unsigned bit-vector carrying its size info
Instances
Signed bit-vectors
A signed bit-vector carrying its size info
Instances
KnownNat n => Arbitrary (IntN n) Source # | Quickcheck instance for IntN | ||||
(KnownNat n, BVIsNonZero n) => Bits (IntN n) Source # | |||||
Defined in Data.SBV.Core.Sized Methods (.&.) :: IntN n -> IntN n -> IntN n # (.|.) :: IntN n -> IntN n -> IntN n # xor :: IntN n -> IntN n -> IntN n # complement :: IntN n -> IntN n # shift :: IntN n -> Int -> IntN n # rotate :: IntN n -> Int -> IntN n # setBit :: IntN n -> Int -> IntN n # clearBit :: IntN n -> Int -> IntN n # complementBit :: IntN n -> Int -> IntN n # testBit :: IntN n -> Int -> Bool # bitSizeMaybe :: IntN n -> Maybe Int # shiftL :: IntN n -> Int -> IntN n # unsafeShiftL :: IntN n -> Int -> IntN n # shiftR :: IntN n -> Int -> IntN n # unsafeShiftR :: IntN n -> Int -> IntN n # rotateL :: IntN n -> Int -> IntN n # | |||||
(KnownNat n, BVIsNonZero n) => Bounded (IntN n) Source # | |||||
(KnownNat n, BVIsNonZero n) => Enum (IntN n) Source # | |||||
Defined in Data.SBV.Core.Sized | |||||
KnownNat n => Num (SInt n) Source # | |||||
(KnownNat n, BVIsNonZero n) => Num (IntN n) Source # | |||||
(KnownNat n, BVIsNonZero n) => Integral (IntN n) Source # | |||||
Defined in Data.SBV.Core.Sized | |||||
(KnownNat n, BVIsNonZero n) => Real (IntN n) Source # | |||||
Defined in Data.SBV.Core.Sized Methods toRational :: IntN n -> Rational # | |||||
Show (IntN n) Source # | Show instance for | ||||
Eq (IntN n) Source # | |||||
Ord (IntN n) Source # | |||||
(KnownNat n, BVIsNonZero n) => SymVal (IntN n) Source # | |||||
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (IntN n)) Source # literal :: IntN n -> SBV (IntN n) Source # fromCV :: CV -> IntN n Source # isConcretely :: SBV (IntN n) -> (IntN n -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (IntN n)) Source # free_ :: MonadSymbolic m => m (SBV (IntN n)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (IntN n)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (IntN n)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (IntN n)] Source # unliteral :: SBV (IntN n) -> Maybe (IntN n) Source # | |||||
(KnownNat n, BVIsNonZero n) => HasKind (IntN n) Source # |
| ||||
Defined in Data.SBV.Core.Sized Methods kindOf :: IntN n -> Kind Source # hasSign :: IntN n -> Bool Source # intSizeOf :: IntN n -> Int Source # isBoolean :: IntN n -> Bool Source # isBounded :: IntN n -> Bool Source # isReal :: IntN n -> Bool Source # isFloat :: IntN n -> Bool Source # isDouble :: IntN n -> Bool Source # isRational :: IntN n -> Bool Source # isFP :: IntN n -> Bool Source # isUnbounded :: IntN n -> Bool Source # isUserSort :: IntN n -> Bool Source # isChar :: IntN n -> Bool Source # isString :: IntN n -> Bool Source # isList :: IntN n -> Bool Source # isSet :: IntN n -> Bool Source # isTuple :: IntN n -> Bool Source # isMaybe :: IntN n -> Bool Source # isEither :: IntN n -> Bool Source # | |||||
(KnownNat n, BVIsNonZero n) => Metric (IntN n) Source # | Optimizing | ||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV (IntN n) -> SBV (MetricSpace (IntN n)) Source # fromMetricSpace :: SBV (MetricSpace (IntN n)) -> SBV (IntN n) Source # annotateForMS :: Proxy (IntN n) -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (IntN n) -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (IntN n) -> m () Source # | |||||
(KnownNat n, BVIsNonZero n) => SDivisible (SInt n) Source # |
| ||||
Defined in Data.SBV.Core.Model | |||||
(KnownNat n, BVIsNonZero n) => SDivisible (IntN n) Source # |
| ||||
Defined in Data.SBV.Core.Model | |||||
(KnownNat n, BVIsNonZero n) => SFiniteBits (IntN n) Source # | |||||
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV (IntN n) -> Int Source # lsb :: SBV (IntN n) -> SBool Source # msb :: SBV (IntN n) -> SBool Source # blastBE :: SBV (IntN n) -> [SBool] Source # blastLE :: SBV (IntN n) -> [SBool] Source # fromBitsBE :: [SBool] -> SBV (IntN n) Source # fromBitsLE :: [SBool] -> SBV (IntN n) Source # sTestBit :: SBV (IntN n) -> Int -> SBool Source # sExtractBits :: SBV (IntN n) -> [Int] -> [SBool] Source # sPopCount :: SBV (IntN n) -> SWord8 Source # setBitTo :: SBV (IntN n) -> Int -> SBool -> SBV (IntN n) Source # sSetBitTo :: SBV (IntN n) -> SBV (IntN n) -> SBool -> SBV (IntN n) Source # fullAdder :: SBV (IntN n) -> SBV (IntN n) -> (SBool, SBV (IntN n)) Source # fullMultiplier :: SBV (IntN n) -> SBV (IntN n) -> (SBV (IntN n), SBV (IntN n)) Source # | |||||
(KnownNat n, BVIsNonZero n) => SIntegral (IntN n) Source # | |||||
Defined in Data.SBV.Core.Model | |||||
(KnownNat n, BVIsNonZero n) => SatModel (IntN n) Source # | Constructing models for | ||||
(KnownNat n, BVIsNonZero n) => ArithOverflow (SInt n) Source # | |||||
(KnownNat n, BVIsNonZero n) => CheckedArithmetic (IntN n) Source # | |||||
type MetricSpace (IntN n) Source # | |||||
Defined in Data.SBV.Core.Model |
Converting between fixed-size and arbitrary bitvectors
type family BVIsNonZero (arg :: Nat) where ... Source #
Type family to create the appropriate non-zero constraint
Equations
BVIsNonZero 0 = TypeError BVZeroWidth :: Constraint | |
BVIsNonZero _1 = () |
type family FromSized t where ... Source #
Capture the correspondence between sized and fixed-sized BVs
Equations
FromSized (WordN 8) = Word8 | |
FromSized (WordN 16) = Word16 | |
FromSized (WordN 32) = Word32 | |
FromSized (WordN 64) = Word64 | |
FromSized (IntN 8) = Int8 | |
FromSized (IntN 16) = Int16 | |
FromSized (IntN 32) = Int32 | |
FromSized (IntN 64) = Int64 | |
FromSized (SWord 8) = SWord8 | |
FromSized (SWord 16) = SWord16 | |
FromSized (SWord 32) = SWord32 | |
FromSized (SWord 64) = SWord64 | |
FromSized (SInt 8) = SInt8 | |
FromSized (SInt 16) = SInt16 | |
FromSized (SInt 32) = SInt32 | |
FromSized (SInt 64) = SInt64 |
type family ToSized t where ... Source #
Capture the correspondence between fixed-sized and sized BVs
Equations
ToSized Word8 = WordN 8 | |
ToSized Word16 = WordN 16 | |
ToSized Word32 = WordN 32 | |
ToSized Word64 = WordN 64 | |
ToSized Int8 = IntN 8 | |
ToSized Int16 = IntN 16 | |
ToSized Int32 = IntN 32 | |
ToSized Int64 = IntN 64 | |
ToSized SWord8 = SWord 8 | |
ToSized SWord16 = SWord 16 | |
ToSized SWord32 = SWord 32 | |
ToSized SWord64 = SWord 64 | |
ToSized SInt8 = SInt 8 | |
ToSized SInt16 = SInt 16 | |
ToSized SInt32 = SInt 32 | |
ToSized SInt64 = SInt 64 |
Unbounded integers
The SBV library supports unbounded signed integers with the type SInteger
, which are not subject to
overflow/underflow as it is the case with the bounded types, such as SWord8
, SInt16
, etc. However,
some bit-vector based operations are not supported for the SInteger
type while in the verification mode. That
is, you can use these operations on SInteger
values during normal programming/simulation.
but the SMT translation will not support these operations since there corresponding operations are not supported in SMT-Lib.
Note that this should rarely be a problem in practice, as these operations are mostly meaningful on fixed-size
bit-vectors. The operations that are restricted to bounded word/int sizes are:
- Rotations and shifts:
rotateL
,rotateR
,shiftL
,shiftR
- Bitwise logical ops:
.&.
,.|.
,xor
,complement
- Extraction and concatenation:
bvExtract
,#
,zeroExtend
,signExtend
,bvDrop
, andbvTake
Usual arithmetic (+
, -
, *
, sQuotRem
, sQuot
, sRem
, sDivMod
, sDiv
, sMod
) and logical operations (.<
, .<=
, .>
, .>=
, .==
, ./=
) operations are
supported for SInteger
fully, both in programming and verification modes.
Floating point numbers
Floating point numbers are defined by the IEEE-754 standard; and correspond to Haskell's
Float
and Double
types. For SMT support with floating-point numbers, see the paper
by Rummer and Wahl: http://www.philipp.ruemmer.org/publications/smt-fpa.pdf.
type family ValidFloat (eb :: Nat) (sb :: Nat) where ... Source #
A valid float has restrictions on eb/sb values. NB. In the below encoding, I found that CPP is very finicky about substitution of the machine-dependent macros. If you try to put the conditionals in the same line, it fails to substitute for some reason. Hence the awkward spacing. Filed this as a bug report for CPPHS at https://github.com/malcolmwallace/cpphs/issues/25.
Equations
ValidFloat eb sb = (KnownNat eb, KnownNat sb, If (((CmpNat eb 2 == 'EQ) || (CmpNat eb 2 == 'GT)) && (((CmpNat eb 61 == 'EQ) || (CmpNat eb 61 == 'LT)) && (((CmpNat sb 2 == 'EQ) || (CmpNat sb 2 == 'GT)) && ((CmpNat sb 4611686018427387902 == 'EQ) || (CmpNat sb 4611686018427387902 == 'LT))))) () (TypeError (InvalidFloat eb sb) :: Constraint)) |
type SFloatingPoint (eb :: Nat) (sb :: Nat) = SBV (FloatingPoint eb sb) Source #
A symbolic arbitrary precision floating point value
data FloatingPoint (eb :: Nat) (sb :: Nat) Source #
A floating point value, indexed by its exponent and significand sizes.
An IEEE SP is FloatingPoint 8 24
DP is FloatingPoint 11 53
etc.
NB. Don't derive Ord for this type automatically, see notes below.
Instances
ValidFloat eb sb => Floating (SFloatingPoint eb sb) Source # | We give a specific instance for | ||||
Defined in Data.SBV.Core.Model Methods pi :: SFloatingPoint eb sb # exp :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log :: SFloatingPoint eb sb -> SFloatingPoint eb sb # sqrt :: SFloatingPoint eb sb -> SFloatingPoint eb sb # (**) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # logBase :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # sin :: SFloatingPoint eb sb -> SFloatingPoint eb sb # cos :: SFloatingPoint eb sb -> SFloatingPoint eb sb # tan :: SFloatingPoint eb sb -> SFloatingPoint eb sb # asin :: SFloatingPoint eb sb -> SFloatingPoint eb sb # acos :: SFloatingPoint eb sb -> SFloatingPoint eb sb # atan :: SFloatingPoint eb sb -> SFloatingPoint eb sb # sinh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # cosh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # tanh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # asinh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # acosh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # atanh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log1p :: SFloatingPoint eb sb -> SFloatingPoint eb sb # expm1 :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log1pexp :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log1mexp :: SFloatingPoint eb sb -> SFloatingPoint eb sb # | |||||
ValidFloat eb sb => Floating (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.SizedFloats Methods pi :: FloatingPoint eb sb # exp :: FloatingPoint eb sb -> FloatingPoint eb sb # log :: FloatingPoint eb sb -> FloatingPoint eb sb # sqrt :: FloatingPoint eb sb -> FloatingPoint eb sb # (**) :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # logBase :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # sin :: FloatingPoint eb sb -> FloatingPoint eb sb # cos :: FloatingPoint eb sb -> FloatingPoint eb sb # tan :: FloatingPoint eb sb -> FloatingPoint eb sb # asin :: FloatingPoint eb sb -> FloatingPoint eb sb # acos :: FloatingPoint eb sb -> FloatingPoint eb sb # atan :: FloatingPoint eb sb -> FloatingPoint eb sb # sinh :: FloatingPoint eb sb -> FloatingPoint eb sb # cosh :: FloatingPoint eb sb -> FloatingPoint eb sb # tanh :: FloatingPoint eb sb -> FloatingPoint eb sb # asinh :: FloatingPoint eb sb -> FloatingPoint eb sb # acosh :: FloatingPoint eb sb -> FloatingPoint eb sb # atanh :: FloatingPoint eb sb -> FloatingPoint eb sb # log1p :: FloatingPoint eb sb -> FloatingPoint eb sb # expm1 :: FloatingPoint eb sb -> FloatingPoint eb sb # log1pexp :: FloatingPoint eb sb -> FloatingPoint eb sb # log1mexp :: FloatingPoint eb sb -> FloatingPoint eb sb # | |||||
ValidFloat eb sb => RealFloat (FloatingPoint eb sb) Source # | RealFloat instance for FloatingPoint. NB. The methods haven't been subjected to much testing, so beware of any floating-point snafus here. | ||||
Defined in Data.SBV.Core.Floating Methods floatRadix :: FloatingPoint eb sb -> Integer # floatDigits :: FloatingPoint eb sb -> Int # floatRange :: FloatingPoint eb sb -> (Int, Int) # decodeFloat :: FloatingPoint eb sb -> (Integer, Int) # encodeFloat :: Integer -> Int -> FloatingPoint eb sb # exponent :: FloatingPoint eb sb -> Int # significand :: FloatingPoint eb sb -> FloatingPoint eb sb # scaleFloat :: Int -> FloatingPoint eb sb -> FloatingPoint eb sb # isNaN :: FloatingPoint eb sb -> Bool # isInfinite :: FloatingPoint eb sb -> Bool # isDenormalized :: FloatingPoint eb sb -> Bool # isNegativeZero :: FloatingPoint eb sb -> Bool # isIEEE :: FloatingPoint eb sb -> Bool # atan2 :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # | |||||
ValidFloat eb sb => Num (SFloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Data Methods (+) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # (-) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # (*) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # negate :: SFloatingPoint eb sb -> SFloatingPoint eb sb # abs :: SFloatingPoint eb sb -> SFloatingPoint eb sb # signum :: SFloatingPoint eb sb -> SFloatingPoint eb sb # fromInteger :: Integer -> SFloatingPoint eb sb # | |||||
ValidFloat eb sb => Num (FloatingPoint eb sb) Source # | Num instance for FloatingPoint | ||||
Defined in Data.SBV.Core.SizedFloats Methods (+) :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # (-) :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # (*) :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # negate :: FloatingPoint eb sb -> FloatingPoint eb sb # abs :: FloatingPoint eb sb -> FloatingPoint eb sb # signum :: FloatingPoint eb sb -> FloatingPoint eb sb # fromInteger :: Integer -> FloatingPoint eb sb # | |||||
ValidFloat eb sb => Fractional (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.SizedFloats Methods (/) :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # recip :: FloatingPoint eb sb -> FloatingPoint eb sb # fromRational :: Rational -> FloatingPoint eb sb # | |||||
ValidFloat eb sb => Real (FloatingPoint eb sb) Source # | Real instance for FloatingPoint. NB. The methods haven't been subjected to much testing, so beware of any floating-point snafus here. | ||||
Defined in Data.SBV.Core.Floating Methods toRational :: FloatingPoint eb sb -> Rational # | |||||
ValidFloat eb sb => RealFrac (FloatingPoint eb sb) Source # | RealFrac instance for FloatingPoint. NB. The methods haven't been subjected to much testing, so beware of any floating-point snafus here. | ||||
Defined in Data.SBV.Core.Floating Methods properFraction :: Integral b => FloatingPoint eb sb -> (b, FloatingPoint eb sb) # truncate :: Integral b => FloatingPoint eb sb -> b # round :: Integral b => FloatingPoint eb sb -> b # ceiling :: Integral b => FloatingPoint eb sb -> b # floor :: Integral b => FloatingPoint eb sb -> b # | |||||
Show (FloatingPoint eb sb) Source # | Show instance for Floats. By default we print in base 10, with standard scientific notation. | ||||
Defined in Data.SBV.Core.SizedFloats Methods showsPrec :: Int -> FloatingPoint eb sb -> ShowS # show :: FloatingPoint eb sb -> String # showList :: [FloatingPoint eb sb] -> ShowS # | |||||
Eq (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.SizedFloats Methods (==) :: FloatingPoint eb sb -> FloatingPoint eb sb -> Bool # (/=) :: FloatingPoint eb sb -> FloatingPoint eb sb -> Bool # | |||||
Ord (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.SizedFloats Methods compare :: FloatingPoint eb sb -> FloatingPoint eb sb -> Ordering # (<) :: FloatingPoint eb sb -> FloatingPoint eb sb -> Bool # (<=) :: FloatingPoint eb sb -> FloatingPoint eb sb -> Bool # (>) :: FloatingPoint eb sb -> FloatingPoint eb sb -> Bool # (>=) :: FloatingPoint eb sb -> FloatingPoint eb sb -> Bool # max :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # min :: FloatingPoint eb sb -> FloatingPoint eb sb -> FloatingPoint eb sb # | |||||
ValidFloat eb sb => SymVal (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (FloatingPoint eb sb)) Source # literal :: FloatingPoint eb sb -> SBV (FloatingPoint eb sb) Source # fromCV :: CV -> FloatingPoint eb sb Source # isConcretely :: SBV (FloatingPoint eb sb) -> (FloatingPoint eb sb -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (FloatingPoint eb sb)) Source # free_ :: MonadSymbolic m => m (SBV (FloatingPoint eb sb)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (FloatingPoint eb sb)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (FloatingPoint eb sb)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (FloatingPoint eb sb)] Source # unliteral :: SBV (FloatingPoint eb sb) -> Maybe (FloatingPoint eb sb) Source # isConcrete :: SBV (FloatingPoint eb sb) -> Bool Source # isSymbolic :: SBV (FloatingPoint eb sb) -> Bool Source # | |||||
ValidFloat eb sb => IEEEFloatConvertible (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV (FloatingPoint eb sb) Source # toSFloat :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV (FloatingPoint eb sb) Source # toSDouble :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SDouble Source # fromSFloatingPoint :: forall (eb0 :: Nat) (sb0 :: Nat). ValidFloat eb0 sb0 => SRoundingMode -> SFloatingPoint eb0 sb0 -> SBV (FloatingPoint eb sb) Source # toSFloatingPoint :: forall (eb0 :: Nat) (sb0 :: Nat). ValidFloat eb0 sb0 => SRoundingMode -> SBV (FloatingPoint eb sb) -> SFloatingPoint eb0 sb0 Source # | |||||
ValidFloat eb sb => IEEEFloating (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Floating Methods fpAbs :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpNeg :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpAdd :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpSub :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpMul :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpDiv :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpFMA :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpSqrt :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpRem :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpRoundToIntegral :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpMin :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpMax :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpIsEqualObject :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBool Source # fpIsNormal :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsSubnormal :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsZero :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsInfinite :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsNaN :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsNegative :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsPositive :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsNegativeZero :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsPositiveZero :: SBV (FloatingPoint eb sb) -> SBool Source # | |||||
ValidFloat eb sb => HasKind (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Model Methods kindOf :: FloatingPoint eb sb -> Kind Source # hasSign :: FloatingPoint eb sb -> Bool Source # intSizeOf :: FloatingPoint eb sb -> Int Source # isBoolean :: FloatingPoint eb sb -> Bool Source # isBounded :: FloatingPoint eb sb -> Bool Source # isReal :: FloatingPoint eb sb -> Bool Source # isFloat :: FloatingPoint eb sb -> Bool Source # isDouble :: FloatingPoint eb sb -> Bool Source # isRational :: FloatingPoint eb sb -> Bool Source # isFP :: FloatingPoint eb sb -> Bool Source # isUnbounded :: FloatingPoint eb sb -> Bool Source # isUserSort :: FloatingPoint eb sb -> Bool Source # isChar :: FloatingPoint eb sb -> Bool Source # isString :: FloatingPoint eb sb -> Bool Source # isList :: FloatingPoint eb sb -> Bool Source # isSet :: FloatingPoint eb sb -> Bool Source # isTuple :: FloatingPoint eb sb -> Bool Source # isMaybe :: FloatingPoint eb sb -> Bool Source # isEither :: FloatingPoint eb sb -> Bool Source # isArray :: FloatingPoint eb sb -> Bool Source # showType :: FloatingPoint eb sb -> String Source # | |||||
(BVIsNonZero (eb + sb), KnownNat (eb + sb), ValidFloat eb sb) => Metric (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Floating Associated Types
Methods toMetricSpace :: SBV (FloatingPoint eb sb) -> SBV (MetricSpace (FloatingPoint eb sb)) Source # fromMetricSpace :: SBV (MetricSpace (FloatingPoint eb sb)) -> SBV (FloatingPoint eb sb) Source # annotateForMS :: Proxy (FloatingPoint eb sb) -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (FloatingPoint eb sb) -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (FloatingPoint eb sb) -> m () Source # | |||||
(KnownNat eb, KnownNat sb) => SatModel (FloatingPoint eb sb) Source # | A general floating-point extracted from a model | ||||
Defined in Data.SBV.SMT.SMT | |||||
type MetricSpace (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Floating |
type FPHalf = FloatingPoint 5 11 Source #
Abbreviation for IEEE half precision float, bit width 16 = 5 + 11.
type FPBFloat = FloatingPoint 8 8 Source #
Abbreviation for brain-float precision float, bit width 16 = 8 + 8.
type FPSingle = FloatingPoint 8 24 Source #
Abbreviation for IEEE single precision float, bit width 32 = 8 + 24.
type FPDouble = FloatingPoint 11 53 Source #
Abbreviation for IEEE double precision float, bit width 64 = 11 + 53.
type FPQuad = FloatingPoint 15 113 Source #
Abbreviation for IEEE quadruble precision float, bit width 128 = 15 + 113.
Rationals
Algebraic reals
Algebraic reals are roots of single-variable polynomials with rational coefficients. (See
http://en.wikipedia.org/wiki/Algebraic_number.) Note that algebraic reals are infinite
precision numbers, but they do not cover all real numbers. (In particular, they cannot
represent transcendentals.) Some irrational numbers are algebraic (such as sqrt 2
), while
others are not (such as pi and e).
SBV can deal with real numbers just fine, since the theory of reals is decidable. (See https://smt-lib.org/theories-Reals.shtml.) In addition, by leveraging backend solver capabilities, SBV can also represent and solve non-linear equations involving real-variables. (For instance, the Z3 SMT solver, supports polynomial constraints on reals starting with v4.0.)
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
Constructors
AlgRational Bool Rational | bool says it's exact (i.e., SMT-solver did not return it with ? at the end.) |
AlgPolyRoot (Integer, AlgRealPoly) (Maybe String) | which root of this polynomial and an approximate decimal representation with given precision, if available |
AlgInterval (RealPoint Rational) (RealPoint Rational) | interval, with low and high bounds |
Instances
Arbitrary AlgReal Source # | |||||
NFData AlgReal Source # | |||||
Defined in Data.SBV.Core.AlgReals | |||||
Data AlgReal Source # | |||||
Defined in Data.SBV.Core.AlgReals Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AlgReal -> c AlgReal # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AlgReal # toConstr :: AlgReal -> Constr # dataTypeOf :: AlgReal -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AlgReal) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AlgReal) # gmapT :: (forall b. Data b => b -> b) -> AlgReal -> AlgReal # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AlgReal -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AlgReal -> r # gmapQ :: (forall d. Data d => d -> u) -> AlgReal -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AlgReal -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AlgReal -> m AlgReal # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AlgReal -> m AlgReal # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AlgReal -> m AlgReal # | |||||
Floating SReal Source # | SReal Floating instance, used in conjunction with the dReal solver for delta-satisfiability. Note that we do not constant fold these values (except for pi), as Haskell doesn't really have any means of computing them for arbitrary rationals. | ||||
Generic AlgReal Source # | |||||
Defined in Data.SBV.Core.AlgReals Associated Types
| |||||
Num AlgReal Source # | |||||
Num SReal Source # | |||||
Fractional AlgReal Source # | NB: Following the other types we have, we require `a/0` to be `0` for all a. | ||||
Real AlgReal Source # | |||||
Defined in Data.SBV.Core.AlgReals Methods toRational :: AlgReal -> Rational # | |||||
Show AlgReal Source # | |||||
Eq AlgReal Source # | |||||
Ord AlgReal Source # | |||||
Defined in Data.SBV.Core.AlgReals | |||||
Random AlgReal Source # | |||||
SymVal AlgReal Source # | |||||
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV AlgReal) Source # literal :: AlgReal -> SBV AlgReal Source # fromCV :: CV -> AlgReal Source # isConcretely :: SBV AlgReal -> (AlgReal -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV AlgReal) Source # free_ :: MonadSymbolic m => m (SBV AlgReal) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV AlgReal] Source # symbolic :: MonadSymbolic m => String -> m (SBV AlgReal) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV AlgReal] Source # unliteral :: SBV AlgReal -> Maybe AlgReal Source # | |||||
IEEEFloatConvertible AlgReal Source # | |||||
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV AlgReal Source # toSFloat :: SRoundingMode -> SBV AlgReal -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV AlgReal Source # toSDouble :: SRoundingMode -> SBV AlgReal -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV AlgReal Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV AlgReal -> SFloatingPoint eb sb Source # | |||||
HasKind AlgReal Source # | |||||
Defined in Data.SBV.Core.Kind Methods kindOf :: AlgReal -> Kind Source # hasSign :: AlgReal -> Bool Source # intSizeOf :: AlgReal -> Int Source # isBoolean :: AlgReal -> Bool Source # isBounded :: AlgReal -> Bool Source # isReal :: AlgReal -> Bool Source # isFloat :: AlgReal -> Bool Source # isDouble :: AlgReal -> Bool Source # isRational :: AlgReal -> Bool Source # isFP :: AlgReal -> Bool Source # isUnbounded :: AlgReal -> Bool Source # isUserSort :: AlgReal -> Bool Source # isChar :: AlgReal -> Bool Source # isString :: AlgReal -> Bool Source # isList :: AlgReal -> Bool Source # isSet :: AlgReal -> Bool Source # isTuple :: AlgReal -> Bool Source # isMaybe :: AlgReal -> Bool Source # isEither :: AlgReal -> Bool Source # | |||||
Metric AlgReal Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV AlgReal -> SBV (MetricSpace AlgReal) Source # fromMetricSpace :: SBV (MetricSpace AlgReal) -> SBV AlgReal Source # annotateForMS :: Proxy AlgReal -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV AlgReal -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV AlgReal -> m () Source # | |||||
SatModel AlgReal Source # |
| ||||
type Rep AlgReal Source # | |||||
Defined in Data.SBV.Core.AlgReals type Rep AlgReal = D1 ('MetaData "AlgReal" "Data.SBV.Core.AlgReals" "sbv-11.4-inplace" 'False) (C1 ('MetaCons "AlgRational" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)) :+: (C1 ('MetaCons "AlgPolyRoot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Integer, AlgRealPoly)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String))) :+: C1 ('MetaCons "AlgInterval" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint Rational)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint Rational))))) | |||||
type MetricSpace AlgReal Source # | |||||
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
.
Is the endpoint included in the interval?
Constructors
OpenPoint a | open: i.e., doesn't include the point |
ClosedPoint a | closed: i.e., includes the point |
Instances
NFData a => NFData (RealPoint a) Source # | |||||
Defined in Data.SBV.Core.AlgReals | |||||
Data a => Data (RealPoint a) Source # | |||||
Defined in Data.SBV.Core.AlgReals Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RealPoint a -> c (RealPoint a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (RealPoint a) # toConstr :: RealPoint a -> Constr # dataTypeOf :: RealPoint a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (RealPoint a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RealPoint a)) # gmapT :: (forall b. Data b => b -> b) -> RealPoint a -> RealPoint a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RealPoint a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RealPoint a -> r # gmapQ :: (forall d. Data d => d -> u) -> RealPoint a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RealPoint a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RealPoint a -> m (RealPoint a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RealPoint a -> m (RealPoint a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RealPoint a -> m (RealPoint a) # | |||||
Generic (RealPoint a) Source # | |||||
Defined in Data.SBV.Core.AlgReals Associated Types
| |||||
Show a => Show (RealPoint a) Source # | |||||
Eq a => Eq (RealPoint a) Source # | |||||
Ord a => Ord (RealPoint a) Source # | |||||
Defined in Data.SBV.Core.AlgReals | |||||
type Rep (RealPoint a) Source # | |||||
Defined in Data.SBV.Core.AlgReals type Rep (RealPoint a) = D1 ('MetaData "RealPoint" "Data.SBV.Core.AlgReals" "sbv-11.4-inplace" 'False) (C1 ('MetaCons "OpenPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "ClosedPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
data RationalCV Source #
Conversion from internal rationals to Haskell values
Constructors
RatIrreducible AlgReal | Root of a polynomial, cannot be reduced |
RatExact Rational | An exact rational |
RatApprox Rational | An approximated value |
RatInterval (RealPoint Rational) (RealPoint Rational) | Interval. Can be open/closed on both ends. |
Instances
Show RationalCV Source # | |
Defined in Data.SBV.Core.AlgReals Methods showsPrec :: Int -> RationalCV -> ShowS # show :: RationalCV -> String # showList :: [RationalCV] -> ShowS # |
Characters, Strings and Regular Expressions
Support for characters, strings, and regular expressions (initial version contributed by Joel Burget) adds support for QF_S logic, described here: https://smt-lib.org/theories-UnicodeStrings.shtml
See Data.SBV.Char, Data.SBV.String, Data.SBV.RegExp for related functions.
type SChar = SBV Char Source #
A symbolic character. Note that this is the full unicode character set. see: https://smt-lib.org/theories-UnicodeStrings.shtml for details.
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
Support for symbolic lists (initial version contributed by Joel Burget) adds support for sequence support.
See Data.SBV.List for related functions.
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.
Tuples
Tuples can be used as symbolic values. This is useful in combination with lists, for example SBV [(Integer, String)]
is a valid type. These types can be arbitrarily nested, eg SBV [(Integer, [(Char, (Integer, String))])]
. Instances of upto 8-tuples are provided.
Identify tuple like things. Note that there are no methods, just instances to control type inference
Instances
SymTuple () Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b) Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b, c) Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b, c, d) Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b, c, d, e) Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b, c, d, e, f) Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b, c, d, e, f, g) Source # | |
Defined in Data.SBV.Core.Model | |
SymTuple (a, b, c, d, e, f, g, h) Source # | |
Defined in Data.SBV.Core.Model |
Sum types
Sets
A RCSet
is either a regular set or a set given by its complement from the corresponding universal set.
Constructors
RegularSet (Set a) | |
ComplementSet (Set a) |
Instances
NFData a => NFData (RCSet a) Source # | |||||
Defined in Data.SBV.Core.Concrete | |||||
(Data a, Ord a) => Data (RCSet a) Source # | |||||
Defined in Data.SBV.Core.Concrete Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RCSet a -> c (RCSet a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (RCSet a) # toConstr :: RCSet a -> Constr # dataTypeOf :: RCSet a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (RCSet a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RCSet a)) # gmapT :: (forall b. Data b => b -> b) -> RCSet a -> RCSet a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RCSet a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RCSet a -> r # gmapQ :: (forall d. Data d => d -> u) -> RCSet a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RCSet a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RCSet a -> m (RCSet a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RCSet a -> m (RCSet a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RCSet a -> m (RCSet a) # | |||||
Generic (RCSet a) Source # | |||||
Defined in Data.SBV.Core.Concrete Associated Types
| |||||
Show a => Show (RCSet a) Source # | Show instance. Regular sets are shown as usual. Complements are shown "U -" notation. | ||||
(Ord a, SymVal a) => SymVal (RCSet a) Source # | |||||
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (RCSet a)) Source # literal :: RCSet a -> SBV (RCSet a) Source # fromCV :: CV -> RCSet a Source # isConcretely :: SBV (RCSet a) -> (RCSet a -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (RCSet a)) Source # free_ :: MonadSymbolic m => m (SBV (RCSet a)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (RCSet a)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (RCSet a)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (RCSet a)] Source # unliteral :: SBV (RCSet a) -> Maybe (RCSet a) Source # | |||||
HasKind a => HasKind (RCSet a) Source # | |||||
Defined in Data.SBV.Core.Concrete Methods kindOf :: RCSet a -> Kind Source # hasSign :: RCSet a -> Bool Source # intSizeOf :: RCSet a -> Int Source # isBoolean :: RCSet a -> Bool Source # isBounded :: RCSet a -> Bool Source # isReal :: RCSet a -> Bool Source # isFloat :: RCSet a -> Bool Source # isDouble :: RCSet a -> Bool Source # isRational :: RCSet a -> Bool Source # isFP :: RCSet a -> Bool Source # isUnbounded :: RCSet a -> Bool Source # isUserSort :: RCSet a -> Bool Source # isChar :: RCSet a -> Bool Source # isString :: RCSet a -> Bool Source # isList :: RCSet a -> Bool Source # isSet :: RCSet a -> Bool Source # isTuple :: RCSet a -> Bool Source # isMaybe :: RCSet a -> Bool Source # isEither :: RCSet a -> Bool Source # | |||||
type Rep (RCSet a) Source # | |||||
Defined in Data.SBV.Core.Concrete type Rep (RCSet a) = D1 ('MetaData "RCSet" "Data.SBV.Core.Concrete" "sbv-11.4-inplace" 'False) (C1 ('MetaCons "RegularSet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set a))) :+: C1 ('MetaCons "ComplementSet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set a)))) |
type SSet a = SBV (RCSet a) Source #
Symbolic Set
. Note that we use RCSet
, which supports
both regular sets and complements, i.e., those obtained from the
universal set (of the right type) by removing elements. Similar to SArray
the contents are stored with object equality, which makes a difference if the
underlying type contains IEEE Floats.
Arrays of symbolic values
type SArray a b = SBV (ArrayModel a b) Source #
Symbolic arrays. A symbolic array is more akin to a function in SMTLib (and thus in SBV),
as opposed to contagious-storage with a finite range as found in many programming languages.
Additionally, the domain uses object-equality in the SMTLib semantics. Object equality is
the same as regular equality for most types, except for IEEE-Floats, where NaN
doesn't compare
equal to itself and +0
and -0
are not distinguished. So, if your index type is a float,
then NaN
can be stored correctly, and 0
and -0
will be distinguished. If you don't use
floats, then you can treat this the same as regular equality in Haskell.
readArray :: (Eq key, SymVal key, SymVal val, HasKind val) => SArray key val -> SBV key -> SBV val Source #
Reading a value from an array.
writeArray :: (HasKind key, SymVal key, SymVal val, HasKind val) => SArray key val -> SBV key -> SBV val -> SArray key val Source #
Writing a value to an array. For the concrete case, we don't bother deleting earlier entries, we keep a history. The earlier a value is in the list, the "later" it happened; in a stack fashion.
lambdaArray :: (SymVal a, HasKind b) => (SBV a -> SBV b) -> SArray a b Source #
Using a lambda as an array.
listArray :: (SymVal a, SymVal b) => [(a, b)] -> b -> SArray a b Source #
Turn a constant association-list and a default into a symbolic array.
Creating symbolic values
Single value
These functions simplify declaring symbolic variables of various types. Strictly speaking, they are just synonyms
for free
(specialized at the given type), but they might be easier to use. We provide both the named and anonymous
versions, latter with the underscore suffix.
sRational_ :: Symbolic SRational Source #
Declare an unnamed SRational
.
NB. For a version which generalizes over the underlying monad, see sRational_
sFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => String -> Symbolic (SFloatingPoint eb sb) Source #
Declare a named 'SFloatingPoint eb sb'
NB. For a version which generalizes over the underlying monad, see sFloatingPoint
sFloatingPoint_ :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => Symbolic (SFloatingPoint eb sb) Source #
Declare an unnamed SFloatingPoint
eb
sb
NB. For a version which generalizes over the underlying monad, see sFloatingPoint_
sFPSingle_ :: Symbolic SFPSingle Source #
Declare an unnamed SFPSingle
NB. For a version which generalizes over the underlying monad, see sFPSingle_
sFPDouble_ :: Symbolic SFPDouble Source #
Declare an unnamed SFPDouble
NB. For a version which generalizes over the underlying monad, see sFPDouble_
sTuple :: (SymTuple tup, SymVal tup) => String -> Symbolic (SBV tup) Source #
Declare a named tuple.
NB. For a version which generalizes over the underlying monad, see sTuple
sTuple_ :: (SymTuple tup, SymVal tup) => Symbolic (SBV tup) Source #
Declare an unnamed tuple.
NB. For a version which generalizes over the underlying monad, see sTuple_
List of values
These functions simplify declaring a sequence symbolic variables of various types. Strictly speaking, they are just synonyms
for mapM
free
(specialized at the given type), but they might be easier to use.
sRationals :: [String] -> Symbolic [SRational] Source #
Declare a list of SRational
values.
NB. For a version which generalizes over the underlying monad, see sRationals
sFloatingPoints :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => [String] -> Symbolic [SFloatingPoint eb sb] Source #
Declare a list of SFloatingPoint
eb
sb
's
NB. For a version which generalizes over the underlying monad, see sFloatingPoints
sFPBFloats :: [String] -> Symbolic [SFPBFloat] Source #
Declare a list of SFPQuad
s
NB. For a version which generalizes over the underlying monad, see sFPBFloats
sFPSingles :: [String] -> Symbolic [SFPSingle] Source #
Declare a list of SFPSingle
s
NB. For a version which generalizes over the underlying monad, see sFPSingles
sFPDoubles :: [String] -> Symbolic [SFPDouble] Source #
Declare a list of SFPDouble
s
NB. For a version which generalizes over the underlying monad, see sFPDoubles
sTuples :: (SymTuple tup, SymVal tup) => [String] -> Symbolic [SBV tup] Source #
Declare a list of tuples.
NB. For a version which generalizes over the underlying monad, see sTuples
Symbolic Equality and Comparisons
Symbolic equality provides the notion of what it means to be equal, similar to Haskell's Eq
class, except allowing comparison of
symbolic values. The methods are .==
and ./=
, returning SBool
results. We also provide a notion of strong equality (.===
and ./==
),
which is useful for floating-point value comparisons as it deals more uniformly with NaN
and positive/negative zeros. Additionally, we
provide distinct
that can be used to assert all elements of a list are different from each other, and distinctExcept
which is similar
to distinct
but allows for certain values to be considered different. These latter two functions are useful in modeling a variety of
puzzles and cardinality constraints:
>>>
prove $ \a -> distinctExcept [a, a] [0::SInteger] .<=> a .== 0
Q.E.D.>>>
prove $ \a b -> distinctExcept [a, b] [0::SWord8] .<=> (a .== b .=> a .== 0)
Q.E.D.>>>
prove $ \a b c d -> distinctExcept [a, b, c, d] [] .== distinct [a, b, c, (d::SInteger)]
Q.E.D.
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.
NB. Equality is a built-in notion in SMTLib, and is object-equality. While this mostly matches Haskell's
notion of equality, the correspondence isn't exact. This mostly shows up in containers with floats inside,
such as sequences of floats, sets of doubles, and arrays of doubles. While SBV tries to maintain Haskell
semantics, it does resort to container equality for compound types. For instance, for an IEEE-float,
-0 == 0. But for an SMTLib sequence, equals is done over objects. i.e., [0] == [-0]
in Haskell, but
literal [0] ./= literal [-0]
when used as SMTLib sequences. The rabbit-hole goes deep here, especially
when NaN
is involved, which does not compare equal to itself per IEEE-semantics.
If you are not using floats, then you can ignore all this. If you do, then SBV will do the right thing for them when checking equality directly, but not when you use containers with floating-point elements. In the latter case, object-equality will be used.
Minimal complete definition: None, if the type is instance of Generic
. Otherwise (.==)
.
Minimal complete definition
Nothing
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.
distinctExcept :: [a] -> [a] -> SBool Source #
Returns (symbolic) sTrue
if all the elements of the given list are different. The second
list contains exceptions, i.e., if an element belongs to that set, it will be considered
distinct regardless of repetition.
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.
sNotElem :: a -> [a] -> SBool Source #
Symbolic negated membership test.
Instances
EqSymbolic RegExp Source # | Regular expressions can be compared for equality. Note that we diverge here from the equality in the concrete sense; i.e., the Eq instance does not match the symbolic case. This is a bit unfortunate, but unavoidable with the current design of how we "distinguish" operators. Hopefully shouldn't be a big deal, though one should be careful. |
Defined in Data.SBV.Core.Model Methods (.==) :: RegExp -> RegExp -> SBool Source # (./=) :: RegExp -> RegExp -> SBool Source # (.===) :: RegExp -> RegExp -> SBool Source # (./==) :: RegExp -> RegExp -> SBool Source # distinct :: [RegExp] -> SBool Source # distinctExcept :: [RegExp] -> [RegExp] -> SBool Source # allEqual :: [RegExp] -> SBool Source # | |
EqSymbolic Bool Source # | |
Defined in Data.SBV.Core.Model Methods (.==) :: Bool -> Bool -> SBool Source # (./=) :: Bool -> Bool -> SBool Source # (.===) :: Bool -> Bool -> SBool Source # (./==) :: Bool -> Bool -> SBool Source # distinct :: [Bool] -> SBool Source # distinctExcept :: [Bool] -> [Bool] -> SBool Source # allEqual :: [Bool] -> SBool Source # | |
EqSymbolic a => EqSymbolic (NonEmpty a) Source # | |
Defined in Data.SBV.Core.Model Methods (.==) :: NonEmpty a -> NonEmpty a -> SBool Source # (./=) :: NonEmpty a -> NonEmpty a -> SBool Source # (.===) :: NonEmpty a -> NonEmpty a -> SBool Source # (./==) :: NonEmpty a -> NonEmpty a -> SBool Source # distinct :: [NonEmpty a] -> SBool Source # distinctExcept :: [NonEmpty a] -> [NonEmpty a] -> SBool Source # allEqual :: [NonEmpty a] -> SBool Source # | |
(HasKind a, SymVal a) => EqSymbolic (SBV a) Source # | |
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 # distinctExcept :: [SBV a] -> [SBV a] -> SBool Source # allEqual :: [SBV a] -> SBool Source # | |
EqSymbolic a => EqSymbolic (S a) Source # | Symbolic equality for |
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 # distinctExcept :: [S a] -> [S a] -> SBool Source # allEqual :: [S a] -> SBool Source # | |
EqSymbolic a => EqSymbolic (Maybe a) Source # | |
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 # distinctExcept :: [Maybe a] -> [Maybe a] -> SBool Source # allEqual :: [Maybe a] -> SBool Source # | |
EqSymbolic a => EqSymbolic [a] Source # | |
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 # distinctExcept :: [[a]] -> [[a]] -> SBool Source # allEqual :: [[a]] -> SBool Source # | |
(EqSymbolic a, EqSymbolic b) => EqSymbolic (Either a b) Source # | |
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 # distinctExcept :: [Either a b] -> [Either a b] -> SBool Source # allEqual :: [Either a b] -> SBool Source # | |
(EqSymbolic a, EqSymbolic b) => EqSymbolic (a, b) Source # | |
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 # distinctExcept :: [(a, b)] -> [(a, b)] -> SBool Source # allEqual :: [(a, b)] -> SBool Source # | |
(EqSymbolic a, EqSymbolic b, EqSymbolic c) => EqSymbolic (a, b, c) Source # | |
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 # distinctExcept :: [(a, b, c)] -> [(a, b, c)] -> SBool Source # allEqual :: [(a, b, c)] -> SBool Source # | |
(EqSymbolic a, EqSymbolic b, EqSymbolic c, EqSymbolic d) => EqSymbolic (a, b, c, d) Source # | |
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 # distinctExcept :: [(a, b, c, d)] -> [(a, b, c, d)] -> SBool Source # allEqual :: [(a, b, c, d)] -> SBool Source # sElem :: (a, b, c, d) -> [(a, b, c, d)] -> SBool Source # sNotElem :: (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 # | |
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 # distinctExcept :: [(a, b, c, d, e)] -> [(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 # sNotElem :: (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 # | |
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 # distinctExcept :: [(a, b, c, d, e, f)] -> [(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 # sNotElem :: (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 # | |
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 # distinctExcept :: [(a, b, c, d, e, f, g)] -> [(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 # sNotElem :: (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.
Symbolic minimum.
Symbolic maximum.
inRange :: a -> (a, a) -> SBool Source #
Is the value within the allowed inclusive range?
Instances
OrdSymbolic a => OrdSymbolic (NonEmpty a) Source # | |
Defined in Data.SBV.Core.Model Methods (.<) :: NonEmpty a -> NonEmpty a -> SBool Source # (.<=) :: NonEmpty a -> NonEmpty a -> SBool Source # (.>) :: NonEmpty a -> NonEmpty a -> SBool Source # (.>=) :: NonEmpty a -> NonEmpty a -> SBool Source # smin :: NonEmpty a -> NonEmpty a -> NonEmpty a Source # smax :: NonEmpty a -> NonEmpty a -> NonEmpty a Source # inRange :: NonEmpty a -> (NonEmpty a, NonEmpty a) -> SBool Source # | |
(Ord a, SymVal a) => OrdSymbolic (SBV a) Source # | If comparison is over something SMTLib can handle, just translate it. Otherwise desugar. |
OrdSymbolic a => OrdSymbolic (Maybe a) Source # | |
Defined in Data.SBV.Core.Model | |
OrdSymbolic a => OrdSymbolic [a] Source # | |
(OrdSymbolic a, OrdSymbolic b) => OrdSymbolic (Either a b) Source # | |
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 # | |
(OrdSymbolic a, OrdSymbolic b, OrdSymbolic c) => OrdSymbolic (a, b, c) Source # | |
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 # | |
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 # | |
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 # | |
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 # | |
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.
Instances
(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 # | |
(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 # | |
(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 # | |
(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> z) Source # | |
(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> z) Source # | |
(SymVal a, SymVal b, EqSymbolic z) => Equality (SBV a -> SBV b -> z) Source # | |
(SymVal a, EqSymbolic z) => Equality (SBV a -> z) Source # | |
(SymVal a, SymVal b, EqSymbolic z) => Equality ((SBV a, SBV b) -> z) Source # | |
(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c) -> z) Source # | |
(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d) -> z) 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 # | |
(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 # | |
(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 # | |
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, Num (SBV 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.
Instances
Mergeable Int16 Source # | |
Mergeable Int32 Source # | |
Mergeable Int64 Source # | |
Mergeable Int8 Source # | |
Mergeable Word16 Source # | |
Mergeable Word32 Source # | |
Mergeable Word64 Source # | |
Mergeable Word8 Source # | |
Mergeable Mostek Source # | |
Mergeable Jug Source # | |
Mergeable Assignment Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods symbolicMerge :: Bool -> SBool -> Assignment -> Assignment -> Assignment Source # select :: (Ord b, SymVal b, Num b, Num (SBV b)) => [Assignment] -> Assignment -> SBV b -> Assignment Source # | |
Mergeable Status Source # | |
Mergeable Integer Source # | |
Mergeable () Source # | |
Mergeable Bool Source # | |
Mergeable Char Source # | |
Mergeable Double Source # | |
Mergeable Float Source # | |
Mergeable a => Mergeable (NonEmpty a) Source # | |
Mergeable a => Mergeable (ZipList a) Source # | |
SymVal a => Mergeable (SBV a) Source # | |
Mergeable a => Mergeable (Move a) Source # | Mergeable instance for |
Mergeable a => Mergeable (AppS a) Source # | |
Mergeable a => Mergeable (IncS a) Source # | |
Mergeable a => Mergeable (FibS a) Source # | |
Mergeable a => Mergeable (GCDS a) Source # | |
Mergeable a => Mergeable (DivS a) Source # | |
Mergeable a => Mergeable (SqrtS a) Source # | |
Mergeable a => Mergeable (SumS a) Source # | |
Mergeable a => Mergeable (Maybe a) Source # | |
Mergeable a => Mergeable [a] Source # | |
(Ix a, Mergeable b) => Mergeable (Array a b) Source # | |
(Mergeable a, Mergeable b) => Mergeable (Either a b) Source # | |
SymVal e => Mergeable (STree i e) Source # | |
(Mergeable a, Mergeable b) => Mergeable (LenS a b) Source # | |
(Mergeable a, Mergeable b) => Mergeable (a, b) Source # | |
Mergeable b => Mergeable (a -> b) Source # | |
(Mergeable a, Mergeable b, Mergeable c) => Mergeable (a, b, c) Source # | |
(Mergeable a, Mergeable b, Mergeable c, Mergeable d) => Mergeable (a, b, c, d) Source # | |
(Mergeable a, Mergeable b, Mergeable c, Mergeable d, Mergeable e) => Mergeable (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 # | |
(Mergeable a, Mergeable b, Mergeable c, Mergeable d, Mergeable e, Mergeable f, Mergeable g) => Mergeable (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, Num (SBV 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 Int16 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Int32 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Int64 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Int8 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Word16 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Word32 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Word64 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Word8 Source # | |
Defined in Data.SBV.Core.Model | |
SIntegral Integer Source # | |
Defined in Data.SBV.Core.Model | |
(KnownNat n, BVIsNonZero n) => SIntegral (IntN n) Source # | |
Defined in Data.SBV.Core.Model | |
(KnownNat n, BVIsNonZero n) => SIntegral (WordN n) Source # | |
Defined in Data.SBV.Core.Model |
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:
xsQuotRem
0 = (0, x) xsDivMod
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.
C code generation of division operations
In the case of division or modulo of a minimal signed value (e.g. -128
for
SInt8
) by -1
, SMTLIB and Haskell agree on what the result should be.
Unfortunately the result in C code depends on CPU architecture and compiler
settings, as this is undefined behaviour in C. **SBV does not guarantee**
what will happen in generated C code in this corner case.
Instances
SDivisible Int16 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Int32 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Int64 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Int8 Source # | |
SDivisible Word16 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Word32 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Word64 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Word8 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible CV Source # | |
SDivisible SInt16 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible SInt32 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible SInt64 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible SInt8 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible SInteger Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible SWord16 Source # | |
SDivisible SWord32 Source # | |
SDivisible SWord64 Source # | |
SDivisible SWord8 Source # | |
Defined in Data.SBV.Core.Model | |
SDivisible Integer Source # | |
(KnownNat n, BVIsNonZero n) => SDivisible (SInt n) Source # |
|
Defined in Data.SBV.Core.Model | |
(KnownNat n, BVIsNonZero n) => SDivisible (SWord n) Source # |
|
(KnownNat n, BVIsNonZero n) => SDivisible (IntN n) Source # |
|
Defined in Data.SBV.Core.Model | |
(KnownNat n, BVIsNonZero n) => SDivisible (WordN n) Source # |
|
Euclidian division and modulus
Euclidian division and modulus for integers differ from regular division modulus when
the divisor is negative. It satisfies the following desirable property: For any m
, n
, we have:
Givenm
,n
, s.t., n /= 0 Let (q, r) = msEDivMod
n Then: m = n * q + r and 0 <= r <= |n| - 1
That is, the modulus is always positive. There's no standard Haskell function that performs this operation. The main reason to prefer this function is that SMT solvers can deal with them better. Compare:
>>>
sDivMod @SInteger 3 (-2)
(-2 :: SInteger,-1 :: SInteger)>>>
sEDivMod 3 (-2)
(-1 :: SInteger,1 :: SInteger)>>>
prove $ \x y -> y .> 0 .=> x `sDivMod` y .== x `sEDivMod` y
Q.E.D.
sDivides :: Integer -> SInteger -> SBool Source #
Does the concrete positive number n divide the given integer?
Bit-vector operations
Conversions
sFromIntegral :: (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
Symbolic words (both signed and unsigned) are an instance of Haskell's Bits
class, so regular
bitwise operations are automatically available for them. Shifts and rotates, however, require
specialized type-signatures since Haskell insists on an Int
second argument for them.
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.
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.
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, Num (SBV 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
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 #
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 #
sSetBitTo :: SBV a -> SBV a -> SBool -> SBV a Source #
Variant of setBitTo
when the index is symbolic. If the index it out-of-bounds,
then the result is underspecified.
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 multiplier, 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 Int16 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Int16 -> Int Source # lsb :: SBV Int16 -> SBool Source # msb :: SBV Int16 -> SBool Source # blastBE :: SBV Int16 -> [SBool] Source # blastLE :: SBV Int16 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Int16 Source # fromBitsLE :: [SBool] -> SBV Int16 Source # sTestBit :: SBV Int16 -> Int -> SBool Source # sExtractBits :: SBV Int16 -> [Int] -> [SBool] Source # sPopCount :: SBV Int16 -> SWord8 Source # setBitTo :: SBV Int16 -> Int -> SBool -> SBV Int16 Source # sSetBitTo :: SBV Int16 -> SBV Int16 -> SBool -> SBV Int16 Source # fullAdder :: SBV Int16 -> SBV Int16 -> (SBool, SBV Int16) Source # fullMultiplier :: SBV Int16 -> SBV Int16 -> (SBV Int16, SBV Int16) Source # | |
SFiniteBits Int32 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Int32 -> Int Source # lsb :: SBV Int32 -> SBool Source # msb :: SBV Int32 -> SBool Source # blastBE :: SBV Int32 -> [SBool] Source # blastLE :: SBV Int32 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Int32 Source # fromBitsLE :: [SBool] -> SBV Int32 Source # sTestBit :: SBV Int32 -> Int -> SBool Source # sExtractBits :: SBV Int32 -> [Int] -> [SBool] Source # sPopCount :: SBV Int32 -> SWord8 Source # setBitTo :: SBV Int32 -> Int -> SBool -> SBV Int32 Source # sSetBitTo :: SBV Int32 -> SBV Int32 -> SBool -> SBV Int32 Source # fullAdder :: SBV Int32 -> SBV Int32 -> (SBool, SBV Int32) Source # fullMultiplier :: SBV Int32 -> SBV Int32 -> (SBV Int32, SBV Int32) Source # | |
SFiniteBits Int64 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Int64 -> Int Source # lsb :: SBV Int64 -> SBool Source # msb :: SBV Int64 -> SBool Source # blastBE :: SBV Int64 -> [SBool] Source # blastLE :: SBV Int64 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Int64 Source # fromBitsLE :: [SBool] -> SBV Int64 Source # sTestBit :: SBV Int64 -> Int -> SBool Source # sExtractBits :: SBV Int64 -> [Int] -> [SBool] Source # sPopCount :: SBV Int64 -> SWord8 Source # setBitTo :: SBV Int64 -> Int -> SBool -> SBV Int64 Source # sSetBitTo :: SBV Int64 -> SBV Int64 -> SBool -> SBV Int64 Source # fullAdder :: SBV Int64 -> SBV Int64 -> (SBool, SBV Int64) Source # fullMultiplier :: SBV Int64 -> SBV Int64 -> (SBV Int64, SBV Int64) Source # | |
SFiniteBits Int8 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Int8 -> Int Source # lsb :: SBV Int8 -> SBool Source # msb :: SBV Int8 -> SBool Source # blastBE :: SBV Int8 -> [SBool] Source # blastLE :: SBV Int8 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Int8 Source # fromBitsLE :: [SBool] -> SBV Int8 Source # sTestBit :: SBV Int8 -> Int -> SBool Source # sExtractBits :: SBV Int8 -> [Int] -> [SBool] Source # sPopCount :: SBV Int8 -> SWord8 Source # setBitTo :: SBV Int8 -> Int -> SBool -> SBV Int8 Source # sSetBitTo :: SBV Int8 -> SBV Int8 -> SBool -> SBV Int8 Source # fullAdder :: SBV Int8 -> SBV Int8 -> (SBool, SBV Int8) Source # fullMultiplier :: SBV Int8 -> SBV Int8 -> (SBV Int8, SBV Int8) Source # | |
SFiniteBits Word16 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Word16 -> Int Source # lsb :: SBV Word16 -> SBool Source # msb :: SBV Word16 -> SBool Source # blastBE :: SBV Word16 -> [SBool] Source # blastLE :: SBV Word16 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Word16 Source # fromBitsLE :: [SBool] -> SBV Word16 Source # sTestBit :: SBV Word16 -> Int -> SBool Source # sExtractBits :: SBV Word16 -> [Int] -> [SBool] Source # sPopCount :: SBV Word16 -> SWord8 Source # setBitTo :: SBV Word16 -> Int -> SBool -> SBV Word16 Source # sSetBitTo :: SBV Word16 -> SBV Word16 -> SBool -> SBV Word16 Source # fullAdder :: SBV Word16 -> SBV Word16 -> (SBool, SBV Word16) Source # fullMultiplier :: SBV Word16 -> SBV Word16 -> (SBV Word16, SBV Word16) Source # | |
SFiniteBits Word32 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Word32 -> Int Source # lsb :: SBV Word32 -> SBool Source # msb :: SBV Word32 -> SBool Source # blastBE :: SBV Word32 -> [SBool] Source # blastLE :: SBV Word32 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Word32 Source # fromBitsLE :: [SBool] -> SBV Word32 Source # sTestBit :: SBV Word32 -> Int -> SBool Source # sExtractBits :: SBV Word32 -> [Int] -> [SBool] Source # sPopCount :: SBV Word32 -> SWord8 Source # setBitTo :: SBV Word32 -> Int -> SBool -> SBV Word32 Source # sSetBitTo :: SBV Word32 -> SBV Word32 -> SBool -> SBV Word32 Source # fullAdder :: SBV Word32 -> SBV Word32 -> (SBool, SBV Word32) Source # fullMultiplier :: SBV Word32 -> SBV Word32 -> (SBV Word32, SBV Word32) Source # | |
SFiniteBits Word64 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Word64 -> Int Source # lsb :: SBV Word64 -> SBool Source # msb :: SBV Word64 -> SBool Source # blastBE :: SBV Word64 -> [SBool] Source # blastLE :: SBV Word64 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Word64 Source # fromBitsLE :: [SBool] -> SBV Word64 Source # sTestBit :: SBV Word64 -> Int -> SBool Source # sExtractBits :: SBV Word64 -> [Int] -> [SBool] Source # sPopCount :: SBV Word64 -> SWord8 Source # setBitTo :: SBV Word64 -> Int -> SBool -> SBV Word64 Source # sSetBitTo :: SBV Word64 -> SBV Word64 -> SBool -> SBV Word64 Source # fullAdder :: SBV Word64 -> SBV Word64 -> (SBool, SBV Word64) Source # fullMultiplier :: SBV Word64 -> SBV Word64 -> (SBV Word64, SBV Word64) Source # | |
SFiniteBits Word8 Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV Word8 -> Int Source # lsb :: SBV Word8 -> SBool Source # msb :: SBV Word8 -> SBool Source # blastBE :: SBV Word8 -> [SBool] Source # blastLE :: SBV Word8 -> [SBool] Source # fromBitsBE :: [SBool] -> SBV Word8 Source # fromBitsLE :: [SBool] -> SBV Word8 Source # sTestBit :: SBV Word8 -> Int -> SBool Source # sExtractBits :: SBV Word8 -> [Int] -> [SBool] Source # sPopCount :: SBV Word8 -> SWord8 Source # setBitTo :: SBV Word8 -> Int -> SBool -> SBV Word8 Source # sSetBitTo :: SBV Word8 -> SBV Word8 -> SBool -> SBV Word8 Source # fullAdder :: SBV Word8 -> SBV Word8 -> (SBool, SBV Word8) Source # fullMultiplier :: SBV Word8 -> SBV Word8 -> (SBV Word8, SBV Word8) Source # | |
(KnownNat n, BVIsNonZero n) => SFiniteBits (IntN n) Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV (IntN n) -> Int Source # lsb :: SBV (IntN n) -> SBool Source # msb :: SBV (IntN n) -> SBool Source # blastBE :: SBV (IntN n) -> [SBool] Source # blastLE :: SBV (IntN n) -> [SBool] Source # fromBitsBE :: [SBool] -> SBV (IntN n) Source # fromBitsLE :: [SBool] -> SBV (IntN n) Source # sTestBit :: SBV (IntN n) -> Int -> SBool Source # sExtractBits :: SBV (IntN n) -> [Int] -> [SBool] Source # sPopCount :: SBV (IntN n) -> SWord8 Source # setBitTo :: SBV (IntN n) -> Int -> SBool -> SBV (IntN n) Source # sSetBitTo :: SBV (IntN n) -> SBV (IntN n) -> SBool -> SBV (IntN n) Source # fullAdder :: SBV (IntN n) -> SBV (IntN n) -> (SBool, SBV (IntN n)) Source # fullMultiplier :: SBV (IntN n) -> SBV (IntN n) -> (SBV (IntN n), SBV (IntN n)) Source # | |
(KnownNat n, BVIsNonZero n) => SFiniteBits (WordN n) Source # | |
Defined in Data.SBV.Core.Model Methods sFiniteBitSize :: SBV (WordN n) -> Int Source # lsb :: SBV (WordN n) -> SBool Source # msb :: SBV (WordN n) -> SBool Source # blastBE :: SBV (WordN n) -> [SBool] Source # blastLE :: SBV (WordN n) -> [SBool] Source # fromBitsBE :: [SBool] -> SBV (WordN n) Source # fromBitsLE :: [SBool] -> SBV (WordN n) Source # sTestBit :: SBV (WordN n) -> Int -> SBool Source # sExtractBits :: SBV (WordN n) -> [Int] -> [SBool] Source # sPopCount :: SBV (WordN n) -> SWord8 Source # setBitTo :: SBV (WordN n) -> Int -> SBool -> SBV (WordN n) Source # sSetBitTo :: SBV (WordN n) -> SBV (WordN n) -> SBool -> SBV (WordN n) Source # fullAdder :: SBV (WordN n) -> SBV (WordN n) -> (SBool, SBV (WordN n)) Source # fullMultiplier :: SBV (WordN n) -> SBV (WordN n) -> (SBV (WordN n), SBV (WordN n)) Source # |
Splitting, joining, and extending bit-vectors
Arguments
:: forall (i :: Nat) (j :: Nat) (n :: Nat) bv proxy. (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat i, KnownNat j, (i + 1) <= n, j <= i, BVIsNonZero ((i - j) + 1)) | |
=> proxy i |
|
-> proxy j |
|
-> SBV (bv n) | Input bit vector of size |
-> SBV (bv ((i - j) + 1)) | Output is of size |
Extract a portion of bits to form a smaller bit-vector.
>>>
prove $ \x -> bvExtract (Proxy @7) (Proxy @3) (x :: SWord 12) .== bvDrop (Proxy @4) (bvTake (Proxy @9) x)
Q.E.D.
Arguments
:: forall (n :: Nat) bv (m :: Nat). (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat m, BVIsNonZero m, SymVal (bv m)) | |
=> SBV (bv n) | First input, of size |
-> SBV (bv m) | Second input, of size |
-> SBV (bv (n + m)) | Concatenation, of size |
Join two bitvectors.
>>>
prove $ \x y -> x .== bvExtract (Proxy @79) (Proxy @71) ((x :: SWord 9) # (y :: SWord 71))
Q.E.D.
Arguments
:: forall (n :: Nat) (m :: Nat) bv. (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat m, BVIsNonZero m, SymVal (bv m), (n + 1) <= m, SIntegral (bv (m - n)), BVIsNonZero (m - n)) | |
=> SBV (bv n) | Input, of size |
-> SBV (bv m) | Output, of size |
Zero extend a bit-vector.
>>>
prove $ \x -> bvExtract (Proxy @20) (Proxy @12) (zeroExtend (x :: SInt 12) :: SInt 21) .== 0
Q.E.D.
Arguments
:: forall (n :: Nat) (m :: Nat) bv. (KnownNat n, BVIsNonZero n, SymVal (bv n), KnownNat m, BVIsNonZero m, SymVal (bv m), (n + 1) <= m, SFiniteBits (bv n), SIntegral (bv (m - n)), BVIsNonZero (m - n)) | |
=> SBV (bv n) | Input, of size |
-> SBV (bv m) | Output, of size |
Sign extend a bit-vector.
>>>
prove $ \x -> sNot (msb x) .=> bvExtract (Proxy @20) (Proxy @12) (signExtend (x :: SInt 12) :: SInt 21) .== 0
Q.E.D.>>>
prove $ \x -> msb x .=> bvExtract (Proxy @20) (Proxy @12) (signExtend (x :: SInt 12) :: SInt 21) .== complement 0
Q.E.D.
Arguments
:: forall (i :: Nat) (n :: Nat) (m :: Natural) bv proxy. (KnownNat n, BVIsNonZero n, KnownNat i, (i + 1) <= n, ((i + m) - n) <= 0, BVIsNonZero (n - i)) | |
=> proxy i |
|
-> SBV (bv n) | Input, of size |
-> SBV (bv m) | Output, of size |
Drop bits from the top of a bit-vector.
>>>
prove $ \x -> bvDrop (Proxy @0) (x :: SWord 43) .== x
Q.E.D.>>>
prove $ \x -> bvDrop (Proxy @20) (x :: SWord 21) .== ite (lsb x) 1 (0 :: SWord 1)
Q.E.D.
Arguments
:: forall (i :: Nat) (n :: Nat) bv proxy. (KnownNat n, BVIsNonZero n, KnownNat i, BVIsNonZero i, i <= n) | |
=> proxy i |
|
-> SBV (bv n) | Input, of size |
-> SBV (bv i) | Output, of size |
Take bits from the top of a bit-vector.
>>>
prove $ \x -> bvTake (Proxy @13) (x :: SWord 13) .== x
Q.E.D.>>>
prove $ \x -> bvTake (Proxy @1) (x :: SWord 13) .== ite (msb x) 1 0
Q.E.D.>>>
prove $ \x -> bvTake (Proxy @4) x # bvDrop (Proxy @4) x .== (x :: SWord 23)
Q.E.D.
class ByteConverter a where Source #
A helper class to convert sized bit-vectors to/from bytes.
Methods
toBytes :: a -> [SWord 8] Source #
Convert to a sequence of bytes
>>>
prove $ \a b c d -> toBytes ((fromBytes [a, b, c, d]) :: SWord 32) .== [a, b, c, d]
Q.E.D.
fromBytes :: [SWord 8] -> a Source #
Convert from a sequence of bytes
>>>
prove $ \r -> fromBytes (toBytes r) .== (r :: SWord 64)
Q.E.D.
Instances
ByteConverter (SWord 8) Source # |
|
ByteConverter (SWord 16) Source # |
|
ByteConverter (SWord 32) Source # |
|
ByteConverter (SWord 64) Source # |
|
ByteConverter (SWord 128) Source # |
|
ByteConverter (SWord 256) Source # |
|
ByteConverter (SWord 512) Source # |
|
ByteConverter (SWord 1024) Source # |
|
Exponentiation
(.^) :: (Mergeable b, Num b, SIntegral e) => b -> SBV e -> b infixr 8 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 |
Defined in Data.SBV.Core.Floating Methods fpAbs :: SBV Double -> SBV Double Source # fpNeg :: SBV Double -> SBV Double Source # fpAdd :: SRoundingMode -> SBV Double -> SBV Double -> SBV Double Source # fpSub :: SRoundingMode -> SBV Double -> SBV Double -> SBV Double Source # fpMul :: SRoundingMode -> SBV Double -> SBV Double -> SBV Double Source # fpDiv :: SRoundingMode -> SBV Double -> SBV Double -> SBV Double Source # fpFMA :: SRoundingMode -> SBV Double -> SBV Double -> SBV Double -> SBV Double Source # fpSqrt :: SRoundingMode -> SBV Double -> SBV Double Source # fpRem :: SBV Double -> SBV Double -> SBV Double Source # fpRoundToIntegral :: SRoundingMode -> SBV Double -> SBV Double Source # fpMin :: SBV Double -> SBV Double -> SBV Double Source # fpMax :: SBV Double -> SBV Double -> SBV Double Source # fpIsEqualObject :: SBV Double -> SBV Double -> SBool Source # fpIsNormal :: SBV Double -> SBool Source # fpIsSubnormal :: SBV Double -> SBool Source # fpIsZero :: SBV Double -> SBool Source # fpIsInfinite :: SBV Double -> SBool Source # fpIsNaN :: SBV Double -> SBool Source # fpIsNegative :: SBV Double -> SBool Source # fpIsPositive :: SBV Double -> SBool Source # fpIsNegativeZero :: SBV Double -> SBool Source # | |
IEEEFloating Float Source # | SFloat instance |
Defined in Data.SBV.Core.Floating Methods fpAbs :: SBV Float -> SBV Float Source # fpNeg :: SBV Float -> SBV Float Source # fpAdd :: SRoundingMode -> SBV Float -> SBV Float -> SBV Float Source # fpSub :: SRoundingMode -> SBV Float -> SBV Float -> SBV Float Source # fpMul :: SRoundingMode -> SBV Float -> SBV Float -> SBV Float Source # fpDiv :: SRoundingMode -> SBV Float -> SBV Float -> SBV Float Source # fpFMA :: SRoundingMode -> SBV Float -> SBV Float -> SBV Float -> SBV Float Source # fpSqrt :: SRoundingMode -> SBV Float -> SBV Float Source # fpRem :: SBV Float -> SBV Float -> SBV Float Source # fpRoundToIntegral :: SRoundingMode -> SBV Float -> SBV Float Source # fpMin :: SBV Float -> SBV Float -> SBV Float Source # fpMax :: SBV Float -> SBV Float -> SBV Float Source # fpIsEqualObject :: SBV Float -> SBV Float -> SBool Source # fpIsNormal :: SBV Float -> SBool Source # fpIsSubnormal :: SBV Float -> SBool Source # fpIsZero :: SBV Float -> SBool Source # fpIsInfinite :: SBV Float -> SBool Source # fpIsNaN :: SBV Float -> SBool Source # fpIsNegative :: SBV Float -> SBool Source # fpIsPositive :: SBV Float -> SBool Source # fpIsNegativeZero :: SBV Float -> SBool Source # | |
ValidFloat eb sb => IEEEFloating (FloatingPoint eb sb) Source # | |
Defined in Data.SBV.Core.Floating Methods fpAbs :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpNeg :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpAdd :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpSub :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpMul :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpDiv :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpFMA :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpSqrt :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpRem :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpRoundToIntegral :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpMin :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpMax :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) Source # fpIsEqualObject :: SBV (FloatingPoint eb sb) -> SBV (FloatingPoint eb sb) -> SBool Source # fpIsNormal :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsSubnormal :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsZero :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsInfinite :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsNaN :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsNegative :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsPositive :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsNegativeZero :: SBV (FloatingPoint eb sb) -> SBool Source # fpIsPositiveZero :: SBV (FloatingPoint eb sb) -> SBool Source # |
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
Data RoundingMode Source # | |
Defined in Data.SBV.Core.Kind 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 :: forall r r'. (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 # | |
Bounded RoundingMode Source # | |
Defined in Data.SBV.Core.Kind | |
Enum RoundingMode Source # | |
Defined in Data.SBV.Core.Kind Methods succ :: RoundingMode -> RoundingMode # pred :: RoundingMode -> RoundingMode # toEnum :: Int -> RoundingMode # fromEnum :: RoundingMode -> Int # enumFrom :: RoundingMode -> [RoundingMode] # enumFromThen :: RoundingMode -> RoundingMode -> [RoundingMode] # enumFromTo :: RoundingMode -> RoundingMode -> [RoundingMode] # enumFromThenTo :: RoundingMode -> RoundingMode -> RoundingMode -> [RoundingMode] # | |
Read RoundingMode Source # | |
Defined in Data.SBV.Core.Kind Methods readsPrec :: Int -> ReadS RoundingMode # readList :: ReadS [RoundingMode] # | |
Show RoundingMode Source # | |
Defined in Data.SBV.Core.Kind Methods showsPrec :: Int -> RoundingMode -> ShowS # show :: RoundingMode -> String # showList :: [RoundingMode] -> ShowS # | |
Eq RoundingMode Source # | |
Defined in Data.SBV.Core.Kind | |
Ord RoundingMode Source # | |
Defined in Data.SBV.Core.Kind Methods compare :: RoundingMode -> RoundingMode -> Ordering # (<) :: RoundingMode -> RoundingMode -> Bool # (<=) :: RoundingMode -> RoundingMode -> Bool # (>) :: RoundingMode -> RoundingMode -> Bool # (>=) :: RoundingMode -> RoundingMode -> Bool # max :: RoundingMode -> RoundingMode -> RoundingMode # min :: RoundingMode -> RoundingMode -> RoundingMode # | |
SymVal RoundingMode Source # |
|
Defined in Data.SBV.Core.Data Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV RoundingMode) Source # literal :: RoundingMode -> SBV RoundingMode Source # fromCV :: CV -> RoundingMode Source # isConcretely :: SBV RoundingMode -> (RoundingMode -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV RoundingMode) Source # free_ :: MonadSymbolic m => m (SBV RoundingMode) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV RoundingMode] Source # symbolic :: MonadSymbolic m => String -> m (SBV RoundingMode) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV RoundingMode] Source # unliteral :: SBV RoundingMode -> Maybe RoundingMode Source # isConcrete :: SBV RoundingMode -> Bool Source # isSymbolic :: SBV RoundingMode -> Bool Source # | |
HasKind RoundingMode Source # |
|
Defined in Data.SBV.Core.Kind Methods kindOf :: RoundingMode -> Kind Source # hasSign :: RoundingMode -> Bool Source # intSizeOf :: RoundingMode -> Int Source # isBoolean :: RoundingMode -> Bool Source # isBounded :: RoundingMode -> Bool Source # isReal :: RoundingMode -> Bool Source # isFloat :: RoundingMode -> Bool Source # isDouble :: RoundingMode -> Bool Source # isRational :: RoundingMode -> Bool Source # isFP :: RoundingMode -> Bool Source # isUnbounded :: RoundingMode -> Bool Source # isUserSort :: RoundingMode -> Bool Source # isChar :: RoundingMode -> Bool Source # isString :: RoundingMode -> Bool Source # isList :: RoundingMode -> Bool Source # isSet :: RoundingMode -> Bool Source # isTuple :: RoundingMode -> Bool Source # isMaybe :: RoundingMode -> Bool Source # isEither :: RoundingMode -> Bool Source # isArray :: RoundingMode -> Bool Source # showType :: RoundingMode -> String Source # | |
SatModel RoundingMode Source # | A rounding mode, extracted from a model. (Default definition suffices) |
Defined in Data.SBV.SMT.SMT |
type SRoundingMode = SBV RoundingMode Source #
The symbolic variant of RoundingMode
sNaN :: (Floating a, SymVal a) => SBV a Source #
Symbolic variant of Not-A-Number. This value will inhabit
SFloat
, SDouble
and SFloatingPoint
. types.
sInfinity :: (Floating a, SymVal a) => SBV a Source #
Symbolic variant of infinity. This value will inhabit both
SFloat
, SDouble
and SFloatingPoint
. types.
Rounding modes
sRoundNearestTiesToEven :: SRoundingMode Source #
Symbolic variant of RoundNearestTiesToEven
sRoundNearestTiesToAway :: SRoundingMode Source #
Symbolic variant of RoundNearestTiesToAway
sRoundTowardPositive :: SRoundingMode Source #
Symbolic variant of RoundTowardPositive
sRoundTowardNegative :: SRoundingMode Source #
Symbolic variant of RoundTowardNegative
sRoundTowardZero :: SRoundingMode Source #
Symbolic variant of RoundTowardZero
sRNE :: SRoundingMode Source #
Alias for sRoundNearestTiesToEven
sRNA :: SRoundingMode Source #
Alias for sRoundNearestTiesToAway
sRTP :: SRoundingMode Source #
Alias for sRoundTowardPositive
sRTN :: SRoundingMode Source #
Alias for sRoundTowardNegative
sRTZ :: SRoundingMode Source #
Alias for sRoundTowardZero
Conversion to/from floats
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. Similarly, toSFloatingPoint
converts to a generalized
floating-point number with specified exponent and significand bith widths.
Conversions from float: fromSFloat
, fromSDouble
, fromSFloatingPoint
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.
Some examples to illustrate the behavior follows:
>>>
:{
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 = RoundTowardPositive :: RoundingMode s1 = 1104019333 :: Int32
Note how we get a failure on Int32
. The counter-example value is not representable exactly as a single precision float:
>>>
toRational (1104019333 :: Float)
1104019328 % 1
Note how the numerator is different, it is off by 5. This is hardly surprising, since floats become sparser as the magnitude increases to be able to cover all the integer values representable.
>>>
:{
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 = -2305843042984656748 :: 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 (fromIntegral (-2305843042984656748 :: Int64) :: Double)
(-2305843042984656896) % 1
In this case the numerator is off by 148.
class SymVal a => IEEEFloatConvertible a where Source #
Conversion to and from floats
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.
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.
fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV a Source #
Convert from an arbitrary floating point.
toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV a -> SFloatingPoint eb sb Source #
Convert to an arbitrary floating point.
default toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). (Integral a, ValidFloat eb sb) => SRoundingMode -> SBV a -> SFloatingPoint eb sb Source #
Instances
IEEEFloatConvertible Int16 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Int16 Source # toSFloat :: SRoundingMode -> SBV Int16 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Int16 Source # toSDouble :: SRoundingMode -> SBV Int16 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Int16 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Int16 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Int32 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Int32 Source # toSFloat :: SRoundingMode -> SBV Int32 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Int32 Source # toSDouble :: SRoundingMode -> SBV Int32 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Int32 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Int32 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Int64 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Int64 Source # toSFloat :: SRoundingMode -> SBV Int64 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Int64 Source # toSDouble :: SRoundingMode -> SBV Int64 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Int64 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Int64 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Int8 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Int8 Source # toSFloat :: SRoundingMode -> SBV Int8 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Int8 Source # toSDouble :: SRoundingMode -> SBV Int8 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Int8 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Int8 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Word16 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Word16 Source # toSFloat :: SRoundingMode -> SBV Word16 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Word16 Source # toSDouble :: SRoundingMode -> SBV Word16 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Word16 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Word16 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Word32 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Word32 Source # toSFloat :: SRoundingMode -> SBV Word32 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Word32 Source # toSDouble :: SRoundingMode -> SBV Word32 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Word32 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Word32 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Word64 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Word64 Source # toSFloat :: SRoundingMode -> SBV Word64 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Word64 Source # toSDouble :: SRoundingMode -> SBV Word64 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Word64 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Word64 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Word8 Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Word8 Source # toSFloat :: SRoundingMode -> SBV Word8 -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Word8 Source # toSDouble :: SRoundingMode -> SBV Word8 -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Word8 Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Word8 -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible AlgReal Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV AlgReal Source # toSFloat :: SRoundingMode -> SBV AlgReal -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV AlgReal Source # toSDouble :: SRoundingMode -> SBV AlgReal -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV AlgReal Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV AlgReal -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Integer Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Integer Source # toSFloat :: SRoundingMode -> SBV Integer -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Integer Source # toSDouble :: SRoundingMode -> SBV Integer -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Integer Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Integer -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Double Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Double Source # toSFloat :: SRoundingMode -> SBV Double -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Double Source # toSDouble :: SRoundingMode -> SBV Double -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Double Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Double -> SFloatingPoint eb sb Source # | |
IEEEFloatConvertible Float Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV Float Source # toSFloat :: SRoundingMode -> SBV Float -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV Float Source # toSDouble :: SRoundingMode -> SBV Float -> SDouble Source # fromSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SFloatingPoint eb sb -> SBV Float Source # toSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). ValidFloat eb sb => SRoundingMode -> SBV Float -> SFloatingPoint eb sb Source # | |
ValidFloat eb sb => IEEEFloatConvertible (FloatingPoint eb sb) Source # | |
Defined in Data.SBV.Core.Floating Methods fromSFloat :: SRoundingMode -> SFloat -> SBV (FloatingPoint eb sb) Source # toSFloat :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SFloat Source # fromSDouble :: SRoundingMode -> SDouble -> SBV (FloatingPoint eb sb) Source # toSDouble :: SRoundingMode -> SBV (FloatingPoint eb sb) -> SDouble Source # fromSFloatingPoint :: forall (eb0 :: Nat) (sb0 :: Nat). ValidFloat eb0 sb0 => SRoundingMode -> SFloatingPoint eb0 sb0 -> SBV (FloatingPoint eb sb) Source # toSFloatingPoint :: forall (eb0 :: Nat) (sb0 :: Nat). ValidFloat eb0 sb0 => SRoundingMode -> SBV (FloatingPoint eb sb) -> SFloatingPoint eb0 sb0 Source # |
Bit-pattern conversions
sFloatAsSWord32 :: SFloat -> SWord32 Source #
Convert an SFloat
to an SWord32
, preserving the bit-correspondence. Note that since the
representation for NaN
s 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 NaN
s 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
sFloatingPointAsSWord :: forall (eb :: Nat) (sb :: Nat). (ValidFloat eb sb, KnownNat (eb + sb), BVIsNonZero (eb + sb)) => SFloatingPoint eb sb -> SWord (eb + sb) Source #
Convert a float to the word containing the corresponding bit pattern
sWordAsSFloatingPoint :: forall (eb :: Natural) (sb :: Natural). (KnownNat (eb + sb), BVIsNonZero (eb + sb), ValidFloat eb sb) => SWord (eb + sb) -> SFloatingPoint eb sb Source #
Convert a word to an arbitrary float, by reinterpreting the bits of the word as the corresponding bits of the float.
Extracting bit patterns from floats
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.
blastSFloatingPoint :: forall (eb :: Nat) (sb :: Nat). (ValidFloat eb sb, KnownNat (eb + sb), BVIsNonZero (eb + sb)) => SFloatingPoint eb sb -> (SBool, [SBool], [SBool]) Source #
Extract the sign/exponent/mantissa of an arbitrary precision float. The output will have
eb
bits in the second argument for exponent, and sb-1
bits in the third for mantissa.
Showing values in detail
crack :: Bool -> SBV a -> String Source #
Show a value in detailed (cracked) form, if possible. This makes most sense with numbers, and especially floating-point types.
Enumerations
If the uninterpreted sort definition takes the form of an enumeration (i.e., a simple data type with all nullary constructors), then
you can use the mkSymbolicEnumeration
function to turn it into an enumeration in SMTLib.
A simple example is:
data X = A | B | C mkSymbolicEnumeration ''X
Note the magic incantation mkSymbolicEnumeration ''X
. For this to work, you need to have the following
options turned on:
LANGUAGE TemplateHaskell LANGUAGE StandaloneDeriving LANGUAGE DeriveDataTypeable LANGUAGE DeriveAnyClass
The declaration will automatically introduce the type:
type SX = SBV X
along with symbolic values of each of the enumerated values sA
, sB
, and sC
. This way,
you can refer to the symbolic version as SX
, treating it as a regular symbolic type ranging over the values A
, B
, and C
. Such values can be compared for equality, and with the usual
other comparison operators, such as .==
, ./=
, .>
, .>=
, <
, and <=
. For each enumerated value X
, the symbolic versions sX
is defined to be equal to literal X
.
A simple query would look like:
allSat $ x -> x .== (x :: SX)
which would list all three elements of this domain as satisfying solutions.
Solution #1: s0 = A :: X Solution #2: s0 = B :: X Solution #3: s0 = C :: X Found 3 different solutions.
Note that the result is properly typed as X
elements; these are not mere strings.
See Documentation.SBV.Examples.Misc.Enumerate for an extended example on how to use symbolic enumerations.
Uninterpreted sorts, constants, and functions
Users can introduce new uninterpreted sorts simply by defining an empty data-type in Haskell and registering it as such. The following example demonstrates:
data B mkUninterpretedSort ''B
(Note that you'll also need to use pragmas TemplateHaskell
, StandAloneDeriving
, DeriveDataTypeable
, and DeriveAnyClass
for this to work, follow GHC's error messages!)
This is all it takes to introduce B
as an uninterpreted sort in SBV, which makes the type SBV B
automagically become available as the type
of symbolic values that ranges over B
values. Note that this will also introduce the type SB
into your environment, which is a synonym
for SBV B
.
Uninterpreted functions over both uninterpreted and regular sorts can be declared using the facilities introduced by
the SMTDefinable
class.
Stopping unrolling: Defined functions
class SMTDefinable a where Source #
SMT definable constants and functions, which can also be uninterpeted. This class captures functions that we can generate standalone-code for in the SMT solver. Note that we also allow uninterpreted constants and functions too. 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: sbvDefineValue
. However, most instances in
practice are already provided by SBV, so end-users should not need to define their
own instances.
Minimal complete definition
Methods
smtFunction :: String -> a -> a Source #
Generate the code for this value as an SMTLib function, instead of the usual unrolling semantics. This is useful for generating sub-functions in generated SMTLib problem, or handling recursive (and mutually-recursive) definitions that wouldn't terminate in an unrolling symbolic simulation context.
IMPORTANT NOTE The string argument names this function. Note that SBV will identify
this function with that name, i.e., if you use this function twice (or use it recursively),
it will simply assume this name uniquely identifies the function being defined. Hence,
the user has to assure that this string is unique amongst all the functions you use.
Furthermore, if the call to smtFunction
happens in the scope of a parameter, you
must make sure the string is chosen to keep it unique per parameter value. For instance,
if you have:
bar :: SInteger -> SInteger -> SInteger bar k = smtFunction "bar" (x -> x+k) -- Note the capture of k!
and you call bar 2
and bar 3
, you *will* get the same SMTLib function. Obviously
this is unsound. The reason is that the parameter value isn't captured by the name. In general,
you should simply not do this, but if you must, have a concrete argument to make sure you can
create a unique name. Something like:
bar :: String -> SInteger -> SInteger -> SInteger bar tag k = smtFunction ("bar_" ++ tag) (x -> x+k) -- Tag should make the name unique!
Then, make sure you use bar "two" 2
and bar "three" 3
etc. to preserve the invariant.
Note that this is a design choice, to keep function creation as easy to use as possible. SBV
could've made smtFunction
a monadic call and generated the name itself to avoid all these issues.
But the ergonomics of that is worse, and doesn't fit with the general design philosophy. If you
can think of a solution (perhaps using some nifty GHC tricks?) to avoid this issue without making
smtFunction
return a monadic result, please get in touch!
registerFunction :: a -> Symbolic () Source #
Register a function. This function is typically not needed as SBV will register functions used automatically upon first use. However, there are scenarios (in particular query contexts) where the definition isn't used before query-mode starts, and SBV (for historical reasons) requires functions to be known before query-mode starts executing. In such cases, use this function to register them with the system.
default registerFunction :: (a ~ (SBV b -> c), SymVal b, SMTDefinable c) => a -> Symbolic () Source #
uninterpret :: String -> a Source #
Uninterpret a value, i.e., add this value as a completely undefined value/function that the solver is free to instantiate to satisfy other constraints.
Known issues
Usually using an uninterpret function will register itself to the solver, but sometimes the lazyness of the evaluation might render this unreliable.
For example, when working with quantifiers and uninterpreted functions with the following code:
runSMTWith z3 $ do let f = uninterpret "f" :: SInteger -> SInteger query $ do constrain $ \(Forall (b :: SInteger)) -> f b .== f b checkSat
The solver will complain about the unknown constant f (Int)
.
A workaround of this is to explicit register them with registerUISMTFunction
:
runSMTWith z3 $ do let f = uninterpret "f" :: SInteger -> SInteger registerUISMTFunction f query $ do constrain $ \(Forall (b :: SInteger)) -> f b .== f b checkSat
See https://github.com/LeventErkok/sbv/issues/711 for more info.
uninterpretWithArgs :: String -> [String] -> a Source #
Uninterpret a value, with named arguments in case of functions. SBV will use these names when it shows the values for the arguments. If the given names are more than needed we ignore the excess. If not enough, we add from a stock set of variables.
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.
sbvDefineValue :: UIName -> Maybe [String] -> UIKind a -> 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.
A synonym for uninterpret
. Allows us to create variables without
having to call free
explicitly, i.e., without being in the symbolic monad.
sbv2smt :: ExtractIO m => a -> m String Source #
Render an uninterpeted value as an SMTLib definition
Instances
(SymVal a, HasKind a) => SMTDefinable (SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> SBV a -> SBV a Source # registerFunction :: SBV a -> Symbolic () Source # uninterpret :: String -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV a Source # cgUninterpret :: String -> [String] -> SBV a -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV a) -> SBV a Source # | |
(SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV b -> SBV a) -> SBV b -> SBV a Source # registerFunction :: (SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV b -> SBV a) -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV b -> SBV a) -> SBV b -> SBV a Source # sym :: String -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV b -> SBV a) -> m String Source # | |
(SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV d -> SBV c -> SBV b -> SBV a) -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV d -> SBV c -> SBV b -> SBV a) -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (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 # sym :: String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (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 # sym :: String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (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 # sym :: String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, SymVal a, HasKind a) => SMTDefinable (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |
(SymVal m, SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m0 => (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m0 String Source # | |
(SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal m, SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m0 => ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m0 String Source # | |
(SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV d, SBV c, SBV b) -> SBV a) -> (SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV d, SBV c, SBV b) -> SBV a) -> (SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((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 # sym :: String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((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 # sym :: String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((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 # sym :: String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |
(SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # |
registerType :: forall a m. (MonadIO m, SolverContext m, HasKind a) => Proxy a -> m () Source #
Register a type with the solver. Like registerFunction
, This is typically not necessary
since SBV will register types as it encounters them automatically. But there are cases
where doing this can explicitly can come handy, typically in query contexts.
Special relations
A special relation is a binary relation that has additional properties. SBV allows for the checking of various kinds of special relations respecting various axioms, and allows for creating transitive closures. See Documentation.SBV.Examples.Misc.FirstOrderLogic for several examples.
isPartialOrder :: SymVal a => String -> Relation a -> SBool Source #
Check if a relation is a partial order. The string argument must uniquely identify this order.
isLinearOrder :: SymVal a => String -> Relation a -> SBool Source #
Check if a relation is a linear order. The string argument must uniquely identify this order.
isTreeOrder :: SymVal a => String -> Relation a -> SBool Source #
Check if a relation is a tree order. The string argument must uniquely identify this order.
isPiecewiseLinearOrder :: SymVal a => String -> Relation a -> SBool Source #
Check if a relation is a piece-wise linear order. The string argument must uniquely identify this order.
mkTransitiveClosure :: SymVal a => String -> Relation a -> Relation a Source #
Create the transitive closure of a given relation. The string argument must uniquely identify the newly created relation.
Properties, proofs, and satisfiability
The SBV library provides a "push-button" verification system via automated SMT solving. The design goal is to let SMT solvers be used without any knowledge of how SMT solvers work or how different logics operate. The details are hidden behind the SBV framework, providing Haskell programmers with a clean API that is unencumbered by the details of individual solvers. To that end, we use the SMT-Lib standard (https://smt-lib.org) to communicate with arbitrary SMT solvers.
Using multiple solvers
On a multi-core machine, it might be desirable to try a given property using multiple SMT solvers, using parallel threads. Even with machines with single-cores, threading can be helpful if you want to try out multiple-solvers but do not know which one would work the best for the problem at hand ahead of time.
SBV allows proving/satisfiability-checking with multiple backends at the same time. Each function comes in two variants, one that returns the results from all solvers, the other that returns the fastest one.
The All
variants, (i.e., proveWithAll
, satWithAll
) run all solvers and
return all the results. SBV internally makes sure that the result is lazily generated; so,
the order of solvers given does not matter. In other words, the order of results will follow
the order of the solvers as they finish, not as given by the user. These variants are useful when you
want to make sure multiple-solvers agree (or disagree!) on a given problem.
The Any
variants, (i.e., proveWithAny
, satWithAny
) will run all the solvers
in parallel, and return the results of the first one finishing. The other threads will then be killed. These variants
are useful when you do not care if the solvers produce the same result, but rather want to get the
solution as quickly as possible, taking advantage of modern many-core machines.
Note that the function getAvailableSolvers
will return all the installed solvers, which can be
used as the first argument to all these functions, if you simply want to try all available solvers on a machine.
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 ConstraintSet = Symbolic () Source #
A constraint set is a symbolic program that returns no values. The idea is that the constraints/min-max goals will serve as the collection of constraints that will be used for sat/optimize calls.
type Satisfiable = SatisfiableM IO Source #
Satisfiable
is specialization of SatisfiableM
to the IO
monad. Unless you are using
transformers explicitly, this is the type you should prefer.
prove :: Provable a => a -> IO ThmResult Source #
Prove a predicate, using the default solver.
NB. For a version which generalizes over the underlying monad, see prove
proveWith :: Provable a => SMTConfig -> a -> IO ThmResult Source #
Prove the predicate using the given SMT-solver.
NB. For a version which generalizes over the underlying monad, see proveWith
dprove :: Provable a => a -> IO ThmResult Source #
Prove a predicate with delta-satisfiability, using the default solver.
NB. For a version which generalizes over the underlying monad, see prove
dproveWith :: Provable a => SMTConfig -> a -> IO ThmResult Source #
Prove the predicate with delta-satisfiability using the given SMT-solver.
NB. For a version which generalizes over the underlying monad, see proveWith
sat :: Satisfiable a => a -> IO SatResult Source #
Find a satisfying assignment for a predicate, using the default solver.
NB. For a version which generalizes over the underlying monad, see sat
satWith :: Satisfiable a => SMTConfig -> a -> IO SatResult Source #
Find a satisfying assignment using the given SMT-solver.
NB. For a version which generalizes over the underlying monad, see satWith
dsat :: Satisfiable a => a -> IO SatResult Source #
Find a delta-satisfying assignment for a predicate, using the default solver for delta-satisfiability.
NB. For a version which generalizes over the underlying monad, see dsat
dsatWith :: Satisfiable a => SMTConfig -> a -> IO SatResult Source #
Find a satisfying assignment using the given SMT-solver.
NB. For a version which generalizes over the underlying monad, see satWith
allSat :: Satisfiable a => a -> IO AllSatResult Source #
Find all satisfying assignments, using the default solver.
Equivalent to
. See allSatWith
defaultSMTCfg
allSatWith
for details.
NB. For a version which generalizes over the underlying monad, see allSat
allSatWith :: Satisfiable a => SMTConfig -> a -> IO AllSatResult Source #
Return all satisfying assignments for a predicate.
Note that this call will block until all satisfying assignments are found. If you have a problem
with infinitely many satisfying models (consider SInteger
) or a very large number of them, you
might have to wait for a long time. To avoid such cases, use the allSatMaxModelCount
parameter in the configuration.
NB. Uninterpreted constant/function values and counter-examples for array values are ignored for
the purposes of allSat
. That is, only the satisfying assignments modulo uninterpreted functions and
array inputs will be returned. This is due to the limitation of not having a robust means of getting a
function counter-example back from the SMT solver.
Find all satisfying assignments using the given SMT-solver
NB. For a version which generalizes over the underlying monad, see allSatWith
isVacuousProof :: Provable a => a -> IO Bool Source #
Check if the constraints given are consistent in a prove call using the default solver.
NB. For a version which generalizes over the underlying monad, see isVacuousProof
isVacuousProofWith :: Provable a => SMTConfig -> a -> IO Bool Source #
Determine if the constraints are vacuous in a SAT call using the given SMT-solver.
NB. For a version which generalizes over the underlying monad, see isVacuousProofWith
isTheorem :: Provable a => a -> IO Bool Source #
Checks theoremhood using the default solver.
NB. For a version which generalizes over the underlying monad, see isTheorem
isTheoremWith :: Provable a => SMTConfig -> a -> IO Bool Source #
Check whether a given property is a theorem.
NB. For a version which generalizes over the underlying monad, see isTheoremWith
isSatisfiable :: Satisfiable a => a -> IO Bool Source #
Checks satisfiability using the default solver.
NB. For a version which generalizes over the underlying monad, see isSatisfiable
isSatisfiableWith :: Satisfiable a => SMTConfig -> a -> IO Bool Source #
Check whether a given property is satisfiable.
NB. For a version which generalizes over the underlying monad, see isSatisfiableWith
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 an exception 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.
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.
proveConcurrentWithAny :: Provable a => SMTConfig -> [Query b] -> a -> IO (Solver, NominalDiffTime, ThmResult) Source #
Prove a property by running many queries each isolated to their own thread concurrently and return the first that finishes, killing the others
proveConcurrentWithAll :: Provable a => SMTConfig -> [Query b] -> a -> IO [(Solver, NominalDiffTime, ThmResult)] Source #
Prove a property by running many queries each isolated to their own thread concurrently and wait for each to finish returning all results
satWithAny :: Satisfiable 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 an exception 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 :: Satisfiable 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.
satConcurrentWithAny :: Satisfiable a => SMTConfig -> [Query b] -> a -> IO (Solver, NominalDiffTime, SatResult) Source #
Find a satisfying assignment to a property using a single solver, but providing several query problems of interest, with each query running in a separate thread and return the first one that returns. This can be useful to use symbolic mode to drive to a location in the search space of the solver and then refine the problem in query mode. If the computation is very hard to solve for the solver than running in concurrent mode may provide a large performance benefit.
satConcurrentWithAll :: Satisfiable a => SMTConfig -> [Query b] -> a -> IO [(Solver, NominalDiffTime, SatResult)] Source #
Find a satisfying assignment to a property using a single solver, but run
each query problem in a separate isolated thread and wait for each thread to
finish. See satConcurrentWithAny
for more details.
generateSMTBenchmarkSat :: SatisfiableM m a => a -> m String Source #
Create an SMT-Lib2 benchmark, for a SAT query.
generateSMTBenchmarkProof :: ProvableM m a => a -> m String Source #
Create an SMT-Lib2 benchmark, for a Proof query.
solve :: [SBool] -> Symbolic SBool Source #
Form the symbolic conjunction of a given list of boolean conditions. Useful in expressing problems with constraints, like the following:
sat $ do [x, y, z] <- sIntegers ["x", "y", "z"] solve [x .> 5, y + z .< x]
NB. For a version which generalizes over the underlying monad, see solve
Partitioning result space
The function allSatPartition
one to restrict the results returned by calls to allSat
.
In certain cases, we might consider certain models to be "equivalent," i.e., we might want to
create equivalence classes over the search space when it comes to what we consider all satisfying
solutions. In these cases, we can use allSatPartition
tell SBV what classes of solutions to consider
as unique. Consider:
>>>
:{
allSat $ do x <- sInteger "x" y <- sInteger "y" allSatPartition "p1" $ x .>= 0 allSatPartition "p2" $ y .>= 0 :} Solution #1: x = 0 :: Integer y = -1 :: Integer p1 = True :: Bool p2 = False :: Bool Solution #2: x = -1 :: Integer y = 0 :: Integer p1 = False :: Bool p2 = True :: Bool Solution #3: x = -1 :: Integer y = -1 :: Integer p1 = False :: Bool p2 = False :: Bool Solution #4: x = 0 :: Integer y = 0 :: Integer p1 = True :: Bool p2 = True :: Bool Found 4 different solutions.
Without the call to allSatPartition
the above example, allSat
would return all possible combinations of x
and y
subject to the constraints. (Since we have none here,
the call would try to enumerate the infinite set of all integer tuples!) But allSatPartition
us to restrict our attention to the examples that satisfy the partitioning
constraints. The first argument to allSatPartition
simply a name, for diagnostic purposes. Note that the conditions given by allSatPartition
not imposed on the search
space at all: They're only used when we construct the search space. In the above example, we pick one example from each quadrant. Furthermore, while it is typical to pass
a boolean as a partitioning argument, it is not required: Any expression is OK, whose value creates the equivalence class:
>>>
:{
allSat $ do x <- sInteger "x" allSatPartition "p" $ x `sMod` 3 :} Solution #1: x = 2 :: Integer p = 2 :: Integer Solution #2: x = 1 :: Integer p = 1 :: Integer Solution #3: x = 0 :: Integer p = 0 :: Integer Found 3 different solutions.
In the above, we get three examples, as the expression x mod 3
can take only three different values.
allSatPartition :: SymVal a => String -> SBV a -> Symbolic () Source #
Create a partitioning constraint, for all-sat calls.
Constraints and Quantifiers
A constraint is a means for restricting the input domain of a formula. Here's a simple example:
do x <-free
"x" y <-free
"y"constrain
$ x .> yconstrain
$ x + y .>= 12constrain
$ y .>= 3 ...
The first constraint requires x
to be larger than y
. The scond one says that
sum of x
and y
must be at least 12
, and the final one says that y
to be at least 3
.
Constraints provide an easy way to assert additional properties on the input domain, right at the point of
the introduction of variables.
Note that the proper reading of a constraint depends on the context:
- In a
sat
(orallSat
) call: The constraint added is asserted conjunctively. That is, the resulting satisfying model (if any) will always satisfy all the constraints given. - In a
prove
call: In this case, the constraint acts as an implication. The property is proved under the assumption that the constraint holds. In other words, the constraint says that we only care about the input space that satisfies the constraint. - In a
quickCheck
call: The constraint acts as a filter forquickCheck
; if the constraint does not hold, then the input value is considered to be irrelevant and is skipped. Note that this is similar toprove
, but is stronger: We do not accept a test case to be valid just because the constraints fail on them, although semantically the implication does hold. We simply skip that test case as a bad test vector. - In a
genTest
call: Similar toquickCheck
andprove
: If a constraint does not hold, the input value is ignored and is not included in the test set.
A good use case (in fact the motivating use case) for constrain
is attaching a
constraint to a variable at the time of its creation.
Also, the conjunctive semantics for sat
and the implicative
semantics for prove
simplify programming by choosing the correct interpretation
automatically. However, one should be aware of the semantic difference. For instance, in
the presence of constraints, formulas that are provable are not necessarily
satisfiable. To wit, consider:
do x <-free
"x"constrain
$ x .< x return $ x .< (x ::SWord8
)
This predicate is unsatisfiable since no element of SWord8
is less than itself. But
it's (vacuously) true, since it excludes the entire domain of values, thus making the proof
trivial. Hence, this predicate is provable, but is not satisfiable. To make sure the given
constraints are not vacuous, the functions isVacuousProof
(and isVacuousProofWith
) can be used.
Also note that this semantics imply that test case generation (genTest
) and
quick-check can take arbitrarily long in the presence of constraints, if the random input values generated
rarely satisfy the constraints. (As an extreme case, consider
.)constrain
sFalse
constrain :: (SolverContext m, QuantifiedBool a) => a -> m () Source #
Add a constraint, any satisfying instance must satisfy this condition.
softConstrain :: (SolverContext m, QuantifiedBool a) => a -> m () Source #
Add a soft constraint. The solver will try to satisfy this condition if possible, but won't if it cannot.
Quantified constraints, quantifier elimination, and skolemization
You can write quantified formulas, and reason with them as in first-order logic. Here is a simple example:
constrain $ \(Forall x) (Exists y) -> y .> (x :: SInteger)
You can nest quantifiers as you wish, and the quantified parameters can be of arbitrary symbolic type.
Additionally, you can convert such a quantified formula to a regular boolean, via a call to quantifiedBool
function, essentially performing quantifier elimination:
other_condition .&& quantifiedBool (\(Forall x) (Exists y) -> y .> (x :: SInteger))
Or you can prove/sat quantified formulas directly:
prove $ \(Forall x) (Exists y) -> y .> (x :: SInteger)
This facility makes quantifiers part of the regular SBV language, allowing them to be mixed/matched with all your other symbolic computations. See the following files demonstrating reasoning with quantifiers:
- Documentation.SBV.Examples.Puzzles.Birthday
- Documentation.SBV.Examples.Puzzles.KnightsAndKnaves
- Documentation.SBV.Examples.Puzzles.Rabbits
- Documentation.SBV.Examples.Misc.FirstOrderLogic
SBV also supports the constructors ExistsUnique
to create unique existentials, in addition
to ForallN
and ExistsN
for creating multiple variables at the same time.
In general, SBV will not display the values of quantified variables for a satisfying instance. For a satisfiability problem, you can apply skolemization manually to have these values computed by the backend solver. Note that skolemization will produce functions for existentials under universals, and SBV generally cannot translate function values back to Haskell, except in certain simple cases. However, for prefix existentials, the manual transformation can pay off. As an example, compare:
>>>
sat $ \(Exists x) (Forall y) -> x .<= (y :: SWord8)
Satisfiable
to:
>>>
sat $ do { x <- free "x"; pure (quantifiedBool (\(Forall y) -> x .<= (y :: SWord8))) }
Satisfiable. Model: x = 0 :: Word8
where we have skolemized the top-level existential out, and received a witness value for it.
class QuantifiedBool a Source #
A value that can be used as a quantified boolean
Minimal complete definition
Instances
QuantifiedBool SBool Source # | Base case of quantification, simple booleans |
Defined in Data.SBV.Core.Data Methods quantifiedBool :: SBool -> SBool Source # | |
Constraint Symbolic a => QuantifiedBool a Source # | A constraint can be turned into a boolean |
Defined in Data.SBV.Lambda Methods quantifiedBool :: a -> SBool Source # |
quantifiedBool :: QuantifiedBool a => a -> SBool Source #
Turn a quantified boolean into a regular boolean. That is, this function turns an exists/forall quantified formula to a simple boolean that can be used as a regular boolean value. An example is:
quantifiedBool $ \(Forall x) (Exists y) -> y .> (x :: SInteger)
is equivalent to sTrue
. You can think of this function as performing quantifier-elimination: It takes
a quantified formula, and reduces it to a simple boolean that is equivalent to it, but has no quantifiers.
newtype Forall (nm :: Symbol) a Source #
A universal symbolic variable, used in building quantified constraints. The name attached via the symbol is used during skolemization. It names the corresponding argument to the skolem-functions within the scope of this quantifier.
Instances
(SymVal a, Constraint m r) => Constraint m (Forall nm a -> r) Source # | Functions of a single universal | ||||
Defined in Data.SBV.Core.Data Methods mkConstraint :: State -> (Forall nm a -> r) -> m () Source # | |||||
(ExtractIO m, SymVal a, Constraint Symbolic r, ProvableM m r) => ProvableM m (Forall nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: (Forall nm a -> r) -> SymbolicT m SBool Source # prove :: (Forall nm a -> r) -> m ThmResult Source # proveWith :: SMTConfig -> (Forall nm a -> r) -> m ThmResult Source # dprove :: (Forall nm a -> r) -> m ThmResult Source # dproveWith :: SMTConfig -> (Forall nm a -> r) -> m ThmResult Source # isVacuousProof :: (Forall nm a -> r) -> m Bool Source # isVacuousProofWith :: SMTConfig -> (Forall nm a -> r) -> m Bool Source # isTheorem :: (Forall nm a -> r) -> m Bool Source # isTheoremWith :: SMTConfig -> (Forall nm a -> r) -> m Bool Source # | |||||
(ExtractIO m, SymVal a, Constraint Symbolic r, SatisfiableM m r) => SatisfiableM m (Forall nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: (Forall nm a -> r) -> SymbolicT m SBool Source # sat :: (Forall nm a -> r) -> m SatResult Source # satWith :: SMTConfig -> (Forall nm a -> r) -> m SatResult Source # dsat :: (Forall nm a -> r) -> m SatResult Source # dsatWith :: SMTConfig -> (Forall nm a -> r) -> m SatResult Source # allSat :: (Forall nm a -> r) -> m AllSatResult Source # allSatWith :: SMTConfig -> (Forall nm a -> r) -> m AllSatResult Source # isSatisfiable :: (Forall nm a -> r) -> m Bool Source # isSatisfiableWith :: SMTConfig -> (Forall nm a -> r) -> m Bool Source # optimize :: OptimizeStyle -> (Forall nm a -> r) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> (Forall nm a -> r) -> m OptimizeResult Source # | |||||
QNot r => QNot (Forall nm a -> r) Source # | Negate over a universal quantifier. Switches to existential. | ||||
(KnownSymbol nm, Skolemize r) => Skolemize (Forall nm a -> r) Source # | Skolemize over a universal quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
type NegatesTo (Forall nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type SkolemsTo (Forall nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data |
newtype Exists (nm :: Symbol) a Source #
An existential symbolic variable, used in building quantified constraints. The name attached via the symbol is used during skolemization to create a skolem-function name when this variable is eliminated.
Instances
(SymVal a, Constraint m r) => Constraint m (Exists nm a -> r) Source # | Functions of a single existential | ||||
Defined in Data.SBV.Core.Data Methods mkConstraint :: State -> (Exists nm a -> r) -> m () Source # | |||||
(ExtractIO m, SymVal a, Constraint Symbolic r, ProvableM m r) => ProvableM m (Exists nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: (Exists nm a -> r) -> SymbolicT m SBool Source # prove :: (Exists nm a -> r) -> m ThmResult Source # proveWith :: SMTConfig -> (Exists nm a -> r) -> m ThmResult Source # dprove :: (Exists nm a -> r) -> m ThmResult Source # dproveWith :: SMTConfig -> (Exists nm a -> r) -> m ThmResult Source # isVacuousProof :: (Exists nm a -> r) -> m Bool Source # isVacuousProofWith :: SMTConfig -> (Exists nm a -> r) -> m Bool Source # isTheorem :: (Exists nm a -> r) -> m Bool Source # isTheoremWith :: SMTConfig -> (Exists nm a -> r) -> m Bool Source # | |||||
(ExtractIO m, SymVal a, Constraint Symbolic r, SatisfiableM m r) => SatisfiableM m (Exists nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: (Exists nm a -> r) -> SymbolicT m SBool Source # sat :: (Exists nm a -> r) -> m SatResult Source # satWith :: SMTConfig -> (Exists nm a -> r) -> m SatResult Source # dsat :: (Exists nm a -> r) -> m SatResult Source # dsatWith :: SMTConfig -> (Exists nm a -> r) -> m SatResult Source # allSat :: (Exists nm a -> r) -> m AllSatResult Source # allSatWith :: SMTConfig -> (Exists nm a -> r) -> m AllSatResult Source # isSatisfiable :: (Exists nm a -> r) -> m Bool Source # isSatisfiableWith :: SMTConfig -> (Exists nm a -> r) -> m Bool Source # optimize :: OptimizeStyle -> (Exists nm a -> r) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> (Exists nm a -> r) -> m OptimizeResult Source # | |||||
QNot r => QNot (Exists nm a -> r) Source # | Negate over an existential quantifier. Switches to universal. | ||||
(HasKind a, KnownSymbol nm, Skolemize r) => Skolemize (Exists nm a -> r) Source # | Skolemize over an existential quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
type NegatesTo (Exists nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type SkolemsTo (Exists nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data |
newtype ExistsUnique (nm :: Symbol) a Source #
An existential unique symbolic variable, used in building quantified constraints. The name
attached via the symbol is used during skolemization. It's split into two extra names, suffixed
_eu1
and _eu2
, to name the universals in the equivalent formula:
\(\exists! x\,P(x)\Leftrightarrow \exists x\,P(x) \land \forall x_{eu1} \forall x_{eu2} (P(x_{eu1}) \land P(x_{eu2}) \Rightarrow x_{eu1} = x_{eu2}) \)
Constructors
ExistsUnique (SBV a) |
Instances
(SymVal a, Constraint m r, EqSymbolic (SBV a), QuantifiedBool r) => Constraint m (ExistsUnique nm a -> r) Source # | Functions of a unique single existential | ||||
Defined in Data.SBV.Core.Data Methods mkConstraint :: State -> (ExistsUnique nm a -> r) -> m () Source # | |||||
(ExtractIO m, SymVal a, Constraint Symbolic r, ProvableM m r, EqSymbolic (SBV a)) => ProvableM m (ExistsUnique nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: (ExistsUnique nm a -> r) -> SymbolicT m SBool Source # prove :: (ExistsUnique nm a -> r) -> m ThmResult Source # proveWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m ThmResult Source # dprove :: (ExistsUnique nm a -> r) -> m ThmResult Source # dproveWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m ThmResult Source # isVacuousProof :: (ExistsUnique nm a -> r) -> m Bool Source # isVacuousProofWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m Bool Source # isTheorem :: (ExistsUnique nm a -> r) -> m Bool Source # isTheoremWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m Bool Source # | |||||
(ExtractIO m, SymVal a, Constraint Symbolic r, SatisfiableM m r, EqSymbolic (SBV a)) => SatisfiableM m (ExistsUnique nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: (ExistsUnique nm a -> r) -> SymbolicT m SBool Source # sat :: (ExistsUnique nm a -> r) -> m SatResult Source # satWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m SatResult Source # dsat :: (ExistsUnique nm a -> r) -> m SatResult Source # dsatWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m SatResult Source # allSat :: (ExistsUnique nm a -> r) -> m AllSatResult Source # allSatWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m AllSatResult Source # isSatisfiable :: (ExistsUnique nm a -> r) -> m Bool Source # isSatisfiableWith :: SMTConfig -> (ExistsUnique nm a -> r) -> m Bool Source # optimize :: OptimizeStyle -> (ExistsUnique nm a -> r) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> (ExistsUnique nm a -> r) -> m OptimizeResult Source # | |||||
(QNot r, QuantifiedBool r, EqSymbolic (SBV a)) => QNot (ExistsUnique nm a -> r) Source # | Negate over an unique existential quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
Methods qNot :: (ExistsUnique nm a -> r) -> NegatesTo (ExistsUnique nm a -> r) Source # | |||||
(HasKind a, EqSymbolic (SBV a), KnownSymbol nm, QuantifiedBool r, Skolemize (Forall (AppendSymbol nm "_eu1") a -> Forall (AppendSymbol nm "_eu2") a -> SBool)) => Skolemize (ExistsUnique nm a -> r) Source # | Skolemize over a unique existential quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
Methods skolem :: String -> [(SVal, String)] -> (ExistsUnique nm a -> r) -> SkolemsTo (ExistsUnique nm a -> r) skolemize :: (ExistsUnique nm a -> r) -> SkolemsTo (ExistsUnique nm a -> r) Source # taggedSkolemize :: String -> (ExistsUnique nm a -> r) -> SkolemsTo (ExistsUnique nm a -> r) Source # | |||||
type NegatesTo (ExistsUnique nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data type NegatesTo (ExistsUnique nm a -> r) = Forall nm a -> Exists (AppendSymbol nm "_eu1") a -> Exists (AppendSymbol nm "_eu2") a -> SBool | |||||
type SkolemsTo (ExistsUnique nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data type SkolemsTo (ExistsUnique nm a -> r) = Forall (AppendSymbol nm "_eu1") a -> Forall (AppendSymbol nm "_eu2") a -> SBool |
newtype ForallN (n :: Nat) (nm :: Symbol) a Source #
Exactly n
universal symbolic variables, used in in building quantified constraints. The name attached
will be prefixed in front of _1
, _2
, ..., _n
to form the names of the variables.
Instances
(KnownNat n, SymVal a, Constraint m r) => Constraint m (ForallN n nm a -> r) Source # | Functions of a number of universals | ||||
Defined in Data.SBV.Core.Data Methods mkConstraint :: State -> (ForallN n nm a -> r) -> m () Source # | |||||
(KnownNat n, ExtractIO m, SymVal a, Constraint Symbolic r, ProvableM m r) => ProvableM m (ForallN n nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: (ForallN n nm a -> r) -> SymbolicT m SBool Source # prove :: (ForallN n nm a -> r) -> m ThmResult Source # proveWith :: SMTConfig -> (ForallN n nm a -> r) -> m ThmResult Source # dprove :: (ForallN n nm a -> r) -> m ThmResult Source # dproveWith :: SMTConfig -> (ForallN n nm a -> r) -> m ThmResult Source # isVacuousProof :: (ForallN n nm a -> r) -> m Bool Source # isVacuousProofWith :: SMTConfig -> (ForallN n nm a -> r) -> m Bool Source # isTheorem :: (ForallN n nm a -> r) -> m Bool Source # isTheoremWith :: SMTConfig -> (ForallN n nm a -> r) -> m Bool Source # | |||||
(KnownNat n, ExtractIO m, SymVal a, Constraint Symbolic r, SatisfiableM m r) => SatisfiableM m (ForallN n nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: (ForallN n nm a -> r) -> SymbolicT m SBool Source # sat :: (ForallN n nm a -> r) -> m SatResult Source # satWith :: SMTConfig -> (ForallN n nm a -> r) -> m SatResult Source # dsat :: (ForallN n nm a -> r) -> m SatResult Source # dsatWith :: SMTConfig -> (ForallN n nm a -> r) -> m SatResult Source # allSat :: (ForallN n nm a -> r) -> m AllSatResult Source # allSatWith :: SMTConfig -> (ForallN n nm a -> r) -> m AllSatResult Source # isSatisfiable :: (ForallN n nm a -> r) -> m Bool Source # isSatisfiableWith :: SMTConfig -> (ForallN n nm a -> r) -> m Bool Source # optimize :: OptimizeStyle -> (ForallN n nm a -> r) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> (ForallN n nm a -> r) -> m OptimizeResult Source # | |||||
QNot r => QNot (ForallN nm n a -> r) Source # | Negate over a number of universal quantifiers | ||||
(KnownSymbol nm, Skolemize r) => Skolemize (ForallN n nm a -> r) Source # | Skolemize over a number of universal quantifiers | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
type NegatesTo (ForallN nm n a -> r) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type SkolemsTo (ForallN n nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data |
newtype ExistsN (n :: Nat) (nm :: Symbol) a Source #
Exactly n
existential symbolic variables, used in building quantified constraints. The name attached
will be prefixed in front of _1
, _2
, ..., _n
to form the names of the variables.
Instances
(KnownNat n, SymVal a, Constraint m r) => Constraint m (ExistsN n nm a -> r) Source # | Functions of a number of existentials | ||||
Defined in Data.SBV.Core.Data Methods mkConstraint :: State -> (ExistsN n nm a -> r) -> m () Source # | |||||
(KnownNat n, ExtractIO m, SymVal a, Constraint Symbolic r, ProvableM m r) => ProvableM m (ExistsN n nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: (ExistsN n nm a -> r) -> SymbolicT m SBool Source # prove :: (ExistsN n nm a -> r) -> m ThmResult Source # proveWith :: SMTConfig -> (ExistsN n nm a -> r) -> m ThmResult Source # dprove :: (ExistsN n nm a -> r) -> m ThmResult Source # dproveWith :: SMTConfig -> (ExistsN n nm a -> r) -> m ThmResult Source # isVacuousProof :: (ExistsN n nm a -> r) -> m Bool Source # isVacuousProofWith :: SMTConfig -> (ExistsN n nm a -> r) -> m Bool Source # isTheorem :: (ExistsN n nm a -> r) -> m Bool Source # isTheoremWith :: SMTConfig -> (ExistsN n nm a -> r) -> m Bool Source # | |||||
(KnownNat n, ExtractIO m, SymVal a, Constraint Symbolic r, SatisfiableM m r) => SatisfiableM m (ExistsN n nm a -> r) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: (ExistsN n nm a -> r) -> SymbolicT m SBool Source # sat :: (ExistsN n nm a -> r) -> m SatResult Source # satWith :: SMTConfig -> (ExistsN n nm a -> r) -> m SatResult Source # dsat :: (ExistsN n nm a -> r) -> m SatResult Source # dsatWith :: SMTConfig -> (ExistsN n nm a -> r) -> m SatResult Source # allSat :: (ExistsN n nm a -> r) -> m AllSatResult Source # allSatWith :: SMTConfig -> (ExistsN n nm a -> r) -> m AllSatResult Source # isSatisfiable :: (ExistsN n nm a -> r) -> m Bool Source # isSatisfiableWith :: SMTConfig -> (ExistsN n nm a -> r) -> m Bool Source # optimize :: OptimizeStyle -> (ExistsN n nm a -> r) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> (ExistsN n nm a -> r) -> m OptimizeResult Source # | |||||
QNot r => QNot (ExistsN nm n a -> r) Source # | Negate over a number of existential quantifiers | ||||
(HasKind a, KnownNat n, KnownSymbol nm, Skolemize r) => Skolemize (ExistsN n nm a -> r) Source # | Skolemize over a number of existential quantifiers | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
type NegatesTo (ExistsN nm n a -> r) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type SkolemsTo (ExistsN n nm a -> r) Source # | |||||
Defined in Data.SBV.Core.Data |
Class of things that we can logically negate
Methods
qNot :: a -> NegatesTo a Source #
Negation of a quantified formula. This operation essentially lifts sNot
to quantified formulae.
Note that you can achieve the same using
, but that will hide the
quantifiers, so prefer this version if you want to keep them around.sNot
. quantifiedBool
Instances
QNot SBool Source # | Base case; pure symbolic boolean | ||||
QNot r => QNot (Exists nm a -> r) Source # | Negate over an existential quantifier. Switches to universal. | ||||
QNot r => QNot (ExistsN nm n a -> r) Source # | Negate over a number of existential quantifiers | ||||
(QNot r, QuantifiedBool r, EqSymbolic (SBV a)) => QNot (ExistsUnique nm a -> r) Source # | Negate over an unique existential quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
Methods qNot :: (ExistsUnique nm a -> r) -> NegatesTo (ExistsUnique nm a -> r) Source # | |||||
QNot r => QNot (Forall nm a -> r) Source # | Negate over a universal quantifier. Switches to existential. | ||||
QNot r => QNot (ForallN nm n a -> r) Source # | Negate over a number of universal quantifiers | ||||
class Skolemize a where Source #
A class of values that can be skolemized. Note that we don't export this class. Use
the skolemize
function instead.
Minimal complete definition
skolem
Methods
skolemize :: a -> SkolemsTo a Source #
Skolemization. For any formula, skolemization gives back an equisatisfiable formula that has no existential quantifiers in it. You have to provide enough names for all the existentials in the argument. (Extras OK, so you can pass an infinite list if you like.) The names should be distinct, and also different from any other uninterpreted name you might have elsewhere.
taggedSkolemize :: String -> a -> SkolemsTo a Source #
If you use the same names for skolemized arguments in different functions, they will
collide; which is undesirable. Unfortunately there's no easy way for SBV to detect this.
In such cases, use taggedSkolemize
to add a scope to the skolem-function names generated.
Instances
Skolemize (SBV a) Source # | Base case; pure symbolic values | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
(HasKind a, KnownSymbol nm, Skolemize r) => Skolemize (Exists nm a -> r) Source # | Skolemize over an existential quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
(HasKind a, KnownNat n, KnownSymbol nm, Skolemize r) => Skolemize (ExistsN n nm a -> r) Source # | Skolemize over a number of existential quantifiers | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
(HasKind a, EqSymbolic (SBV a), KnownSymbol nm, QuantifiedBool r, Skolemize (Forall (AppendSymbol nm "_eu1") a -> Forall (AppendSymbol nm "_eu2") a -> SBool)) => Skolemize (ExistsUnique nm a -> r) Source # | Skolemize over a unique existential quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
Methods skolem :: String -> [(SVal, String)] -> (ExistsUnique nm a -> r) -> SkolemsTo (ExistsUnique nm a -> r) skolemize :: (ExistsUnique nm a -> r) -> SkolemsTo (ExistsUnique nm a -> r) Source # taggedSkolemize :: String -> (ExistsUnique nm a -> r) -> SkolemsTo (ExistsUnique nm a -> r) Source # | |||||
(KnownSymbol nm, Skolemize r) => Skolemize (Forall nm a -> r) Source # | Skolemize over a universal quantifier | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
(KnownSymbol nm, Skolemize r) => Skolemize (ForallN n nm a -> r) Source # | Skolemize over a number of universal quantifiers | ||||
Defined in Data.SBV.Core.Data Associated Types
|
Constraint Vacuity
When adding constraints, one has to be careful about
making sure they are not inconsistent. The function isVacuousProof
can be used for this purpose.
Here is an example. Consider the following predicate:
>>>
let pred = do { x <- free "x"; constrain $ x .< x; return $ x .>= (5 :: SWord8) }
This predicate asserts that all 8-bit values are larger than 5, subject to the constraint that the
values considered satisfy x .< x
, i.e., they are less than themselves. Since there are no values that
satisfy this constraint, the proof will pass vacuously:
>>>
prove pred
Q.E.D.
We can use isVacuousProof
to make sure to see that the pass was vacuous:
>>>
isVacuousProof pred
True
While the above example is trivial, things can get complicated if there are multiple constraints with non-straightforward relations; so if constraints are used one should make sure to check the predicate is not vacuously true. Here's an example that is not vacuous:
>>>
let pred' = do { x <- free "x"; constrain $ x .> 6; return $ x .>= (5 :: SWord8) }
This time the proof passes as expected:
>>>
prove pred'
Q.E.D.
And the proof is not vacuous:
>>>
isVacuousProof pred'
False
Named constraints and attributes
Constraints can be given names:
namedConstraint
"a is at least 5" $ a .>= 5
Similarly, arbitrary term attributes can also be associated:
constrainWithAttribute
[(":solver-specific-attribute", "value")] $ a .>= 5
Note that a namedConstraint
is equivalent to a constrainWithAttribute
call, setting the `":named"' attribute.
namedConstraint :: (SolverContext m, QuantifiedBool a) => String -> a -> m () Source #
Add a named constraint. The name is used in unsat-core extraction.
constrainWithAttribute :: (SolverContext m, QuantifiedBool a) => [(String, String)] -> a -> m () Source #
Add a constraint, with arbitrary attributes.
Unsat cores
Named constraints are useful when used in conjunction with getUnsatCore
function
where the backend solver can be queried to obtain an unsat core in case the constraints are unsatisfiable.
See getUnsatCore
for details and Documentation.SBV.Examples.Queries.UnsatCore for an example use case.
Cardinality constraints
A pseudo-boolean function (http://en.wikipedia.org/wiki/Pseudo-Boolean_function) is a
function from booleans to reals, basically treating True
as 1
and False
as 0
. They
are typically expressed in polynomial form. Such functions can be used to express cardinality
constraints, where we want to count how many things satisfy a certain condition.
One can code such constraints using regular SBV programming: Simply walk over the booleans and the corresponding coefficients, and assert the required relation. For instance:
[b0, b1, b2, b3] `pbAtMost` 2
is precisely equivalent to:
sum (map (\b -> ite b 1 0) [b0, b1, b2, b3]) .<= 2
and they both express that at most two of b0
, b1
, b2
, and b3
can be sTrue
.
However, the equivalent forms give rise to long formulas and the cardinality constraint
can get lost in the translation. The idea here is that if you use these functions instead, SBV will
produce better translations to SMTLib for more efficient solving of cardinality constraints, assuming
the backend solver supports them. Currently, only Z3 supports pseudo-booleans directly. For all other solvers,
SBV will translate these to equivalent terms that do not require special functions.
Checking safety
The sAssert
function allows users to introduce invariants to make sure
certain properties hold at all times. This is another mechanism to provide further documentation/contract info
into SBV code. The functions safe
and safeWith
can be used to statically discharge these proof assumptions.
If a violation is found, SBV will print a model showing which inputs lead to the invariant being violated.
Here's a simple example. Let's assume we have a function that does subtraction, and requires its first argument to be larger than the second:
>>>
let sub x y = sAssert Nothing "sub: x >= y must hold!" (x .>= y) (x - y)
Clearly, this function is not safe, as there's nothing that stops us from passing it a larger second argument.
We can use safe
to statically see if such a violation is possible before we use this function elsewhere.
>>>
safe (sub :: SInt8 -> SInt8 -> SInt8)
[sub: x >= y must hold!: Violated. Model: s0 = 0 :: Int8 s1 = 1 :: Int8]
What happens if we make sure to arrange for this invariant? Consider this version:
>>>
let safeSub x y = ite (x .>= y) (sub x y) 0
Clearly, safeSub
must be safe. And indeed, SBV can prove that:
>>>
safe (safeSub :: SInt8 -> SInt8 -> SInt8)
[sub: x >= y must hold!: No violations detected]
Note how we used sub
and safeSub
polymorphically. We only need to monomorphise our types when a proof
attempt is done, as we did in the safe
calls.
If required, the user can pass a CallStack
through the first argument to sAssert
, which will be used
by SBV to print a diagnostic info to pinpoint the failure.
Also see Documentation.SBV.Examples.Misc.NoDiv0 for the classic div-by-zero example.
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 :: Type -> Type) a Source #
Symbolically executable program fragments. This class is mainly used for safe
calls, and is sufficiently 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
Instances
ExtractIO m => SExecutable m () Source # | |
Defined in Data.SBV.Provers.Prover | |
ExtractIO m => SExecutable m (SBV a) Source # | |
ExtractIO m => SExecutable m [SBV a] Source # | |
(ExtractIO m, NFData a) => SExecutable m (SymbolicT m a) Source # | |
(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b) => SExecutable m (SBV a, SBV b) Source # | |
(SymVal a, SExecutable m p) => SExecutable m (SBV a -> p) Source # | |
(SymVal a, SymVal b, SExecutable m p) => SExecutable m ((SBV a, SBV b) -> p) Source # | |
(SymVal a, SymVal b, SymVal c, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c) -> p) Source # | |
(SymVal a, SymVal b, SymVal c, SymVal d, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d) -> p) 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 # | |
(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 # | |
Defined in Data.SBV.Provers.Prover | |
(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 # | |
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 # | |
(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 # | |
(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 # | |
(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 # | |
(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 # | |
Defined in Data.SBV.Provers.Prover |
sName :: SExecutable IO a => a -> Symbolic () Source #
Create an argument for a name used in a safety-checking call.
NB. For a version which generalizes over the underlying monad, see sName_
safe :: SExecutable IO a => a -> IO [SafeResult] Source #
Check safety using the default solver.
NB. For a version which generalizes over the underlying monad, see safe
safeWith :: SExecutable IO a => SMTConfig -> a -> IO [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
SBV can optimize metric functions, i.e., those that generate both bounded SIntN
, SWordN
, and unbounded SInteger
types, along with those produce SReal
s. That is, it can find models satisfying all the constraints while minimizing
or maximizing user given metrics. Currently, optimization requires the use of the z3 SMT solver as the backend,
and a good review of these features is given
in this paper: http://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/nbjorner-scss2014.pdf.
Goals can be lexicographically (default), independently, or pareto-front optimized. The relevant functions are:
Goals can be optimized at a regular or an extended value: An extended value is either positive or negative infinity (for unbounded integers and reals) or positive or negative epsilon differential from a real value (for reals).
For instance, a call of the form
minimize
"name-of-goal" $ x + 2*y
minimizes the arithmetic goal x+2*y
, where x
and y
can be signed/unsigned bit-vectors, reals,
or integers.
A simple example
Here's an optimization example in action:
>>>
optimize Lexicographic $ \x y -> minimize "goal" (x+2*(y::SInteger))
Optimal in an extension field: goal = -oo :: Integer
We will describe the role of the constructor Lexicographic
shortly.
Of course, this becomes more useful when the result is not in an extension field:
>>>
:{
optimize Lexicographic $ do x <- sInteger "x" y <- sInteger "y" constrain $ x .> 0 constrain $ x .< 6 constrain $ y .> 2 constrain $ y .< 12 minimize "goal" $ x + 2 * y :} Optimal model: x = 1 :: Integer y = 3 :: Integer goal = 7 :: Integer
As usual, the programmatic API can be used to extract the values of objectives and model-values (getModelObjectives
,
getModelAssignment
, etc.) to access these values and program with them further.
The following examples illustrate the use of basic optimization routines:
- Documentation.SBV.Examples.Optimization.LinearOpt: Simple linear-optimization example.
- Documentation.SBV.Examples.Optimization.Production: Scheduling machines in a shop
- Documentation.SBV.Examples.Optimization.VM: Scheduling virtual-machines in a data-center
optimize :: Satisfiable a => OptimizeStyle -> a -> IO OptimizeResult Source #
optimizeWith :: Satisfiable a => SMTConfig -> OptimizeStyle -> a -> IO OptimizeResult Source #
Optimizes the objectives using the given SMT-solver.
NB. For a version which generalizes over the underlying monad, see optimizeWith
optLexicographic :: Satisfiable a => a -> IO SMTResult Source #
Optimize lexicographically, with the default solver.
optLexicographicWith :: Satisfiable a => SMTConfig -> a -> IO SMTResult Source #
Optimize lexicographically, using the given solver.
optPareto :: Satisfiable a => Maybe Int -> a -> IO (Bool, [SMTResult]) Source #
Pareto front optimization, with the default solver.
optParetoWith :: Satisfiable a => SMTConfig -> Maybe Int -> a -> IO (Bool, [SMTResult]) Source #
Pareto front optimization, with the given solver. The optional integer argument is the number of fronts to return. If Nothing
, then
we will return all pareto fronts. If the first component of the result is True
then we reached the pareto-query limit specified by
the user, so there might be more unqueried results remaining. If False
, it means that all the pareto fronts are returned.
optIndependent :: Satisfiable a => a -> IO [(String, SMTResult)] Source #
Independent optimization, with the default solver. In each result, string is the name of the objective optimized given by the user.
optIndependentWith :: Satisfiable a => SMTConfig -> a -> IO [(String, SMTResult)] Source #
Independent optimization, with the given solver. In each result, string is the name of the objective optimized given by the user.
Multiple optimization goals
Multiple goals can be specified, using the same syntax. In this case, the user gets to pick what style of
optimization to perform, by passing the relevant OptimizeStyle
as the first argument to optimize
.
- [
Lexicographic
]. The solver will optimize the goals in the given order, optimizing the latter ones under the model that optimizes the previous ones. - [
Independent
]. The solver will optimize the goals independently of each other. In this case the user will be presented a model for each goal given. - [
Pareto
]. Finally, the user can query for pareto-fronts. A pareto front is an model such that no goal can be made "better" without making some other goal "worse."
Pareto fronts only make sense when the objectives are bounded. If there are unbounded objective values, then the
backend solver can loop infinitely. (This is what z3 does currently.) If you are not sure the objectives are
bounded, you should first use Independent
mode to ensure the objectives are bounded, and then switch to
pareto-mode to extract them further.
The optional number argument to Pareto
specifies the maximum number of pareto-fronts the user is asking
to get. If Nothing
, SBV will query for all pareto-fronts. Note that pareto-fronts can be really large,
so if Nothing
is used, there is a potential for waiting indefinitely for the SBV-solver interaction to finish. (If
you suspect this might be the case, run in verbose
mode to see the interaction and put a limiting factor
appropriately.)
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. |
Instances
NFData OptimizeStyle Source # | |
Defined in Data.SBV.Core.Symbolic Methods rnf :: OptimizeStyle -> () # | |
Show OptimizeStyle Source # | |
Defined in Data.SBV.Core.Symbolic Methods showsPrec :: Int -> OptimizeStyle -> ShowS # show :: OptimizeStyle -> String # showList :: [OptimizeStyle] -> ShowS # | |
Eq OptimizeStyle Source # | |
Defined in Data.SBV.Core.Symbolic Methods (==) :: OptimizeStyle -> OptimizeStyle -> Bool # (/=) :: OptimizeStyle -> OptimizeStyle -> Bool # |
Objectives and Metrics
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 |
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
annotateForMS
, and possibly 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.
type MetricSpace a = a
Methods
toMetricSpace :: SBV a -> SBV (MetricSpace a) Source #
Compute the metric value to optimize.
default toMetricSpace :: a ~ MetricSpace a => SBV a -> SBV (MetricSpace a) Source #
fromMetricSpace :: SBV (MetricSpace a) -> SBV a Source #
Compute the value itself from the metric corresponding to it.
default fromMetricSpace :: a ~ MetricSpace a => SBV (MetricSpace a) -> SBV a Source #
annotateForMS :: Proxy a -> String -> String Source #
Annotate for the metric space, to clarify the new name. If this result is not identity, we will add an sObserve on the original.
default annotateForMS :: a ~ MetricSpace a => Proxy a -> String -> String Source #
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
Instances
Metric Int16 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Int16 -> SBV (MetricSpace Int16) Source # fromMetricSpace :: SBV (MetricSpace Int16) -> SBV Int16 Source # annotateForMS :: Proxy Int16 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int16 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int16 -> m () Source # | |||||
Metric Int32 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Int32 -> SBV (MetricSpace Int32) Source # fromMetricSpace :: SBV (MetricSpace Int32) -> SBV Int32 Source # annotateForMS :: Proxy Int32 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int32 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int32 -> m () Source # | |||||
Metric Int64 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Int64 -> SBV (MetricSpace Int64) Source # fromMetricSpace :: SBV (MetricSpace Int64) -> SBV Int64 Source # annotateForMS :: Proxy Int64 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int64 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int64 -> m () Source # | |||||
Metric Int8 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Int8 -> SBV (MetricSpace Int8) Source # fromMetricSpace :: SBV (MetricSpace Int8) -> SBV Int8 Source # annotateForMS :: Proxy Int8 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int8 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Int8 -> m () Source # | |||||
Metric Word16 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Word16 -> SBV (MetricSpace Word16) Source # fromMetricSpace :: SBV (MetricSpace Word16) -> SBV Word16 Source # annotateForMS :: Proxy Word16 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word16 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word16 -> m () Source # | |||||
Metric Word32 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Word32 -> SBV (MetricSpace Word32) Source # fromMetricSpace :: SBV (MetricSpace Word32) -> SBV Word32 Source # annotateForMS :: Proxy Word32 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word32 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word32 -> m () Source # | |||||
Metric Word64 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Word64 -> SBV (MetricSpace Word64) Source # fromMetricSpace :: SBV (MetricSpace Word64) -> SBV Word64 Source # annotateForMS :: Proxy Word64 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word64 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word64 -> m () Source # | |||||
Metric Word8 Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Word8 -> SBV (MetricSpace Word8) Source # fromMetricSpace :: SBV (MetricSpace Word8) -> SBV Word8 Source # annotateForMS :: Proxy Word8 -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word8 -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Word8 -> m () Source # | |||||
Metric AlgReal Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV AlgReal -> SBV (MetricSpace AlgReal) Source # fromMetricSpace :: SBV (MetricSpace AlgReal) -> SBV AlgReal Source # annotateForMS :: Proxy AlgReal -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV AlgReal -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV AlgReal -> m () Source # | |||||
Metric Day Source # | Make day an optimizable value, by mapping it to | ||||
Defined in Documentation.SBV.Examples.Optimization.Enumerate Associated Types
Methods toMetricSpace :: SBV Day -> SBV (MetricSpace Day) Source # fromMetricSpace :: SBV (MetricSpace Day) -> SBV Day Source # annotateForMS :: Proxy Day -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Day -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Day -> m () Source # | |||||
Metric Integer Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Integer -> SBV (MetricSpace Integer) Source # fromMetricSpace :: SBV (MetricSpace Integer) -> SBV Integer Source # annotateForMS :: Proxy Integer -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Integer -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Integer -> m () Source # | |||||
Metric Bool Source # | |||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV Bool -> SBV (MetricSpace Bool) Source # fromMetricSpace :: SBV (MetricSpace Bool) -> SBV Bool Source # annotateForMS :: Proxy Bool -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Bool -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Bool -> m () Source # | |||||
Metric Double Source # |
| ||||
Defined in Data.SBV.Core.Floating Associated Types
Methods toMetricSpace :: SBV Double -> SBV (MetricSpace Double) Source # fromMetricSpace :: SBV (MetricSpace Double) -> SBV Double Source # annotateForMS :: Proxy Double -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Double -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Double -> m () Source # | |||||
Metric Float Source # |
| ||||
Defined in Data.SBV.Core.Floating Associated Types
Methods toMetricSpace :: SBV Float -> SBV (MetricSpace Float) Source # fromMetricSpace :: SBV (MetricSpace Float) -> SBV Float Source # annotateForMS :: Proxy Float -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV Float -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV Float -> m () Source # | |||||
(KnownNat n, BVIsNonZero n) => Metric (IntN n) Source # | Optimizing | ||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV (IntN n) -> SBV (MetricSpace (IntN n)) Source # fromMetricSpace :: SBV (MetricSpace (IntN n)) -> SBV (IntN n) Source # annotateForMS :: Proxy (IntN n) -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (IntN n) -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (IntN n) -> m () Source # | |||||
(KnownNat n, BVIsNonZero n) => Metric (WordN n) Source # | Optimizing | ||||
Defined in Data.SBV.Core.Model Associated Types
Methods toMetricSpace :: SBV (WordN n) -> SBV (MetricSpace (WordN n)) Source # fromMetricSpace :: SBV (MetricSpace (WordN n)) -> SBV (WordN n) Source # annotateForMS :: Proxy (WordN n) -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (WordN n) -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (WordN n) -> m () Source # | |||||
(BVIsNonZero (eb + sb), KnownNat (eb + sb), ValidFloat eb sb) => Metric (FloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Floating Associated Types
Methods toMetricSpace :: SBV (FloatingPoint eb sb) -> SBV (MetricSpace (FloatingPoint eb sb)) Source # fromMetricSpace :: SBV (MetricSpace (FloatingPoint eb sb)) -> SBV (FloatingPoint eb sb) Source # annotateForMS :: Proxy (FloatingPoint eb sb) -> String -> String Source # msMinimize :: (MonadSymbolic m, SolverContext m) => String -> SBV (FloatingPoint eb sb) -> m () Source # msMaximize :: (MonadSymbolic m, SolverContext m) => String -> SBV (FloatingPoint eb sb) -> m () Source # | |||||
(SymVal a, Metric a, SymVal b, Metric b) => Metric (a, b) Source # | |||||
Defined in Data.SBV.Tuple Associated Types
Methods toMetricSpace :: SBV (a, b) -> SBV (MetricSpace (a, b)) Source # fromMetricSpace :: SBV (MetricSpace (a, b)) -> SBV (a, b) Source # annotateForMS :: Proxy (a, b) -> String -> String 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 # | |||||
Defined in Data.SBV.Tuple Associated Types
Methods toMetricSpace :: SBV (a, b, c) -> SBV (MetricSpace (a, b, c)) Source # fromMetricSpace :: SBV (MetricSpace (a, b, c)) -> SBV (a, b, c) Source # annotateForMS :: Proxy (a, b, c) -> String -> String 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 # | |||||
Defined in Data.SBV.Tuple Associated Types
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 # annotateForMS :: Proxy (a, b, c, d) -> String -> String 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 # | |||||
Defined in Data.SBV.Tuple Associated Types
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 # annotateForMS :: Proxy (a, b, c, d, e) -> String -> String 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 # | |||||
Defined in Data.SBV.Tuple Associated Types
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 # annotateForMS :: Proxy (a, b, c, d, e, f) -> String -> String 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 # | |||||
Defined in Data.SBV.Tuple Associated Types
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 # annotateForMS :: Proxy (a, b, c, d, e, f, g) -> String -> String 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 # | |||||
Defined in Data.SBV.Tuple Associated Types
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 # annotateForMS :: Proxy (a, b, c, d, e, f, g, h) -> String -> String 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 # |
minimize :: Metric a => String -> SBV a -> Symbolic () Source #
Minimize a named metric
NB. For a version which generalizes over the underlying monad, see minimize
maximize :: Metric a => String -> SBV a -> Symbolic () Source #
Maximize a named metric
NB. For a version which generalizes over the underlying monad, see maximize
Soft assertions
Related to optimization, SBV implements soft-asserts via assertWithPenalty
calls. A soft assertion
is a hint to the SMT solver that we would like a particular condition to hold if **possible*.
That is, if there is a solution satisfying it, then we would like it to hold, but it can be violated
if there is no way to satisfy it. Each soft-assertion can be associated with a numeric penalty for
not satisfying it, hence turning it into an optimization problem.
Note that assertWithPenalty
works well with optimization goals (minimize
/maximize
etc.),
and are most useful when we are optimizing a metric and thus some of the constraints
can be relaxed with a penalty to obtain a good solution. Again
see http://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/nbjorner-scss2014.pdf
for a good overview of the features in Z3 that SBV is providing the bridge for.
A soft assertion can be specified in one of the following three main ways:
assertWithPenalty
"bounded_x" (x .< 5)DefaultPenalty
assertWithPenalty
"bounded_x" (x .< 5) $Penalty
2.3 NothingassertWithPenalty
"bounded_x" (x .< 5) $Penalty
4.7 (Just "group-1")
In the first form, we are saying that the constraint x .< 5
must be satisfied, if possible,
but if this constraint can not be satisfied to find a model, it can be violated with the default penalty of 1.
In the second case, we are associating a penalty value of 2.3
.
Finally in the third case, we are also associating this constraint with a group. The group name is only needed if we have classes of soft-constraints that should be considered together.
assertWithPenalty :: String -> SBool -> Penalty -> Symbolic () Source #
Introduce a soft assertion, with an optional penalty
NB. For a version which generalizes over the underlying monad, see assertWithPenalty
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 |
Penalty Rational (Maybe String) | Penalty with a weight and an optional group |
Field extensions
If an optimization results in an infinity/epsilon value, the returned CV
value will be in the corresponding extension field.
A simple expression type over extended values, covering infinity, epsilon and intervals.
Constructors
Infinite Kind | |
Epsilon Kind | |
Interval ExtCV ExtCV | |
BoundedCV CV | |
AddExtCV ExtCV ExtCV | |
MulExtCV ExtCV ExtCV |
Instances
Show ExtCV Source # | Show instance, shows with the kind |
HasKind ExtCV Source # | Kind instance for Extended CV |
Defined in Data.SBV.Core.Concrete Methods kindOf :: ExtCV -> Kind Source # hasSign :: ExtCV -> Bool Source # intSizeOf :: ExtCV -> Int Source # isBoolean :: ExtCV -> Bool Source # isBounded :: ExtCV -> Bool Source # isReal :: ExtCV -> Bool Source # isFloat :: ExtCV -> Bool Source # isDouble :: ExtCV -> Bool Source # isRational :: ExtCV -> Bool Source # isFP :: ExtCV -> Bool Source # isUnbounded :: ExtCV -> Bool Source # isUserSort :: ExtCV -> Bool Source # isChar :: ExtCV -> Bool Source # isString :: ExtCV -> Bool Source # isList :: ExtCV -> Bool Source # isSet :: ExtCV -> Bool Source # isTuple :: ExtCV -> Bool Source # isMaybe :: ExtCV -> Bool Source # isEither :: ExtCV -> Bool Source # |
data GeneralizedCV Source #
A generalized CV allows for expressions involving infinite and epsilon values/intervals Used in optimization problems.
Constructors
ExtendedCV ExtCV | |
RegularCV CV |
Instances
NFData GeneralizedCV Source # | |
Defined in Data.SBV.Core.Symbolic Methods rnf :: GeneralizedCV -> () # | |
Show GeneralizedCV Source # | Show instance for Generalized |
Defined in Data.SBV.Core.Concrete Methods showsPrec :: Int -> GeneralizedCV -> ShowS # show :: GeneralizedCV -> String # showList :: [GeneralizedCV] -> ShowS # | |
HasKind GeneralizedCV Source # |
|
Defined in Data.SBV.Core.Concrete Methods kindOf :: GeneralizedCV -> Kind Source # hasSign :: GeneralizedCV -> Bool Source # intSizeOf :: GeneralizedCV -> Int Source # isBoolean :: GeneralizedCV -> Bool Source # isBounded :: GeneralizedCV -> Bool Source # isReal :: GeneralizedCV -> Bool Source # isFloat :: GeneralizedCV -> Bool Source # isDouble :: GeneralizedCV -> Bool Source # isRational :: GeneralizedCV -> Bool Source # isFP :: GeneralizedCV -> Bool Source # isUnbounded :: GeneralizedCV -> Bool Source # isUserSort :: GeneralizedCV -> Bool Source # isChar :: GeneralizedCV -> Bool Source # isString :: GeneralizedCV -> Bool Source # isList :: GeneralizedCV -> Bool Source # isSet :: GeneralizedCV -> Bool Source # isTuple :: GeneralizedCV -> Bool Source # isMaybe :: GeneralizedCV -> Bool Source # isEither :: GeneralizedCV -> Bool Source # isArray :: GeneralizedCV -> Bool Source # showType :: GeneralizedCV -> String Source # |
Model extraction
The default Show
instances for prover calls provide all the counter-example information in a
human-readable form and should be sufficient for most casual uses of sbv. However, tools built
on top of sbv will inevitably need to look into the constructed models more deeply, programmatically
extracting their results and performing actions based on them. The API provided in this section
aims at simplifying this task.
Inspecting proof results
ThmResult
, SatResult
, and AllSatResult
are simple newtype wrappers over SMTResult
. Their
main purpose is so that we can provide custom Show
instances to print results accordingly.
Instances
NFData ThmResult Source # | |
Defined in Data.SBV.SMT.SMT | |
Show ThmResult Source # | |
Modelable ThmResult Source # |
|
Defined in Data.SBV.SMT.SMT Methods modelExists :: ThmResult -> Bool Source # getModelAssignment :: SatModel b => ThmResult -> Either String (Bool, b) Source # getModelDictionary :: ThmResult -> Map String CV Source # getModelValue :: SymVal b => String -> ThmResult -> Maybe b Source # getModelUninterpretedValue :: String -> ThmResult -> Maybe String Source # extractModel :: SatModel b => ThmResult -> Maybe b Source # getModelObjectives :: ThmResult -> Map String GeneralizedCV Source # getModelObjectiveValue :: String -> ThmResult -> Maybe GeneralizedCV Source # getModelUIFuns :: ThmResult -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # getModelUIFunValue :: String -> ThmResult -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # |
A sat
call results in a SatResult
The reason for having a separate SatResult
is to have a more meaningful Show
instance.
Instances
NFData SatResult Source # | |
Defined in Data.SBV.SMT.SMT | |
Show SatResult Source # | |
Modelable SatResult Source # |
|
Defined in Data.SBV.SMT.SMT Methods modelExists :: SatResult -> Bool Source # getModelAssignment :: SatModel b => SatResult -> Either String (Bool, b) Source # getModelDictionary :: SatResult -> Map String CV Source # getModelValue :: SymVal b => String -> SatResult -> Maybe b Source # getModelUninterpretedValue :: String -> SatResult -> Maybe String Source # extractModel :: SatModel b => SatResult -> Maybe b Source # getModelObjectives :: SatResult -> Map String GeneralizedCV Source # getModelObjectiveValue :: String -> SatResult -> Maybe GeneralizedCV Source # getModelUIFuns :: SatResult -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # getModelUIFunValue :: String -> SatResult -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # |
data AllSatResult Source #
An allSat
call results in a AllSatResult
Constructors
AllSatResult | |
Fields
|
Instances
Show AllSatResult Source # | |
Defined in Data.SBV.SMT.SMT Methods showsPrec :: Int -> AllSatResult -> ShowS # show :: AllSatResult -> String # showList :: [AllSatResult] -> ShowS # |
newtype SafeResult Source #
A safe
call results in a SafeResult
Constructors
SafeResult (Maybe String, String, SMTResult) |
Instances
Show SafeResult Source # | |
Defined in Data.SBV.SMT.SMT Methods showsPrec :: Int -> SafeResult -> ShowS # show :: SafeResult -> String # showList :: [SafeResult] -> ShowS # |
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.
Constructors
LexicographicResult SMTResult | |
ParetoResult (Bool, [SMTResult]) | |
IndependentResult [(String, SMTResult)] |
Instances
Show OptimizeResult Source # | |
Defined in Data.SBV.SMT.SMT Methods showsPrec :: Int -> OptimizeResult -> ShowS # show :: OptimizeResult -> String # showList :: [OptimizeResult] -> ShowS # |
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 |
DeltaSat SMTConfig (Maybe String) SMTModel | Delta satisfiable with queried string if available and 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 |
Instances
NFData SMTResult Source # | |
Defined in Data.SBV.Core.Symbolic | |
Modelable SMTResult Source # |
|
Defined in Data.SBV.SMT.SMT Methods modelExists :: SMTResult -> Bool Source # getModelAssignment :: SatModel b => SMTResult -> Either String (Bool, b) Source # getModelDictionary :: SMTResult -> Map String CV Source # getModelValue :: SymVal b => String -> SMTResult -> Maybe b Source # getModelUninterpretedValue :: String -> SMTResult -> Maybe String Source # extractModel :: SatModel b => SMTResult -> Maybe b Source # getModelObjectives :: SMTResult -> Map String GeneralizedCV Source # getModelObjectiveValue :: String -> SMTResult -> Maybe GeneralizedCV Source # getModelUIFuns :: SMTResult -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # getModelUIFunValue :: String -> SMTResult -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # |
data SMTReasonUnknown Source #
Reason for reporting unknown.
Constructors
UnknownMemOut | |
UnknownIncomplete | |
UnknownTimeOut | |
UnknownOther String |
Instances
NFData SMTReasonUnknown Source # | Trivial rnf instance |
Defined in Data.SBV.Control.Types Methods rnf :: SMTReasonUnknown -> () # | |
Show SMTReasonUnknown Source # | Show instance for unknown |
Defined in Data.SBV.Control.Types Methods showsPrec :: Int -> SMTReasonUnknown -> ShowS # show :: SMTReasonUnknown -> String # showList :: [SMTReasonUnknown] -> ShowS # |
Observing expressions
The observe
command can be used to trace values of arbitrary expressions during a sat
, prove
, or perhaps more
importantly, in a quickCheck
call with the sObserve
variant.. This is useful for, for instance, recording expected vs. obtained expressions
as a symbolic program is executing.
>>>
:{
prove $ do a1 <- free "i1" a2 <- free "i2" let spec, res :: SWord8 spec = a1 + a2 res = ite (a1 .== 12 .&& a2 .== 22) -- insert a malicious bug! 1 (a1 + a2) return $ observe "Expected" spec .== observe "Result" res :} Falsifiable. Counter-example: i1 = 12 :: Word8 i2 = 22 :: Word8 Expected = 34 :: Word8 Result = 1 :: Word8
The observeIf
variant allows the user to specify a boolean condition when the value is interesting to observe. Useful when
you have lots of "debugging" points, but not all are of interest. Use the sObserve
variant when you are at the Symbolic
monad, which also supports quick-check applications.
observe :: SymVal a => String -> SBV a -> SBV a Source #
Observe the value of an expression, unconditionally. See observeIf
for a generalized version.
observeIf :: SymVal a => (a -> Bool) -> String -> SBV a -> SBV a Source #
Observe the value of an expression, if the given condition holds. Such values are useful in model construction, as they are printed part of a satisfying model, or a
counter-example. The same works for quick-check as well. Useful when we want to see intermediate values, or expected/obtained
pairs in a particular run. Note that an observed expression is always symbolic, i.e., it won't be constant folded. Compare this to label
which is used for putting a label in the generated SMTLib-C code.
NB. If the observed expression happens under a SBV-lambda expression, then it is silently ignored; since there's no way to access the value of such a value.
sObserve :: SymVal a => String -> SBV a -> Symbolic () Source #
A variant of observe that you can use at the top-level. This is useful with quick-check, for instance.
NB. For a version which generalizes over the underlying monad, see sObserve
Programmable model extraction
While default Show
instances are sufficient for most use cases, it is sometimes desirable (especially
for library construction) that the SMT-models are reinterpreted in terms of domain types. Programmable
extraction allows getting arbitrarily typed models out of SMT models.
class Modelable a where Source #
Various SMT results that we can extract models out of.
Minimal complete definition
modelExists, getModelAssignment, getModelDictionary, getModelObjectives, getModelUIFuns
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 (Bool, SBVType, Either String ([([CV], CV)], CV)) Source #
Extract model uninterpreted-functions
getModelUIFunValue :: String -> a -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source #
Extract the value of an uninterpreted-function as an association list
Instances
Modelable SMTResult Source # |
|
Defined in Data.SBV.SMT.SMT Methods modelExists :: SMTResult -> Bool Source # getModelAssignment :: SatModel b => SMTResult -> Either String (Bool, b) Source # getModelDictionary :: SMTResult -> Map String CV Source # getModelValue :: SymVal b => String -> SMTResult -> Maybe b Source # getModelUninterpretedValue :: String -> SMTResult -> Maybe String Source # extractModel :: SatModel b => SMTResult -> Maybe b Source # getModelObjectives :: SMTResult -> Map String GeneralizedCV Source # getModelObjectiveValue :: String -> SMTResult -> Maybe GeneralizedCV Source # getModelUIFuns :: SMTResult -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # getModelUIFunValue :: String -> SMTResult -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # | |
Modelable SatResult Source # |
|
Defined in Data.SBV.SMT.SMT Methods modelExists :: SatResult -> Bool Source # getModelAssignment :: SatModel b => SatResult -> Either String (Bool, b) Source # getModelDictionary :: SatResult -> Map String CV Source # getModelValue :: SymVal b => String -> SatResult -> Maybe b Source # getModelUninterpretedValue :: String -> SatResult -> Maybe String Source # extractModel :: SatModel b => SatResult -> Maybe b Source # getModelObjectives :: SatResult -> Map String GeneralizedCV Source # getModelObjectiveValue :: String -> SatResult -> Maybe GeneralizedCV Source # getModelUIFuns :: SatResult -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # getModelUIFunValue :: String -> SatResult -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # | |
Modelable ThmResult Source # |
|
Defined in Data.SBV.SMT.SMT Methods modelExists :: ThmResult -> Bool Source # getModelAssignment :: SatModel b => ThmResult -> Either String (Bool, b) Source # getModelDictionary :: ThmResult -> Map String CV Source # getModelValue :: SymVal b => String -> ThmResult -> Maybe b Source # getModelUninterpretedValue :: String -> ThmResult -> Maybe String Source # extractModel :: SatModel b => ThmResult -> Maybe b Source # getModelObjectives :: ThmResult -> Map String GeneralizedCV Source # getModelObjectiveValue :: String -> ThmResult -> Maybe GeneralizedCV Source # getModelUIFuns :: ThmResult -> Map String (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # getModelUIFunValue :: String -> ThmResult -> Maybe (Bool, SBVType, Either String ([([CV], CV)], CV)) Source # |
displayModels :: SatModel a => ([(Bool, a)] -> [(Bool, 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, returning Unknown).
The arrange argument can sort the results in any way you like, if necessary.
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
Solver configuration. See also z3
, yices
, cvc4
, boolector
, mathSAT
, etc.
which are instantiations of this type for those solvers, with reasonable defaults. In particular, custom configuration can be
created by varying those values. (Such as z3{verbose=True}
.)
Most fields are self explanatory. The notion of precision for printing algebraic reals stems from the fact that such values does
not necessarily have finite decimal representations, and hence we have to stop printing at some depth. It is important to
emphasize that such values always have infinite precision internally. The issue is merely with how we print such an infinite
precision value on the screen. The field printRealPrec
controls the printing precision, by specifying the number of digits after
the decimal point. The default value is 16, but it can be set to any positive integer.
When printing, SBV will add the suffix ...
at the end of a real-value, if the given bound is not sufficient to represent the real-value
exactly. Otherwise, the number will be written out in standard decimal notation. Note that SBV will always print the whole value if it
is precise (i.e., if it fits in a finite number of digits), regardless of the precision limit. The limit only applies if the representation
of the real value is not finite, i.e., if it is not rational.
The printBase
field can be used to print numbers in base 2, 10, or 16.
The crackNum
field can be used to display numbers in detail, all its bits and how they are laid out in memory. Works with all bounded number types
(i.e., SWord and SInt), but also with floats. It is particularly useful with floating-point numbers, as it shows you how they are laid out in
memory following the IEEE754 rules.
Constructors
SMTConfig | |
Fields
|
Configuration for KnuckleDragger
Constructors
KDOptions | |
Fields
|
Specify how to save timing information, if at all.
Constructors
NoTiming | |
PrintTiming | |
SaveTiming (IORef NominalDiffTime) |
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 |
Instances
NFData SMTLibVersion Source # | |
Defined in Data.SBV.Core.Symbolic Methods rnf :: SMTLibVersion -> () # | |
Bounded SMTLibVersion Source # | |
Defined in Data.SBV.Core.Symbolic | |
Enum SMTLibVersion Source # | |
Defined in Data.SBV.Core.Symbolic Methods succ :: SMTLibVersion -> SMTLibVersion # pred :: SMTLibVersion -> SMTLibVersion # toEnum :: Int -> SMTLibVersion # fromEnum :: SMTLibVersion -> Int # enumFrom :: SMTLibVersion -> [SMTLibVersion] # enumFromThen :: SMTLibVersion -> SMTLibVersion -> [SMTLibVersion] # enumFromTo :: SMTLibVersion -> SMTLibVersion -> [SMTLibVersion] # enumFromThenTo :: SMTLibVersion -> SMTLibVersion -> SMTLibVersion -> [SMTLibVersion] # | |
Show SMTLibVersion Source # | |
Defined in Data.SBV.Core.Symbolic Methods showsPrec :: Int -> SMTLibVersion -> ShowS # show :: SMTLibVersion -> String # showList :: [SMTLibVersion] -> ShowS # | |
Eq SMTLibVersion Source # | |
Defined in Data.SBV.Core.Symbolic Methods (==) :: SMTLibVersion -> SMTLibVersion -> Bool # (/=) :: SMTLibVersion -> SMTLibVersion -> Bool # |
Solvers that SBV is aware of
An SMT solver
Constructors
SMTSolver | |
Fields
|
Controlling verbosity
SBV provides various levels of verbosity to aid in debugging, by using the SMTConfig
fields:
- [
verbose
] Print on stdout a shortened account of what is sent/received. This is specifically trimmed to reduce noise and is good for quick debugging. The output is not supposed to be machine-readable. - [
redirectVerbose
] Send the verbose output to a file. Note that you still have to set `verbose=True` for redirection to take effect. Otherwise, the output is the same as what you would see inverbose
. - [
transcript
] Produce a file that is valid SMTLib2 format, containing everything sent and received. In particular, one can directly feed this file to the SMT-solver outside of the SBV since it is machine-readable. This is good for offline analysis situations, where you want to have a full account of what happened. For instance, it will print time-stamps at every interaction point, so you can see how long each command took.
Solvers
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.
defaultDeltaSMTCfg :: SMTConfig Source #
The default solver used by SBV for delta-satisfiability problems. This is currently set to dReal, which is also the only solver that supports delta-satisfiability.
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.
getAvailableSolvers :: IO [SMTConfig] Source #
Return the known available solver configs, installed on your machine.
setLogic :: SolverContext m => Logic -> m () Source #
Set the logic.
SMT-Lib logics. If left unspecified SBV will pick the logic based on what it determines is needed. However, the
user can override this choice using a call to setLogic
This is especially handy if one is experimenting with custom
logics that might be supported on new solvers. See https://smt-lib.org/logics.shtml for the official list.
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! |
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.
Constructors
SBVException | |
Fields
|
Instances
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. |
Defined in Data.SBV.SMT.Utils Methods toException :: SBVException -> SomeException # fromException :: SomeException -> Maybe SBVException # displayException :: SBVException -> String # backtraceDesired :: SBVException -> Bool # | |
Show SBVException Source # | A fairly nice rendering of the exception, for display purposes. |
Defined in Data.SBV.SMT.Utils Methods showsPrec :: Int -> SBVException -> ShowS # show :: SBVException -> String # showList :: [SBVException] -> ShowS # |
Abstract SBV type
The Symbolic value. The parameter a
is phantom, but is
extremely important in keeping the user interface strongly typed.
Instances
Testable SBool Source # | |||||
IsString SString Source # | |||||
Defined in Data.SBV.Core.Model Methods fromString :: String -> SString # | |||||
Floating SReal Source # | SReal Floating instance, used in conjunction with the dReal solver for delta-satisfiability. Note that we do not constant fold these values (except for pi), as Haskell doesn't really have any means of computing them for arbitrary rationals. | ||||
Num SDouble Source # | |||||
Num SFloat Source # | |||||
Num SInt16 Source # | |||||
Num SInt32 Source # | |||||
Num SInt64 Source # | |||||
Num SInt8 Source # | |||||
Num SInteger Source # | |||||
Num SReal Source # | |||||
Num SWord16 Source # | |||||
Num SWord32 Source # | |||||
Num SWord64 Source # | |||||
Num SWord8 Source # | |||||
Num SKleene Source # | The | ||||
QNot SBool Source # | Base case; pure symbolic boolean | ||||
QuantifiedBool SBool Source # | Base case of quantification, simple booleans | ||||
Defined in Data.SBV.Core.Data Methods quantifiedBool :: SBool -> SBool Source # | |||||
SDivisible SInt16 Source # | |||||
Defined in Data.SBV.Core.Model | |||||
SDivisible SInt32 Source # | |||||
Defined in Data.SBV.Core.Model | |||||
SDivisible SInt64 Source # | |||||
Defined in Data.SBV.Core.Model | |||||
SDivisible SInt8 Source # | |||||
Defined in Data.SBV.Core.Model | |||||
SDivisible SInteger Source # | |||||
Defined in Data.SBV.Core.Model | |||||
SDivisible SWord16 Source # | |||||
SDivisible SWord32 Source # | |||||
SDivisible SWord64 Source # | |||||
SDivisible SWord8 Source # | |||||
Defined in Data.SBV.Core.Model | |||||
RegExpMatchable SChar Source # | Matching a character simply means the singleton string matches the regex. | ||||
RegExpMatchable SString Source # | Matching symbolic strings. | ||||
ArithOverflow SInt16 Source # | |||||
ArithOverflow SInt32 Source # | |||||
ArithOverflow SInt64 Source # | |||||
ArithOverflow SInt8 Source # | |||||
ArithOverflow SWord16 Source # | |||||
ArithOverflow SWord32 Source # | |||||
ArithOverflow SWord64 Source # | |||||
ArithOverflow SWord8 Source # | |||||
Polynomial SWord16 Source # | |||||
Defined in Data.SBV.Tools.Polynomial Methods polynomial :: [Int] -> SWord16 Source # pAdd :: SWord16 -> SWord16 -> SWord16 Source # pMult :: (SWord16, SWord16, [Int]) -> SWord16 Source # pDiv :: SWord16 -> SWord16 -> SWord16 Source # pMod :: SWord16 -> SWord16 -> SWord16 Source # pDivMod :: SWord16 -> SWord16 -> (SWord16, SWord16) Source # | |||||
Polynomial SWord32 Source # | |||||
Defined in Data.SBV.Tools.Polynomial Methods polynomial :: [Int] -> SWord32 Source # pAdd :: SWord32 -> SWord32 -> SWord32 Source # pMult :: (SWord32, SWord32, [Int]) -> SWord32 Source # pDiv :: SWord32 -> SWord32 -> SWord32 Source # pMod :: SWord32 -> SWord32 -> SWord32 Source # pDivMod :: SWord32 -> SWord32 -> (SWord32, SWord32) Source # | |||||
Polynomial SWord64 Source # | |||||
Defined in Data.SBV.Tools.Polynomial Methods polynomial :: [Int] -> SWord64 Source # pAdd :: SWord64 -> SWord64 -> SWord64 Source # pMult :: (SWord64, SWord64, [Int]) -> SWord64 Source # pDiv :: SWord64 -> SWord64 -> SWord64 Source # pMod :: SWord64 -> SWord64 -> SWord64 Source # pDivMod :: SWord64 -> SWord64 -> (SWord64, SWord64) Source # | |||||
Polynomial SWord8 Source # | |||||
Defined in Data.SBV.Tools.Polynomial Methods polynomial :: [Int] -> SWord8 Source # pAdd :: SWord8 -> SWord8 -> SWord8 Source # pMult :: (SWord8, SWord8, [Int]) -> SWord8 Source # pDiv :: SWord8 -> SWord8 -> SWord8 Source # pMod :: SWord8 -> SWord8 -> SWord8 Source # pDivMod :: SWord8 -> SWord8 -> (SWord8, SWord8) Source # | |||||
BooleanAlgebra SStroke Source # | The boolean algebra of the sheffer stroke. | ||||
Defined in Documentation.SBV.Examples.KnuckleDragger.ShefferStroke Methods ﬧ :: SStroke -> SStroke Source # (⨆) :: SStroke -> SStroke -> SStroke Source # (⨅) :: SStroke -> SStroke -> SStroke Source # (≤) :: SStroke -> SStroke -> SBool Source # (<) :: SStroke -> SStroke -> SBool Source # (\\) :: SStroke -> SStroke -> SStroke Source # | |||||
Queriable IO SState Source # |
| ||||
Defined in Documentation.SBV.Examples.Puzzles.DieHard Associated Types
| |||||
MonadSymbolic m => Constraint m SBool Source # | Base case: simple booleans | ||||
Defined in Data.SBV.Core.Data Methods mkConstraint :: State -> SBool -> m () Source # | |||||
ExtractIO m => ProvableM m SBool Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: SBool -> SymbolicT m SBool Source # prove :: SBool -> m ThmResult Source # proveWith :: SMTConfig -> SBool -> m ThmResult Source # dprove :: SBool -> m ThmResult Source # dproveWith :: SMTConfig -> SBool -> m ThmResult Source # isVacuousProof :: SBool -> m Bool Source # isVacuousProofWith :: SMTConfig -> SBool -> m Bool Source # | |||||
ExtractIO m => SatisfiableM m SBool Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: SBool -> SymbolicT m SBool Source # sat :: SBool -> m SatResult Source # satWith :: SMTConfig -> SBool -> m SatResult Source # dsat :: SBool -> m SatResult Source # dsatWith :: SMTConfig -> SBool -> m SatResult Source # allSat :: SBool -> m AllSatResult Source # allSatWith :: SMTConfig -> SBool -> m AllSatResult Source # isSatisfiable :: SBool -> m Bool Source # isSatisfiableWith :: SMTConfig -> SBool -> m Bool Source # optimize :: OptimizeStyle -> SBool -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> SBool -> m OptimizeResult Source # | |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.BMC Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.Fibonacci Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.Strengthen Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.Sum Associated Types
| |||||
Queriable IO (AppS (SList Integer)) Source # |
| ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Append Associated Types
| |||||
Queriable IO (IncS SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Basics Associated Types
| |||||
Queriable IO (FibS SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Fib Associated Types
| |||||
Queriable IO (GCDS SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.GCD Associated Types
| |||||
SymVal a => Queriable IO (DivS (SBV a)) Source # |
| ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.IntDiv Associated Types
| |||||
SymVal a => Queriable IO (SqrtS (SBV a)) Source # | 'Queriable instance for the program state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.IntSqrt Associated Types
| |||||
Queriable IO (SumS SInteger) Source # |
| ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Sum Associated Types
| |||||
(MonadIO m, SymVal a) => Queriable m (SBV a) Source # | Generic | ||||
MonadSymbolic m => Lambda m (SBV a) Source # | Base case, simple values | ||||
ExtractIO m => SExecutable m (SBV a) Source # | |||||
ExtractIO m => SExecutable m [SBV a] Source # | |||||
Queriable IO (LenS (SList Integer) SInteger) Source # | Injection/projection from concrete and symbolic values. | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Length Associated Types
| |||||
(SymVal a, Lambda m r) => Lambda m (SBV a -> r) Source # | Functions | ||||
ExtractIO m => ProvableM m (SymbolicT m SBool) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: SymbolicT m SBool -> SymbolicT m SBool Source # prove :: SymbolicT m SBool -> m ThmResult Source # proveWith :: SMTConfig -> SymbolicT m SBool -> m ThmResult Source # dprove :: SymbolicT m SBool -> m ThmResult Source # dproveWith :: SMTConfig -> SymbolicT m SBool -> m ThmResult Source # isVacuousProof :: SymbolicT m SBool -> m Bool Source # isVacuousProofWith :: SMTConfig -> SymbolicT m SBool -> m Bool Source # isTheorem :: SymbolicT m SBool -> m Bool Source # isTheoremWith :: SMTConfig -> SymbolicT m SBool -> m Bool Source # | |||||
(SymVal a, ProvableM m p) => ProvableM m (SBV a -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: (SBV a -> p) -> SymbolicT m SBool Source # prove :: (SBV a -> p) -> m ThmResult Source # proveWith :: SMTConfig -> (SBV a -> p) -> m ThmResult Source # dprove :: (SBV a -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> (SBV a -> p) -> m ThmResult Source # isVacuousProof :: (SBV a -> p) -> m Bool Source # isVacuousProofWith :: SMTConfig -> (SBV a -> p) -> m Bool Source # isTheorem :: (SBV a -> p) -> m Bool Source # isTheoremWith :: SMTConfig -> (SBV a -> p) -> m Bool Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SymVal j, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> SymbolicT m SBool Source # prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m ThmResult Source # proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m ThmResult Source # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m Bool Source # isVacuousProofWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m Bool Source # isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m Bool Source # isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m Bool Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SymVal j, SymVal k, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> SymbolicT m SBool Source # prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m ThmResult Source # proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m ThmResult Source # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m Bool Source # isVacuousProofWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m Bool Source # isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m Bool Source # isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m Bool Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SymVal j, SymVal k, SymVal l, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> SymbolicT m SBool Source # prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m ThmResult Source # proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m ThmResult Source # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m Bool Source # isVacuousProofWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m Bool Source # isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m Bool Source # isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m Bool Source # | |||||
(SymVal a, SymVal b, ProvableM m p) => ProvableM m ((SBV a, SBV b) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((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 # dprove :: ((SBV a, SBV b) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b) -> p) -> m Bool Source # isVacuousProofWith :: 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 # | |||||
(SymVal a, SymVal b, SymVal c, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((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 # dprove :: ((SBV a, SBV b, SBV c) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source # isVacuousProofWith :: 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((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 # dprove :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m Bool Source # isVacuousProofWith :: 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((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 # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m Bool Source # isVacuousProofWith :: 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((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 # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m Bool Source # isVacuousProofWith :: 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((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 # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m Bool Source # isVacuousProofWith :: 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> SymbolicT m SBool Source # prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m ThmResult Source # proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m ThmResult Source # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m Bool Source # isVacuousProofWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m Bool Source # isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m Bool Source # isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m Bool Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, ProvableM m p) => ProvableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> SymbolicT m SBool Source # prove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m ThmResult Source # proveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m ThmResult Source # dprove :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m ThmResult Source # dproveWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m ThmResult Source # isVacuousProof :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m Bool Source # isVacuousProofWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m Bool Source # isTheorem :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m Bool Source # isTheoremWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m Bool Source # | |||||
(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b) => SExecutable m (SBV a, SBV b) Source # | |||||
(SymVal a, SExecutable m p) => SExecutable m (SBV a -> p) Source # | |||||
(SymVal a, SymVal b, SExecutable m p) => SExecutable m ((SBV a, SBV b) -> p) Source # | |||||
(SymVal a, SymVal b, SymVal c, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c) -> p) Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SExecutable m p) => SExecutable m ((SBV a, SBV b, SBV c, SBV d) -> p) 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 # | |||||
(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 # | |||||
Defined in Data.SBV.Provers.Prover | |||||
(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 # | |||||
Defined in Data.SBV.Provers.Prover | |||||
ExtractIO m => SatisfiableM m (SymbolicT m SBool) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: SymbolicT m SBool -> SymbolicT m SBool Source # sat :: SymbolicT m SBool -> m SatResult Source # satWith :: SMTConfig -> SymbolicT m SBool -> m SatResult Source # dsat :: SymbolicT m SBool -> m SatResult Source # dsatWith :: SMTConfig -> SymbolicT m SBool -> m SatResult Source # allSat :: SymbolicT m SBool -> m AllSatResult Source # allSatWith :: SMTConfig -> SymbolicT m SBool -> m AllSatResult Source # isSatisfiable :: SymbolicT m SBool -> m Bool Source # isSatisfiableWith :: SMTConfig -> SymbolicT m SBool -> m Bool Source # optimize :: OptimizeStyle -> SymbolicT m SBool -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> SymbolicT m SBool -> m OptimizeResult Source # | |||||
(SymVal a, SatisfiableM m p) => SatisfiableM m (SBV a -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: (SBV a -> p) -> SymbolicT m SBool Source # sat :: (SBV a -> p) -> m SatResult Source # satWith :: SMTConfig -> (SBV a -> p) -> m SatResult Source # dsat :: (SBV a -> p) -> m SatResult Source # dsatWith :: SMTConfig -> (SBV a -> p) -> m SatResult Source # allSat :: (SBV a -> p) -> m AllSatResult Source # allSatWith :: SMTConfig -> (SBV a -> p) -> m AllSatResult Source # isSatisfiable :: (SBV a -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> (SBV a -> p) -> m Bool Source # optimize :: OptimizeStyle -> (SBV a -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> (SBV a -> p) -> m OptimizeResult Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SymVal j, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m SatResult Source # dsatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m SatResult Source # allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m AllSatResult Source # allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m AllSatResult Source # isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m Bool Source # optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j) -> p) -> m OptimizeResult Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SymVal j, SymVal k, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m SatResult Source # dsatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m SatResult Source # allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m AllSatResult Source # allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m AllSatResult Source # isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m Bool Source # optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k) -> p) -> m OptimizeResult Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SymVal j, SymVal k, SymVal l, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m SatResult Source # dsatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m SatResult Source # allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m AllSatResult Source # allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m AllSatResult Source # isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m Bool Source # optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i, SBV j, SBV k, SBV l) -> p) -> m OptimizeResult Source # | |||||
(SymVal a, SymVal b, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b) -> p) -> m SatResult Source # dsatWith :: 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 # isSatisfiable :: ((SBV a, SBV b) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b) -> p) -> m Bool Source # optimize :: OptimizeStyle -> ((SBV a, SBV b) -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b) -> p) -> m OptimizeResult Source # | |||||
(SymVal a, SymVal b, SymVal c, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b, SBV c) -> p) -> m SatResult Source # dsatWith :: 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 # isSatisfiable :: ((SBV a, SBV b, SBV c) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c) -> p) -> m Bool 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> SymbolicT m SBool 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 # dsat :: ((SBV a, SBV b, SBV c, SBV d) -> p) -> m SatResult Source # dsatWith :: 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 # 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 # 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> SymbolicT m SBool 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 # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e) -> p) -> m SatResult Source # dsatWith :: 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 # 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 # 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> SymbolicT m SBool 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 # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f) -> p) -> m SatResult Source # dsatWith :: 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 # 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 # 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> SymbolicT m SBool 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 # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g) -> p) -> m SatResult Source # dsatWith :: 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 # 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 # 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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m SatResult Source # dsatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m SatResult Source # allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m AllSatResult Source # allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m AllSatResult Source # isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m Bool Source # optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h) -> p) -> m OptimizeResult Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, SymVal e, SymVal f, SymVal g, SymVal h, SymVal i, SatisfiableM m p) => SatisfiableM m ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) Source # | |||||
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> SymbolicT m SBool Source # sat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m SatResult Source # satWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m SatResult Source # dsat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m SatResult Source # dsatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m SatResult Source # allSat :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m AllSatResult Source # allSatWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m AllSatResult Source # isSatisfiable :: ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m Bool Source # isSatisfiableWith :: SMTConfig -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m Bool Source # optimize :: OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> ((SBV a, SBV b, SBV c, SBV d, SBV e, SBV f, SBV g, SBV h, SBV i) -> p) -> m OptimizeResult Source # | |||||
(ExtractIO m, NFData a, SymVal a, NFData b, SymVal b, NFData c, SymVal c) => SExecutable m (SBV a, SBV b, SBV c) 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 # | |||||
(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 # | |||||
(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 # | |||||
(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 # | |||||
Defined in Data.SBV.Provers.Prover | |||||
(SymVal a, Arbitrary a) => Arbitrary (SBV a) Source # | |||||
Testable (Symbolic SBool) Source # | |||||
NFData (SBV a) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
(Ord a, Num (SBV a), Num a, Bits a, SymVal a) => Bits (SBV a) Source # | Using | ||||
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 # 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 # 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 # | |||||
(SymVal a, Bounded a) => Bounded (SBV a) Source # | |||||
(Show a, Bounded a, Integral a, Num a, Num (SBV a), SymVal a) => Enum (SBV a) Source # | |||||
Defined in Data.SBV.Core.Model | |||||
(Ord a, Num (SBV 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., | ||||
Generic (SBV a) Source # | |||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
SymVal [a] => IsList (SList a) Source # | IsList instance allows list literals to be written compactly. | ||||
(Ord a, SymVal a, Num a, Num (SBV a)) => Num (SBV (Maybe a)) Source # | |||||
Defined in Data.SBV.Maybe Methods (+) :: SBV (Maybe a) -> SBV (Maybe a) -> SBV (Maybe a) # (-) :: SBV (Maybe a) -> SBV (Maybe a) -> SBV (Maybe a) # (*) :: SBV (Maybe a) -> SBV (Maybe a) -> SBV (Maybe a) # negate :: SBV (Maybe a) -> SBV (Maybe a) # abs :: SBV (Maybe a) -> SBV (Maybe a) # signum :: SBV (Maybe a) -> SBV (Maybe a) # fromInteger :: Integer -> SBV (Maybe a) # | |||||
KnownNat n => Num (SInt n) Source # | |||||
KnownNat n => Num (SWord n) Source # | |||||
(Ord a, Num (SBV a), SymVal a, Fractional a) => Fractional (SBV a) Source # | |||||
Show (SBV a) Source # | A | ||||
(SymVal a, Show a) => Show (IncS (SBV a)) Source # | Show instance for | ||||
(SymVal a, Show a) => Show (FibS (SBV a)) Source # | Show instance for | ||||
(SymVal a, Show a) => Show (GCDS (SBV a)) Source # | Show instance for | ||||
(SymVal a, Show a) => Show (DivS (SBV a)) Source # | Show instance for | ||||
(SymVal a, Show a) => Show (SqrtS (SBV a)) Source # | Show instance for | ||||
(SymVal a, Show a) => Show (SumS (SBV a)) Source # | Show instance for | ||||
Eq (SBV a) Source # | This instance is only defined so that we can define an instance for
| ||||
(Random a, SymVal a) => Random (SBV a) Source # | |||||
ByteConverter (SWord 8) Source # |
| ||||
ByteConverter (SWord 16) Source # |
| ||||
ByteConverter (SWord 32) Source # |
| ||||
ByteConverter (SWord 64) Source # |
| ||||
ByteConverter (SWord 128) Source # |
| ||||
ByteConverter (SWord 256) Source # |
| ||||
ByteConverter (SWord 512) Source # |
| ||||
ByteConverter (SWord 1024) Source # |
| ||||
(HasKind a, SymVal a) => EqSymbolic (SBV a) Source # | |||||
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 # distinctExcept :: [SBV a] -> [SBV a] -> SBool Source # allEqual :: [SBV a] -> SBool Source # | |||||
Outputtable (SBV a) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
Skolemize (SBV a) Source # | Base case; pure symbolic values | ||||
Defined in Data.SBV.Core.Data Associated Types
| |||||
HasKind a => HasKind (SBV a) Source # | |||||
Defined in Data.SBV.Core.Data Methods kindOf :: SBV a -> Kind Source # hasSign :: SBV a -> Bool Source # intSizeOf :: SBV a -> Int Source # isBoolean :: SBV a -> Bool Source # isBounded :: SBV a -> Bool Source # isReal :: SBV a -> Bool Source # isFloat :: SBV a -> Bool Source # isDouble :: SBV a -> Bool Source # isRational :: SBV a -> Bool Source # isFP :: SBV a -> Bool Source # isUnbounded :: SBV a -> Bool Source # isUserSort :: SBV a -> Bool Source # isChar :: SBV a -> Bool Source # isString :: SBV a -> Bool Source # isList :: SBV a -> Bool Source # isSet :: SBV a -> Bool Source # isTuple :: SBV a -> Bool Source # isMaybe :: SBV a -> Bool Source # isEither :: SBV a -> Bool Source # | |||||
SymVal a => Mergeable (SBV a) Source # | |||||
(Ord a, SymVal a) => OrdSymbolic (SBV a) Source # | If comparison is over something SMTLib can handle, just translate it. Otherwise desugar. | ||||
(KnownNat n, BVIsNonZero n) => SDivisible (SInt n) Source # |
| ||||
Defined in Data.SBV.Core.Model | |||||
(KnownNat n, BVIsNonZero n) => SDivisible (SWord n) Source # |
| ||||
(SymVal a, HasKind a) => SMTDefinable (SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> SBV a -> SBV a Source # registerFunction :: SBV a -> Symbolic () Source # uninterpret :: String -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV a Source # cgUninterpret :: String -> [String] -> SBV a -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV a) -> SBV a Source # | |||||
(KnownNat n, BVIsNonZero n) => ArithOverflow (SInt n) Source # | |||||
(KnownNat n, BVIsNonZero n) => ArithOverflow (SWord n) Source # | |||||
(KnownNat n, BVIsNonZero n) => Polynomial (SWord n) Source # | |||||
Defined in Data.SBV.Tools.Polynomial Methods polynomial :: [Int] -> SWord n Source # pAdd :: SWord n -> SWord n -> SWord n Source # pMult :: (SWord n, SWord n, [Int]) -> SWord n Source # pDiv :: SWord n -> SWord n -> SWord n Source # pMod :: SWord n -> SWord n -> SWord n Source # pDivMod :: SWord n -> SWord n -> (SWord n, SWord n) Source # | |||||
(SymVal a, PrettyNum a) => PrettyNum (SBV a) Source # | |||||
ValidFloat eb sb => Floating (SFloatingPoint eb sb) Source # | We give a specific instance for | ||||
Defined in Data.SBV.Core.Model Methods pi :: SFloatingPoint eb sb # exp :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log :: SFloatingPoint eb sb -> SFloatingPoint eb sb # sqrt :: SFloatingPoint eb sb -> SFloatingPoint eb sb # (**) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # logBase :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # sin :: SFloatingPoint eb sb -> SFloatingPoint eb sb # cos :: SFloatingPoint eb sb -> SFloatingPoint eb sb # tan :: SFloatingPoint eb sb -> SFloatingPoint eb sb # asin :: SFloatingPoint eb sb -> SFloatingPoint eb sb # acos :: SFloatingPoint eb sb -> SFloatingPoint eb sb # atan :: SFloatingPoint eb sb -> SFloatingPoint eb sb # sinh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # cosh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # tanh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # asinh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # acosh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # atanh :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log1p :: SFloatingPoint eb sb -> SFloatingPoint eb sb # expm1 :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log1pexp :: SFloatingPoint eb sb -> SFloatingPoint eb sb # log1mexp :: SFloatingPoint eb sb -> SFloatingPoint eb sb # | |||||
ValidFloat eb sb => Num (SFloatingPoint eb sb) Source # | |||||
Defined in Data.SBV.Core.Data Methods (+) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # (-) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # (*) :: SFloatingPoint eb sb -> SFloatingPoint eb sb -> SFloatingPoint eb sb # negate :: SFloatingPoint eb sb -> SFloatingPoint eb sb # abs :: SFloatingPoint eb sb -> SFloatingPoint eb sb # signum :: SFloatingPoint eb sb -> SFloatingPoint eb sb # fromInteger :: Integer -> SFloatingPoint eb sb # | |||||
(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 # | |||||
(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 # | |||||
(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 # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> SBV d -> z) Source # | |||||
(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality (SBV a -> SBV b -> SBV c -> z) Source # | |||||
(SymVal a, SymVal b, EqSymbolic z) => Equality (SBV a -> SBV b -> z) Source # | |||||
(SymVal a, EqSymbolic z) => Equality (SBV a -> z) Source # | |||||
(SymVal a, SymVal b, EqSymbolic z) => Equality ((SBV a, SBV b) -> z) Source # | |||||
(SymVal a, SymVal b, SymVal c, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c) -> z) Source # | |||||
(SymVal a, SymVal b, SymVal c, SymVal d, EqSymbolic z) => Equality ((SBV a, SBV b, SBV c, SBV d) -> z) 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 # | |||||
(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 # | |||||
(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 # | |||||
SymVal e => Mergeable (STree i e) Source # | |||||
(SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV b -> SBV a) -> SBV b -> SBV a Source # registerFunction :: (SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV b -> SBV a) -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV b -> SBV a) -> SBV b -> SBV a Source # sym :: String -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV b -> SBV a) -> m String Source # | |||||
(SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV c -> SBV b -> SBV a) -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV d -> SBV c -> SBV b -> SBV a) -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV d -> SBV c -> SBV b -> SBV a) -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (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 # sym :: String -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (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 # sym :: String -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (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 # sym :: String -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, SymVal a, HasKind a) => SMTDefinable (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m => (SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m String Source # | |||||
(SymVal m, SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # registerFunction :: (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> Symbolic () Source # uninterpret :: String -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # uninterpretWithArgs :: String -> [String] -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # cgUninterpret :: String -> [String] -> (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sym :: String -> SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a Source # sbv2smt :: ExtractIO m0 => (SBV m -> SBV l -> SBV k -> SBV j -> SBV i -> SBV h -> SBV g -> SBV f -> SBV e -> SBV d -> SBV c -> SBV b -> SBV a) -> m0 String Source # | |||||
(SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal m, SymVal l, SymVal k, SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m0 => ((SBV m, SBV l, SBV k, SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m0 String Source # | |||||
(SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV c, SBV b) -> SBV a) -> (SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV d, SBV c, SBV b) -> SBV a) -> (SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV d, SBV c, SBV b) -> SBV a) -> (SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((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 # sym :: String -> (SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((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 # sym :: String -> (SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: 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 # registerFunction :: ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [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 # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((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 # sym :: String -> (SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
(SymVal j, SymVal i, SymVal h, SymVal g, SymVal f, SymVal e, SymVal d, SymVal c, SymVal b, SymVal a, HasKind a) => SMTDefinable ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) Source # | |||||
Defined in Data.SBV.Core.Model Methods smtFunction :: String -> ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # registerFunction :: ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> Symbolic () Source # uninterpret :: String -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # uninterpretWithArgs :: String -> [String] -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # cgUninterpret :: String -> [String] -> ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbvDefineValue :: UIName -> Maybe [String] -> UIKind ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sym :: String -> (SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a Source # sbv2smt :: ExtractIO m => ((SBV j, SBV i, SBV h, SBV g, SBV f, SBV e, SBV d, SBV c, SBV b) -> SBV a) -> m String Source # | |||||
type QueryResult SState Source # | |||||
Defined in Documentation.SBV.Examples.Puzzles.DieHard | |||||
type NegatesTo SBool Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type Rep (SBV a) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type Item (SList a) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type QueryResult (SBV a) Source # | |||||
Defined in Data.SBV | |||||
type QueryResult (S SInteger) Source # | |||||
Defined in Documentation.SBV.Examples.ProofTools.BMC | |||||
type QueryResult (S SInteger) Source # | |||||
type QueryResult (S SInteger) Source # | |||||
type QueryResult (S SInteger) Source # | |||||
Defined in Documentation.SBV.Examples.ProofTools.Sum | |||||
type QueryResult (AppS (SList Integer)) Source # | |||||
type QueryResult (IncS SInteger) Source # | |||||
type QueryResult (FibS SInteger) Source # | |||||
type QueryResult (GCDS SInteger) Source # | |||||
type QueryResult (DivS (SBV a)) Source # | |||||
type QueryResult (SqrtS (SBV a)) Source # | |||||
type QueryResult (SumS SInteger) Source # | |||||
type SkolemsTo (SBV a) Source # | |||||
Defined in Data.SBV.Core.Data | |||||
type QueryResult (LenS (SList Integer) SInteger) Source # | |||||
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
Methods
intSizeOf :: a -> Int Source #
isBoolean :: a -> Bool Source #
isBounded :: a -> Bool Source #
isDouble :: a -> Bool Source #
isRational :: a -> Bool Source #
isUnbounded :: a -> Bool Source #
isUserSort :: a -> Bool Source #
isString :: a -> Bool Source #
Instances
HasKind Int16 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Int16 -> Kind Source # hasSign :: Int16 -> Bool Source # intSizeOf :: Int16 -> Int Source # isBoolean :: Int16 -> Bool Source # isBounded :: Int16 -> Bool Source # isReal :: Int16 -> Bool Source # isFloat :: Int16 -> Bool Source # isDouble :: Int16 -> Bool Source # isRational :: Int16 -> Bool Source # isFP :: Int16 -> Bool Source # isUnbounded :: Int16 -> Bool Source # isUserSort :: Int16 -> Bool Source # isChar :: Int16 -> Bool Source # isString :: Int16 -> Bool Source # isList :: Int16 -> Bool Source # isSet :: Int16 -> Bool Source # isTuple :: Int16 -> Bool Source # isMaybe :: Int16 -> Bool Source # isEither :: Int16 -> Bool Source # | |
HasKind Int32 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Int32 -> Kind Source # hasSign :: Int32 -> Bool Source # intSizeOf :: Int32 -> Int Source # isBoolean :: Int32 -> Bool Source # isBounded :: Int32 -> Bool Source # isReal :: Int32 -> Bool Source # isFloat :: Int32 -> Bool Source # isDouble :: Int32 -> Bool Source # isRational :: Int32 -> Bool Source # isFP :: Int32 -> Bool Source # isUnbounded :: Int32 -> Bool Source # isUserSort :: Int32 -> Bool Source # isChar :: Int32 -> Bool Source # isString :: Int32 -> Bool Source # isList :: Int32 -> Bool Source # isSet :: Int32 -> Bool Source # isTuple :: Int32 -> Bool Source # isMaybe :: Int32 -> Bool Source # isEither :: Int32 -> Bool Source # | |
HasKind Int64 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Int64 -> Kind Source # hasSign :: Int64 -> Bool Source # intSizeOf :: Int64 -> Int Source # isBoolean :: Int64 -> Bool Source # isBounded :: Int64 -> Bool Source # isReal :: Int64 -> Bool Source # isFloat :: Int64 -> Bool Source # isDouble :: Int64 -> Bool Source # isRational :: Int64 -> Bool Source # isFP :: Int64 -> Bool Source # isUnbounded :: Int64 -> Bool Source # isUserSort :: Int64 -> Bool Source # isChar :: Int64 -> Bool Source # isString :: Int64 -> Bool Source # isList :: Int64 -> Bool Source # isSet :: Int64 -> Bool Source # isTuple :: Int64 -> Bool Source # isMaybe :: Int64 -> Bool Source # isEither :: Int64 -> Bool Source # | |
HasKind Int8 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Int8 -> Kind Source # hasSign :: Int8 -> Bool Source # intSizeOf :: Int8 -> Int Source # isBoolean :: Int8 -> Bool Source # isBounded :: Int8 -> Bool Source # isReal :: Int8 -> Bool Source # isFloat :: Int8 -> Bool Source # isDouble :: Int8 -> Bool Source # isRational :: Int8 -> Bool Source # isUnbounded :: Int8 -> Bool Source # isUserSort :: Int8 -> Bool Source # isChar :: Int8 -> Bool Source # isString :: Int8 -> Bool Source # isList :: Int8 -> Bool Source # isSet :: Int8 -> Bool Source # isTuple :: Int8 -> Bool Source # isMaybe :: Int8 -> Bool Source # isEither :: Int8 -> Bool Source # | |
HasKind Rational Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Rational -> Kind Source # hasSign :: Rational -> Bool Source # intSizeOf :: Rational -> Int Source # isBoolean :: Rational -> Bool Source # isBounded :: Rational -> Bool Source # isReal :: Rational -> Bool Source # isFloat :: Rational -> Bool Source # isDouble :: Rational -> Bool Source # isRational :: Rational -> Bool Source # isFP :: Rational -> Bool Source # isUnbounded :: Rational -> Bool Source # isUserSort :: Rational -> Bool Source # isChar :: Rational -> Bool Source # isString :: Rational -> Bool Source # isList :: Rational -> Bool Source # isSet :: Rational -> Bool Source # isTuple :: Rational -> Bool Source # isMaybe :: Rational -> Bool Source # isEither :: Rational -> Bool Source # | |
HasKind Word16 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Word16 -> Kind Source # hasSign :: Word16 -> Bool Source # intSizeOf :: Word16 -> Int Source # isBoolean :: Word16 -> Bool Source # isBounded :: Word16 -> Bool Source # isReal :: Word16 -> Bool Source # isFloat :: Word16 -> Bool Source # isDouble :: Word16 -> Bool Source # isRational :: Word16 -> Bool Source # isFP :: Word16 -> Bool Source # isUnbounded :: Word16 -> Bool Source # isUserSort :: Word16 -> Bool Source # isChar :: Word16 -> Bool Source # isString :: Word16 -> Bool Source # isList :: Word16 -> Bool Source # isSet :: Word16 -> Bool Source # isTuple :: Word16 -> Bool Source # isMaybe :: Word16 -> Bool Source # isEither :: Word16 -> Bool Source # | |
HasKind Word32 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Word32 -> Kind Source # hasSign :: Word32 -> Bool Source # intSizeOf :: Word32 -> Int Source # isBoolean :: Word32 -> Bool Source # isBounded :: Word32 -> Bool Source # isReal :: Word32 -> Bool Source # isFloat :: Word32 -> Bool Source # isDouble :: Word32 -> Bool Source # isRational :: Word32 -> Bool Source # isFP :: Word32 -> Bool Source # isUnbounded :: Word32 -> Bool Source # isUserSort :: Word32 -> Bool Source # isChar :: Word32 -> Bool Source # isString :: Word32 -> Bool Source # isList :: Word32 -> Bool Source # isSet :: Word32 -> Bool Source # isTuple :: Word32 -> Bool Source # isMaybe :: Word32 -> Bool Source # isEither :: Word32 -> Bool Source # | |
HasKind Word64 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Word64 -> Kind Source # hasSign :: Word64 -> Bool Source # intSizeOf :: Word64 -> Int Source # isBoolean :: Word64 -> Bool Source # isBounded :: Word64 -> Bool Source # isReal :: Word64 -> Bool Source # isFloat :: Word64 -> Bool Source # isDouble :: Word64 -> Bool Source # isRational :: Word64 -> Bool Source # isFP :: Word64 -> Bool Source # isUnbounded :: Word64 -> Bool Source # isUserSort :: Word64 -> Bool Source # isChar :: Word64 -> Bool Source # isString :: Word64 -> Bool Source # isList :: Word64 -> Bool Source # isSet :: Word64 -> Bool Source # isTuple :: Word64 -> Bool Source # isMaybe :: Word64 -> Bool Source # isEither :: Word64 -> Bool Source # | |
HasKind Word8 Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Word8 -> Kind Source # hasSign :: Word8 -> Bool Source # intSizeOf :: Word8 -> Int Source # isBoolean :: Word8 -> Bool Source # isBounded :: Word8 -> Bool Source # isReal :: Word8 -> Bool Source # isFloat :: Word8 -> Bool Source # isDouble :: Word8 -> Bool Source # isRational :: Word8 -> Bool Source # isFP :: Word8 -> Bool Source # isUnbounded :: Word8 -> Bool Source # isUserSort :: Word8 -> Bool Source # isChar :: Word8 -> Bool Source # isString :: Word8 -> Bool Source # isList :: Word8 -> Bool Source # isSet :: Word8 -> Bool Source # isTuple :: Word8 -> Bool Source # isMaybe :: Word8 -> Bool Source # isEither :: Word8 -> Bool Source # | |
HasKind AlgReal Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: AlgReal -> Kind Source # hasSign :: AlgReal -> Bool Source # intSizeOf :: AlgReal -> Int Source # isBoolean :: AlgReal -> Bool Source # isBounded :: AlgReal -> Bool Source # isReal :: AlgReal -> Bool Source # isFloat :: AlgReal -> Bool Source # isDouble :: AlgReal -> Bool Source # isRational :: AlgReal -> Bool Source # isFP :: AlgReal -> Bool Source # isUnbounded :: AlgReal -> Bool Source # isUserSort :: AlgReal -> Bool Source # isChar :: AlgReal -> Bool Source # isString :: AlgReal -> Bool Source # isList :: AlgReal -> Bool Source # isSet :: AlgReal -> Bool Source # isTuple :: AlgReal -> Bool Source # isMaybe :: AlgReal -> Bool Source # isEither :: AlgReal -> Bool Source # | |
HasKind CV Source # |
|
Defined in Data.SBV.Core.Concrete Methods hasSign :: CV -> Bool Source # intSizeOf :: CV -> Int Source # isBoolean :: CV -> Bool Source # isBounded :: CV -> Bool Source # isFloat :: CV -> Bool Source # isDouble :: CV -> Bool Source # isRational :: CV -> Bool Source # isUnbounded :: CV -> Bool Source # isUserSort :: CV -> Bool Source # isString :: CV -> Bool Source # isTuple :: CV -> Bool Source # isMaybe :: CV -> Bool Source # isEither :: CV -> Bool Source # | |
HasKind ExtCV Source # | Kind instance for Extended CV |
Defined in Data.SBV.Core.Concrete Methods kindOf :: ExtCV -> Kind Source # hasSign :: ExtCV -> Bool Source # intSizeOf :: ExtCV -> Int Source # isBoolean :: ExtCV -> Bool Source # isBounded :: ExtCV -> Bool Source # isReal :: ExtCV -> Bool Source # isFloat :: ExtCV -> Bool Source # isDouble :: ExtCV -> Bool Source # isRational :: ExtCV -> Bool Source # isFP :: ExtCV -> Bool Source # isUnbounded :: ExtCV -> Bool Source # isUserSort :: ExtCV -> Bool Source # isChar :: ExtCV -> Bool Source # isString :: ExtCV -> Bool Source # isList :: ExtCV -> Bool Source # isSet :: ExtCV -> Bool Source # isTuple :: ExtCV -> Bool Source # isMaybe :: ExtCV -> Bool Source # isEither :: ExtCV -> Bool Source # | |
HasKind GeneralizedCV Source # |
|
Defined in Data.SBV.Core.Concrete Methods kindOf :: GeneralizedCV -> Kind Source # hasSign :: GeneralizedCV -> Bool Source # intSizeOf :: GeneralizedCV -> Int Source # isBoolean :: GeneralizedCV -> Bool Source # isBounded :: GeneralizedCV -> Bool Source # isReal :: GeneralizedCV -> Bool Source # isFloat :: GeneralizedCV -> Bool Source # isDouble :: GeneralizedCV -> Bool Source # isRational :: GeneralizedCV -> Bool Source # isFP :: GeneralizedCV -> Bool Source # isUnbounded :: GeneralizedCV -> Bool Source # isUserSort :: GeneralizedCV -> Bool Source # isChar :: GeneralizedCV -> Bool Source # isString :: GeneralizedCV -> Bool Source # isList :: GeneralizedCV -> Bool Source # isSet :: GeneralizedCV -> Bool Source # isTuple :: GeneralizedCV -> Bool Source # isMaybe :: GeneralizedCV -> Bool Source # isEither :: GeneralizedCV -> Bool Source # isArray :: GeneralizedCV -> Bool Source # showType :: GeneralizedCV -> String Source # | |
HasKind Kind Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Kind -> Kind Source # hasSign :: Kind -> Bool Source # intSizeOf :: Kind -> Int Source # isBoolean :: Kind -> Bool Source # isBounded :: Kind -> Bool Source # isReal :: Kind -> Bool Source # isFloat :: Kind -> Bool Source # isDouble :: Kind -> Bool Source # isRational :: Kind -> Bool Source # isUnbounded :: Kind -> Bool Source # isUserSort :: Kind -> Bool Source # isChar :: Kind -> Bool Source # isString :: Kind -> Bool Source # isList :: Kind -> Bool Source # isSet :: Kind -> Bool Source # isTuple :: Kind -> Bool Source # isMaybe :: Kind -> Bool Source # isEither :: Kind -> Bool Source # | |
HasKind RoundingMode Source # |
|
Defined in Data.SBV.Core.Kind Methods kindOf :: RoundingMode -> Kind Source # hasSign :: RoundingMode -> Bool Source # intSizeOf :: RoundingMode -> Int Source # isBoolean :: RoundingMode -> Bool Source # isBounded :: RoundingMode -> Bool Source # isReal :: RoundingMode -> Bool Source # isFloat :: RoundingMode -> Bool Source # isDouble :: RoundingMode -> Bool Source # isRational :: RoundingMode -> Bool Source # isFP :: RoundingMode -> Bool Source # isUnbounded :: RoundingMode -> Bool Source # isUserSort :: RoundingMode -> Bool Source # isChar :: RoundingMode -> Bool Source # isString :: RoundingMode -> Bool Source # isList :: RoundingMode -> Bool Source # isSet :: RoundingMode -> Bool Source # isTuple :: RoundingMode -> Bool Source # isMaybe :: RoundingMode -> Bool Source # isEither :: RoundingMode -> Bool Source # isArray :: RoundingMode -> Bool Source # showType :: RoundingMode -> String Source # | |
HasKind SV Source # | |
Defined in Data.SBV.Core.Symbolic Methods hasSign :: SV -> Bool Source # intSizeOf :: SV -> Int Source # isBoolean :: SV -> Bool Source # isBounded :: SV -> Bool Source # isFloat :: SV -> Bool Source # isDouble :: SV -> Bool Source # isRational :: SV -> Bool Source # isUnbounded :: SV -> Bool Source # isUserSort :: SV -> Bool Source # isString :: SV -> Bool Source # isTuple :: SV -> Bool Source # isMaybe :: SV -> Bool Source # isEither :: SV -> Bool Source # | |
HasKind SVal Source # | |
Defined in Data.SBV.Core.Symbolic Methods kindOf :: SVal -> Kind Source # hasSign :: SVal -> Bool Source # intSizeOf :: SVal -> Int Source # isBoolean :: SVal -> Bool Source # isBounded :: SVal -> Bool Source # isReal :: SVal -> Bool Source # isFloat :: SVal -> Bool Source # isDouble :: SVal -> Bool Source # isRational :: SVal -> Bool Source # isUnbounded :: SVal -> Bool Source # isUserSort :: SVal -> Bool Source # isChar :: SVal -> Bool Source # isString :: SVal -> Bool Source # isList :: SVal -> Bool Source # isSet :: SVal -> Bool Source # isTuple :: SVal -> Bool Source # isMaybe :: SVal -> Bool Source # isEither :: SVal -> Bool Source # | |
HasKind T Source # | |
HasKind Kleene Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Kleene Methods kindOf :: Kleene -> Kind Source # hasSign :: Kleene -> Bool Source # intSizeOf :: Kleene -> Int Source # isBoolean :: Kleene -> Bool Source # isBounded :: Kleene -> Bool Source # isReal :: Kleene -> Bool Source # isFloat :: Kleene -> Bool Source # isDouble :: Kleene -> Bool Source # isRational :: Kleene -> Bool Source # isFP :: Kleene -> Bool Source # isUnbounded :: Kleene -> Bool Source # isUserSort :: Kleene -> Bool Source # isChar :: Kleene -> Bool Source # isString :: Kleene -> Bool Source # isList :: Kleene -> Bool Source # isSet :: Kleene -> Bool Source # isTuple :: Kleene -> Bool Source # isMaybe :: Kleene -> Bool Source # isEither :: Kleene -> Bool Source # | |
HasKind A Source # | |
HasKind B Source # | |
HasKind C Source # | |
HasKind Stroke Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.ShefferStroke Methods kindOf :: Stroke -> Kind Source # hasSign :: Stroke -> Bool Source # intSizeOf :: Stroke -> Int Source # isBoolean :: Stroke -> Bool Source # isBounded :: Stroke -> Bool Source # isReal :: Stroke -> Bool Source # isFloat :: Stroke -> Bool Source # isDouble :: Stroke -> Bool Source # isRational :: Stroke -> Bool Source # isFP :: Stroke -> Bool Source # isUnbounded :: Stroke -> Bool Source # isUserSort :: Stroke -> Bool Source # isChar :: Stroke -> Bool Source # isString :: Stroke -> Bool Source # isList :: Stroke -> Bool Source # isSet :: Stroke -> Bool Source # isTuple :: Stroke -> Bool Source # isMaybe :: Stroke -> Bool Source # isEither :: Stroke -> Bool Source # | |
HasKind T Source # | |
HasKind State Source # | |
Defined in Documentation.SBV.Examples.Lists.BoundedMutex Methods kindOf :: State -> Kind Source # hasSign :: State -> Bool Source # intSizeOf :: State -> Int Source # isBoolean :: State -> Bool Source # isBounded :: State -> Bool Source # isReal :: State -> Bool Source # isFloat :: State -> Bool Source # isDouble :: State -> Bool Source # isRational :: State -> Bool Source # isFP :: State -> Bool Source # isUnbounded :: State -> Bool Source # isUserSort :: State -> Bool Source # isChar :: State -> Bool Source # isString :: State -> Bool Source # isList :: State -> Bool Source # isSet :: State -> Bool Source # isTuple :: State -> Bool Source # isMaybe :: State -> Bool Source # isEither :: State -> Bool Source # | |
HasKind E Source # | |
Defined in Documentation.SBV.Examples.Misc.Enumerate | |
HasKind E Source # | |
HasKind U Source # | |
HasKind V Source # | |
HasKind HumanHeightInCm Source # | Symbolic instance simply follows the underlying type, just like |
Defined in Documentation.SBV.Examples.Misc.Newtypes Methods kindOf :: HumanHeightInCm -> Kind Source # hasSign :: HumanHeightInCm -> Bool Source # intSizeOf :: HumanHeightInCm -> Int Source # isBoolean :: HumanHeightInCm -> Bool Source # isBounded :: HumanHeightInCm -> Bool Source # isReal :: HumanHeightInCm -> Bool Source # isFloat :: HumanHeightInCm -> Bool Source # isDouble :: HumanHeightInCm -> Bool Source # isRational :: HumanHeightInCm -> Bool Source # isFP :: HumanHeightInCm -> Bool Source # isUnbounded :: HumanHeightInCm -> Bool Source # isUserSort :: HumanHeightInCm -> Bool Source # isChar :: HumanHeightInCm -> Bool Source # isString :: HumanHeightInCm -> Bool Source # isList :: HumanHeightInCm -> Bool Source # isSet :: HumanHeightInCm -> Bool Source # isTuple :: HumanHeightInCm -> Bool Source # isMaybe :: HumanHeightInCm -> Bool Source # isEither :: HumanHeightInCm -> Bool Source # isArray :: HumanHeightInCm -> Bool Source # showType :: HumanHeightInCm -> String Source # | |
HasKind Metres Source # | To use |
Defined in Documentation.SBV.Examples.Misc.Newtypes Methods kindOf :: Metres -> Kind Source # hasSign :: Metres -> Bool Source # intSizeOf :: Metres -> Int Source # isBoolean :: Metres -> Bool Source # isBounded :: Metres -> Bool Source # isReal :: Metres -> Bool Source # isFloat :: Metres -> Bool Source # isDouble :: Metres -> Bool Source # isRational :: Metres -> Bool Source # isFP :: Metres -> Bool Source # isUnbounded :: Metres -> Bool Source # isUserSort :: Metres -> Bool Source # isChar :: Metres -> Bool Source # isString :: Metres -> Bool Source # isList :: Metres -> Bool Source # isSet :: Metres -> Bool Source # isTuple :: Metres -> Bool Source # isMaybe :: Metres -> Bool Source # isEither :: Metres -> Bool Source # | |
HasKind Day Source # | |
Defined in Documentation.SBV.Examples.Optimization.Enumerate Methods kindOf :: Day -> Kind Source # hasSign :: Day -> Bool Source # intSizeOf :: Day -> Int Source # isBoolean :: Day -> Bool Source # isBounded :: Day -> Bool Source # isReal :: Day -> Bool Source # isFloat :: Day -> Bool Source # isDouble :: Day -> Bool Source # isRational :: Day -> Bool Source # isUnbounded :: Day -> Bool Source # isUserSort :: Day -> Bool Source # isChar :: Day -> Bool Source # isString :: Day -> Bool Source # isList :: Day -> Bool Source # isTuple :: Day -> Bool Source # isMaybe :: Day -> Bool Source # isEither :: Day -> Bool Source # | |
HasKind Day Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Birthday Methods kindOf :: Day -> Kind Source # hasSign :: Day -> Bool Source # intSizeOf :: Day -> Int Source # isBoolean :: Day -> Bool Source # isBounded :: Day -> Bool Source # isReal :: Day -> Bool Source # isFloat :: Day -> Bool Source # isDouble :: Day -> Bool Source # isRational :: Day -> Bool Source # isUnbounded :: Day -> Bool Source # isUserSort :: Day -> Bool Source # isChar :: Day -> Bool Source # isString :: Day -> Bool Source # isList :: Day -> Bool Source # isTuple :: Day -> Bool Source # isMaybe :: Day -> Bool Source # isEither :: Day -> Bool Source # | |
HasKind Month Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Birthday Methods kindOf :: Month -> Kind Source # hasSign :: Month -> Bool Source # intSizeOf :: Month -> Int Source # isBoolean :: Month -> Bool Source # isBounded :: Month -> Bool Source # isReal :: Month -> Bool Source # isFloat :: Month -> Bool Source # isDouble :: Month -> Bool Source # isRational :: Month -> Bool Source # isFP :: Month -> Bool Source # isUnbounded :: Month -> Bool Source # isUserSort :: Month -> Bool Source # isChar :: Month -> Bool Source # isString :: Month -> Bool Source # isList :: Month -> Bool Source # isSet :: Month -> Bool Source # isTuple :: Month -> Bool Source # isMaybe :: Month -> Bool Source # isEither :: Month -> Bool Source # | |
HasKind Action Source # | |
Defined in Documentation.SBV.Examples.Puzzles.DieHard Methods kindOf :: Action -> Kind Source # hasSign :: Action -> Bool Source # intSizeOf :: Action -> Int Source # isBoolean :: Action -> Bool Source # isBounded :: Action -> Bool Source # isReal :: Action -> Bool Source # isFloat :: Action -> Bool Source # isDouble :: Action -> Bool Source # isRational :: Action -> Bool Source # isFP :: Action -> Bool Source # isUnbounded :: Action -> Bool Source # isUserSort :: Action -> Bool Source # isChar :: Action -> Bool Source # isString :: Action -> Bool Source # isList :: Action -> Bool Source # isSet :: Action -> Bool Source # isTuple :: Action -> Bool Source # isMaybe :: Action -> Bool Source # isEither :: Action -> Bool Source # | |
HasKind P Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Drinker | |
HasKind Beverage Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods kindOf :: Beverage -> Kind Source # hasSign :: Beverage -> Bool Source # intSizeOf :: Beverage -> Int Source # isBoolean :: Beverage -> Bool Source # isBounded :: Beverage -> Bool Source # isReal :: Beverage -> Bool Source # isFloat :: Beverage -> Bool Source # isDouble :: Beverage -> Bool Source # isRational :: Beverage -> Bool Source # isFP :: Beverage -> Bool Source # isUnbounded :: Beverage -> Bool Source # isUserSort :: Beverage -> Bool Source # isChar :: Beverage -> Bool Source # isString :: Beverage -> Bool Source # isList :: Beverage -> Bool Source # isSet :: Beverage -> Bool Source # isTuple :: Beverage -> Bool Source # isMaybe :: Beverage -> Bool Source # isEither :: Beverage -> Bool Source # | |
HasKind Color Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods kindOf :: Color -> Kind Source # hasSign :: Color -> Bool Source # intSizeOf :: Color -> Int Source # isBoolean :: Color -> Bool Source # isBounded :: Color -> Bool Source # isReal :: Color -> Bool Source # isFloat :: Color -> Bool Source # isDouble :: Color -> Bool Source # isRational :: Color -> Bool Source # isFP :: Color -> Bool Source # isUnbounded :: Color -> Bool Source # isUserSort :: Color -> Bool Source # isChar :: Color -> Bool Source # isString :: Color -> Bool Source # isList :: Color -> Bool Source # isSet :: Color -> Bool Source # isTuple :: Color -> Bool Source # isMaybe :: Color -> Bool Source # isEither :: Color -> Bool Source # | |
HasKind Nationality Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods kindOf :: Nationality -> Kind Source # hasSign :: Nationality -> Bool Source # intSizeOf :: Nationality -> Int Source # isBoolean :: Nationality -> Bool Source # isBounded :: Nationality -> Bool Source # isReal :: Nationality -> Bool Source # isFloat :: Nationality -> Bool Source # isDouble :: Nationality -> Bool Source # isRational :: Nationality -> Bool Source # isFP :: Nationality -> Bool Source # isUnbounded :: Nationality -> Bool Source # isUserSort :: Nationality -> Bool Source # isChar :: Nationality -> Bool Source # isString :: Nationality -> Bool Source # isList :: Nationality -> Bool Source # isSet :: Nationality -> Bool Source # isTuple :: Nationality -> Bool Source # isMaybe :: Nationality -> Bool Source # isEither :: Nationality -> Bool Source # isArray :: Nationality -> Bool Source # showType :: Nationality -> String Source # | |
HasKind Pet Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods kindOf :: Pet -> Kind Source # hasSign :: Pet -> Bool Source # intSizeOf :: Pet -> Int Source # isBoolean :: Pet -> Bool Source # isBounded :: Pet -> Bool Source # isReal :: Pet -> Bool Source # isFloat :: Pet -> Bool Source # isDouble :: Pet -> Bool Source # isRational :: Pet -> Bool Source # isUnbounded :: Pet -> Bool Source # isUserSort :: Pet -> Bool Source # isChar :: Pet -> Bool Source # isString :: Pet -> Bool Source # isList :: Pet -> Bool Source # isTuple :: Pet -> Bool Source # isMaybe :: Pet -> Bool Source # isEither :: Pet -> Bool Source # | |
HasKind Sport Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods kindOf :: Sport -> Kind Source # hasSign :: Sport -> Bool Source # intSizeOf :: Sport -> Int Source # isBoolean :: Sport -> Bool Source # isBounded :: Sport -> Bool Source # isReal :: Sport -> Bool Source # isFloat :: Sport -> Bool Source # isDouble :: Sport -> Bool Source # isRational :: Sport -> Bool Source # isFP :: Sport -> Bool Source # isUnbounded :: Sport -> Bool Source # isUserSort :: Sport -> Bool Source # isChar :: Sport -> Bool Source # isString :: Sport -> Bool Source # isList :: Sport -> Bool Source # isSet :: Sport -> Bool Source # isTuple :: Sport -> Bool Source # isMaybe :: Sport -> Bool Source # isEither :: Sport -> Bool Source # | |
HasKind Color Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Garden Methods kindOf :: Color -> Kind Source # hasSign :: Color -> Bool Source # intSizeOf :: Color -> Int Source # isBoolean :: Color -> Bool Source # isBounded :: Color -> Bool Source # isReal :: Color -> Bool Source # isFloat :: Color -> Bool Source # isDouble :: Color -> Bool Source # isRational :: Color -> Bool Source # isFP :: Color -> Bool Source # isUnbounded :: Color -> Bool Source # isUserSort :: Color -> Bool Source # isChar :: Color -> Bool Source # isString :: Color -> Bool Source # isList :: Color -> Bool Source # isSet :: Color -> Bool Source # isTuple :: Color -> Bool Source # isMaybe :: Color -> Bool Source # isEither :: Color -> Bool Source # | |
HasKind Color Source # | |
Defined in Documentation.SBV.Examples.Puzzles.HexPuzzle Methods kindOf :: Color -> Kind Source # hasSign :: Color -> Bool Source # intSizeOf :: Color -> Int Source # isBoolean :: Color -> Bool Source # isBounded :: Color -> Bool Source # isReal :: Color -> Bool Source # isFloat :: Color -> Bool Source # isDouble :: Color -> Bool Source # isRational :: Color -> Bool Source # isFP :: Color -> Bool Source # isUnbounded :: Color -> Bool Source # isUserSort :: Color -> Bool Source # isChar :: Color -> Bool Source # isString :: Color -> Bool Source # isList :: Color -> Bool Source # isSet :: Color -> Bool Source # isTuple :: Color -> Bool Source # isMaybe :: Color -> Bool Source # isEither :: Color -> Bool Source # | |
HasKind Identity Source # | |
Defined in Documentation.SBV.Examples.Puzzles.KnightsAndKnaves Methods kindOf :: Identity -> Kind Source # hasSign :: Identity -> Bool Source # intSizeOf :: Identity -> Int Source # isBoolean :: Identity -> Bool Source # isBounded :: Identity -> Bool Source # isReal :: Identity -> Bool Source # isFloat :: Identity -> Bool Source # isDouble :: Identity -> Bool Source # isRational :: Identity -> Bool Source # isFP :: Identity -> Bool Source # isUnbounded :: Identity -> Bool Source # isUserSort :: Identity -> Bool Source # isChar :: Identity -> Bool Source # isString :: Identity -> Bool Source # isList :: Identity -> Bool Source # isSet :: Identity -> Bool Source # isTuple :: Identity -> Bool Source # isMaybe :: Identity -> Bool Source # isEither :: Identity -> Bool Source # | |
HasKind Inhabitant Source # | |
Defined in Documentation.SBV.Examples.Puzzles.KnightsAndKnaves Methods kindOf :: Inhabitant -> Kind Source # hasSign :: Inhabitant -> Bool Source # intSizeOf :: Inhabitant -> Int Source # isBoolean :: Inhabitant -> Bool Source # isBounded :: Inhabitant -> Bool Source # isReal :: Inhabitant -> Bool Source # isFloat :: Inhabitant -> Bool Source # isDouble :: Inhabitant -> Bool Source # isRational :: Inhabitant -> Bool Source # isFP :: Inhabitant -> Bool Source # isUnbounded :: Inhabitant -> Bool Source # isUserSort :: Inhabitant -> Bool Source # isChar :: Inhabitant -> Bool Source # isString :: Inhabitant -> Bool Source # isList :: Inhabitant -> Bool Source # isSet :: Inhabitant -> Bool Source # isTuple :: Inhabitant -> Bool Source # isMaybe :: Inhabitant -> Bool Source # isEither :: Inhabitant -> Bool Source # isArray :: Inhabitant -> Bool Source # showType :: Inhabitant -> String Source # | |
HasKind Statement Source # | |
Defined in Documentation.SBV.Examples.Puzzles.KnightsAndKnaves Methods kindOf :: Statement -> Kind Source # hasSign :: Statement -> Bool Source # intSizeOf :: Statement -> Int Source # isBoolean :: Statement -> Bool Source # isBounded :: Statement -> Bool Source # isReal :: Statement -> Bool Source # isFloat :: Statement -> Bool Source # isDouble :: Statement -> Bool Source # isRational :: Statement -> Bool Source # isFP :: Statement -> Bool Source # isUnbounded :: Statement -> Bool Source # isUserSort :: Statement -> Bool Source # isChar :: Statement -> Bool Source # isString :: Statement -> Bool Source # isList :: Statement -> Bool Source # isSet :: Statement -> Bool Source # isTuple :: Statement -> Bool Source # isMaybe :: Statement -> Bool Source # isEither :: Statement -> Bool Source # | |
HasKind Location Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Murder Methods kindOf :: Location -> Kind Source # hasSign :: Location -> Bool Source # intSizeOf :: Location -> Int Source # isBoolean :: Location -> Bool Source # isBounded :: Location -> Bool Source # isReal :: Location -> Bool Source # isFloat :: Location -> Bool Source # isDouble :: Location -> Bool Source # isRational :: Location -> Bool Source # isFP :: Location -> Bool Source # isUnbounded :: Location -> Bool Source # isUserSort :: Location -> Bool Source # isChar :: Location -> Bool Source # isString :: Location -> Bool Source # isList :: Location -> Bool Source # isSet :: Location -> Bool Source # isTuple :: Location -> Bool Source # isMaybe :: Location -> Bool Source # isEither :: Location -> Bool Source # | |
HasKind Role Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Murder Methods kindOf :: Role -> Kind Source # hasSign :: Role -> Bool Source # intSizeOf :: Role -> Int Source # isBoolean :: Role -> Bool Source # isBounded :: Role -> Bool Source # isReal :: Role -> Bool Source # isFloat :: Role -> Bool Source # isDouble :: Role -> Bool Source # isRational :: Role -> Bool Source # isUnbounded :: Role -> Bool Source # isUserSort :: Role -> Bool Source # isChar :: Role -> Bool Source # isString :: Role -> Bool Source # isList :: Role -> Bool Source # isSet :: Role -> Bool Source # isTuple :: Role -> Bool Source # isMaybe :: Role -> Bool Source # isEither :: Role -> Bool Source # | |
HasKind Sex Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Murder Methods kindOf :: Sex -> Kind Source # hasSign :: Sex -> Bool Source # intSizeOf :: Sex -> Int Source # isBoolean :: Sex -> Bool Source # isBounded :: Sex -> Bool Source # isReal :: Sex -> Bool Source # isFloat :: Sex -> Bool Source # isDouble :: Sex -> Bool Source # isRational :: Sex -> Bool Source # isUnbounded :: Sex -> Bool Source # isUserSort :: Sex -> Bool Source # isChar :: Sex -> Bool Source # isString :: Sex -> Bool Source # isList :: Sex -> Bool Source # isTuple :: Sex -> Bool Source # isMaybe :: Sex -> Bool Source # isEither :: Sex -> Bool Source # | |
HasKind Handler Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods kindOf :: Handler -> Kind Source # hasSign :: Handler -> Bool Source # intSizeOf :: Handler -> Int Source # isBoolean :: Handler -> Bool Source # isBounded :: Handler -> Bool Source # isReal :: Handler -> Bool Source # isFloat :: Handler -> Bool Source # isDouble :: Handler -> Bool Source # isRational :: Handler -> Bool Source # isFP :: Handler -> Bool Source # isUnbounded :: Handler -> Bool Source # isUserSort :: Handler -> Bool Source # isChar :: Handler -> Bool Source # isString :: Handler -> Bool Source # isList :: Handler -> Bool Source # isSet :: Handler -> Bool Source # isTuple :: Handler -> Bool Source # isMaybe :: Handler -> Bool Source # isEither :: Handler -> Bool Source # | |
HasKind Location Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods kindOf :: Location -> Kind Source # hasSign :: Location -> Bool Source # intSizeOf :: Location -> Int Source # isBoolean :: Location -> Bool Source # isBounded :: Location -> Bool Source # isReal :: Location -> Bool Source # isFloat :: Location -> Bool Source # isDouble :: Location -> Bool Source # isRational :: Location -> Bool Source # isFP :: Location -> Bool Source # isUnbounded :: Location -> Bool Source # isUserSort :: Location -> Bool Source # isChar :: Location -> Bool Source # isString :: Location -> Bool Source # isList :: Location -> Bool Source # isSet :: Location -> Bool Source # isTuple :: Location -> Bool Source # isMaybe :: Location -> Bool Source # isEither :: Location -> Bool Source # | |
HasKind Orangutan Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods kindOf :: Orangutan -> Kind Source # hasSign :: Orangutan -> Bool Source # intSizeOf :: Orangutan -> Int Source # isBoolean :: Orangutan -> Bool Source # isBounded :: Orangutan -> Bool Source # isReal :: Orangutan -> Bool Source # isFloat :: Orangutan -> Bool Source # isDouble :: Orangutan -> Bool Source # isRational :: Orangutan -> Bool Source # isFP :: Orangutan -> Bool Source # isUnbounded :: Orangutan -> Bool Source # isUserSort :: Orangutan -> Bool Source # isChar :: Orangutan -> Bool Source # isString :: Orangutan -> Bool Source # isList :: Orangutan -> Bool Source # isSet :: Orangutan -> Bool Source # isTuple :: Orangutan -> Bool Source # isMaybe :: Orangutan -> Bool Source # isEither :: Orangutan -> Bool Source # | |
HasKind Rabbit Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Rabbits Methods kindOf :: Rabbit -> Kind Source # hasSign :: Rabbit -> Bool Source # intSizeOf :: Rabbit -> Int Source # isBoolean :: Rabbit -> Bool Source # isBounded :: Rabbit -> Bool Source # isReal :: Rabbit -> Bool Source # isFloat :: Rabbit -> Bool Source # isDouble :: Rabbit -> Bool Source # isRational :: Rabbit -> Bool Source # isFP :: Rabbit -> Bool Source # isUnbounded :: Rabbit -> Bool Source # isUserSort :: Rabbit -> Bool Source # isChar :: Rabbit -> Bool Source # isString :: Rabbit -> Bool Source # isList :: Rabbit -> Bool Source # isSet :: Rabbit -> Bool Source # isTuple :: Rabbit -> Bool Source # isMaybe :: Rabbit -> Bool Source # isEither :: Rabbit -> Bool Source # | |
HasKind Location Source # | |
Defined in Documentation.SBV.Examples.Puzzles.U2Bridge Methods kindOf :: Location -> Kind Source # hasSign :: Location -> Bool Source # intSizeOf :: Location -> Int Source # isBoolean :: Location -> Bool Source # isBounded :: Location -> Bool Source # isReal :: Location -> Bool Source # isFloat :: Location -> Bool Source # isDouble :: Location -> Bool Source # isRational :: Location -> Bool Source # isFP :: Location -> Bool Source # isUnbounded :: Location -> Bool Source # isUserSort :: Location -> Bool Source # isChar :: Location -> Bool Source # isString :: Location -> Bool Source # isList :: Location -> Bool Source # isSet :: Location -> Bool Source # isTuple :: Location -> Bool Source # isMaybe :: Location -> Bool Source # isEither :: Location -> Bool Source # | |
HasKind U2Member Source # | |
Defined in Documentation.SBV.Examples.Puzzles.U2Bridge Methods kindOf :: U2Member -> Kind Source # hasSign :: U2Member -> Bool Source # intSizeOf :: U2Member -> Int Source # isBoolean :: U2Member -> Bool Source # isBounded :: U2Member -> Bool Source # isReal :: U2Member -> Bool Source # isFloat :: U2Member -> Bool Source # isDouble :: U2Member -> Bool Source # isRational :: U2Member -> Bool Source # isFP :: U2Member -> Bool Source # isUnbounded :: U2Member -> Bool Source # isUserSort :: U2Member -> Bool Source # isChar :: U2Member -> Bool Source # isString :: U2Member -> Bool Source # isList :: U2Member -> Bool Source # isSet :: U2Member -> Bool Source # isTuple :: U2Member -> Bool Source # isMaybe :: U2Member -> Bool Source # isEither :: U2Member -> Bool Source # | |
HasKind Day Source # | |
Defined in Documentation.SBV.Examples.Queries.Enums Methods kindOf :: Day -> Kind Source # hasSign :: Day -> Bool Source # intSizeOf :: Day -> Int Source # isBoolean :: Day -> Bool Source # isBounded :: Day -> Bool Source # isReal :: Day -> Bool Source # isFloat :: Day -> Bool Source # isDouble :: Day -> Bool Source # isRational :: Day -> Bool Source # isUnbounded :: Day -> Bool Source # isUserSort :: Day -> Bool Source # isChar :: Day -> Bool Source # isString :: Day -> Bool Source # isList :: Day -> Bool Source # isTuple :: Day -> Bool Source # isMaybe :: Day -> Bool Source # isEither :: Day -> Bool Source # | |
HasKind BinOp Source # | |
Defined in Documentation.SBV.Examples.Queries.FourFours Methods kindOf :: BinOp -> Kind Source # hasSign :: BinOp -> Bool Source # intSizeOf :: BinOp -> Int Source # isBoolean :: BinOp -> Bool Source # isBounded :: BinOp -> Bool Source # isReal :: BinOp -> Bool Source # isFloat :: BinOp -> Bool Source # isDouble :: BinOp -> Bool Source # isRational :: BinOp -> Bool Source # isFP :: BinOp -> Bool Source # isUnbounded :: BinOp -> Bool Source # isUserSort :: BinOp -> Bool Source # isChar :: BinOp -> Bool Source # isString :: BinOp -> Bool Source # isList :: BinOp -> Bool Source # isSet :: BinOp -> Bool Source # isTuple :: BinOp -> Bool Source # isMaybe :: BinOp -> Bool Source # isEither :: BinOp -> Bool Source # | |
HasKind UnOp Source # | |
Defined in Documentation.SBV.Examples.Queries.FourFours Methods kindOf :: UnOp -> Kind Source # hasSign :: UnOp -> Bool Source # intSizeOf :: UnOp -> Int Source # isBoolean :: UnOp -> Bool Source # isBounded :: UnOp -> Bool Source # isReal :: UnOp -> Bool Source # isFloat :: UnOp -> Bool Source # isDouble :: UnOp -> Bool Source # isRational :: UnOp -> Bool Source # isUnbounded :: UnOp -> Bool Source # isUserSort :: UnOp -> Bool Source # isChar :: UnOp -> Bool Source # isString :: UnOp -> Bool Source # isList :: UnOp -> Bool Source # isSet :: UnOp -> Bool Source # isTuple :: UnOp -> Bool Source # isMaybe :: UnOp -> Bool Source # isEither :: UnOp -> Bool Source # | |
HasKind B Source # | |
HasKind Q Source # | |
HasKind L Source # | |
Defined in Documentation.SBV.Examples.Uninterpreted.UISortAllSat | |
HasKind Integer Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Integer -> Kind Source # hasSign :: Integer -> Bool Source # intSizeOf :: Integer -> Int Source # isBoolean :: Integer -> Bool Source # isBounded :: Integer -> Bool Source # isReal :: Integer -> Bool Source # isFloat :: Integer -> Bool Source # isDouble :: Integer -> Bool Source # isRational :: Integer -> Bool Source # isFP :: Integer -> Bool Source # isUnbounded :: Integer -> Bool Source # isUserSort :: Integer -> Bool Source # isChar :: Integer -> Bool Source # isString :: Integer -> Bool Source # isList :: Integer -> Bool Source # isSet :: Integer -> Bool Source # isTuple :: Integer -> Bool Source # isMaybe :: Integer -> Bool Source # isEither :: Integer -> Bool Source # | |
HasKind () Source # | |
Defined in Data.SBV.Core.Kind Methods hasSign :: () -> Bool Source # intSizeOf :: () -> Int Source # isBoolean :: () -> Bool Source # isBounded :: () -> Bool Source # isFloat :: () -> Bool Source # isDouble :: () -> Bool Source # isRational :: () -> Bool Source # isUnbounded :: () -> Bool Source # isUserSort :: () -> Bool Source # isString :: () -> Bool Source # isTuple :: () -> Bool Source # isMaybe :: () -> Bool Source # isEither :: () -> Bool Source # | |
HasKind Bool Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Bool -> Kind Source # hasSign :: Bool -> Bool Source # intSizeOf :: Bool -> Int Source # isBoolean :: Bool -> Bool Source # isBounded :: Bool -> Bool Source # isReal :: Bool -> Bool Source # isFloat :: Bool -> Bool Source # isDouble :: Bool -> Bool Source # isRational :: Bool -> Bool Source # isUnbounded :: Bool -> Bool Source # isUserSort :: Bool -> Bool Source # isChar :: Bool -> Bool Source # isString :: Bool -> Bool Source # isList :: Bool -> Bool Source # isSet :: Bool -> Bool Source # isTuple :: Bool -> Bool Source # isMaybe :: Bool -> Bool Source # isEither :: Bool -> Bool Source # | |
HasKind Char Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Char -> Kind Source # hasSign :: Char -> Bool Source # intSizeOf :: Char -> Int Source # isBoolean :: Char -> Bool Source # isBounded :: Char -> Bool Source # isReal :: Char -> Bool Source # isFloat :: Char -> Bool Source # isDouble :: Char -> Bool Source # isRational :: Char -> Bool Source # isUnbounded :: Char -> Bool Source # isUserSort :: Char -> Bool Source # isChar :: Char -> Bool Source # isString :: Char -> Bool Source # isList :: Char -> Bool Source # isSet :: Char -> Bool Source # isTuple :: Char -> Bool Source # isMaybe :: Char -> Bool Source # isEither :: Char -> Bool Source # | |
HasKind Double Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Double -> Kind Source # hasSign :: Double -> Bool Source # intSizeOf :: Double -> Int Source # isBoolean :: Double -> Bool Source # isBounded :: Double -> Bool Source # isReal :: Double -> Bool Source # isFloat :: Double -> Bool Source # isDouble :: Double -> Bool Source # isRational :: Double -> Bool Source # isFP :: Double -> Bool Source # isUnbounded :: Double -> Bool Source # isUserSort :: Double -> Bool Source # isChar :: Double -> Bool Source # isString :: Double -> Bool Source # isList :: Double -> Bool Source # isSet :: Double -> Bool Source # isTuple :: Double -> Bool Source # isMaybe :: Double -> Bool Source # isEither :: Double -> Bool Source # | |
HasKind Float Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Float -> Kind Source # hasSign :: Float -> Bool Source # intSizeOf :: Float -> Int Source # isBoolean :: Float -> Bool Source # isBounded :: Float -> Bool Source # isReal :: Float -> Bool Source # isFloat :: Float -> Bool Source # isDouble :: Float -> Bool Source # isRational :: Float -> Bool Source # isFP :: Float -> Bool Source # isUnbounded :: Float -> Bool Source # isUserSort :: Float -> Bool Source # isChar :: Float -> Bool Source # isString :: Float -> Bool Source # isList :: Float -> Bool Source # isSet :: Float -> Bool Source # isTuple :: Float -> Bool Source # isMaybe :: Float -> Bool Source # isEither :: Float -> Bool Source # | |
HasKind a => HasKind (RCSet a) Source # | |
Defined in Data.SBV.Core.Concrete Methods kindOf :: RCSet a -> Kind Source # hasSign :: RCSet a -> Bool Source # intSizeOf :: RCSet a -> Int Source # isBoolean :: RCSet a -> Bool Source # isBounded :: RCSet a -> Bool Source # isReal :: RCSet a -> Bool Source # isFloat :: RCSet a -> Bool Source # isDouble :: RCSet a -> Bool Source # isRational :: RCSet a -> Bool Source # isFP :: RCSet a -> Bool Source # isUnbounded :: RCSet a -> Bool Source # isUserSort :: RCSet a -> Bool Source # isChar :: RCSet a -> Bool Source # isString :: RCSet a -> Bool Source # isList :: RCSet a -> Bool Source # isSet :: RCSet a -> Bool Source # isTuple :: RCSet a -> Bool Source # isMaybe :: RCSet a -> Bool Source # isEither :: RCSet a -> Bool Source # | |
HasKind a => HasKind (SBV a) Source # | |
Defined in Data.SBV.Core.Data Methods kindOf :: SBV a -> Kind Source # hasSign :: SBV a -> Bool Source # intSizeOf :: SBV a -> Int Source # isBoolean :: SBV a -> Bool Source # isBounded :: SBV a -> Bool Source # isReal :: SBV a -> Bool Source # isFloat :: SBV a -> Bool Source # isDouble :: SBV a -> Bool Source # isRational :: SBV a -> Bool Source # isFP :: SBV a -> Bool Source # isUnbounded :: SBV a -> Bool Source # isUserSort :: SBV a -> Bool Source # isChar :: SBV a -> Bool Source # isString :: SBV a -> Bool Source # isList :: SBV a -> Bool Source # isSet :: SBV a -> Bool Source # isTuple :: SBV a -> Bool Source # isMaybe :: SBV a -> Bool Source # isEither :: SBV a -> Bool Source # | |
(KnownNat n, BVIsNonZero n) => HasKind (IntN n) Source # |
|
Defined in Data.SBV.Core.Sized Methods kindOf :: IntN n -> Kind Source # hasSign :: IntN n -> Bool Source # intSizeOf :: IntN n -> Int Source # isBoolean :: IntN n -> Bool Source # isBounded :: IntN n -> Bool Source # isReal :: IntN n -> Bool Source # isFloat :: IntN n -> Bool Source # isDouble :: IntN n -> Bool Source # isRational :: IntN n -> Bool Source # isFP :: IntN n -> Bool Source # isUnbounded :: IntN n -> Bool Source # isUserSort :: IntN n -> Bool Source # isChar :: IntN n -> Bool Source # isString :: IntN n -> Bool Source # isList :: IntN n -> Bool Source # isSet :: IntN n -> Bool Source # isTuple :: IntN n -> Bool Source # isMaybe :: IntN n -> Bool Source # isEither :: IntN n -> Bool Source # | |
(KnownNat n, BVIsNonZero n) => HasKind (WordN n) Source # |
|
Defined in Data.SBV.Core.Sized Methods kindOf :: WordN n -> Kind Source # hasSign :: WordN n -> Bool Source # intSizeOf :: WordN n -> Int Source # isBoolean :: WordN n -> Bool Source # isBounded :: WordN n -> Bool Source # isReal :: WordN n -> Bool Source # isFloat :: WordN n -> Bool Source # isDouble :: WordN n -> Bool Source # isRational :: WordN n -> Bool Source # isFP :: WordN n -> Bool Source # isUnbounded :: WordN n -> Bool Source # isUserSort :: WordN n -> Bool Source # isChar :: WordN n -> Bool Source # isString :: WordN n -> Bool Source # isList :: WordN n -> Bool Source # isSet :: WordN n -> Bool Source # isTuple :: WordN n -> Bool Source # isMaybe :: WordN n -> Bool Source # isEither :: WordN n -> Bool Source # | |
HasKind a => HasKind (Maybe a) Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Maybe a -> Kind Source # hasSign :: Maybe a -> Bool Source # intSizeOf :: Maybe a -> Int Source # isBoolean :: Maybe a -> Bool Source # isBounded :: Maybe a -> Bool Source # isReal :: Maybe a -> Bool Source # isFloat :: Maybe a -> Bool Source # isDouble :: Maybe a -> Bool Source # isRational :: Maybe a -> Bool Source # isFP :: Maybe a -> Bool Source # isUnbounded :: Maybe a -> Bool Source # isUserSort :: Maybe a -> Bool Source # isChar :: Maybe a -> Bool Source # isString :: Maybe a -> Bool Source # isList :: Maybe a -> Bool Source # isSet :: Maybe a -> Bool Source # isTuple :: Maybe a -> Bool Source # isMaybe :: Maybe a -> Bool Source # isEither :: Maybe a -> Bool Source # | |
(Typeable a, HasKind a) => HasKind [a] Source # | |
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 # isRational :: [a] -> Bool Source # isUnbounded :: [a] -> Bool Source # isUserSort :: [a] -> Bool Source # isChar :: [a] -> Bool Source # isString :: [a] -> Bool Source # isList :: [a] -> Bool Source # isTuple :: [a] -> Bool Source # isMaybe :: [a] -> Bool Source # isEither :: [a] -> Bool Source # | |
(HasKind a, HasKind b) => HasKind (Either a b) Source # | |
Defined in Data.SBV.Core.Kind Methods kindOf :: Either a b -> Kind Source # hasSign :: Either a b -> Bool Source # intSizeOf :: Either a b -> Int Source # isBoolean :: Either a b -> Bool Source # isBounded :: Either a b -> Bool Source # isReal :: Either a b -> Bool Source # isFloat :: Either a b -> Bool Source # isDouble :: Either a b -> Bool Source # isRational :: Either a b -> Bool Source # isFP :: Either a b -> Bool Source # isUnbounded :: Either a b -> Bool Source # isUserSort :: Either a b -> Bool Source # isChar :: Either a b -> Bool Source # isString :: Either a b -> Bool Source # isList :: Either a b -> Bool Source # isSet :: Either a b -> Bool Source # isTuple :: Either a b -> Bool Source # isMaybe :: Either a b -> Bool Source # isEither :: Either a b -> Bool 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. |
Defined in Data.SBV.Core.Kind Methods kindOf :: Proxy a -> Kind Source # hasSign :: Proxy a -> Bool Source # intSizeOf :: Proxy a -> Int Source # isBoolean :: Proxy a -> Bool Source # isBounded :: Proxy a -> Bool Source # isReal :: Proxy a -> Bool Source # isFloat :: Proxy a -> Bool Source # isDouble :: Proxy a -> Bool Source # isRational :: Proxy a -> Bool Source # isFP :: Proxy a -> Bool Source # isUnbounded :: Proxy a -> Bool Source # isUserSort :: Proxy a -> Bool Source # isChar :: Proxy a -> Bool Source # isString :: Proxy a -> Bool Source # isList :: Proxy a -> Bool Source # isSet :: Proxy a -> Bool Source # isTuple :: Proxy a -> Bool Source # isMaybe :: Proxy a -> Bool Source # isEither :: Proxy a -> Bool Source # | |
(HasKind a, HasKind b) => HasKind (ArrayModel a b) Source # | The kind of an ArrayModel |
Defined in Data.SBV.Core.Concrete Methods kindOf :: ArrayModel a b -> Kind Source # hasSign :: ArrayModel a b -> Bool Source # intSizeOf :: ArrayModel a b -> Int Source # isBoolean :: ArrayModel a b -> Bool Source # isBounded :: ArrayModel a b -> Bool Source # isReal :: ArrayModel a b -> Bool Source # isFloat :: ArrayModel a b -> Bool Source # isDouble :: ArrayModel a b -> Bool Source # isRational :: ArrayModel a b -> Bool Source # isFP :: ArrayModel a b -> Bool Source # isUnbounded :: ArrayModel a b -> Bool Source # isUserSort :: ArrayModel a b -> Bool Source # isChar :: ArrayModel a b -> Bool Source # isString :: ArrayModel a b -> Bool Source # isList :: ArrayModel a b -> Bool Source # isSet :: ArrayModel a b -> Bool Source # isTuple :: ArrayModel a b -> Bool Source # isMaybe :: ArrayModel a b -> Bool Source # isEither :: ArrayModel a b -> Bool Source # isArray :: ArrayModel a b -> Bool Source # showType :: ArrayModel a b -> String Source # | |
ValidFloat eb sb => HasKind (FloatingPoint eb sb) Source # | |
Defined in Data.SBV.Core.Model Methods kindOf :: FloatingPoint eb sb -> Kind Source # hasSign :: FloatingPoint eb sb -> Bool Source # intSizeOf :: FloatingPoint eb sb -> Int Source # isBoolean :: FloatingPoint eb sb -> Bool Source # isBounded :: FloatingPoint eb sb -> Bool Source # isReal :: FloatingPoint eb sb -> Bool Source # isFloat :: FloatingPoint eb sb -> Bool Source # isDouble :: FloatingPoint eb sb -> Bool Source # isRational :: FloatingPoint eb sb -> Bool Source # isFP :: FloatingPoint eb sb -> Bool Source # isUnbounded :: FloatingPoint eb sb -> Bool Source # isUserSort :: FloatingPoint eb sb -> Bool Source # isChar :: FloatingPoint eb sb -> Bool Source # isString :: FloatingPoint eb sb -> Bool Source # isList :: FloatingPoint eb sb -> Bool Source # isSet :: FloatingPoint eb sb -> Bool Source # isTuple :: FloatingPoint eb sb -> Bool Source # isMaybe :: FloatingPoint eb sb -> Bool Source # isEither :: FloatingPoint eb sb -> Bool Source # isArray :: FloatingPoint eb sb -> Bool Source # showType :: FloatingPoint eb sb -> String Source # | |
(HasKind a, HasKind b) => HasKind (a, b) Source # | |
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 # isRational :: (a, b) -> Bool Source # isFP :: (a, b) -> Bool Source # isUnbounded :: (a, b) -> Bool Source # isUserSort :: (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 # | |
(HasKind a, HasKind b) => HasKind (a -> b) Source # | |
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 # isRational :: (a -> b) -> Bool Source # isFP :: (a -> b) -> Bool Source # isUnbounded :: (a -> b) -> Bool Source # isUserSort :: (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 # | |
(HasKind a, HasKind b, HasKind c) => HasKind (a, b, c) Source # | |
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 # isRational :: (a, b, c) -> Bool Source # isFP :: (a, b, c) -> Bool Source # isUnbounded :: (a, b, c) -> Bool Source # isUserSort :: (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 # | |
(HasKind a, HasKind b, HasKind c, HasKind d) => HasKind (a, b, c, d) Source # | |
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 # isRational :: (a, b, c, d) -> Bool Source # isFP :: (a, b, c, d) -> Bool Source # isUnbounded :: (a, b, c, d) -> Bool Source # isUserSort :: (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 # | |
(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e) => HasKind (a, b, c, d, e) Source # | |
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 # isRational :: (a, b, c, d, e) -> Bool Source # isFP :: (a, b, c, d, e) -> Bool Source # isUnbounded :: (a, b, c, d, e) -> Bool Source # isUserSort :: (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 # | |
(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e, HasKind f) => HasKind (a, b, c, d, e, f) Source # | |
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 # isRational :: (a, b, c, d, e, f) -> Bool Source # isFP :: (a, b, c, d, e, f) -> Bool Source # isUnbounded :: (a, b, c, d, e, f) -> Bool Source # isUserSort :: (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 # | |
(HasKind a, HasKind b, HasKind c, HasKind d, HasKind e, HasKind f, HasKind g) => HasKind (a, b, c, d, e, f, g) Source # | |
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 # isRational :: (a, b, c, d, e, f, g) -> Bool Source # isFP :: (a, b, c, d, e, f, g) -> Bool Source # isUnbounded :: (a, b, c, d, e, f, g) -> Bool Source # isUserSort :: (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 # | |
(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 # | |
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 # isRational :: (a, b, c, d, e, f, g, h) -> Bool Source # isFP :: (a, b, c, d, e, f, g, h) -> Bool Source # isUnbounded :: (a, b, c, d, e, f, g, h) -> Bool Source # isUserSort :: (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 # |
Kind of symbolic value
Constructors
KBool | |
KBounded !Bool !Int | |
KUnbounded | |
KReal | |
KUserSort String (Maybe [String]) | |
KFloat | |
KDouble | |
KFP !Int !Int | |
KChar | |
KString | |
KList Kind | |
KSet Kind | |
KTuple [Kind] | |
KMaybe Kind | |
KRational | |
KEither Kind Kind | |
KArray Kind Kind |
Instances
NFData Kind Source # | |||||
Defined in Data.SBV.Core.Kind | |||||
Data Kind Source # | |||||
Defined in Data.SBV.Core.Kind Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Kind -> c Kind # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Kind # dataTypeOf :: Kind -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Kind) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Kind) # gmapT :: (forall b. Data b => b -> b) -> Kind -> Kind # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Kind -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Kind -> r # gmapQ :: (forall d. Data d => d -> u) -> Kind -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Kind -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Kind -> m Kind # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Kind -> m Kind # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Kind -> m Kind # | |||||
Generic Kind Source # | |||||
Defined in Data.SBV.Core.Kind Associated Types
| |||||
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 | ||||
Eq Kind Source # | |||||
Ord Kind Source # | |||||
HasKind Kind Source # | |||||
Defined in Data.SBV.Core.Kind Methods kindOf :: Kind -> Kind Source # hasSign :: Kind -> Bool Source # intSizeOf :: Kind -> Int Source # isBoolean :: Kind -> Bool Source # isBounded :: Kind -> Bool Source # isReal :: Kind -> Bool Source # isFloat :: Kind -> Bool Source # isDouble :: Kind -> Bool Source # isRational :: Kind -> Bool Source # isUnbounded :: Kind -> Bool Source # isUserSort :: Kind -> Bool Source # isChar :: Kind -> Bool Source # isString :: Kind -> Bool Source # isList :: Kind -> Bool Source # isSet :: Kind -> Bool Source # isTuple :: Kind -> Bool Source # isMaybe :: Kind -> Bool Source # isEither :: Kind -> Bool Source # | |||||
type Rep Kind Source # | |||||
Defined in Data.SBV.Core.Kind type Rep Kind = D1 ('MetaData "Kind" "Data.SBV.Core.Kind" "sbv-11.4-inplace" 'False) ((((C1 ('MetaCons "KBool" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KBounded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "KUnbounded" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KReal" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "KUserSort" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [String]))) :+: C1 ('MetaCons "KFloat" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "KDouble" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KFP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))))) :+: (((C1 ('MetaCons "KChar" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KString" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "KList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind)) :+: C1 ('MetaCons "KSet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind)))) :+: ((C1 ('MetaCons "KTuple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Kind])) :+: C1 ('MetaCons "KMaybe" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind))) :+: (C1 ('MetaCons "KRational" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KEither" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind)) :+: C1 ('MetaCons "KArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind))))))) |
class (HasKind a, Typeable a) => SymVal a Source #
A SymVal
is a potential symbolic value that can be created instances of to be fed to a symbolic program.
Instances
SymVal Int16 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Int16) Source # literal :: Int16 -> SBV Int16 Source # fromCV :: CV -> Int16 Source # isConcretely :: SBV Int16 -> (Int16 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Int16) Source # free_ :: MonadSymbolic m => m (SBV Int16) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Int16] Source # symbolic :: MonadSymbolic m => String -> m (SBV Int16) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Int16] Source # unliteral :: SBV Int16 -> Maybe Int16 Source # | |
SymVal Int32 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Int32) Source # literal :: Int32 -> SBV Int32 Source # fromCV :: CV -> Int32 Source # isConcretely :: SBV Int32 -> (Int32 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Int32) Source # free_ :: MonadSymbolic m => m (SBV Int32) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Int32] Source # symbolic :: MonadSymbolic m => String -> m (SBV Int32) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Int32] Source # unliteral :: SBV Int32 -> Maybe Int32 Source # | |
SymVal Int64 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Int64) Source # literal :: Int64 -> SBV Int64 Source # fromCV :: CV -> Int64 Source # isConcretely :: SBV Int64 -> (Int64 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Int64) Source # free_ :: MonadSymbolic m => m (SBV Int64) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Int64] Source # symbolic :: MonadSymbolic m => String -> m (SBV Int64) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Int64] Source # unliteral :: SBV Int64 -> Maybe Int64 Source # | |
SymVal Int8 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Int8) Source # literal :: Int8 -> SBV Int8 Source # isConcretely :: SBV Int8 -> (Int8 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Int8) Source # free_ :: MonadSymbolic m => m (SBV Int8) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Int8] Source # symbolic :: MonadSymbolic m => String -> m (SBV Int8) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Int8] Source # unliteral :: SBV Int8 -> Maybe Int8 Source # | |
SymVal Rational Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Rational) Source # literal :: Rational -> SBV Rational Source # fromCV :: CV -> Rational Source # isConcretely :: SBV Rational -> (Rational -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Rational) Source # free_ :: MonadSymbolic m => m (SBV Rational) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Rational] Source # symbolic :: MonadSymbolic m => String -> m (SBV Rational) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Rational] Source # unliteral :: SBV Rational -> Maybe Rational Source # | |
SymVal Word16 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Word16) Source # literal :: Word16 -> SBV Word16 Source # fromCV :: CV -> Word16 Source # isConcretely :: SBV Word16 -> (Word16 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Word16) Source # free_ :: MonadSymbolic m => m (SBV Word16) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Word16] Source # symbolic :: MonadSymbolic m => String -> m (SBV Word16) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Word16] Source # unliteral :: SBV Word16 -> Maybe Word16 Source # | |
SymVal Word32 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Word32) Source # literal :: Word32 -> SBV Word32 Source # fromCV :: CV -> Word32 Source # isConcretely :: SBV Word32 -> (Word32 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Word32) Source # free_ :: MonadSymbolic m => m (SBV Word32) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Word32] Source # symbolic :: MonadSymbolic m => String -> m (SBV Word32) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Word32] Source # unliteral :: SBV Word32 -> Maybe Word32 Source # | |
SymVal Word64 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Word64) Source # literal :: Word64 -> SBV Word64 Source # fromCV :: CV -> Word64 Source # isConcretely :: SBV Word64 -> (Word64 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Word64) Source # free_ :: MonadSymbolic m => m (SBV Word64) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Word64] Source # symbolic :: MonadSymbolic m => String -> m (SBV Word64) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Word64] Source # unliteral :: SBV Word64 -> Maybe Word64 Source # | |
SymVal Word8 Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Word8) Source # literal :: Word8 -> SBV Word8 Source # fromCV :: CV -> Word8 Source # isConcretely :: SBV Word8 -> (Word8 -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Word8) Source # free_ :: MonadSymbolic m => m (SBV Word8) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Word8] Source # symbolic :: MonadSymbolic m => String -> m (SBV Word8) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Word8] Source # unliteral :: SBV Word8 -> Maybe Word8 Source # | |
SymVal AlgReal Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV AlgReal) Source # literal :: AlgReal -> SBV AlgReal Source # fromCV :: CV -> AlgReal Source # isConcretely :: SBV AlgReal -> (AlgReal -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV AlgReal) Source # free_ :: MonadSymbolic m => m (SBV AlgReal) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV AlgReal] Source # symbolic :: MonadSymbolic m => String -> m (SBV AlgReal) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV AlgReal] Source # unliteral :: SBV AlgReal -> Maybe AlgReal Source # | |
SymVal RoundingMode Source # |
|
Defined in Data.SBV.Core.Data Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV RoundingMode) Source # literal :: RoundingMode -> SBV RoundingMode Source # fromCV :: CV -> RoundingMode Source # isConcretely :: SBV RoundingMode -> (RoundingMode -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV RoundingMode) Source # free_ :: MonadSymbolic m => m (SBV RoundingMode) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV RoundingMode] Source # symbolic :: MonadSymbolic m => String -> m (SBV RoundingMode) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV RoundingMode] Source # unliteral :: SBV RoundingMode -> Maybe RoundingMode Source # isConcrete :: SBV RoundingMode -> Bool Source # isSymbolic :: SBV RoundingMode -> Bool Source # | |
SymVal T Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Basics Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV T) Source # literal :: T -> SBV T Source # isConcretely :: SBV T -> (T -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV T) Source # free_ :: MonadSymbolic m => m (SBV T) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV T] Source # symbolic :: MonadSymbolic m => String -> m (SBV T) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV T] Source # unliteral :: SBV T -> Maybe T Source # | |
SymVal Kleene Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Kleene Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Kleene) Source # literal :: Kleene -> SBV Kleene Source # fromCV :: CV -> Kleene Source # isConcretely :: SBV Kleene -> (Kleene -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Kleene) Source # free_ :: MonadSymbolic m => m (SBV Kleene) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Kleene] Source # symbolic :: MonadSymbolic m => String -> m (SBV Kleene) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Kleene] Source # unliteral :: SBV Kleene -> Maybe Kleene Source # | |
SymVal A Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Lists Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV A) Source # literal :: A -> SBV A Source # isConcretely :: SBV A -> (A -> Bool) -> Bool 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 # | |
SymVal B Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Lists Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV B) Source # literal :: B -> SBV B Source # isConcretely :: SBV B -> (B -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV B) Source # free_ :: MonadSymbolic m => m (SBV B) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV B] Source # symbolic :: MonadSymbolic m => String -> m (SBV B) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV B] Source # unliteral :: SBV B -> Maybe B Source # | |
SymVal C Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Lists Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV C) Source # literal :: C -> SBV C Source # isConcretely :: SBV C -> (C -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV C) Source # free_ :: MonadSymbolic m => m (SBV C) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV C] Source # symbolic :: MonadSymbolic m => String -> m (SBV C) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV C] Source # unliteral :: SBV C -> Maybe C Source # | |
SymVal Stroke Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.ShefferStroke Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Stroke) Source # literal :: Stroke -> SBV Stroke Source # fromCV :: CV -> Stroke Source # isConcretely :: SBV Stroke -> (Stroke -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Stroke) Source # free_ :: MonadSymbolic m => m (SBV Stroke) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Stroke] Source # symbolic :: MonadSymbolic m => String -> m (SBV Stroke) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Stroke] Source # unliteral :: SBV Stroke -> Maybe Stroke Source # | |
SymVal T Source # | |
Defined in Documentation.SBV.Examples.KnuckleDragger.Tao Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV T) Source # literal :: T -> SBV T Source # isConcretely :: SBV T -> (T -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV T) Source # free_ :: MonadSymbolic m => m (SBV T) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV T] Source # symbolic :: MonadSymbolic m => String -> m (SBV T) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV T] Source # unliteral :: SBV T -> Maybe T Source # | |
SymVal State Source # | |
Defined in Documentation.SBV.Examples.Lists.BoundedMutex Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV State) Source # literal :: State -> SBV State Source # fromCV :: CV -> State Source # isConcretely :: SBV State -> (State -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV State) Source # free_ :: MonadSymbolic m => m (SBV State) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV State] Source # symbolic :: MonadSymbolic m => String -> m (SBV State) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV State] Source # unliteral :: SBV State -> Maybe State Source # | |
SymVal E Source # | |
Defined in Documentation.SBV.Examples.Misc.Enumerate Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV E) Source # literal :: E -> SBV E Source # isConcretely :: SBV E -> (E -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV E) Source # free_ :: MonadSymbolic m => m (SBV E) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV E] Source # symbolic :: MonadSymbolic m => String -> m (SBV E) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV E] Source # unliteral :: SBV E -> Maybe E Source # | |
SymVal E Source # | |
Defined in Documentation.SBV.Examples.Misc.FirstOrderLogic Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV E) Source # literal :: E -> SBV E Source # isConcretely :: SBV E -> (E -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV E) Source # free_ :: MonadSymbolic m => m (SBV E) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV E] Source # symbolic :: MonadSymbolic m => String -> m (SBV E) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV E] Source # unliteral :: SBV E -> Maybe E Source # | |
SymVal U Source # | |
Defined in Documentation.SBV.Examples.Misc.FirstOrderLogic Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV U) Source # literal :: U -> SBV U Source # isConcretely :: SBV U -> (U -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV U) Source # free_ :: MonadSymbolic m => m (SBV U) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV U] Source # symbolic :: MonadSymbolic m => String -> m (SBV U) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV U] Source # unliteral :: SBV U -> Maybe U Source # | |
SymVal V Source # | |
Defined in Documentation.SBV.Examples.Misc.FirstOrderLogic Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV V) Source # literal :: V -> SBV V Source # isConcretely :: SBV V -> (V -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV V) Source # free_ :: MonadSymbolic m => m (SBV V) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV V] Source # symbolic :: MonadSymbolic m => String -> m (SBV V) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV V] Source # unliteral :: SBV V -> Maybe V Source # | |
SymVal HumanHeightInCm Source # | Similarly here, for the |
Defined in Documentation.SBV.Examples.Misc.Newtypes Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV HumanHeightInCm) Source # literal :: HumanHeightInCm -> SBV HumanHeightInCm Source # fromCV :: CV -> HumanHeightInCm Source # isConcretely :: SBV HumanHeightInCm -> (HumanHeightInCm -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV HumanHeightInCm) Source # free_ :: MonadSymbolic m => m (SBV HumanHeightInCm) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV HumanHeightInCm] Source # symbolic :: MonadSymbolic m => String -> m (SBV HumanHeightInCm) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV HumanHeightInCm] Source # unliteral :: SBV HumanHeightInCm -> Maybe HumanHeightInCm Source # isConcrete :: SBV HumanHeightInCm -> Bool Source # isSymbolic :: SBV HumanHeightInCm -> Bool Source # | |
SymVal Metres Source # | The |
Defined in Documentation.SBV.Examples.Misc.Newtypes Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Metres) Source # literal :: Metres -> SBV Metres Source # fromCV :: CV -> Metres Source # isConcretely :: SBV Metres -> (Metres -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Metres) Source # free_ :: MonadSymbolic m => m (SBV Metres) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Metres] Source # symbolic :: MonadSymbolic m => String -> m (SBV Metres) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Metres] Source # unliteral :: SBV Metres -> Maybe Metres Source # | |
SymVal Day Source # | |
Defined in Documentation.SBV.Examples.Optimization.Enumerate Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Day) Source # literal :: Day -> SBV Day Source # isConcretely :: SBV Day -> (Day -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Day) Source # free_ :: MonadSymbolic m => m (SBV Day) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Day] Source # symbolic :: MonadSymbolic m => String -> m (SBV Day) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Day] Source # unliteral :: SBV Day -> Maybe Day Source # | |
SymVal Day Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Birthday Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Day) Source # literal :: Day -> SBV Day Source # isConcretely :: SBV Day -> (Day -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Day) Source # free_ :: MonadSymbolic m => m (SBV Day) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Day] Source # symbolic :: MonadSymbolic m => String -> m (SBV Day) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Day] Source # unliteral :: SBV Day -> Maybe Day Source # | |
SymVal Month Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Birthday Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Month) Source # literal :: Month -> SBV Month Source # fromCV :: CV -> Month Source # isConcretely :: SBV Month -> (Month -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Month) Source # free_ :: MonadSymbolic m => m (SBV Month) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Month] Source # symbolic :: MonadSymbolic m => String -> m (SBV Month) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Month] Source # unliteral :: SBV Month -> Maybe Month Source # | |
SymVal Action Source # | |
Defined in Documentation.SBV.Examples.Puzzles.DieHard Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Action) Source # literal :: Action -> SBV Action Source # fromCV :: CV -> Action Source # isConcretely :: SBV Action -> (Action -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Action) Source # free_ :: MonadSymbolic m => m (SBV Action) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Action] Source # symbolic :: MonadSymbolic m => String -> m (SBV Action) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Action] Source # unliteral :: SBV Action -> Maybe Action Source # | |
SymVal P Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Drinker Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV P) Source # literal :: P -> SBV P Source # isConcretely :: SBV P -> (P -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV P) Source # free_ :: MonadSymbolic m => m (SBV P) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV P] Source # symbolic :: MonadSymbolic m => String -> m (SBV P) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV P] Source # unliteral :: SBV P -> Maybe P Source # | |
SymVal Beverage Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Beverage) Source # literal :: Beverage -> SBV Beverage Source # fromCV :: CV -> Beverage Source # isConcretely :: SBV Beverage -> (Beverage -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Beverage) Source # free_ :: MonadSymbolic m => m (SBV Beverage) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Beverage] Source # symbolic :: MonadSymbolic m => String -> m (SBV Beverage) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Beverage] Source # unliteral :: SBV Beverage -> Maybe Beverage Source # | |
SymVal Color Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Color) Source # literal :: Color -> SBV Color Source # fromCV :: CV -> Color Source # isConcretely :: SBV Color -> (Color -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Color) Source # free_ :: MonadSymbolic m => m (SBV Color) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Color] Source # symbolic :: MonadSymbolic m => String -> m (SBV Color) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Color] Source # unliteral :: SBV Color -> Maybe Color Source # | |
SymVal Nationality Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Nationality) Source # literal :: Nationality -> SBV Nationality Source # fromCV :: CV -> Nationality Source # isConcretely :: SBV Nationality -> (Nationality -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Nationality) Source # free_ :: MonadSymbolic m => m (SBV Nationality) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Nationality] Source # symbolic :: MonadSymbolic m => String -> m (SBV Nationality) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Nationality] Source # unliteral :: SBV Nationality -> Maybe Nationality Source # isConcrete :: SBV Nationality -> Bool Source # isSymbolic :: SBV Nationality -> Bool Source # | |
SymVal Pet Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Pet) Source # literal :: Pet -> SBV Pet Source # isConcretely :: SBV Pet -> (Pet -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Pet) Source # free_ :: MonadSymbolic m => m (SBV Pet) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Pet] Source # symbolic :: MonadSymbolic m => String -> m (SBV Pet) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Pet] Source # unliteral :: SBV Pet -> Maybe Pet Source # | |
SymVal Sport Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Fish Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Sport) Source # literal :: Sport -> SBV Sport Source # fromCV :: CV -> Sport Source # isConcretely :: SBV Sport -> (Sport -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Sport) Source # free_ :: MonadSymbolic m => m (SBV Sport) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Sport] Source # symbolic :: MonadSymbolic m => String -> m (SBV Sport) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Sport] Source # unliteral :: SBV Sport -> Maybe Sport Source # | |
SymVal Color Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Garden Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Color) Source # literal :: Color -> SBV Color Source # fromCV :: CV -> Color Source # isConcretely :: SBV Color -> (Color -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Color) Source # free_ :: MonadSymbolic m => m (SBV Color) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Color] Source # symbolic :: MonadSymbolic m => String -> m (SBV Color) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Color] Source # unliteral :: SBV Color -> Maybe Color Source # | |
SymVal Color Source # | |
Defined in Documentation.SBV.Examples.Puzzles.HexPuzzle Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Color) Source # literal :: Color -> SBV Color Source # fromCV :: CV -> Color Source # isConcretely :: SBV Color -> (Color -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Color) Source # free_ :: MonadSymbolic m => m (SBV Color) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Color] Source # symbolic :: MonadSymbolic m => String -> m (SBV Color) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Color] Source # unliteral :: SBV Color -> Maybe Color Source # | |
SymVal Identity Source # | |
Defined in Documentation.SBV.Examples.Puzzles.KnightsAndKnaves Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Identity) Source # literal :: Identity -> SBV Identity Source # fromCV :: CV -> Identity Source # isConcretely :: SBV Identity -> (Identity -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Identity) Source # free_ :: MonadSymbolic m => m (SBV Identity) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Identity] Source # symbolic :: MonadSymbolic m => String -> m (SBV Identity) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Identity] Source # unliteral :: SBV Identity -> Maybe Identity Source # | |
SymVal Inhabitant Source # | |
Defined in Documentation.SBV.Examples.Puzzles.KnightsAndKnaves Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Inhabitant) Source # literal :: Inhabitant -> SBV Inhabitant Source # fromCV :: CV -> Inhabitant Source # isConcretely :: SBV Inhabitant -> (Inhabitant -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Inhabitant) Source # free_ :: MonadSymbolic m => m (SBV Inhabitant) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Inhabitant] Source # symbolic :: MonadSymbolic m => String -> m (SBV Inhabitant) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Inhabitant] Source # unliteral :: SBV Inhabitant -> Maybe Inhabitant Source # isConcrete :: SBV Inhabitant -> Bool Source # isSymbolic :: SBV Inhabitant -> Bool Source # | |
SymVal Statement Source # | |
Defined in Documentation.SBV.Examples.Puzzles.KnightsAndKnaves Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Statement) Source # literal :: Statement -> SBV Statement Source # fromCV :: CV -> Statement Source # isConcretely :: SBV Statement -> (Statement -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Statement) Source # free_ :: MonadSymbolic m => m (SBV Statement) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Statement] Source # symbolic :: MonadSymbolic m => String -> m (SBV Statement) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Statement] Source # unliteral :: SBV Statement -> Maybe Statement Source # | |
SymVal Location Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Murder Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Location) Source # literal :: Location -> SBV Location Source # fromCV :: CV -> Location Source # isConcretely :: SBV Location -> (Location -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Location) Source # free_ :: MonadSymbolic m => m (SBV Location) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Location] Source # symbolic :: MonadSymbolic m => String -> m (SBV Location) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Location] Source # unliteral :: SBV Location -> Maybe Location Source # | |
SymVal Role Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Murder Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Role) Source # literal :: Role -> SBV Role Source # isConcretely :: SBV Role -> (Role -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Role) Source # free_ :: MonadSymbolic m => m (SBV Role) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Role] Source # symbolic :: MonadSymbolic m => String -> m (SBV Role) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Role] Source # unliteral :: SBV Role -> Maybe Role Source # | |
SymVal Sex Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Murder Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Sex) Source # literal :: Sex -> SBV Sex Source # isConcretely :: SBV Sex -> (Sex -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Sex) Source # free_ :: MonadSymbolic m => m (SBV Sex) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Sex] Source # symbolic :: MonadSymbolic m => String -> m (SBV Sex) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Sex] Source # unliteral :: SBV Sex -> Maybe Sex Source # | |
SymVal Handler Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Handler) Source # literal :: Handler -> SBV Handler Source # fromCV :: CV -> Handler Source # isConcretely :: SBV Handler -> (Handler -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Handler) Source # free_ :: MonadSymbolic m => m (SBV Handler) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Handler] Source # symbolic :: MonadSymbolic m => String -> m (SBV Handler) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Handler] Source # unliteral :: SBV Handler -> Maybe Handler Source # | |
SymVal Location Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Location) Source # literal :: Location -> SBV Location Source # fromCV :: CV -> Location Source # isConcretely :: SBV Location -> (Location -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Location) Source # free_ :: MonadSymbolic m => m (SBV Location) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Location] Source # symbolic :: MonadSymbolic m => String -> m (SBV Location) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Location] Source # unliteral :: SBV Location -> Maybe Location Source # | |
SymVal Orangutan Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Orangutans Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Orangutan) Source # literal :: Orangutan -> SBV Orangutan Source # fromCV :: CV -> Orangutan Source # isConcretely :: SBV Orangutan -> (Orangutan -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Orangutan) Source # free_ :: MonadSymbolic m => m (SBV Orangutan) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Orangutan] Source # symbolic :: MonadSymbolic m => String -> m (SBV Orangutan) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Orangutan] Source # unliteral :: SBV Orangutan -> Maybe Orangutan Source # | |
SymVal Rabbit Source # | |
Defined in Documentation.SBV.Examples.Puzzles.Rabbits Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Rabbit) Source # literal :: Rabbit -> SBV Rabbit Source # fromCV :: CV -> Rabbit Source # isConcretely :: SBV Rabbit -> (Rabbit -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Rabbit) Source # free_ :: MonadSymbolic m => m (SBV Rabbit) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Rabbit] Source # symbolic :: MonadSymbolic m => String -> m (SBV Rabbit) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Rabbit] Source # unliteral :: SBV Rabbit -> Maybe Rabbit Source # | |
SymVal Location Source # | |
Defined in Documentation.SBV.Examples.Puzzles.U2Bridge Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Location) Source # literal :: Location -> SBV Location Source # fromCV :: CV -> Location Source # isConcretely :: SBV Location -> (Location -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Location) Source # free_ :: MonadSymbolic m => m (SBV Location) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Location] Source # symbolic :: MonadSymbolic m => String -> m (SBV Location) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Location] Source # unliteral :: SBV Location -> Maybe Location Source # | |
SymVal U2Member Source # | |
Defined in Documentation.SBV.Examples.Puzzles.U2Bridge Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV U2Member) Source # literal :: U2Member -> SBV U2Member Source # fromCV :: CV -> U2Member Source # isConcretely :: SBV U2Member -> (U2Member -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV U2Member) Source # free_ :: MonadSymbolic m => m (SBV U2Member) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV U2Member] Source # symbolic :: MonadSymbolic m => String -> m (SBV U2Member) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV U2Member] Source # unliteral :: SBV U2Member -> Maybe U2Member Source # | |
SymVal Day Source # | |
Defined in Documentation.SBV.Examples.Queries.Enums Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Day) Source # literal :: Day -> SBV Day Source # isConcretely :: SBV Day -> (Day -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Day) Source # free_ :: MonadSymbolic m => m (SBV Day) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Day] Source # symbolic :: MonadSymbolic m => String -> m (SBV Day) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Day] Source # unliteral :: SBV Day -> Maybe Day Source # | |
SymVal BinOp Source # | |
Defined in Documentation.SBV.Examples.Queries.FourFours Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV BinOp) Source # literal :: BinOp -> SBV BinOp Source # fromCV :: CV -> BinOp Source # isConcretely :: SBV BinOp -> (BinOp -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV BinOp) Source # free_ :: MonadSymbolic m => m (SBV BinOp) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV BinOp] Source # symbolic :: MonadSymbolic m => String -> m (SBV BinOp) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV BinOp] Source # unliteral :: SBV BinOp -> Maybe BinOp Source # | |
SymVal UnOp Source # | |
Defined in Documentation.SBV.Examples.Queries.FourFours Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV UnOp) Source # literal :: UnOp -> SBV UnOp Source # isConcretely :: SBV UnOp -> (UnOp -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV UnOp) Source # free_ :: MonadSymbolic m => m (SBV UnOp) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV UnOp] Source # symbolic :: MonadSymbolic m => String -> m (SBV UnOp) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV UnOp] Source # unliteral :: SBV UnOp -> Maybe UnOp Source # | |
SymVal B Source # | |
Defined in Documentation.SBV.Examples.Uninterpreted.Deduce Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV B) Source # literal :: B -> SBV B Source # isConcretely :: SBV B -> (B -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV B) Source # free_ :: MonadSymbolic m => m (SBV B) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV B] Source # symbolic :: MonadSymbolic m => String -> m (SBV B) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV B] Source # unliteral :: SBV B -> Maybe B Source # | |
SymVal Q Source # | |
Defined in Documentation.SBV.Examples.Uninterpreted.Sort Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Q) Source # literal :: Q -> SBV Q Source # isConcretely :: SBV Q -> (Q -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Q) Source # free_ :: MonadSymbolic m => m (SBV Q) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Q] Source # symbolic :: MonadSymbolic m => String -> m (SBV Q) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Q] Source # unliteral :: SBV Q -> Maybe Q Source # | |
SymVal L Source # | |
Defined in Documentation.SBV.Examples.Uninterpreted.UISortAllSat Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV L) Source # literal :: L -> SBV L Source # isConcretely :: SBV L -> (L -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV L) Source # free_ :: MonadSymbolic m => m (SBV L) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV L] Source # symbolic :: MonadSymbolic m => String -> m (SBV L) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV L] Source # unliteral :: SBV L -> Maybe L Source # | |
SymVal Integer Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Integer) Source # literal :: Integer -> SBV Integer Source # fromCV :: CV -> Integer Source # isConcretely :: SBV Integer -> (Integer -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Integer) Source # free_ :: MonadSymbolic m => m (SBV Integer) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Integer] Source # symbolic :: MonadSymbolic m => String -> m (SBV Integer) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Integer] Source # unliteral :: SBV Integer -> Maybe Integer Source # | |
SymVal () Source # | SymVal for 0-tuple (i.e., unit) |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV ()) Source # literal :: () -> SBV () Source # isConcretely :: SBV () -> (() -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV ()) Source # free_ :: MonadSymbolic m => m (SBV ()) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV ()] Source # symbolic :: MonadSymbolic m => String -> m (SBV ()) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV ()] Source # unliteral :: SBV () -> Maybe () Source # isConcrete :: SBV () -> Bool Source # isSymbolic :: SBV () -> Bool Source # | |
SymVal Bool Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Bool) Source # literal :: Bool -> SBV Bool Source # isConcretely :: SBV Bool -> (Bool -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Bool) Source # free_ :: MonadSymbolic m => m (SBV Bool) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Bool] Source # symbolic :: MonadSymbolic m => String -> m (SBV Bool) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Bool] Source # unliteral :: SBV Bool -> Maybe Bool Source # | |
SymVal Char Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Char) Source # literal :: Char -> SBV Char Source # isConcretely :: SBV Char -> (Char -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Char) Source # free_ :: MonadSymbolic m => m (SBV Char) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Char] Source # symbolic :: MonadSymbolic m => String -> m (SBV Char) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Char] Source # unliteral :: SBV Char -> Maybe Char Source # | |
SymVal Double Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Double) Source # literal :: Double -> SBV Double Source # fromCV :: CV -> Double Source # isConcretely :: SBV Double -> (Double -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Double) Source # free_ :: MonadSymbolic m => m (SBV Double) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Double] Source # symbolic :: MonadSymbolic m => String -> m (SBV Double) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Double] Source # unliteral :: SBV Double -> Maybe Double Source # | |
SymVal Float Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV Float) Source # literal :: Float -> SBV Float Source # fromCV :: CV -> Float Source # isConcretely :: SBV Float -> (Float -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV Float) Source # free_ :: MonadSymbolic m => m (SBV Float) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV Float] Source # symbolic :: MonadSymbolic m => String -> m (SBV Float) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV Float] Source # unliteral :: SBV Float -> Maybe Float Source # | |
(Ord a, SymVal a) => SymVal (RCSet a) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (RCSet a)) Source # literal :: RCSet a -> SBV (RCSet a) Source # fromCV :: CV -> RCSet a Source # isConcretely :: SBV (RCSet a) -> (RCSet a -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (RCSet a)) Source # free_ :: MonadSymbolic m => m (SBV (RCSet a)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (RCSet a)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (RCSet a)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (RCSet a)] Source # unliteral :: SBV (RCSet a) -> Maybe (RCSet a) Source # | |
(KnownNat n, BVIsNonZero n) => SymVal (IntN n) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (IntN n)) Source # literal :: IntN n -> SBV (IntN n) Source # fromCV :: CV -> IntN n Source # isConcretely :: SBV (IntN n) -> (IntN n -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (IntN n)) Source # free_ :: MonadSymbolic m => m (SBV (IntN n)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (IntN n)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (IntN n)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (IntN n)] Source # unliteral :: SBV (IntN n) -> Maybe (IntN n) Source # | |
(KnownNat n, BVIsNonZero n) => SymVal (WordN n) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (WordN n)) Source # literal :: WordN n -> SBV (WordN n) Source # fromCV :: CV -> WordN n Source # isConcretely :: SBV (WordN n) -> (WordN n -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (WordN n)) Source # free_ :: MonadSymbolic m => m (SBV (WordN n)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (WordN n)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (WordN n)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (WordN n)] Source # unliteral :: SBV (WordN n) -> Maybe (WordN n) Source # | |
SymVal a => SymVal (Maybe a) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (Maybe a)) Source # literal :: Maybe a -> SBV (Maybe a) Source # fromCV :: CV -> Maybe a Source # isConcretely :: SBV (Maybe a) -> (Maybe a -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (Maybe a)) Source # free_ :: MonadSymbolic m => m (SBV (Maybe a)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (Maybe a)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (Maybe a)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (Maybe a)] Source # unliteral :: SBV (Maybe a) -> Maybe (Maybe a) Source # | |
SymVal a => SymVal [a] Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV [a]) Source # literal :: [a] -> SBV [a] Source # isConcretely :: SBV [a] -> ([a] -> Bool) -> Bool 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 b) => SymVal (Either a b) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (Either a b)) Source # literal :: Either a b -> SBV (Either a b) Source # fromCV :: CV -> Either a b Source # isConcretely :: SBV (Either a b) -> (Either a b -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (Either a b)) Source # free_ :: MonadSymbolic m => m (SBV (Either a b)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (Either a b)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (Either a b)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (Either a b)] Source # unliteral :: SBV (Either a b) -> Maybe (Either a b) Source # | |
(HasKind a, HasKind b, SymVal a, SymVal b) => SymVal (ArrayModel a b) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (ArrayModel a b)) Source # literal :: ArrayModel a b -> SBV (ArrayModel a b) Source # fromCV :: CV -> ArrayModel a b Source # isConcretely :: SBV (ArrayModel a b) -> (ArrayModel a b -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (ArrayModel a b)) Source # free_ :: MonadSymbolic m => m (SBV (ArrayModel a b)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (ArrayModel a b)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (ArrayModel a b)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (ArrayModel a b)] Source # unliteral :: SBV (ArrayModel a b) -> Maybe (ArrayModel a b) Source # isConcrete :: SBV (ArrayModel a b) -> Bool Source # isSymbolic :: SBV (ArrayModel a b) -> Bool Source # | |
ValidFloat eb sb => SymVal (FloatingPoint eb sb) Source # | |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> Maybe String -> m (SBV (FloatingPoint eb sb)) Source # literal :: FloatingPoint eb sb -> SBV (FloatingPoint eb sb) Source # fromCV :: CV -> FloatingPoint eb sb Source # isConcretely :: SBV (FloatingPoint eb sb) -> (FloatingPoint eb sb -> Bool) -> Bool Source # free :: MonadSymbolic m => String -> m (SBV (FloatingPoint eb sb)) Source # free_ :: MonadSymbolic m => m (SBV (FloatingPoint eb sb)) Source # mkFreeVars :: MonadSymbolic m => Int -> m [SBV (FloatingPoint eb sb)] Source # symbolic :: MonadSymbolic m => String -> m (SBV (FloatingPoint eb sb)) Source # symbolics :: MonadSymbolic m => [String] -> m [SBV (FloatingPoint eb sb)] Source # unliteral :: SBV (FloatingPoint eb sb) -> Maybe (FloatingPoint eb sb) Source # isConcrete :: SBV (FloatingPoint eb sb) -> Bool Source # isSymbolic :: SBV (FloatingPoint eb sb) -> Bool Source # | |
(SymVal a, SymVal b) => SymVal (a, b) Source # | SymVal for 2-tuples |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 |
Defined in Data.SBV.Core.Model Methods mkSymVal :: MonadSymbolic m => VarContext -> 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 # 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 # |
free :: SymVal a => String -> Symbolic (SBV a) Source #
Create a free variable, universal in a proof, existential in sat
NB. For a version which generalizes over the underlying monad, see free
free_ :: SymVal a => Symbolic (SBV a) Source #
Create an unnamed free variable, universal in proof, existential in sat
NB. For a version which generalizes over the underlying monad, see free_
mkFreeVars :: SymVal a => Int -> Symbolic [SBV a] Source #
Create a bunch of free vars
NB. For a version which generalizes over the underlying monad, see mkFreeVars
symbolic :: SymVal a => String -> Symbolic (SBV a) Source #
Similar to free; Just a more convenient name
NB. For a version which generalizes over the underlying monad, see symbolic
symbolics :: SymVal a => [String] -> Symbolic [SBV a] Source #
Similar to mkFreeVars; but automatically gives names based on the strings
NB. For a version which generalizes over the underlying monad, see symbolics
isConcretely :: SymVal a => SBV a -> (a -> Bool) -> Bool Source #
Does it concretely satisfy the given predicate?
mkSymVal :: SymVal a => VarContext -> Maybe String -> Symbolic (SBV a) Source #
One stop allocator
NB. For a version which generalizes over the underlying monad, see mkSymVal
class MonadIO m => MonadSymbolic (m :: Type -> Type) 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 #
default symbolicEnv :: forall (t :: (Type -> Type) -> Type -> Type) (m' :: Type -> Type). (MonadTrans t, MonadSymbolic m', m ~ t m') => m State Source #
Instances
MonadSymbolic SBVCodeGen Source # | |
Defined in Data.SBV.Compilers.CodeGen Methods | |
MonadSymbolic Query Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: Query State Source # | |
MonadSymbolic Alloc Source # | |
Defined in Documentation.SBV.Examples.Transformers.SymbolicEval Methods symbolicEnv :: Alloc State Source # | |
MonadIO m => MonadSymbolic (SymbolicT m) Source # |
|
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: SymbolicT m State Source # | |
MonadSymbolic m => MonadSymbolic (MaybeT m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: MaybeT m State Source # | |
MonadSymbolic m => MonadSymbolic (ExceptT e m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: ExceptT e m State Source # | |
MonadSymbolic m => MonadSymbolic (ReaderT r m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: ReaderT r m State Source # | |
MonadSymbolic m => MonadSymbolic (StateT s m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: StateT s m State Source # | |
MonadSymbolic m => MonadSymbolic (StateT s m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: StateT s m State Source # | |
(MonadSymbolic m, Monoid w) => MonadSymbolic (WriterT w m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: WriterT w m State Source # | |
(MonadSymbolic m, Monoid w) => MonadSymbolic (WriterT w m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: WriterT w m State Source # |
data SymbolicT (m :: Type -> Type) a Source #
A generalization of Symbolic
.
Instances
MonadTrans SymbolicT Source # | |
Defined in Data.SBV.Core.Symbolic | |
MonadError e m => MonadError e (SymbolicT m) Source # | |
Defined in Data.SBV.Core.Symbolic Methods throwError :: e -> SymbolicT m a # catchError :: SymbolicT m a -> (e -> SymbolicT m a) -> SymbolicT m a # | |
MonadReader r m => MonadReader r (SymbolicT m) Source # | |
MonadState s m => MonadState s (SymbolicT m) Source # | |
MonadWriter w m => MonadWriter w (SymbolicT m) Source # | |
ExtractIO m => ProvableM m (SymbolicT m SBool) Source # | |
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: SymbolicT m SBool -> SymbolicT m SBool Source # prove :: SymbolicT m SBool -> m ThmResult Source # proveWith :: SMTConfig -> SymbolicT m SBool -> m ThmResult Source # dprove :: SymbolicT m SBool -> m ThmResult Source # dproveWith :: SMTConfig -> SymbolicT m SBool -> m ThmResult Source # isVacuousProof :: SymbolicT m SBool -> m Bool Source # isVacuousProofWith :: SMTConfig -> SymbolicT m SBool -> m Bool Source # isTheorem :: SymbolicT m SBool -> m Bool Source # isTheoremWith :: SMTConfig -> SymbolicT m SBool -> m Bool Source # | |
(ExtractIO m, ProvableM m a) => ProvableM m (SymbolicT m a) Source # | |
Defined in Data.SBV.Provers.Prover Methods proofArgReduce :: SymbolicT m a -> SymbolicT m SBool Source # prove :: SymbolicT m a -> m ThmResult Source # proveWith :: SMTConfig -> SymbolicT m a -> m ThmResult Source # dprove :: SymbolicT m a -> m ThmResult Source # dproveWith :: SMTConfig -> SymbolicT m a -> m ThmResult Source # isVacuousProof :: SymbolicT m a -> m Bool Source # isVacuousProofWith :: SMTConfig -> SymbolicT m a -> m Bool Source # isTheorem :: SymbolicT m a -> m Bool Source # isTheoremWith :: SMTConfig -> SymbolicT m a -> m Bool Source # | |
(ExtractIO m, NFData a) => SExecutable m (SymbolicT m a) Source # | |
ExtractIO m => SatisfiableM m (SymbolicT m SBool) Source # | |
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: SymbolicT m SBool -> SymbolicT m SBool Source # sat :: SymbolicT m SBool -> m SatResult Source # satWith :: SMTConfig -> SymbolicT m SBool -> m SatResult Source # dsat :: SymbolicT m SBool -> m SatResult Source # dsatWith :: SMTConfig -> SymbolicT m SBool -> m SatResult Source # allSat :: SymbolicT m SBool -> m AllSatResult Source # allSatWith :: SMTConfig -> SymbolicT m SBool -> m AllSatResult Source # isSatisfiable :: SymbolicT m SBool -> m Bool Source # isSatisfiableWith :: SMTConfig -> SymbolicT m SBool -> m Bool Source # optimize :: OptimizeStyle -> SymbolicT m SBool -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> SymbolicT m SBool -> m OptimizeResult Source # | |
ExtractIO m => SatisfiableM m (SymbolicT m ()) Source # | |
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: SymbolicT m () -> SymbolicT m SBool Source # sat :: SymbolicT m () -> m SatResult Source # satWith :: SMTConfig -> SymbolicT m () -> m SatResult Source # dsat :: SymbolicT m () -> m SatResult Source # dsatWith :: SMTConfig -> SymbolicT m () -> m SatResult Source # allSat :: SymbolicT m () -> m AllSatResult Source # allSatWith :: SMTConfig -> SymbolicT m () -> m AllSatResult Source # isSatisfiable :: SymbolicT m () -> m Bool Source # isSatisfiableWith :: SMTConfig -> SymbolicT m () -> m Bool Source # optimize :: OptimizeStyle -> SymbolicT m () -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> SymbolicT m () -> m OptimizeResult Source # | |
(ExtractIO m, SatisfiableM m a) => SatisfiableM m (SymbolicT m a) Source # | |
Defined in Data.SBV.Provers.Prover Methods satArgReduce :: SymbolicT m a -> SymbolicT m SBool Source # sat :: SymbolicT m a -> m SatResult Source # satWith :: SMTConfig -> SymbolicT m a -> m SatResult Source # dsat :: SymbolicT m a -> m SatResult Source # dsatWith :: SMTConfig -> SymbolicT m a -> m SatResult Source # allSat :: SymbolicT m a -> m AllSatResult Source # allSatWith :: SMTConfig -> SymbolicT m a -> m AllSatResult Source # isSatisfiable :: SymbolicT m a -> m Bool Source # isSatisfiableWith :: SMTConfig -> SymbolicT m a -> m Bool Source # optimize :: OptimizeStyle -> SymbolicT m a -> m OptimizeResult Source # optimizeWith :: SMTConfig -> OptimizeStyle -> SymbolicT m a -> m OptimizeResult Source # | |
Testable (Symbolic SBool) Source # | |
Testable (Symbolic SVal) Source # | |
Applicative m => Applicative (SymbolicT m) Source # | |
Defined in Data.SBV.Core.Symbolic | |
Functor m => Functor (SymbolicT m) Source # | |
Monad m => Monad (SymbolicT m) Source # | |
MonadFail m => MonadFail (SymbolicT m) Source # | |
Defined in Data.SBV.Core.Symbolic | |
MonadIO m => MonadIO (SymbolicT m) Source # | |
Defined in Data.SBV.Core.Symbolic | |
MonadIO m => SolverContext (SymbolicT m) Source # | Symbolic computations provide a context for writing symbolic programs. |
Defined in Data.SBV.Core.Model Methods constrain :: QuantifiedBool a => a -> SymbolicT m () Source # softConstrain :: QuantifiedBool a => a -> SymbolicT m () Source # namedConstraint :: QuantifiedBool a => String -> a -> SymbolicT m () Source # constrainWithAttribute :: QuantifiedBool a => [(String, String)] -> a -> SymbolicT m () Source # setInfo :: String -> [String] -> SymbolicT m () Source # setOption :: SMTOption -> SymbolicT m () Source # setLogic :: Logic -> SymbolicT m () Source # setTimeOut :: Integer -> SymbolicT m () Source # contextState :: SymbolicT m State Source # | |
MonadIO m => MonadSymbolic (SymbolicT m) Source # |
|
Defined in Data.SBV.Core.Symbolic Methods symbolicEnv :: SymbolicT m State Source # |
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 => a -> Symbolic a Source #
Mark an interim result as an output. Useful when constructing Symbolic programs that return multiple values, or when the result is programmatically computed.
NB. For a version which generalizes over the underlying monad, see output
runSMT :: Symbolic a -> IO a Source #
Run an arbitrary symbolic computation, equivalent to runSMTWith
defaultSMTCfg
NB. For a version which generalizes over the underlying monad, see runSMT
runSMTWith :: SMTConfig -> Symbolic a -> IO a Source #
Runs an arbitrary symbolic computation, exposed to the user in SAT mode
NB. For a version which generalizes over the underlying monad, see runSMTWith
some :: (SymVal a, HasKind a) => String -> (SBV a -> SBool) -> SBV a Source #
Choose a value that satisfies the given predicate. This is Hillbert's choice, essentially. Note that
if the predicate given is not satisfiable (for instance const sFalse
), then the element returned will be arbitrary.
The only guarantee is that if there's at least one element that satisfies the predicate, then the returned
element will be one of those that do. The returned element is not guaranteed to be unique, least, greatest etc, unless
there happens to be exactly one satisfying element.
Queriable values
class Queriable (m :: Type -> Type) a where Source #
An queriable value: Mapping between concrete/symbolic values. If your type is traversable and simply embeds
symbolic equivalents for one type, then you can simply define create
. (Which is the most common case.)
Minimal complete definition
Associated Types
type QueryResult a Source #
Methods
^ Create a new symbolic value of type a
project :: a -> QueryT m (QueryResult a) Source #
^ Extract the current value in a SAT context
default project :: forall (t :: Type -> Type) e. (a ~ t e, QueryResult (t e) ~ t (QueryResult e), Traversable t, Monad m, Queriable m e) => a -> QueryT m (QueryResult a) Source #
embed :: QueryResult a -> QueryT m a Source #
^ Create a literal value. Morally, embed
and project
are inverses of each other
via the QueryT
monad transformer.
default embed :: forall (t :: Type -> Type) e. (a ~ t e, QueryResult (t e) ~ t (QueryResult e), Traversable t, Monad m, Queriable m e) => QueryResult a -> QueryT m a Source #
Instances
Queriable IO SState Source # |
| ||||
Defined in Documentation.SBV.Examples.Puzzles.DieHard Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.BMC Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.Fibonacci Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.Strengthen Associated Types
| |||||
Queriable IO (S SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.ProofTools.Sum Associated Types
| |||||
Queriable IO (AppS (SList Integer)) Source # |
| ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Append Associated Types
| |||||
Queriable IO (IncS SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Basics Associated Types
| |||||
Queriable IO (FibS SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Fib Associated Types
| |||||
Queriable IO (GCDS SInteger) Source # | 'Queriable instance for our state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.GCD Associated Types
| |||||
SymVal a => Queriable IO (DivS (SBV a)) Source # |
| ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.IntDiv Associated Types
| |||||
SymVal a => Queriable IO (SqrtS (SBV a)) Source # | 'Queriable instance for the program state | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.IntSqrt Associated Types
| |||||
Queriable IO (SumS SInteger) Source # |
| ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Sum Associated Types
| |||||
(MonadIO m, SymVal a) => Queriable m (SBV a) Source # | Generic | ||||
Queriable IO (LenS (SList Integer) SInteger) Source # | Injection/projection from concrete and symbolic values. | ||||
Defined in Documentation.SBV.Examples.WeakestPreconditions.Length Associated Types
|
freshVar :: forall a m. (MonadIO m, MonadQuery m, SymVal a) => String -> m (SBV a) Source #
Generalization of freshVar
freshVar_ :: forall a m. (MonadIO m, MonadQuery m, SymVal a) => m (SBV a) Source #
Generalization of freshVar_
Module exports
The SBV library exports the following modules wholesale, as user programs will have to import these modules to make any sensible use of the SBV functionality.
module Data.Bits
module Data.Word
module Data.Int
module Data.Ratio