Copyright | (c) Sirui Lu 2024 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- forallSet :: ConstantSymbolSet -> SymBool -> SymBool
- forallSym :: (HasCallStack, ExtractSym a) => a -> SymBool -> SymBool
- existsSet :: ConstantSymbolSet -> SymBool -> SymBool
- existsSym :: (HasCallStack, ExtractSym a) => a -> SymBool -> SymBool
- forallFresh :: (HasCallStack, ExtractSym v, MonadFresh m, GenSym spec v, TryMerge m) => spec -> (v -> FreshT Union SymBool) -> m SymBool
- existsFresh :: (HasCallStack, ExtractSym v, MonadFresh m, GenSym spec v, TryMerge m) => spec -> (v -> FreshT Union SymBool) -> m SymBool
Documentation
forallSet :: ConstantSymbolSet -> SymBool -> SymBool Source #
Forall quantifier over a set of constant symbols. Quantifier over functions is not supported.
>>>
let xsym = "x" :: TypedConstantSymbol Integer
>>>
let ysym = "y" :: TypedConstantSymbol Integer
>>>
let x = "x" :: SymInteger
>>>
let y = "y" :: SymInteger
>>>
forallSet (buildSymbolSet [xsym, ysym]) (x .== y)
(forall x :: Integer (forall y :: Integer (= x y)))
Only available with SBV 10.1.0 or later.
forallSym :: (HasCallStack, ExtractSym a) => a -> SymBool -> SymBool Source #
Forall quantifier over all symbolic constants in a value. Quantifier over functions is not supported.
>>>
let a = ["x", "y"] :: [SymInteger]
>>>
forallSym a $ sum a .== 0
(forall x :: Integer (forall y :: Integer (= (+ x y) 0)))
Only available with sbv 10.1.0 or later.
existsSet :: ConstantSymbolSet -> SymBool -> SymBool Source #
Exists quantifier over a set of constant symbols. Quantifier over functions is not supported.
>>>
let xsym = "x" :: TypedConstantSymbol Integer
>>>
let ysym = "y" :: TypedConstantSymbol Integer
>>>
let x = "x" :: SymInteger
>>>
let y = "y" :: SymInteger
>>>
existsSet (buildSymbolSet [xsym, ysym]) (x .== y)
(exists x :: Integer (exists y :: Integer (= x y)))
Only available with SBV 10.1.0 or later.
existsSym :: (HasCallStack, ExtractSym a) => a -> SymBool -> SymBool Source #
Exists quantifier over all symbolic constants in a value. Quantifier over functions is not supported.
>>>
let a = ["x", "y"] :: [SymInteger]
>>>
existsSym a $ sum a .== 0
(exists x :: Integer (exists y :: Integer (= (+ x y) 0)))
Only available with sbv 10.1.0 or later.
forallFresh :: (HasCallStack, ExtractSym v, MonadFresh m, GenSym spec v, TryMerge m) => spec -> (v -> FreshT Union SymBool) -> m SymBool Source #
Forall quantifier over symbolic constants in a freshly generated value. Quantifier over functions is not supported.
>>>
:{
x :: Fresh SymBool x = forallFresh () $ \(a :: SymBool) -> existsFresh () $ \(b :: SymBool) -> mrgReturn $ a .== b :}
>>>
runFresh x "x"
(forall x@0 :: Bool (exists x@1 :: Bool (= x@0 x@1)))
Only available with sbv 10.1.0 or later.
existsFresh :: (HasCallStack, ExtractSym v, MonadFresh m, GenSym spec v, TryMerge m) => spec -> (v -> FreshT Union SymBool) -> m SymBool Source #
Exists quantifier over symbolic constants in a freshly generated value. Quantifier over functions is not supported.
>>>
:{
x :: Fresh SymBool x = forallFresh () $ \(a :: SymBool) -> existsFresh () $ \(b :: SymBool) -> mrgReturn $ a .== b :}
>>>
runFresh x "x"
(forall x@0 :: Bool (exists x@1 :: Bool (= x@0 x@1)))
Only available with sbv 10.1.0 or later.