Safe Haskell | None |
---|---|
Language | Haskell98 |
- module Data.Expr.Sugar
- data FDSolver s => FDInstance s a
- 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
- type FDIntTerm s :: *
- type FDBoolTerm s :: *
- type FDIntSpec s :: *
- type FDBoolSpec s :: *
- type FDColSpec s :: *
- type FDIntSpecType s :: *
- type FDBoolSpecType s :: *
- type FDColSpecType s :: *
- type FDSpecInfo s = ([FDSpecInfoBool s], [FDSpecInfoInt s], [FDSpecInfoCol s])
- data FDSpecInfoBool s = FDSpecInfoBool {
- fdspBoolSpec :: Maybe (FDBoolSpecType s) -> Maybe (FDBoolSpec s)
- fdspBoolVar :: Maybe EGVarId
- fdspBoolVal :: Maybe EGBoolPar
- fdspBoolTypes :: Set (FDBoolSpecType s)
- data FDSpecInfoInt s = FDSpecInfoInt {
- fdspIntSpec :: Maybe (FDIntSpecType s) -> Maybe (FDIntSpec s)
- fdspIntVar :: Maybe EGVarId
- fdspIntVal :: Maybe EGPar
- fdspIntTypes :: Set (FDIntSpecType s)
- data FDSpecInfoCol s = FDSpecInfoCol {
- fdspColSpec :: Maybe (FDColSpecType s) -> Maybe (FDColSpec s)
- fdspColVar :: Maybe EGVarId
- fdspColVal :: Maybe EGColPar
- fdspColTypes :: Set (FDColSpecType s)
- liftFD :: FDSolver s => s a -> FDInstance s a
- addFD :: (Show (Constraint s), FDSolver s) => Constraint s -> FDInstance s ()
- type SpecFn s = EGEdge -> SpecFnRes s
- type SpecFnRes s = ([(Int, EGVarId, Bool, SpecBool s)], [(Int, EGVarId, Bool, SpecInt s)], [(Int, EGVarId, Bool, SpecCol s)])
- data SpecResult t
- getBoolSpec_ :: FDSolver s => EGVarId -> FDBoolSpecTypeSet s -> FDInstance s (Maybe (FDBoolSpecType s, FDBoolSpec s))
- getIntSpec_ :: FDSolver s => EGVarId -> FDIntSpecTypeSet s -> FDInstance s (Maybe (FDIntSpecType s, FDIntSpec s))
- getColSpec_ :: FDSolver s => EGVarId -> FDColSpecTypeSet s -> FDInstance s (Maybe (FDColSpecType s, FDColSpec s))
- getBoolSpec :: FDSolver s => EGVarId -> FDInstance s (Maybe (FDBoolSpec s))
- getIntSpec :: FDSolver s => EGVarId -> FDInstance s (Maybe (FDIntSpec s))
- getColSpec :: (Show (FDColSpec s), FDSolver s) => EGVarId -> FDInstance s (Maybe (FDColSpec s))
- getEdge :: FDSolver s => EGEdgeId -> FDInstance s (Maybe EGEdge)
- markEdge :: FDSolver s => EGEdgeId -> FDInstance s ()
- setFailed :: FDSolver s => FDInstance s ()
- getLevel :: FDSolver s => FDInstance s Int
- getIntVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGPar)
- getBoolVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGBoolPar)
- getColVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGColPar)
- getIntTerm :: FDSolver s => [ModelInt] -> FDInstance s [FDIntTerm s]
- getBoolTerm :: FDSolver s => [ModelBool] -> FDInstance s [FDBoolTerm s]
- getColTerm :: FDSolver s => [ModelCol] -> FDColSpecType s -> FDInstance s [FDColSpec s]
- getSingleIntTerm :: FDSolver s => ModelInt -> FDInstance s (FDIntTerm s)
- getDefBoolSpec :: FDSolver s => FDSpecInfoBool s -> FDBoolSpec s
- getDefIntSpec :: FDSolver s => FDSpecInfoInt s -> FDIntSpec s
- getDefColSpec :: FDSolver s => FDSpecInfoCol s -> FDColSpec s
- getFullBoolSpec :: (FDSolver s, MonadState (FDState s) m) => EGVarId -> m (FDSpecInfoBool s)
- getFullIntSpec :: (FDSolver s, MonadState (FDState s) m) => EGVarId -> m (FDSpecInfoInt s)
- getFullColSpec :: (FDSolver s, MonadState (FDState s) m) => EGVarId -> m (FDSpecInfoCol s)
- getColItems :: FDSolver s => ModelCol -> FDColSpecType s -> FDInstance s [FDIntTerm s]
- fdSpecInfo_spec :: FDSolver s => ([Either (FDSpecInfoBool s) (FDBoolSpecType s, FDBoolSpec s)], [Either (FDSpecInfoInt s) (FDIntSpecType s, FDIntSpec s)], [Either (FDSpecInfoCol s) (FDColSpecType s, FDColSpec s)]) -> FDSpecInfo s
- specInfoBoolTerm :: FDSolver s => FDBoolTerm s -> s (FDSpecInfoBool s)
- specInfoIntTerm :: FDSolver s => FDIntTerm s -> s (FDSpecInfoInt s)
- newInt :: FDSolver s => FDInstance s ModelInt
- newBool :: FDSolver s => FDInstance s ModelBool
- newCol :: FDSolver s => FDInstance s ModelCol
- procSubModel :: FDSolver s => EGModel -> (Int -> FDSpecInfoBool s, Int -> FDSpecInfoInt s, Int -> FDSpecInfoCol s) -> FDInstance s ()
- procSubModelEx :: FDSolver s => EGModel -> (Int -> Maybe (FDSpecInfoBool s), Int -> Maybe (FDSpecInfoInt s), Int -> Maybe (FDSpecInfoCol s)) -> FDInstance s ()
- 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))
- runFD :: FDSolver s => FDInstance s a -> s a
- setMinimizeVar :: (Show (FDIntTerm s), FDSolver s) => ModelInt -> FDInstance s ()
- boundMinimize :: (Show (FDIntTerm s), FDSolver s, EnumTerm s (FDIntTerm s), Integral (TermBaseType s (FDIntTerm s))) => NewBound (FDInstance s)
- getMinimizeTerm :: (Show (FDIntTerm s), FDSolver s) => FDInstance s (Maybe (FDIntTerm s))
- getMinimizeVar :: (Show (FDIntTerm s), FDSolver s) => FDInstance s (Maybe ModelInt)
- fdNewvar :: (FDSolver s, Term s t) => FDInstance s (Maybe t)
Documentation
module Data.Expr.Sugar
data FDSolver s => FDInstance s a Source #
definition of FDInstance, a Solver wrapper that adds power to post boolean expressions as constraints
Monad s => Monad (FDInstance s) Source # | |
Functor s => Functor (FDInstance s) Source # | |
Monad s => Applicative (FDInstance s) Source # | |
FDSolver s => Solver (FDInstance s) Source # | |
FDSolver s => Term (FDInstance s) ModelCol Source # | |
FDSolver s => Term (FDInstance s) ModelBool Source # | |
FDSolver s => Term (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 Help (FDInstance s) ModelCol Source # | |
type Help (FDInstance s) ModelBool Source # | |
type Help (FDInstance s) ModelInt Source # | |
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.
fdIntSpec_const, fdBoolSpec_const, fdColSpec_const, fdColSpec_list, fdIntSpec_term, fdBoolSpec_term, fdColSpec_size, fdIntVarSpec, fdBoolVarSpec, fdColInspect, fdProcess, fdEqualBool, fdEqualInt, fdEqualCol, fdConstrainIntTerm, fdSplitIntDomain, fdSplitBoolDomain
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 #
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 #
type FDSpecInfo s = ([FDSpecInfoBool s], [FDSpecInfoInt s], [FDSpecInfoCol s]) Source #
data FDSpecInfoBool s Source #
FDSpecInfoBool | |
|
(Ord (FDBoolSpec s), Ord (FDBoolSpecType s)) => Eq (FDSpecInfoBool s) Source # | |
(Ord (FDBoolSpec s), Ord (FDBoolSpecType s)) => Ord (FDSpecInfoBool s) Source # | |
Show (FDBoolSpec s) => Show (FDSpecInfoBool s) Source # | |
data FDSpecInfoInt s Source #
FDSpecInfoInt | |
|
(Ord (FDIntSpec s), Ord (FDIntSpecType s)) => Eq (FDSpecInfoInt s) Source # | |
(Ord (FDIntSpec s), Ord (FDIntSpecType s)) => Ord (FDSpecInfoInt s) Source # | |
Show (FDIntSpec s) => Show (FDSpecInfoInt s) Source # | |
data FDSpecInfoCol s Source #
FDSpecInfoCol | |
|
(Ord (FDColSpec s), Ord (FDColSpecType s)) => Eq (FDSpecInfoCol s) Source # | |
(Ord (FDColSpec s), Ord (FDColSpecType s)) => Ord (FDSpecInfoCol s) Source # | |
Show (FDColSpec s) => Show (FDSpecInfoCol s) 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
addFD :: (Show (Constraint s), FDSolver s) => Constraint s -> FDInstance s () Source #
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 #
getBoolSpec :: FDSolver s => EGVarId -> FDInstance s (Maybe (FDBoolSpec s)) Source #
getIntSpec :: FDSolver s => EGVarId -> FDInstance s (Maybe (FDIntSpec s)) Source #
getColSpec :: (Show (FDColSpec s), FDSolver s) => EGVarId -> FDInstance s (Maybe (FDColSpec s)) Source #
setFailed :: FDSolver s => FDInstance s () Source #
getBoolVal :: FDSolver s => EGVarId -> FDInstance s (Maybe EGBoolPar) Source #
getIntTerm :: FDSolver s => [ModelInt] -> FDInstance s [FDIntTerm s] Source #
getBoolTerm :: FDSolver s => [ModelBool] -> FDInstance s [FDBoolTerm s] Source #
getColTerm :: FDSolver s => [ModelCol] -> FDColSpecType s -> FDInstance s [FDColSpec s] Source #
getSingleIntTerm :: FDSolver s => ModelInt -> FDInstance s (FDIntTerm s) Source #
getDefBoolSpec :: FDSolver s => FDSpecInfoBool s -> FDBoolSpec s Source #
getDefIntSpec :: FDSolver s => FDSpecInfoInt s -> FDIntSpec s Source #
getDefColSpec :: FDSolver s => FDSpecInfoCol s -> FDColSpec s Source #
getFullBoolSpec :: (FDSolver s, MonadState (FDState s) m) => EGVarId -> m (FDSpecInfoBool 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 #
getColItems :: FDSolver s => ModelCol -> FDColSpecType s -> FDInstance s [FDIntTerm s] Source #
fdSpecInfo_spec :: FDSolver s => ([Either (FDSpecInfoBool s) (FDBoolSpecType s, FDBoolSpec s)], [Either (FDSpecInfoInt s) (FDIntSpecType s, FDIntSpec s)], [Either (FDSpecInfoCol s) (FDColSpecType s, FDColSpec s)]) -> FDSpecInfo s Source #
specInfoBoolTerm :: FDSolver s => FDBoolTerm s -> s (FDSpecInfoBool s) Source #
specInfoIntTerm :: FDSolver s => FDIntTerm s -> s (FDSpecInfoInt s) Source #
procSubModel :: FDSolver s => EGModel -> (Int -> FDSpecInfoBool s, Int -> FDSpecInfoInt s, Int -> FDSpecInfoCol s) -> FDInstance s () Source #
procSubModelEx :: FDSolver s => EGModel -> (Int -> Maybe (FDSpecInfoBool s), Int -> Maybe (FDSpecInfoInt s), Int -> Maybe (FDSpecInfoCol s)) -> FDInstance 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 a Source #
setMinimizeVar :: (Show (FDIntTerm s), FDSolver s) => ModelInt -> FDInstance s () Source #
boundMinimize :: (Show (FDIntTerm s), FDSolver s, EnumTerm s (FDIntTerm s), Integral (TermBaseType s (FDIntTerm s))) => NewBound (FDInstance s) Source #
getMinimizeTerm :: (Show (FDIntTerm s), FDSolver s) => FDInstance s (Maybe (FDIntTerm s)) Source #
getMinimizeVar :: (Show (FDIntTerm s), FDSolver s) => FDInstance s (Maybe ModelInt) Source #