| 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
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. (MonadState s m, HasSAT s) => m Bit) |
Instances
| Show Bit # | |
| Codec Bit # | |
| Variable Bit # | |
Defined in Ersatz.Bit | |
| Boolean Bit # | |
| Equatable Bit # | |
| Orderable Bit # | |
| HasBits Bit # | |
Defined in Ersatz.Bits | |
| type Decoded Bit # | |
Defined in Ersatz.Bit | |
assert :: (MonadState s m, HasSAT s) => Bit -> m () #
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
Methods
Lift a Bool
(&&) :: b -> b -> b infixr 3 #
Logical conjunction.
(||) :: b -> b -> b infixr 2 #
Logical disjunction (inclusive or).
(==>) :: b -> b -> b infixr 0 #
Logical implication.
Logical negation
and :: Foldable t => t b -> b #
The logical conjunction of several values.
or :: Foldable t => t b -> b #
The logical disjunction of several values.
nand :: Foldable t => t b -> b #
nor :: Foldable t => t b -> b #
all :: Foldable t => (a -> b) -> t a -> b #
The logical conjunction of the mapping of a function over several values.
any :: Foldable t => (a -> b) -> t a -> b #
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 #
Lift a Bool
(&&) :: (Generic b, GBoolean (Rep b)) => b -> b -> b infixr 3 #
Logical conjunction.
(||) :: (Generic b, GBoolean (Rep b)) => b -> b -> b infixr 2 #
Logical disjunction (inclusive or).
not :: (Generic b, GBoolean (Rep b)) => b -> b #
Logical negation
all :: (Foldable t, Generic b, GBoolean (Rep b)) => (a -> b) -> t a -> b #
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 #
The logical disjunction of the mapping of a function over several values.
xor :: (Generic b, GBoolean (Rep b)) => b -> b -> b #
Exclusive-or