monadiccp-0.7.4: Constraint Programming

Safe HaskellNone

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

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 whereSource

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

liftFD :: FDSolver s => s a -> FDInstance s aSource

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

type SpecFn s = EGEdge -> SpecFnRes sSource

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

data SpecResult t Source

Constructors

SpecResNone 
SpecResSpec t 
SpecResUnify EGVarId 

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

getEdge :: FDSolver s => EGEdgeId -> FDInstance s (Maybe EGEdge)Source

markEdge :: FDSolver s => EGEdgeId -> FDInstance s ()Source

getIntVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGPar)Source

getBoolVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGBoolPar)Source

getColVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGColPar)Source

getFullBoolSpec :: (MonadState (FDState s) m, FDSolver s) => EGVarId -> m (FDSpecInfoBool s)Source

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

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

specSubModelEx :: FDSolver s => EGModel -> (Int -> Maybe (FDSpecInfoBool s), Int -> Maybe (FDSpecInfoInt s), Int -> Maybe (FDSpecInfoCol s)) -> FDInstance s (Map EGVarId (FDSpecInfoBool s), Map EGVarId (FDSpecInfoInt s), Map EGVarId (FDSpecInfoCol s))Source

runFD :: FDSolver s => FDInstance s a -> s aSource