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

  Synopsis    [Performs the recursive step of Cloud_DagSize.]

  Description [Performs the recursive step of Cloud_DagSize. Returns the
  number of nodes in the graph rooted at n.]

  SideEffects [None]

******************************************************************************/
Function
Synopsis    [Performs the recursive step of Cloud_DagSize.]

Description [Performs the recursive step of Cloud_DagSize. Returns the
number of nodes in the graph rooted at n.]


Function Synopsis [ Performs the recursive step of Cloud_DagSize . ] Description [ Performs the recursive step of Cloud_DagSize . Returns the number of nodes in the graph rooted at n . ]
static int Cloud_DagCollect_rec( CloudManager * dd, CloudNode * n, int * pCounter )
{
    int tval, eval;
    if ( cloudNodeIsMarked(n) )
        return 0;
    cloudNodeMark(n);
    if ( cloudIsConstant(n) )
    {
        dd->ppNodes[(*pCounter)++] = n;
        return 1;
    }
    tval = Cloud_DagCollect_rec( dd, cloudT(n), pCounter );
    eval = Cloud_DagCollect_rec( dd, Cloud_Regular(cloudE(n)), pCounter );
    dd->ppNodes[(*pCounter)++] = n;
    return tval + eval + 1;
}
static int Cloud_DagCollect_rec ( CloudManager * dd , CloudNode * n , int * pCounter ) { int tval , eval ; if ( cloudNodeIsMarked ( n ) ) return 0 ; cloudNodeMark ( n ) ; if ( cloudIsConstant ( n ) ) { dd -> ppNodes [ ( * pCounter ) ++ ] = n ; return 1 ; } tval = Cloud_DagCollect_rec ( dd , cloudT ( n ) , pCounter ) ; eval = Cloud_DagCollect_rec ( dd , Cloud_Regular ( cloudE ( n ) ) , pCounter ) ; dd -> ppNodes [ ( * pCounter ) ++ ] = n ; return tval + eval + 1 ; }
Function
Synopsis    [Performs the recursive step of Cloud_DagSize.]
Function Synopsis [ Performs the recursive step of Cloud_DagSize . ]
// set visited flag