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

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

Ersatz.Problem

Contents

Description

 

Synopsis

SAT

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

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

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 -> ByteStringSource

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

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

QSAT

data QSAT Source

A (quantified) boolean formula.

Constructors

QSAT !IntSet SAT 

class HasSAT t => HasQSAT t whereSource

Instances

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 -> ByteStringSource

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

DIMACS pretty printing

class DIMACS t whereSource

DIMACS file format pretty printer

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

Instances

class QDIMACS t whereSource

QDIMACS file format pretty printer

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

Instances

class WDIMACS t whereSource

WDIMACS file format pretty printer

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

Methods

wdimacsComments :: t -> [ByteString]Source

wdimacsNumVariables :: t -> IntSource

wdimacsTopWeightSource

Arguments

:: t 
-> Int64

Specified to be 1 ≤ n < 2^63

wdimacsClauses :: t -> Set (Int64, IntSet)Source

dimacs :: DIMACS t => t -> BuilderSource

Generate a Builder out of a DIMACS problem.

qdimacs :: QDIMACS t => t -> BuilderSource

Generate a Builder out of a QDIMACS problem.

wdimacs :: WDIMACS t => t -> BuilderSource

Generate a Builder out of a WDIMACS problem.