abc/src/bdd/cudd/cuddGenCof.c
/**Function********************************************************************

  Synopsis    [Find a dense subset of BDD <code>f</code>.]

  Description [Finds a dense subset of BDD <code>f</code>. Density is
  the ratio of number of minterms to number of nodes.  Uses several
  techniques in series. It is more expensive than other subsetting
  procedures, but often produces better results. See
  Cudd_SubsetShortPaths for a description of the threshold and nvars
  parameters.  Returns a pointer to the result if successful; NULL
  otherwise.]

  SideEffects [None]

  SeeAlso     [Cudd_SubsetRemap Cudd_SubsetShortPaths Cudd_SubsetHeavyBranch
  Cudd_bddSqueeze]

******************************************************************************/
Function
Synopsis    [Find a dense subset of BDD f.]

Description [Finds a dense subset of BDD f. Density is
the ratio of number of minterms to number of nodes.  Uses several
techniques in series. It is more expensive than other subsetting
procedures, but often produces better results. See
Cudd_SubsetShortPaths for a description of the threshold and nvars
parameters.  Returns a pointer to the result if successful; NULL
otherwise.]




Function Synopsis [ Find a dense subset of BDD f . ] Description [ Finds a dense subset of BDD f . Density is the ratio of number of minterms to number of nodes . Uses several techniques in series . It is more expensive than other subsetting procedures but often produces better results . See Cudd_SubsetShortPaths for a description of the threshold and nvars parameters . Returns a pointer to the result if successful ; NULL otherwise . ]
DdNode *
Cudd_SubsetCompress(
  DdManager * dd ,
  DdNode * f ,
  int  nvars ,
  int  threshold )
{
    DdNode *res, *tmp1, *tmp2;
    tmp1 = Cudd_SubsetShortPaths(dd, f, nvars, threshold, 0);
    if (tmp1 == NULL) return(NULL);
    cuddRef(tmp1);
    tmp2 = Cudd_RemapUnderApprox(dd,tmp1,nvars,0,1.0);
    if (tmp2 == NULL) {
        Cudd_IterDerefBdd(dd,tmp1);
        return(NULL);
    }
    cuddRef(tmp2);
    Cudd_IterDerefBdd(dd,tmp1);
    res = Cudd_bddSqueeze(dd,tmp2,f);
    if (res == NULL) {
        Cudd_IterDerefBdd(dd,tmp2);
        return(NULL);
    }
    cuddRef(res);
    Cudd_IterDerefBdd(dd,tmp2);
    cuddDeref(res);
    return(res);
}
DdNode * Cudd_SubsetCompress ( DdManager * dd , DdNode * f , int nvars , int threshold ) { DdNode * res , * tmp1 , * tmp2 ; tmp1 = Cudd_SubsetShortPaths ( dd , f , nvars , threshold , 0 ) ; if ( tmp1 == NULL ) return ( NULL ) ; cuddRef ( tmp1 ) ; tmp2 = Cudd_RemapUnderApprox ( dd , tmp1 , nvars , 0 , 1.0 ) ; if ( tmp2 == NULL ) { Cudd_IterDerefBdd ( dd , tmp1 ) ; return ( NULL ) ; } cuddRef ( tmp2 ) ; Cudd_IterDerefBdd ( dd , tmp1 ) ; res = Cudd_bddSqueeze ( dd , tmp2 , f ) ; if ( res == NULL ) { Cudd_IterDerefBdd ( dd , tmp2 ) ; return ( NULL ) ; } cuddRef ( res ) ; Cudd_IterDerefBdd ( dd , tmp2 ) ; cuddDeref ( res ) ; return ( res ) ; }
Function
Synopsis    [Find a dense subset of BDD <code>f</code>.]
Function Synopsis [ Find a dense subset of BDD <code > f< / code > . ]
/* manager */ /* BDD whose subset is sought */ /* number of variables in the support of f */ /* maximum number of nodes in the subset */