| Copyright | (c) Sirui Lu 2021-2023 |
|---|---|
| License | BSD-3-Clause (see the LICENSE file) |
| Maintainer | siruilu@cs.washington.edu |
| Stability | Experimental |
| Portability | GHC only |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Grisette.Core.Data.Class.Bool
Description
Symbolic equality
Symbolic equality. Note that we can't use Haskell's Eq class since
symbolic comparison won't necessarily return a concrete Bool value.
>>>let a = 1 :: SymInteger>>>let b = 2 :: SymInteger>>>a ==~ bfalse>>>a /=~ btrue
>>>let a = "a" :: SymInteger>>>let b = "b" :: SymInteger>>>a /=~ b(! (= a b))>>>a /=~ b(! (= a b))
Note: This type class can be derived for algebraic data types.
You may need the DerivingVia and DerivingStrategies extensions.
data X = ... deriving Generic deriving SEq via (Default X)
Instances
Auxiliary class for SEq instance derivation
Symbolic Boolean operations
class LogicalOp b where Source #
Symbolic logical operators for symbolic booleans.
>>>let t = con True :: SymBool>>>let f = con False :: SymBool>>>let a = "a" :: SymBool>>>let b = "b" :: SymBool>>>t ||~ ftrue>>>a ||~ ttrue>>>a ||~ fa>>>a ||~ b(|| a b)>>>t &&~ ffalse>>>a &&~ ta>>>a &&~ ffalse>>>a &&~ b(&& a b)>>>nots tfalse>>>nots ftrue>>>nots a(! a)>>>t `xors` ftrue>>>t `xors` tfalse>>>a `xors` t(! a)>>>a `xors` fa>>>a `xors` b(|| (&& (! a) b) (&& a (! b)))
Methods
(||~) :: b -> b -> b infixr 2 Source #
Symbolic disjunction
(&&~) :: b -> b -> b infixr 3 Source #
Symbolic conjunction
Symbolic negation
Symbolic exclusive disjunction
implies :: b -> b -> b Source #
Symbolic implication
class (SimpleMergeable b, SEq b, Eq b, LogicalOp b, Solvable Bool b, ITEOp b) => SymBoolOp b Source #
Aggregation for the operations on symbolic boolean types
ITE operator for solvable (see Grisette.Core)s, including symbolic boolean, integer, etc.
>>>let a = "a" :: SymBool>>>let b = "b" :: SymBool>>>let c = "c" :: SymBool>>>ites a b c(ite a b c)
Instances
| ITEOp SomeSymIntN Source # | |
Defined in Grisette.Core.Data.Class.Bool Methods ites :: SymBool -> SomeSymIntN -> SomeSymIntN -> SomeSymIntN Source # | |
| ITEOp SomeSymWordN Source # | |
Defined in Grisette.Core.Data.Class.Bool Methods ites :: SymBool -> SomeSymWordN -> SomeSymWordN -> SomeSymWordN Source # | |
| ITEOp SymBool Source # | |
| ITEOp SymInteger Source # | |
Defined in Grisette.Core.Data.Class.Bool Methods ites :: SymBool -> SymInteger -> SymInteger -> SymInteger Source # | |
| (ITEOp a, Mergeable a) => ITEOp (UnionM a) Source # | |
| (KnownNat n, 1 <= n) => ITEOp (SymIntN n) Source # | |
| (KnownNat n, 1 <= n) => ITEOp (SymWordN n) Source # | |
| (SupportedPrim ca, SupportedPrim cb, LinkedRep ca sa, LinkedRep cb sb) => ITEOp (sa -~> sb) Source # | |
| (SupportedPrim ca, SupportedPrim cb, LinkedRep ca sa, LinkedRep cb sb) => ITEOp (sa =~> sb) Source # | |