     --     {#call unsafe cudd_bddIte#} ddmanager ip tp ep
     --       >>= addBDDfinalizer
 
-bddConstant :: (DDManager -> IO (Ptr BDD)) -> BDD
-bddConstant f = unsafePerformIO $ f ddmanager >>= addBDDnullFinalizer
+cudd_constant :: (DDManager -> IO (Ptr BDD)) -> BDD
+cudd_constant f = unsafePerformIO $ f ddmanager >>= addBDDnullFinalizer
+{-# INLINE cudd_constant #-}
 
 bddBinOp :: CuddBinOp -> BDD -> BDD -> BDD
 bddBinOp op x y = unsafePerformIO $
   withBDD x $ \xp -> withBDD y $ \yp ->
     {#call unsafe cudd_BinOp#} ddmanager (cFromEnum op) xp yp >>= addBDDfinalizer
+{-# INLINE bddBinOp #-}
 
 instance QBF BDD where
-    data Group BDD = MkGroup BDD
+    data Group BDD = MkGroup !BDD
 
     mkGroup = MkGroup . conjoin -- FIXME maybe use Cudd_bddComputeCube
     exists = cudd_exists

    rel_product = cudd_rel_product

instance Substitution BDD where
    data Subst BDD = MkSubst [(BDD, BDD)]

    mkSubst = MkSubst
    rename = cudd_rename
    substitute = error "CUDD substitute" -- cudd_substitute

instance BDDOps BDD where
    bif bdd = unsafePerformIO $

                                   Just v  -> v

instance Boolean BDD where
    true  = cudd_constant {#call unsafe Cudd_ReadOne as _cudd_ReadOne#}
    false = cudd_constant {#call unsafe Cudd_ReadLogicZero as _cudd_ReadLogicZero#}

    (/\)  = bddBinOp AND
    neg x = unsafePerformIO $ withBDD x $ \xp ->
