monadiccp-gecode 0.1 → 0.1.1
raw patch · 3 files changed
+16/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Control/CP/FD/Gecode/Common.hs +15/−1
- examples/Grocery.hs +0/−2
- monadiccp-gecode.cabal +1/−1
Control/CP/FD/Gecode/Common.hs view
@@ -529,6 +529,19 @@ Just (GCTVar var) -> return var x -> error $ "unable to decompose col ("++(show x)++"): "++str++"?" +-- workaround for collections which contain constant values and variables:+-- for each constant value a new variable is introduced which is bound to the value+decompInt :: (GecodeSolver s, Constraint s ~ GecodeConstraint s) => GecodeIntSpec s -> (GecodeWrappedSolver s) (GecodeIntVar s)+decompInt (GITVar v) = return v+decompInt (GITConst val) = do+ x <- newvar+ add $ GCIntVal x val+ return x+decompInt (GITLinear l) = do+ x <- newvar+ add $ GCLinear (l-(termToLinear x)) GOEqual+ return x+ newtype GecodeWrappedSolver s a = GecodeWrappedSolver (s a) newtype GecodeWrappedLabel s = GecodeWrappedLabel (Label s) @@ -575,7 +588,8 @@ fdIntSpec_term x = (GISVar, return $ GITVar x) fdBoolSpec_term x = (GBSVar, return $ GBTVar x) fdColSpec_list lst = (GCSVar, do- let vir = map (\(GITVar v) -> v) lst+-- let vir = map (\(GITVar v) -> v) lst+ vir <- mapM decompInt lst gcv <- newCol_list vir return $ GCTVar gcv) fdColSpec_size len = (GCSVar, do
examples/Grocery.hs view
@@ -9,8 +9,6 @@ import Control.CP.FD.GecodeExample -import Data.Expr.Sugar hiding (loopall, (@=), sorted)- model :: ExampleModel () model _ = exists $ \col -> do [a,b,c,d] <- colList col 4
monadiccp-gecode.cabal view
@@ -1,5 +1,5 @@ Name: monadiccp-gecode-Version: 0.1+Version: 0.1.1 Description: Gecode extension for the Monadic Constraint Programming Framework (code generator and runtime solver backend) License: BSD3 License-file: LICENSE