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

  Synopsis    [Extracts a dense superset from a BDD with the heavy branch
  heuristic.]

  Description [Extracts a dense superset from a BDD. The procedure is
  identical to the subset procedure except for the fact that it
  receives the complement of the given function. Extracting the subset
  of the complement function is equivalent to extracting the superset
  of the function. This procedure builds a superset by throwing away
  one of the children of each node starting from the root of the
  complement function, until the result is small enough. The child
  that is eliminated from the result is the one that contributes the
  fewer minterms.
  Returns a pointer to the BDD of the superset if successful. NULL if
  intermediate result causes the procedure to run out of memory. The
  parameter numVars is the maximum number of variables to be used in
  minterm calculation and node count calculation.  The optimal number
  should be as close as possible to the size of the support of f.
  However, it is safe to pass the value returned by Cudd_ReadSize for
  numVars when the number of variables is under 1023.  If numVars is
  larger than 1023, it will overflow. If a 0 parameter is passed then
  the procedure will compute a value which will avoid overflow but
  will cause underflow with 2046 variables or more.]

  SideEffects [None]

  SeeAlso     [Cudd_SubsetHeavyBranch Cudd_SupersetShortPaths Cudd_ReadSize]

******************************************************************************/
Function
Synopsis    [Extracts a dense superset from a BDD with the heavy branch
heuristic.]

Description [Extracts a dense superset from a BDD. The procedure is
identical to the subset procedure except for the fact that it
receives the complement of the given function. Extracting the subset
of the complement function is equivalent to extracting the superset
of the function. This procedure builds a superset by throwing away
one of the children of each node starting from the root of the
complement function, until the result is small enough. The child
that is eliminated from the result is the one that contributes the
fewer minterms.
Returns a pointer to the BDD of the superset if successful. NULL if
intermediate result causes the procedure to run out of memory. The
parameter numVars is the maximum number of variables to be used in
minterm calculation and node count calculation.  The optimal number
should be as close as possible to the size of the support of f.
However, it is safe to pass the value returned by Cudd_ReadSize for
numVars when the number of variables is under 1023.  If numVars is
larger than 1023, it will overflow. If a 0 parameter is passed then
the procedure will compute a value which will avoid overflow but
will cause underflow with 2046 variables or more.]




Function Synopsis [ Extracts a dense superset from a BDD with the heavy branch heuristic . ] Description [ Extracts a dense superset from a BDD . The procedure is identical to the subset procedure except for the fact that it receives the complement of the given function . Extracting the subset of the complement function is equivalent to extracting the superset of the function . This procedure builds a superset by throwing away one of the children of each node starting from the root of the complement function until the result is small enough . The child that is eliminated from the result is the one that contributes the fewer minterms . Returns a pointer to the BDD of the superset if successful . NULL if intermediate result causes the procedure to run out of memory . The parameter numVars is the maximum number of variables to be used in minterm calculation and node count calculation . The optimal number should be as close as possible to the size of the support of f . However it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023 . If numVars is larger than 1023 it will overflow . If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more . ]
DdNode *
Cudd_SupersetHeavyBranch(
  DdManager * dd ,
  DdNode * f ,
  int  numVars ,
  int  threshold )
{
    DdNode *subset, *g;
    g = Cudd_Not(f);
    memOut = 0;
    do {
        dd->reordered = 0;
        subset = cuddSubsetHeavyBranch(dd, g, numVars, threshold);
    } while ((dd->reordered == 1) && (!memOut));
    return(Cudd_NotCond(subset, (subset != NULL)));
}
DdNode * Cudd_SupersetHeavyBranch ( DdManager * dd , DdNode * f , int numVars , int threshold ) { DdNode * subset , * g ; g = Cudd_Not ( f ) ; memOut = 0 ; do { dd -> reordered = 0 ; subset = cuddSubsetHeavyBranch ( dd , g , numVars , threshold ) ; } while ( ( dd -> reordered == 1 ) && ( ! memOut ) ) ; return ( Cudd_NotCond ( subset , ( subset != NULL ) ) ) ; }
Function
Synopsis    [Extracts a dense superset from a BDD with the heavy branch
heuristic.]
Function Synopsis [ Extracts a dense superset from a BDD with the heavy branch heuristic . ]
/* manager */ /* function to be superset */ /* number of variables in the support of f */ /* maximum number of nodes in the superset */