| Copyright | © Edward Kmett 2010-2014 Johan Kiviniemi 2013 |
|---|---|
| License | BSD3 |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Ersatz.Bit
Description
Synopsis
- data Bit
- assert :: MonadSAT s m => Bit -> m ()
- class Boolean b where
- bool :: Bool -> b
- true :: b
- false :: b
- (&&) :: b -> b -> b
- (||) :: b -> b -> b
- (==>) :: b -> b -> b
- not :: b -> b
- and :: Foldable t => t b -> b
- or :: Foldable t => t b -> b
- nand :: Foldable t => t b -> b
- nor :: Foldable t => t b -> b
- all :: Foldable t => (a -> b) -> t a -> b
- any :: Foldable t => (a -> b) -> t a -> b
- xor :: b -> b -> b
- choose :: b -> b -> b -> b
Documentation
A Bit provides a reference to a possibly indeterminate boolean
value that can be determined by an external SAT solver.
Constructors
| And !(Seq Bit) | |
| Xor !Bit !Bit | |
| Mux !Bit !Bit !Bit | |
| Not !Bit | |
| Var !Literal | |
| Run (forall m s. MonadSAT s m => m Bit) |
Instances
| Show Bit Source # | |
| Codec Bit Source # | |
| Variable Bit Source # | |
| Boolean Bit Source # | |
Defined in Ersatz.Bit Methods (&&) :: Bit -> Bit -> Bit Source # (||) :: Bit -> Bit -> Bit Source # (==>) :: Bit -> Bit -> Bit Source # and :: Foldable t => t Bit -> Bit Source # or :: Foldable t => t Bit -> Bit Source # nand :: Foldable t => t Bit -> Bit Source # nor :: Foldable t => t Bit -> Bit Source # all :: Foldable t => (a -> Bit) -> t a -> Bit Source # any :: Foldable t => (a -> Bit) -> t a -> Bit Source # | |
| Equatable Bit Source # | |
| Orderable Bit Source # | |
| HasBits Bit Source # | |
| type Decoded Bit Source # | |
Defined in Ersatz.Bit | |
class Boolean b where Source #
The normal Bool operators in Haskell are not overloaded. This
provides a richer set that are.
Instances for this class for product-like types can be automatically derived
for any type that is an instance of Generic
Minimal complete definition
Nothing
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.
Logical negation
and :: Foldable t => t b -> b Source #
The logical conjunction of several values.
or :: Foldable t => t b -> b Source #
The logical disjunction of several values.
nand :: Foldable t => t b -> b Source #
nor :: Foldable t => t b -> b Source #
all :: Foldable t => (a -> b) -> t a -> b Source #
The logical conjunction of the mapping of a function over several values.
any :: Foldable t => (a -> b) -> t a -> b Source #
The logical disjunction of the mapping of a function over several values.
Exclusive-or
Arguments
| :: b | False branch |
| -> b | True branch |
| -> b | Predicate/selector branch |
| -> b |
Choose between two alternatives based on a selector bit.
bool :: (Generic b, GBoolean (Rep b)) => Bool -> b Source #
Lift a Bool
(&&) :: (Generic b, GBoolean (Rep b)) => b -> b -> b infixr 3 Source #
Logical conjunction.
(||) :: (Generic b, GBoolean (Rep b)) => b -> b -> b infixr 2 Source #
Logical disjunction (inclusive or).
not :: (Generic b, GBoolean (Rep b)) => b -> b Source #
Logical negation
all :: (Foldable t, Generic b, GBoolean (Rep b)) => (a -> b) -> t a -> b Source #
The logical conjunction of the mapping of a function over several values.
any :: (Foldable t, Generic b, GBoolean (Rep b)) => (a -> b) -> t a -> b Source #
The logical disjunction of the mapping of a function over several values.
xor :: (Generic b, GBoolean (Rep b)) => b -> b -> b Source #
Exclusive-or