packages feed

cudd 0.1.0.3 → 0.1.0.3.1

raw patch · 3 files changed

+24/−8 lines, 3 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Cudd.C: c_cuddApaCountMinterm :: Ptr CDDManager -> Ptr CDDNode -> CInt -> Ptr CInt -> IO (Ptr CInt)
+ Cudd.C: c_cuddFreeApaNumber :: Ptr CInt -> IO ()
+ Cudd.Imperative: countMintermExact :: DDManager s u -> DDNode s u -> Int -> ST s Integer

Files

Cudd/C.hs view
@@ -66,6 +66,8 @@     c_cuddEval,     c_cuddCountLeaves,     c_cuddCountMinterm,+    c_cuddApaCountMinterm,+    c_cuddFreeApaNumber,     c_cuddCountPathsToNonZero,     c_cuddCountPath,     c_cuddBddConstrain,@@ -295,6 +297,12 @@  foreign import ccall safe "Cudd_CountMinterm"     c_cuddCountMinterm :: Ptr CDDManager -> Ptr CDDNode -> CInt -> IO CDouble++foreign import ccall safe "Cudd_FreeApaNumber"+    c_cuddFreeApaNumber :: Ptr CInt -> IO () ++foreign import ccall safe "Cudd_ApaCountMinterm"+    c_cuddApaCountMinterm :: Ptr CDDManager -> Ptr CDDNode -> CInt -> Ptr CInt -> IO (Ptr CInt)  foreign import ccall safe "Cudd_CountPathsToNonZero"     c_cuddCountPathsToNonZero :: Ptr CDDNode -> IO CDouble
Cudd/Imperative.hs view
@@ -93,6 +93,7 @@     quit,     readIndex,     printMinterm,+    countMintermExact,     checkCube,     Cube,     Prime,@@ -382,6 +383,15 @@  printMinterm :: DDManager s u -> DDNode s u -> ST s () printMinterm (DDManager m) (DDNode x) = unsafeIOToST $ c_cuddPrintMinterm m x++countMintermExact :: DDManager s u -> DDNode s u -> Int -> ST s Integer+countMintermExact (DDManager m) (DDNode x) n = unsafeIOToST $+    alloca $ \ sizep -> do+    apa <- c_cuddApaCountMinterm m x (fromIntegral n) sizep+    size <- fromIntegral <$> peek sizep+    digits <- peekArray size apa+    c_cuddFreeApaNumber apa+    return $ foldl ( \ a d -> a * 2^32 + fromIntegral d ) 0 digits  checkCube :: DDManager s u -> DDNode s u -> ST s Bool checkCube (DDManager m) (DDNode x) = liftM (==1) $ unsafeIOToST $ c_cuddCheckCube m x
cudd.cabal view
@@ -1,7 +1,7 @@ -- Initial cudd.cabal generated by cabal init.  For further  -- documentation, see http://haskell.org/cabal/users-guide/ name:                cudd-version:             0.1.0.3+version:             0.1.0.3.1 synopsis:            Bindings to the CUDD binary decision diagrams library description:              Bindings to version 3.0.0 of the CUDD binary decision diagrams library. @@ -10,15 +10,11 @@     .     /Installation/     .-    Either install CUDD using your system's package manager or download and build CUDD from here: <https://github.com/adamwalker/cudd>. This is a mirror of the CUDD source that has been modified to build shared object files.-    .-    If you chose the latter option you need to tell cabal where to find cudd:-    .-    "cabal install cudd --extra-include-dirs=\/path\/to\/cudd\/src\/include --extra-lib-dirs=\/path\/to\/cudd\/src\/libso"+    Either install CUDD 3.0.0 using your system's package manager or download and install CUDD from here: <http://vlsi.colorado.edu/~fabio/>.      .-    and you need to tell your program where to find the shared libraries:+    Then:     .-    "LD_LIBRARY_PATH=\/path\/to\/cudd\/src\/libso ghci"+    "cabal install cudd"     .     /Usage/     .@@ -27,6 +23,8 @@     * A purely functional one in "Cudd.Cudd" that automatically dereferences BDDs during garbage collection.     .     * An ST Monad based one in "Cudd.Imperative" that gives you precise control over the ordering of BDD operations and when BDDs are dereferenced. Use this one if you want your code to perform well.+    .+    Also, for a higher level interface in the style of the <https://hackage.haskell.org/package/ersatz ersatz> SAT encoder, see <https://github.com/jwaldmann/cudd-ersatz/>.  license:             BSD3 license-file:        LICENSE