Safe Haskell | None |
---|---|
Language | Haskell98 |
Derived from work by Gerrit vd Geest, but with searching structures for predicates to avoid explosion of search space during resolution.
- class IsConstraint c where
- data ConstraintSolvesVia :: *
- class (CHRMatchable env c subst, VarExtractable c, VarUpdatable c subst, Typeable c, Serialize c, TTKeyable c, IsConstraint c, Ord c, Ord (TTKey c), PP c, PP (TTKey c)) => IsCHRConstraint env c subst
- class (CHRCheckable env g subst, VarExtractable g, VarUpdatable g subst, Typeable g, Serialize g, PP g) => IsCHRGuard env g subst
- class (CHRPrioEvaluatable env p subst, Typeable p, Serialize p, PP p) => IsCHRPrio env p subst
- class (IsCHRPrio env bp subst, CHRMatchable env bp subst, PP (CHRPrioEvaluatableVal bp)) => IsCHRBacktrackPrio env bp subst
- class CHREmptySubstitution subst where
- data CHRMatcherFailure :: *
- type CHRMatcher subst = StateT (CHRMatcherState subst (VarLookupKey subst)) (Either CHRMatcherFailure)
- chrmatcherRun' :: CHREmptySubstitution subst => (CHRMatcherFailure -> r) -> (subst -> CHRWaitForVarSet subst -> x -> r) -> CHRMatcher subst x -> CHRMatchEnv (VarLookupKey subst) -> StackedVarLookup subst -> r
- chrmatcherRun :: CHREmptySubstitution subst => CHRMatcher subst () -> CHRMatchEnv (VarLookupKey subst) -> subst -> Maybe (subst, CHRWaitForVarSet subst)
- chrmatcherstateEnv :: Functor f => (c -> f c) -> (a, b, c) -> f (a, b, c)
- chrmatcherstateVarLookup :: Functor f => (a -> f a) -> (a, b, c) -> f (a, b, c)
- chrMatchResolveCompareAndContinue :: (Lookup s (VarLookupKey s) (VarLookupVal s), LookupApply s s, Ord (VarLookupKey s), VarTerm (VarLookupVal s), (~) * (ExtrValVarKey (VarLookupVal s)) (VarLookupKey s)) => CHRMatchHow -> (VarLookupVal s -> VarLookupVal s -> CHRMatcher s ()) -> VarLookupVal s -> VarLookupVal s -> CHRMatcher s ()
- chrMatchSubst :: CHRMatcher subst (StackedVarLookup subst)
- chrMatchBind :: (LookupApply subst subst, Lookup subst k v, (~) * k (VarLookupKey subst), (~) * v (VarLookupVal subst)) => k -> v -> CHRMatcher subst ()
- chrMatchFail :: CHRMatcher subst a
- chrMatchFailNoBinding :: CHRMatcher subst a
- chrMatchSuccess :: CHRMatcher subst ()
- chrMatchWait :: (Ord k, (~) * k (VarLookupKey subst)) => k -> CHRMatcher subst ()
- chrMatchSucces :: CHRMatcher subst ()
- data CHRMatchEnv k :: * -> * = CHRMatchEnv {
- chrmatchenvMetaMayBind :: !(k -> Bool)
- emptyCHRMatchEnv :: CHRMatchEnv x
- class (CHREmptySubstitution subst, LookupApply subst subst, VarExtractable x, (~) * (VarLookupKey subst) (ExtrValVarKey x)) => CHRMatchable env x subst where
- type family CHRMatchableKey subst :: *
- data CHRMatchHow :: *
- chrMatchAndWaitToM :: CHRMatchable env x subst => Bool -> env -> x -> x -> CHRMatcher subst ()
- type CHRWaitForVarSet s = Set (VarLookupKey s)
- class (CHREmptySubstitution subst, LookupApply subst subst) => CHRCheckable env x subst where
- newtype Prio :: * = Prio {}
- class (Ord (CHRPrioEvaluatableVal x), Bounded (CHRPrioEvaluatableVal x)) => CHRPrioEvaluatable env x subst | x -> env subst where
- type family CHRPrioEvaluatableVal p :: *
- data CHRTrOpt :: *
- type IVar = Key
- type VarToNmMp = IntMap String
- emptyVarToNmMp :: VarToNmMp
- type NmToVarMp = HashMap String IVar
- emptyNmToVarMp :: NmToVarMp
Documentation
class IsConstraint c where #
cnstrRequiresSolve :: c -> Bool #
cnstrSolvesVia :: c -> ConstraintSolvesVia #
data ConstraintSolvesVia :: * #
class (CHRMatchable env c subst, VarExtractable c, VarUpdatable c subst, Typeable c, Serialize c, TTKeyable c, IsConstraint c, Ord c, Ord (TTKey c), PP c, PP (TTKey c)) => IsCHRConstraint env c subst Source #
(Class alias) API for constraint requirements
class (CHRCheckable env g subst, VarExtractable g, VarUpdatable g subst, Typeable g, Serialize g, PP g) => IsCHRGuard env g subst Source #
(Class alias) API for guard requirements
class (CHRPrioEvaluatable env p subst, Typeable p, Serialize p, PP p) => IsCHRPrio env p subst Source #
(Class alias) API for priority requirements
class (IsCHRPrio env bp subst, CHRMatchable env bp subst, PP (CHRPrioEvaluatableVal bp)) => IsCHRBacktrackPrio env bp subst Source #
(Class alias) API for backtrack priority requirements
type CHRMatcher subst = StateT (CHRMatcherState subst (VarLookupKey subst)) (Either CHRMatcherFailure) #
chrmatcherRun' :: CHREmptySubstitution subst => (CHRMatcherFailure -> r) -> (subst -> CHRWaitForVarSet subst -> x -> r) -> CHRMatcher subst x -> CHRMatchEnv (VarLookupKey subst) -> StackedVarLookup subst -> r #
chrmatcherRun :: CHREmptySubstitution subst => CHRMatcher subst () -> CHRMatchEnv (VarLookupKey subst) -> subst -> Maybe (subst, CHRWaitForVarSet subst) #
chrmatcherstateEnv :: Functor f => (c -> f c) -> (a, b, c) -> f (a, b, c) #
chrmatcherstateVarLookup :: Functor f => (a -> f a) -> (a, b, c) -> f (a, b, c) #
chrMatchResolveCompareAndContinue :: (Lookup s (VarLookupKey s) (VarLookupVal s), LookupApply s s, Ord (VarLookupKey s), VarTerm (VarLookupVal s), (~) * (ExtrValVarKey (VarLookupVal s)) (VarLookupKey s)) => CHRMatchHow -> (VarLookupVal s -> VarLookupVal s -> CHRMatcher s ()) -> VarLookupVal s -> VarLookupVal s -> CHRMatcher s () #
chrMatchSubst :: CHRMatcher subst (StackedVarLookup subst) #
chrMatchBind :: (LookupApply subst subst, Lookup subst k v, (~) * k (VarLookupKey subst), (~) * v (VarLookupVal subst)) => k -> v -> CHRMatcher subst () #
chrMatchFail :: CHRMatcher subst a #
chrMatchFailNoBinding :: CHRMatcher subst a #
chrMatchSuccess :: CHRMatcher subst () #
chrMatchWait :: (Ord k, (~) * k (VarLookupKey subst)) => k -> CHRMatcher subst () #
chrMatchSucces :: CHRMatcher subst () #
data CHRMatchEnv k :: * -> * #
CHRMatchEnv | |
|
emptyCHRMatchEnv :: CHRMatchEnv x #
class (CHREmptySubstitution subst, LookupApply subst subst, VarExtractable x, (~) * (VarLookupKey subst) (ExtrValVarKey x)) => CHRMatchable env x subst where #
chrMatchTo :: env -> subst -> x -> x -> Maybe subst #
chrUnify :: CHRMatchHow -> CHRMatchEnv (VarLookupKey subst) -> env -> subst -> x -> x -> Maybe subst #
chrMatchToM :: env -> x -> x -> CHRMatcher subst () #
chrUnifyM :: CHRMatchHow -> env -> x -> x -> CHRMatcher subst () #
chrBuiltinSolveM :: env -> x -> CHRMatcher subst () #
(Ord (ExtrValVarKey ()), CHREmptySubstitution subst, LookupApply subst subst, (~) * (VarLookupKey subst) (ExtrValVarKey ())) => CHRMatchable env () subst | |
CHRMatchable env x subst => CHRMatchable env [x] subst | |
CHRMatchable env x subst => CHRMatchable env (Maybe x) subst | |
type family CHRMatchableKey subst :: * #
type CHRMatchableKey (StackedVarLookup subst) | |
data CHRMatchHow :: * #
chrMatchAndWaitToM :: CHRMatchable env x subst => Bool -> env -> x -> x -> CHRMatcher subst () #
type CHRWaitForVarSet s = Set (VarLookupKey s) #
class (CHREmptySubstitution subst, LookupApply subst subst) => CHRCheckable env x subst where #
class (Ord (CHRPrioEvaluatableVal x), Bounded (CHRPrioEvaluatableVal x)) => CHRPrioEvaluatable env x subst | x -> env subst where #
chrPrioEval :: env -> subst -> x -> CHRPrioEvaluatableVal x #
chrPrioCompare :: env -> (subst, x) -> (subst, x) -> Ordering #
chrPrioLift :: CHRPrioEvaluatableVal x -> x #
type family CHRPrioEvaluatableVal p :: * #
type CHRPrioEvaluatableVal () | |