abc/src/bool/kit/cloud.c
/**Function********************************************************************

  Synopsis    [Finds the variables on which a DD depends.]

  Description [Finds the variables on which a DD depends.
  Returns a BDD consisting of the product of the variables if
  successful; NULL otherwise.]

  SideEffects [None]

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Finds the variables on which a DD depends.]

Description [Finds the variables on which a DD depends.
Returns a BDD consisting of the product of the variables if
successful; NULL otherwise.]




Function Synopsis [ Finds the variables on which a DD depends . ] Description [ Finds the variables on which a DD depends . Returns a BDD consisting of the product of the variables if successful ; NULL otherwise . ]
CloudNode * Cloud_Support( CloudManager * dd, CloudNode * n )
{
    CloudNode * res;
    int * support, i;
    CLOUD_ASSERT(n);
    support = ABC_CALLOC( int, dd->nVars );
    cloudSupport( dd, Cloud_Regular(n), support );
    cloudClearMark( dd, Cloud_Regular(n) );
    res = dd->one;
    for ( i = dd->nVars - 1; i >= 0; i-- ) 
        if ( support[i] == 1 )
        {
            res = Cloud_bddAnd( dd, res, dd->vars[i] );
            if ( res == NULL )
                break;
        }
    ABC_FREE( support );
    return res;
}
CloudNode * Cloud_Support ( CloudManager * dd , CloudNode * n ) { CloudNode * res ; int * support , i ; CLOUD_ASSERT ( n ) ; support = ABC_CALLOC ( int , dd -> nVars ) ; cloudSupport ( dd , Cloud_Regular ( n ) , support ) ; cloudClearMark ( dd , Cloud_Regular ( n ) ) ; res = dd -> one ; for ( i = dd -> nVars - 1 ; i >= 0 ; i -- ) if ( support [ i ] == 1 ) { res = Cloud_bddAnd ( dd , res , dd -> vars [ i ] ) ; if ( res == NULL ) break ; } ABC_FREE ( support ) ; return res ; }
Function
Synopsis    [Finds the variables on which a DD depends.]
Function Synopsis [ Finds the variables on which a DD depends . ]
// allocate and initialize support array for cloudSupport // compute support and clean up markers // transform support from array to cube // for each level bottom-up 