ersatz-0.1.0.1: A monad for expressing SAT or QSAT problems using observable sharing.

Portabilitynon-portable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellNone

Ersatz.Bit

Description

 

Synopsis

Documentation

newtype Bit Source

A Bit provides a reference to a possibly indeterminate boolean value that can be determined by an external SAT solver.

Constructors

Bit (Circuit Bit) 

assert :: MonadSAT m => Bit -> m ()Source

Assert claims that in any satisf given Bit must be true in any satisfying interpretation of the current problem.

class Boolean t whereSource

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

bool :: Bool -> tSource

Lift a Bool

true :: tSource

false :: tSource

(&&) :: t -> t -> tSource

Logical conjunction.

(||) :: t -> t -> tSource

Logical disjunction (inclusive or).

(==>) :: t -> t -> tSource

Logical implication.

not :: t -> tSource

Logical negation

and :: [t] -> tSource

The logical conjunction of several values.

or :: [t] -> tSource

The logical disjunction of several values.

nand :: [t] -> tSource

The negated logical conjunction of several values.

nand = not . and

nor :: [t] -> tSource

The negated logical disjunction of several values.

nor = not . or

xor :: t -> t -> tSource

Exclusive-or

chooseSource

Arguments

:: t

False branch

-> t

True branch

-> t

Predicate/selector branch

-> t 

Choose between two alternatives based on a selector bit.