monadiccp-0.7.7: Constraint Programming

Safe HaskellNone
LanguageHaskell98

Control.CP.FD.FD

Synopsis

Documentation

data FDSolver s => FDInstance s a Source #

definition of FDInstance, a Solver wrapper that adds power to post boolean expressions as constraints

Instances

Monad s => Monad (FDInstance s) Source # 

Methods

(>>=) :: FDInstance s a -> (a -> FDInstance s b) -> FDInstance s b #

(>>) :: FDInstance s a -> FDInstance s b -> FDInstance s b #

return :: a -> FDInstance s a #

fail :: String -> FDInstance s a #

Functor s => Functor (FDInstance s) Source # 

Methods

fmap :: (a -> b) -> FDInstance s a -> FDInstance s b #

(<$) :: a -> FDInstance s b -> FDInstance s a #

Monad s => Applicative (FDInstance s) Source # 

Methods

pure :: a -> FDInstance s a #

(<*>) :: FDInstance s (a -> b) -> FDInstance s a -> FDInstance s b #

liftA2 :: (a -> b -> c) -> FDInstance s a -> FDInstance s b -> FDInstance s c #

(*>) :: FDInstance s a -> FDInstance s b -> FDInstance s b #

(<*) :: FDInstance s a -> FDInstance s b -> FDInstance s a #

FDSolver s => Solver (FDInstance s) Source # 

Associated Types

type Constraint (FDInstance s :: * -> *) :: * Source #

type Label (FDInstance s :: * -> *) :: * Source #

FDSolver s => Term (FDInstance s) ModelCol Source # 

Associated Types

type Help (FDInstance s :: * -> *) ModelCol :: * Source #

FDSolver s => Term (FDInstance s) ModelBool Source # 

Associated Types

type Help (FDInstance s :: * -> *) ModelBool :: * Source #

FDSolver s => Term (FDInstance s) ModelInt Source # 

Associated Types

type Help (FDInstance s :: * -> *) ModelInt :: * Source #

(FDSolver s, EnumTerm s (FDBoolTerm s)) => EnumTerm (FDInstance s) ModelBool Source # 
(FDSolver s, EnumTerm s (FDIntTerm s)) => EnumTerm (FDInstance s) ModelInt Source # 
type Constraint (FDInstance s) Source # 
type Label (FDInstance s) Source # 
type Label (FDInstance s)
type Help (FDInstance s) ModelCol Source # 
type Help (FDInstance s) ModelCol = ()
type Help (FDInstance s) ModelBool Source # 
type Help (FDInstance s) ModelBool = ()
type Help (FDInstance s) ModelInt Source # 
type Help (FDInstance s) ModelInt = ()
type TermBaseType (FDInstance s) ModelBool Source # 
type TermBaseType (FDInstance s) ModelInt Source # 

class (Solver s, Term s (FDIntTerm s), Term s (FDBoolTerm s), Eq (FDBoolSpecType s), Ord (FDBoolSpecType s), Enum (FDBoolSpecType s), Bounded (FDBoolSpecType s), Show (FDBoolSpecType s), Eq (FDIntSpecType s), Ord (FDIntSpecType s), Enum (FDIntSpecType s), Bounded (FDIntSpecType s), Show (FDIntSpecType s), Eq (FDColSpecType s), Ord (FDColSpecType s), Enum (FDColSpecType s), Bounded (FDColSpecType s), Show (FDColSpecType s), Show (FDIntSpec s), Show (FDColSpec s), Show (FDBoolSpec s)) => FDSolver s where Source #

A solver needs to be an instance of this FDSolver class in order to create an FDInstance around it.

Associated Types

type FDIntTerm s :: * Source #

type FDBoolTerm s :: * Source #

type FDIntSpec s :: * Source #

type FDBoolSpec s :: * Source #

type FDColSpec s :: * Source #

type FDIntSpecType s :: * Source #

type FDBoolSpecType s :: * Source #

type FDColSpecType s :: * Source #

Methods

fdIntSpec_const :: EGPar -> (FDIntSpecType s, s (FDIntSpec s)) Source #

fdBoolSpec_const :: EGBoolPar -> (FDBoolSpecType s, s (FDBoolSpec s)) Source #

fdColSpec_const :: EGColPar -> (FDColSpecType s, s (FDColSpec s)) Source #

fdColSpec_list :: [FDIntSpec s] -> (FDColSpecType s, s (FDColSpec s)) Source #

fdIntSpec_term :: FDIntTerm s -> (FDIntSpecType s, s (FDIntSpec s)) Source #

fdBoolSpec_term :: FDBoolTerm s -> (FDBoolSpecType s, s (FDBoolSpec s)) Source #

fdColSpec_size :: EGPar -> (FDColSpecType s, s (FDColSpec s)) Source #

fdIntVarSpec :: FDIntSpec s -> s (Maybe (FDIntTerm s)) Source #

fdBoolVarSpec :: FDBoolSpec s -> s (Maybe (FDBoolTerm s)) Source #

fdTypeReqBool :: s (EGEdge -> [(EGVarId, FDBoolSpecTypeSet s)]) Source #

fdTypeReqInt :: s (EGEdge -> [(EGVarId, FDIntSpecTypeSet s)]) Source #

fdTypeReqCol :: s (EGEdge -> [(EGVarId, FDColSpecTypeSet s)]) Source #

fdTypeVarInt :: s (Set (FDIntSpecType s)) Source #

fdTypeVarBool :: s (Set (FDBoolSpecType s)) Source #

fdSpecify :: Mixin (SpecFn s) Source #

fdColInspect :: FDColSpec s -> s [FDIntTerm s] Source #

fdProcess :: Mixin (EGConstraintSpec -> FDSpecInfo s -> FDInstance s ()) Source #

fdEqualBool :: FDBoolSpec s -> FDBoolSpec s -> FDInstance s () Source #

fdEqualInt :: FDIntSpec s -> FDIntSpec s -> FDInstance s () Source #

fdEqualCol :: FDColSpec s -> FDColSpec s -> FDInstance s () Source #

fdConstrainIntTerm :: FDIntTerm s -> Integer -> s (Constraint s) Source #

fdSplitIntDomain :: FDIntTerm s -> s ([Constraint s], Bool) Source #

fdSplitBoolDomain :: FDBoolTerm s -> s ([Constraint s], Bool) Source #

liftFD :: FDSolver s => s a -> FDInstance s a Source #

lift a monad action for the underlying solver to a monad action for an FDInstance around it

type SpecFnRes s = ([(Int, EGVarId, Bool, SpecBool s)], [(Int, EGVarId, Bool, SpecInt s)], [(Int, EGVarId, Bool, SpecCol s)]) Source #

getBoolSpec_ :: FDSolver s => EGVarId -> FDBoolSpecTypeSet s -> FDInstance s (Maybe (FDBoolSpecType s, FDBoolSpec s)) Source #

getIntSpec_ :: FDSolver s => EGVarId -> FDIntSpecTypeSet s -> FDInstance s (Maybe (FDIntSpecType s, FDIntSpec s)) Source #

getColSpec_ :: FDSolver s => EGVarId -> FDColSpecTypeSet s -> FDInstance s (Maybe (FDColSpecType s, FDColSpec s)) Source #

getFullIntSpec :: (FDSolver s, MonadState (FDState s) m) => EGVarId -> m (FDSpecInfoInt s) Source #

getFullColSpec :: (FDSolver s, MonadState (FDState s) m) => EGVarId -> m (FDSpecInfoCol s) Source #

runFD :: FDSolver s => FDInstance s a -> s a Source #