cudd 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+67/−4 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Cudd.Imperative: bNot :: DDNode t t1 -> DDNode s u
+ Cudd.Imperative: bNot :: DDNode s u -> DDNode s u
- Cudd.Imperative: bOne :: DDManager t t1 -> DDNode s u
+ Cudd.Imperative: bOne :: DDManager s u -> DDNode s u
- Cudd.Imperative: bZero :: DDManager t t1 -> DDNode s u
+ Cudd.Imperative: bZero :: DDManager s u -> DDNode s u
- Cudd.Imperative: ithVar :: Integral a => DDManager t t1 -> a -> ST s1 (DDNode s u)
+ Cudd.Imperative: ithVar :: DDManager s u -> Int -> ST s (DDNode s u)
Files
- Cudd/Cudd.hs +17/−0
- Cudd/Imperative.hs +24/−0
- cudd.cabal +26/−4
Cudd/Cudd.hs view
@@ -1,5 +1,22 @@ {-# LANGUAGE ForeignFunctionInterface, CPP, FlexibleContexts, RankNTypes #-} +{-| Bindings to the CUDD BDD library++This is a straightforward wrapper around the C library. See <http://vlsi.colorado.edu/~fabio/CUDD/> for documentation.++Exampe usage:++> import Cudd.Cudd+> +> main = do+> let manager = cuddInit+> v1 = ithVar manager 0+> v2 = ithVar manager 1+> conj = bAnd manager v1 v2+> implies = lEq manager conj v1+> print implies+-}+ module Cudd.Cudd ( DDManager(..), DDNode(..),
Cudd/Imperative.hs view
@@ -1,5 +1,25 @@ {-# LANGUAGE RankNTypes #-} +{-| An ST Monad based interface to the CUDD BDD library++This is a straightforward wrapper around the C library. See <http://vlsi.colorado.edu/~fabio/CUDD/> for documentation.++Exampe usage:++> import Control.Monad.ST+> import Cudd.Imperative+> +> main = do+> res <- stToIO $ withManagerDefaults $ \manager -> do+> v1 <- ithVar manager 0+> v2 <- ithVar manager 1+> conj <- bAnd manager v1 v2+> implies <- lEq manager conj v1+> deref manager conj+> return implies+> print res+-}+ module Cudd.Imperative ( DDManager(..), DDNode(..),@@ -156,6 +176,7 @@ arg3 :: (Ptr CDDManager -> Ptr CDDNode -> Ptr CDDNode -> Ptr CDDNode -> IO (Ptr CDDNode)) -> DDManager s u -> DDNode s u -> DDNode s u -> DDNode s u -> ST s (DDNode s u) arg3 f (DDManager m) (DDNode x) (DDNode y) (DDNode z) = liftM DDNode $ unsafeIOToST $ f m x y z +bZero, bOne :: DDManager s u -> DDNode s u bZero (DDManager m) = DDNode $ unsafePerformIO $ c_cuddReadLogicZero m bOne (DDManager m) = DDNode $ unsafePerformIO $ c_cuddReadOne m @@ -172,7 +193,10 @@ andAbstract = arg3 c_cuddBddAndAbstract xorExistAbstract = arg3 c_cuddBddXorExistAbstract +bNot :: DDNode s u -> DDNode s u bNot (DDNode x) = DDNode $ unsafePerformIO $ c_cuddNotNoRef x++ithVar :: DDManager s u -> Int -> ST s (DDNode s u) ithVar (DDManager m) i = liftM DDNode $ unsafeIOToST $ c_cuddBddIthVar m (fromIntegral i) deref :: DDManager s u -> DDNode s u -> ST s ()
cudd.cabal view
@@ -1,11 +1,33 @@ -- Initial cudd.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ name: cudd-version: 0.1.0.0+version: 0.1.0.1 synopsis: Bindings to the CUDD binary decision diagrams library-description: Bindings to the CUDD binary decision diagrams library. - .- <http://vlsi.colorado.edu/~fabio/CUDD/>+description: + Bindings to version 2.5.0 of the CUDD binary decision diagrams library. + .+ <http://vlsi.colorado.edu/~fabio/CUDD/>+ .+ /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"+ .+ and you need to tell your program where to find the shared libraries:+ .+ "LD_LIBRARY_PATH=\/path\/to\/cudd\/src\/libso ghci"+ .+ /Usage/+ .+ This package provides two interfaces to the CUDD library:+ .+ * 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.+ license: BSD3 license-file: LICENSE author: Adam Walker