packages feed

chr-core 0.1.0.4 → 0.1.1.0

raw patch · 3 files changed

+10/−4 lines, 3 filesdep ~logict-statePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: logict-state

API changes (from Hackage documentation)

- CHR.Types.Core: instance (GHC.Classes.Ord (CHR.Data.Substitutable.ExtrValVarKey ()), CHR.Types.Core.CHREmptySubstitution subst, CHR.Data.Lookup.Types.LookupApply subst subst, CHR.Data.VarLookup.VarLookupKey subst ~ CHR.Data.Substitutable.ExtrValVarKey ()) => CHR.Types.Core.CHRMatchable env () subst
- CHR.Types.Core: instance CHR.Types.Core.CHRMatchable env x subst => CHR.Types.Core.CHRMatchable env (GHC.Base.Maybe x) subst
- CHR.Types.Rule: instance (CHR.Data.Substitutable.VarExtractable c, CHR.Data.Substitutable.VarExtractable g, CHR.Data.Substitutable.ExtrValVarKey c ~ CHR.Data.Substitutable.ExtrValVarKey g) => CHR.Data.Substitutable.VarExtractable (CHR.Types.Rule.Rule c g bp p)
+ CHR.Types: type family TrTrKey x
+ CHR.Types.Core: instance (GHC.Classes.Ord (CHR.Data.Substitutable.ExtrValVarKey ()), CHR.Types.Core.CHREmptySubstitution subst, CHR.Data.Lookup.Types.LookupApply subst subst, CHR.Data.VarLookup.VarLookupKey subst GHC.Types.~ CHR.Data.Substitutable.ExtrValVarKey ()) => CHR.Types.Core.CHRMatchable env () subst
+ CHR.Types.Core: instance CHR.Types.Core.CHRMatchable env x subst => CHR.Types.Core.CHRMatchable env (GHC.Maybe.Maybe x) subst
+ CHR.Types.Core: type family CHRPrioEvaluatableVal p :: *
+ CHR.Types.Rule: instance (CHR.Data.Substitutable.VarExtractable c, CHR.Data.Substitutable.VarExtractable g, CHR.Data.Substitutable.ExtrValVarKey c GHC.Types.~ CHR.Data.Substitutable.ExtrValVarKey g) => CHR.Data.Substitutable.VarExtractable (CHR.Types.Rule.Rule c g bp p)
- CHR.Solve.MonoBacktrackPrio: CHRBackState :: !(CHRPrioEvaluatableVal bprio) -> !WorkQueue -> !WorkQueue -> [WorkInx] -> !(WorkStore cnstr) -> !(Set MatchedCombi) -> {-# UNPACK #-} !Int -> !subst -> !(Map (VarLookupKey subst) [WaitForVar subst]) -> ![SolverReductionStep] -> CHRBackState cnstr bprio subst env
+ CHR.Solve.MonoBacktrackPrio: CHRBackState :: !CHRPrioEvaluatableVal bprio -> !WorkQueue -> !WorkQueue -> [WorkInx] -> !WorkStore cnstr -> !Set MatchedCombi -> {-# UNPACK #-} !Int -> !subst -> !Map (VarLookupKey subst) [WaitForVar subst] -> ![SolverReductionStep] -> CHRBackState cnstr bprio subst env
- CHR.Solve.MonoBacktrackPrio: CHRGlobState :: !(CHRStore cnstr guard bprio prio) -> {-# UNPACK #-} !CHRInx -> !(MinPQueue (CHRPrioEvaluatableVal bprio) (CHRMonoBacktrackPrioT cnstr guard bprio prio subst env m (SolverResult subst))) -> !(SolveTrace' cnstr (StoredCHR cnstr guard bprio prio) subst) -> {-# UNPACK #-} !Int -> !VarToNmMp -> CHRGlobState cnstr guard bprio prio subst env m
+ CHR.Solve.MonoBacktrackPrio: CHRGlobState :: !CHRStore cnstr guard bprio prio -> {-# UNPACK #-} !CHRInx -> !MinPQueue (CHRPrioEvaluatableVal bprio) (CHRMonoBacktrackPrioT cnstr guard bprio prio subst env m (SolverResult subst)) -> !SolveTrace' cnstr (StoredCHR cnstr guard bprio prio) subst -> {-# UNPACK #-} !Int -> !VarToNmMp -> CHRGlobState cnstr guard bprio prio subst env m
- CHR.Solve.MonoBacktrackPrio: [_chrbstBacktrackPrio] :: CHRBackState cnstr bprio subst env -> !(CHRPrioEvaluatableVal bprio)
+ CHR.Solve.MonoBacktrackPrio: [_chrbstBacktrackPrio] :: CHRBackState cnstr bprio subst env -> !CHRPrioEvaluatableVal bprio
- CHR.Solve.MonoBacktrackPrio: [_chrbstMatchedCombis] :: CHRBackState cnstr bprio subst env -> !(Set MatchedCombi)
+ CHR.Solve.MonoBacktrackPrio: [_chrbstMatchedCombis] :: CHRBackState cnstr bprio subst env -> !Set MatchedCombi
- CHR.Solve.MonoBacktrackPrio: [_chrbstWaitForVar] :: CHRBackState cnstr bprio subst env -> !(Map (VarLookupKey subst) [WaitForVar subst])
+ CHR.Solve.MonoBacktrackPrio: [_chrbstWaitForVar] :: CHRBackState cnstr bprio subst env -> !Map (VarLookupKey subst) [WaitForVar subst]
- CHR.Solve.MonoBacktrackPrio: [_chrbstWorkStore] :: CHRBackState cnstr bprio subst env -> !(WorkStore cnstr)
+ CHR.Solve.MonoBacktrackPrio: [_chrbstWorkStore] :: CHRBackState cnstr bprio subst env -> !WorkStore cnstr
- CHR.Solve.MonoBacktrackPrio: [_chrgstScheduleQueue] :: CHRGlobState cnstr guard bprio prio subst env m -> !(MinPQueue (CHRPrioEvaluatableVal bprio) (CHRMonoBacktrackPrioT cnstr guard bprio prio subst env m (SolverResult subst)))
+ CHR.Solve.MonoBacktrackPrio: [_chrgstScheduleQueue] :: CHRGlobState cnstr guard bprio prio subst env m -> !MinPQueue (CHRPrioEvaluatableVal bprio) (CHRMonoBacktrackPrioT cnstr guard bprio prio subst env m (SolverResult subst))
- CHR.Solve.MonoBacktrackPrio: [_chrgstStore] :: CHRGlobState cnstr guard bprio prio subst env m -> !(CHRStore cnstr guard bprio prio)
+ CHR.Solve.MonoBacktrackPrio: [_chrgstStore] :: CHRGlobState cnstr guard bprio prio subst env m -> !CHRStore cnstr guard bprio prio
- CHR.Solve.MonoBacktrackPrio: [_chrgstTrace] :: CHRGlobState cnstr guard bprio prio subst env m -> !(SolveTrace' cnstr (StoredCHR cnstr guard bprio prio) subst)
+ CHR.Solve.MonoBacktrackPrio: [_chrgstTrace] :: CHRGlobState cnstr guard bprio prio subst env m -> !SolveTrace' cnstr (StoredCHR cnstr guard bprio prio) subst
- CHR.Solve.MonoBacktrackPrio: chrgstStatNrSolveSteps :: forall cnstr_apmU guard_apmV bprio_apmW prio_apmX subst_apmY env_apmZ m_apn0. Lens' (CHRGlobState cnstr_apmU guard_apmV bprio_apmW prio_apmX subst_apmY env_apmZ m_apn0) Int
+ CHR.Solve.MonoBacktrackPrio: chrgstStatNrSolveSteps :: forall cnstr_akl4 guard_akl5 bprio_akl6 prio_akl7 subst_akl8 env_akl9 m_akla. Lens' (CHRGlobState cnstr_akl4 guard_akl5 bprio_akl6 prio_akl7 subst_akl8 env_akl9 m_akla) Int
- CHR.Solve.MonoBacktrackPrio: chrgstVarToNmMp :: forall cnstr_apmU guard_apmV bprio_apmW prio_apmX subst_apmY env_apmZ m_apn0. Lens' (CHRGlobState cnstr_apmU guard_apmV bprio_apmW prio_apmX subst_apmY env_apmZ m_apn0) VarToNmMp
+ CHR.Solve.MonoBacktrackPrio: chrgstVarToNmMp :: forall cnstr_akl4 guard_akl5 bprio_akl6 prio_akl7 subst_akl8 env_akl9 m_akla. Lens' (CHRGlobState cnstr_akl4 guard_akl5 bprio_akl6 prio_akl7 subst_akl8 env_akl9 m_akla) VarToNmMp
- CHR.Types.Core: CHRMatchEnv :: !(k -> Bool) -> CHRMatchEnv k
+ CHR.Types.Core: CHRMatchEnv :: !k -> Bool -> CHRMatchEnv k
- CHR.Types.Core: [chrmatchenvMetaMayBind] :: CHRMatchEnv k -> !(k -> Bool)
+ CHR.Types.Core: [chrmatchenvMetaMayBind] :: CHRMatchEnv k -> !k -> Bool
- CHR.Types.Core: chrmatcherRun :: (CHREmptySubstitution subst) => CHRMatcher subst () -> CHRMatchEnv (VarLookupKey subst) -> subst -> Maybe (subst, CHRWaitForVarSet subst)
+ CHR.Types.Core: chrmatcherRun :: CHREmptySubstitution subst => CHRMatcher subst () -> CHRMatchEnv (VarLookupKey subst) -> subst -> Maybe (subst, CHRWaitForVarSet subst)
- CHR.Types.Core: chrmatcherRun' :: (CHREmptySubstitution subst) => (CHRMatcherFailure -> r) -> (subst -> CHRWaitForVarSet subst -> x -> r) -> CHRMatcher subst x -> CHRMatchEnv (VarLookupKey subst) -> StackedVarLookup subst -> r
+ CHR.Types.Core: chrmatcherRun' :: CHREmptySubstitution subst => (CHRMatcherFailure -> r) -> (subst -> CHRWaitForVarSet subst -> x -> r) -> CHRMatcher subst x -> CHRMatchEnv (VarLookupKey subst) -> StackedVarLookup subst -> r
- CHR.Types.Core: chrmatcherstateEnv :: Functor f => c -> f c -> (a, b, c) -> f (a, b, c)
+ CHR.Types.Core: chrmatcherstateEnv :: Functor f => (c -> f c) -> (a, b, c) -> f (a, b, c)
- CHR.Types.Core: chrmatcherstateVarLookup :: Functor f => a -> f a -> (a, b, c) -> f (a, b, c)
+ CHR.Types.Core: chrmatcherstateVarLookup :: Functor f => (a -> f a) -> (a, b, c) -> f (a, b, c)
- CHR.Types.Rule: (<==>) :: () => [a] -> [a] -> Rule a guard bprio prio
+ CHR.Types.Rule: (<==>) :: [a] -> [a] -> Rule a guard bprio prio
- CHR.Types.Rule: (<=>) :: () => [a] -> [a] -> Rule a guard bprio prio
+ CHR.Types.Rule: (<=>) :: [a] -> [a] -> Rule a guard bprio prio
- CHR.Types.Rule: (<=>>) :: () => [a] -> ([a], p) -> Rule a guard bprio prio
+ CHR.Types.Rule: (<=>>) :: [a] -> ([a], p) -> Rule a guard bprio prio
- CHR.Types.Rule: (<\>) :: () => ([a], [a]) -> [a] -> Rule a guard bprio prio
+ CHR.Types.Rule: (<\>) :: ([a], [a]) -> [a] -> Rule a guard bprio prio
- CHR.Types.Rule: (<\>>) :: () => ([a], [a]) -> ([a], p) -> Rule a guard bprio prio
+ CHR.Types.Rule: (<\>>) :: ([a], [a]) -> ([a], p) -> Rule a guard bprio prio
- CHR.Types.Rule: (=!!) :: () => Rule cnstr guard bprio prio1 -> prio2 -> Rule cnstr guard bprio prio2
+ CHR.Types.Rule: (=!!) :: Rule cnstr guard bprio prio -> prio -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (=!) :: () => Rule cnstr guard bprio prio -> bprio -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (=!) :: Rule cnstr guard bprio prio -> bprio -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (==>) :: () => [cnstr] -> [cnstr] -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (==>) :: [cnstr] -> [cnstr] -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (==>>) :: () => [cnstr] -> ([cnstr], p) -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (==>>) :: [cnstr] -> ([cnstr], p) -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (=@) :: () => Rule cnstr guard bprio prio -> String -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (=@) :: Rule cnstr guard bprio prio -> String -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (=|) :: () => Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (=|) :: Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (@=) :: () => String -> Rule cnstr guard bprio prio -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (@=) :: String -> Rule cnstr guard bprio prio -> Rule cnstr guard bprio prio
- CHR.Types.Rule: (|>) :: () => Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: (|>) :: Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio
- CHR.Types.Rule: Rule :: ![cnstr] -> !Int -> ![guard] -> ![RuleBodyAlt cnstr bprio] -> !(Maybe bprio) -> !(Maybe prio) -> (Maybe String) -> Rule cnstr guard bprio prio
+ CHR.Types.Rule: Rule :: ![cnstr] -> !Int -> ![guard] -> ![RuleBodyAlt cnstr bprio] -> !Maybe bprio -> !Maybe prio -> Maybe String -> Rule cnstr guard bprio prio
- CHR.Types.Rule: RuleBodyAlt :: !(Maybe bprio) -> ![cnstr] -> RuleBodyAlt cnstr bprio
+ CHR.Types.Rule: RuleBodyAlt :: !Maybe bprio -> ![cnstr] -> RuleBodyAlt cnstr bprio
- CHR.Types.Rule: [rbodyaltBacktrackPrio] :: RuleBodyAlt cnstr bprio -> !(Maybe bprio)
+ CHR.Types.Rule: [rbodyaltBacktrackPrio] :: RuleBodyAlt cnstr bprio -> !Maybe bprio
- CHR.Types.Rule: [ruleBacktrackPrio] :: Rule cnstr guard bprio prio -> !(Maybe bprio)
+ CHR.Types.Rule: [ruleBacktrackPrio] :: Rule cnstr guard bprio prio -> !Maybe bprio
- CHR.Types.Rule: [ruleName] :: Rule cnstr guard bprio prio -> (Maybe String)
+ CHR.Types.Rule: [ruleName] :: Rule cnstr guard bprio prio -> Maybe String
- CHR.Types.Rule: [rulePrio] :: Rule cnstr guard bprio prio -> !(Maybe prio)
+ CHR.Types.Rule: [rulePrio] :: Rule cnstr guard bprio prio -> !Maybe prio

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for chr +## 0.1.0.4  -- 2018-08-18++* ghc 8.4+ ## 0.1.0.3  -- 2018-04-27  * comment cleanup
chr-core.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/  name:                chr-core-version:             0.1.0.4+version:             0.1.1.0 synopsis:            Constraint Handling Rules description:         Constraint Handling Rules evaluation engine license:             BSD3@@ -51,6 +51,6 @@     -- fclabels >= 2.0.3,     chr-data >= 0.1.0.1,     chr-pretty >= 0.1.0.0,-    logict-state >= 0.1.0.5+    logict-state >= 0.1.1.0   hs-source-dirs:      src   default-language:    Haskell2010
src/CHR/Types/Core.hs view
@@ -425,8 +425,10 @@ -- | Lift into CHRMatcher chrmatcherLift :: (LookupApply subst subst) => (subst -> Maybe subst) -> CHRMatcher subst () chrmatcherLift f = do-    [sl,sg] <- fmap Lk.unlifts $ getl chrmatcherstateVarLookup -- gets (unStackedVarLookup . _chrmatcherstateVarLookup)-    maybe chrMatchFail (\snew -> chrmatcherstateVarLookup =$: (Lk.apply snew)) $ f sg+    stLk <- getl chrmatcherstateVarLookup -- gets (unStackedVarLookup . _chrmatcherstateVarLookup)+    case Lk.unlifts stLk of+      [sl,sg] -> maybe chrMatchFail (\snew -> chrmatcherstateVarLookup =$: (Lk.apply snew)) $ f sg+      _ -> chrMatchFail  -- | Run a CHRMatcher chrmatcherRun' :: (CHREmptySubstitution subst) => (CHRMatcherFailure -> r) -> (subst -> CHRWaitForVarSet subst -> x -> r) -> CHRMatcher subst x -> CHRMatchEnv (VarLookupKey subst) -> StackedVarLookup subst -> r