Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Language.Hasmtlib.Boolean
Description
This module provides a more generic version of bool-like algebras than what the Prelude does for Bool
.
The class Boolean
therefore overloads most of the Preludes operators like (&&)
.
However, as Bool
also features an instance of Boolean
, you can simply hide the Prelude ones - not having to import either qualified.
Example
import Prelude hiding (not, any, all, (&&), (||), and, or) import Language.Hasmtlib problem :: MonadSMT s m => StateT s m (Expr BoolSort, Expr BoolSort) problem = do x <- var @BoolSort y <- var let b = False || True assert $ x && y <==> and [x, y, true] && encode b ==> x && y return (x,y)
Synopsis
Class
class Boolean b where Source #
Methods
Lift a Bool
.
(&&) :: b -> b -> b infixr 3 Source #
Logical conjunction.
(||) :: b -> b -> b infixr 2 Source #
Logical disjunction (inclusive or).
(==>) :: b -> b -> b infixr 0 Source #
Logical implication.
(<==) :: b -> b -> b infixl 0 Source #
Logical implication with arrow reversed.
forall x y. (x ==> y) === (y <== x)
(<==>) :: b -> b -> b infixr 4 Source #
Logical equivalence.
Logical negation.
xor :: b -> b -> b infix 4 Source #
Exclusive-or.