qlogic-0.9: A Haskell Library for Propositional Logic.

Safe HaskellNone

Qlogic.SatSolver

Synopsis

Documentation

newtype SatSolver s l r

Constructors

SatSolver (ErrorT SatError (StateT (State l) s) r) 

Instances

Monad s => MonadError SatError (SatSolver s l) 
Monad s => MonadState (State l) (SatSolver s l) 
Monad s => Monad (SatSolver s l) 
MonadIO s => MonadIO (SatSolver s l) 

class Monad s => Solver s l | s -> l where

Methods

solve :: s Bool

run :: s a -> IO a

newLit :: s l

negate :: l -> s l

addClause :: Clause l -> s Bool

getModelValue :: l -> s Bool

newtype Clause l

Constructors

Clause 

Fields

clauseToList :: [l]
 

class Typeable a => Decoder e a | e -> a, a -> e where

Methods

extract :: PA -> Maybe a

add :: a -> e -> e

Instances

(Decoder e1 a1, Decoder e2 a2) => Decoder (:&: e1 e2) (OneOf a1 a2) 

data a :&: b

Constructors

a :&: b 

Instances

(Decoder e1 a1, Decoder e2 a2) => Decoder (:&: e1 e2) (OneOf a1 a2) 

addFormula :: (Show l, Eq l, Solver s l) => PropFormula l -> SatSolver s l ()

fix :: (Eq l, Solver s l) => l -> PropFormula l -> SatSolver s l ()

value :: (Ord l, Decoder e a, Solver s l) => SatSolver s l () -> e -> IO (Either SatError e)

assignment :: (Ord l, Solver s l) => SatSolver s l () -> IO (Either SatError (Assign l))

freshLit :: Solver s l => SatSolver s l l

getAssign :: (Ord l, Solver s l) => SatSolver s l (Assign l)

runSolver :: Solver s l => SatSolver s l r -> IO (Either SatError r)

liftS :: Solver s l => s r -> SatSolver s l r

liftIO :: MonadIO m => forall a. IO a -> m a

Lift a computation from the IO monad.