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

Copyright© Edward Kmett 2010-2014 Johan Kiviniemi 2013
LicenseBSD3
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

Ersatz.Problem

Contents

Description

 
Synopsis

SAT

data SAT #

Constructors

SAT !Int !Formula !(HashMap (StableName ()) Literal) 
Instances
Show SAT # 
Instance details

Defined in Ersatz.Problem

Methods

showsPrec :: Int -> SAT -> ShowS #

show :: SAT -> String #

showList :: [SAT] -> ShowS #

Default SAT # 
Instance details

Defined in Ersatz.Problem

Methods

def :: SAT #

DIMACS SAT # 
Instance details

Defined in Ersatz.Problem

HasSAT SAT # 
Instance details

Defined in Ersatz.Problem

class HasSAT s where #

Minimal complete definition

sat

runSAT :: StateT SAT m a -> m (a, SAT) #

Run a SAT-generating state computation. Useful e.g. in ghci for disambiguating the type of a MonadState, HasSAT value.

runSAT' :: StateT SAT Identity a -> (a, SAT) #

Run a SAT-generating state computation in the Identity monad. Useful e.g. in ghci for disambiguating the type of a MonadState, HasSAT value.

dimacsSAT :: StateT SAT Identity a -> ByteString #

Run a SAT-generating state computation and return the respective DIMACS output. Useful for testing and debugging.

assertFormula :: (MonadState s m, HasSAT s) => Formula -> m () #

generateLiteral :: (MonadState s m, HasSAT s) => a -> (Literal -> m ()) -> m Literal #

QSAT

data QSAT #

A (quantified) boolean formula.

Constructors

QSAT !IntSet SAT 
Instances
Show QSAT # 
Instance details

Defined in Ersatz.Problem

Methods

showsPrec :: Int -> QSAT -> ShowS #

show :: QSAT -> String #

showList :: [QSAT] -> ShowS #

Default QSAT # 
Instance details

Defined in Ersatz.Problem

Methods

def :: QSAT #

QDIMACS QSAT # 
Instance details

Defined in Ersatz.Problem

HasQSAT QSAT # 
Instance details

Defined in Ersatz.Problem

HasSAT QSAT # 
Instance details

Defined in Ersatz.Problem

class HasSAT t => HasQSAT t where #

Minimal complete definition

qsat

Instances
HasQSAT QSAT # 
Instance details

Defined in Ersatz.Problem

runQSAT :: StateT QSAT m a -> m (a, QSAT) #

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) #

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 #

Run a QSAT-generating state computation and return the respective QDIMACS output. Useful for testing and debugging.

DIMACS pretty printing

class DIMACS t where #

DIMACS file format pretty printer

This is used to generate the problem statement for a given SAT Solver.

Minimal complete definition

dimacsComments, dimacsNumVariables, dimacsClauses

Instances
DIMACS SAT # 
Instance details

Defined in Ersatz.Problem

class QDIMACS t where #

QDIMACS file format pretty printer

This is used to generate the problem statement for a given QSAT Solver.

Instances
QDIMACS QSAT # 
Instance details

Defined in Ersatz.Problem

class WDIMACS t where #

WDIMACS file format pretty printer

This is used to generate the problem statement for a given MaxSAT Solver (TODO).

Methods

wdimacsComments :: t -> [ByteString] #

wdimacsNumVariables :: t -> Int #

wdimacsTopWeight #

Arguments

:: t 
-> Int64

Specified to be 1 ≤ n < 2^63

wdimacsClauses :: t -> Seq (Int64, IntSet) #

dimacs :: DIMACS t => t -> Builder #

Generate a Builder out of a DIMACS problem.

qdimacs :: QDIMACS t => t -> Builder #

Generate a Builder out of a QDIMACS problem.

wdimacs :: WDIMACS t => t -> Builder #

Generate a Builder out of a WDIMACS problem.