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 |
Synopsis
- data SAT = SAT !Int !Formula !(HashMap (StableName ()) Literal)
- class HasSAT s where
- type MonadSAT s m = (HasSAT s, MonadState s m)
- runSAT :: StateT SAT m a -> m (a, SAT)
- runSAT' :: StateT SAT Identity a -> (a, SAT)
- dimacsSAT :: StateT SAT Identity a -> ByteString
- literalExists :: MonadSAT s m => m Literal
- assertFormula :: MonadSAT s m => Formula -> m ()
- generateLiteral :: MonadSAT s m => a -> (Literal -> m ()) -> m Literal
- data QSAT = QSAT !IntSet SAT
- class HasSAT t => HasQSAT t where
- type MonadQSAT s m = (HasQSAT s, MonadState s m)
- runQSAT :: StateT QSAT m a -> m (a, QSAT)
- runQSAT' :: StateT QSAT Identity a -> (a, QSAT)
- qdimacsQSAT :: StateT QSAT Identity a -> ByteString
- literalForall :: MonadQSAT s m => m Literal
- class DIMACS t where
- dimacsComments :: t -> [ByteString]
- dimacsNumVariables :: t -> Int
- dimacsClauses :: t -> Seq IntSet
- class QDIMACS t where
- qdimacsComments :: t -> [ByteString]
- qdimacsNumVariables :: t -> Int
- qdimacsQuantified :: t -> [Quant]
- qdimacsClauses :: t -> Seq IntSet
- class WDIMACS t where
- wdimacsComments :: t -> [ByteString]
- wdimacsNumVariables :: t -> Int
- wdimacsTopWeight :: t -> Int64
- wdimacsClauses :: t -> Seq (Int64, IntSet)
- dimacs :: DIMACS t => t -> Builder
- qdimacs :: QDIMACS t => t -> Builder
- wdimacs :: WDIMACS t => t -> Builder
SAT
lastAtom :: Lens' s Int Source #
formula :: Lens' s Formula Source #
stableMap :: Lens' s (HashMap (StableName ()) Literal) Source #
type MonadSAT s m = (HasSAT s, MonadState s m) Source #
Constraint synonym for types that carry a SAT state.
literalExists :: MonadSAT s m => m Literal Source #
assertFormula :: MonadSAT s m => Formula -> m () Source #
QSAT
A (quantified) boolean formula.
Instances
Show QSAT Source # | |
Default QSAT Source # | |
Defined in Ersatz.Problem | |
QDIMACS QSAT Source # | |
Defined in Ersatz.Problem qdimacsComments :: QSAT -> [ByteString] Source # qdimacsNumVariables :: QSAT -> Int Source # qdimacsQuantified :: QSAT -> [Quant] Source # | |
HasQSAT QSAT Source # | |
HasSAT QSAT Source # | |
type MonadQSAT s m = (HasQSAT s, MonadState s m) Source #
Constraint synonym for types that carry a QSAT state.
runQSAT :: StateT QSAT m a -> m (a, QSAT) Source #
Run a QSAT
-generating state computation. Useful e.g. in ghci for
disambiguating the type of a MonadState
, HasQSAT
value.
runQSAT' :: StateT QSAT Identity a -> (a, QSAT) Source #
Run a QSAT
-generating state computation in the Identity
monad. Useful
e.g. in ghci for disambiguating the type of a MonadState
, HasQSAT
value.
qdimacsQSAT :: StateT QSAT Identity a -> ByteString Source #
literalForall :: MonadQSAT s m => m Literal Source #
DIMACS pretty printing
DIMACS file format pretty printer
This is used to generate the problem statement for a given SAT
Solver
.
dimacsComments :: t -> [ByteString] Source #
dimacsNumVariables :: t -> Int Source #
dimacsClauses :: t -> Seq IntSet Source #
Instances
DIMACS SAT Source # | |
Defined in Ersatz.Problem dimacsComments :: SAT -> [ByteString] Source # dimacsNumVariables :: SAT -> Int Source # |
class QDIMACS t where Source #
QDIMACS file format pretty printer
This is used to generate the problem statement for a given QSAT
Solver
.
qdimacsComments :: t -> [ByteString] Source #
qdimacsNumVariables :: t -> Int Source #
qdimacsQuantified :: t -> [Quant] Source #
qdimacsClauses :: t -> Seq IntSet Source #
Instances
QDIMACS QSAT Source # | |
Defined in Ersatz.Problem qdimacsComments :: QSAT -> [ByteString] Source # qdimacsNumVariables :: QSAT -> Int Source # qdimacsQuantified :: QSAT -> [Quant] Source # |
class WDIMACS t where Source #
WDIMACS file format pretty printer
This is used to generate the problem statement for a given MaxSAT
Solver
(TODO).
wdimacsComments :: t -> [ByteString] Source #
wdimacsNumVariables :: t -> Int Source #
:: t | |
-> Int64 | Specified to be 1 ≤ n < 2^63 |