Skip to content

Commit 1813220

Browse files
committed
initial bit of infra for factoring out concrete impl of work/rule store
1 parent f212e22 commit 1813220

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

chr-core/chr-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ library
5151
-- fclabels >= 2.0.3,
5252
chr-data >= 0.1.0.0,
5353
chr-pretty >= 0.1.0.0,
54-
logict-state >= 0.1.0.4
54+
logict-state >= 0.1.0.5
5555
hs-source-dirs: src
5656
default-language: Haskell2010

chr-core/src/CHR/Solve/MonoBacktrackPrio.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module CHR.Solve.MonoBacktrackPrio
3737
, runCHRMonoBacktrackPrioT
3838

3939
, addRule
40-
-- , addRule2
4140

4241
, addConstraintAsWork
4342

@@ -79,6 +78,7 @@ import Data.Typeable
7978
import Data.Maybe
8079

8180
import Control.Monad
81+
-- import Control.Monad.IO.Class
8282
import Control.Monad.Except
8383
import Control.Monad.State.Strict
8484
import Control.Monad.LogicState
@@ -298,6 +298,8 @@ bst = sndl
298298
type MonoBacktrackPrio cnstr guard bprio prio subst env m
299299
= ( IsCHRSolvable env cnstr guard bprio prio subst
300300
, Monad m
301+
-- TODO: replace MonadIO with API abstracting away access to persistent structures
302+
-- , MonadIO m
301303
, Lookup subst (VarLookupKey subst) (VarLookupVal subst)
302304
, LookupApply subst subst
303305
, Fresh Int (ExtrValVarKey (VarLookupVal subst))
@@ -951,7 +953,7 @@ chrSolve opts env = slv
951953
alts -> do
952954
forM alts $ \alt@(FoundBodyAlt {foundBodyAltBacktrackPrio=bprio}) -> do
953955
log (Just alt)
954-
(backtrack $ nextwork bprio alt) >>= slvSchedule bprio
956+
(backtrackWithRoll (\_ _ bs -> {- (liftIO $ putStrLn "TEST") >> -} return bs) $ nextwork bprio alt) >>= slvSchedule bprio
955957
slvScheduleRun
956958

957959
where

chr-lang/chr-lang.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ library
5050
chr-parse >= 0.1.0.0,
5151
chr-pretty >= 0.1.0.0,
5252
chr-data >= 0.1.0.0,
53-
chr-core >= 0.1.0.1
53+
chr-core >= 0.1.0.3
5454
hs-source-dirs: src
5555
default-language: Haskell2010
5656

0 commit comments

Comments
 (0)