abc/src/proof/fraig/fraigUtil.c
/**Function*************************************************************

  Synopsis    [Sets the number of fanouts (none, one, or many).]

  Description [This procedure collects the nodes reachable from
  the POs of the AIG and sets the type of fanout counter (none, one,
  or many) for each node. This procedure is useful to determine
  fanout-free cones of AND-nodes, which is helpful for rebalancing
  the AIG (see procedure Fraig_ManRebalance, or something like that).]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Sets the number of fanouts (none, one, or many).]

Description [This procedure collects the nodes reachable from
the POs of the AIG and sets the type of fanout counter (none, one,
or many) for each node. This procedure is useful to determine
fanout-free cones of AND-nodes, which is helpful for rebalancing
the AIG .]




Function Synopsis [ Sets the number of fanouts ( none one or many ) . ] Description [ This procedure collects the nodes reachable from the POs of the AIG and sets the type of fanout counter ( none one or many ) for each node . This procedure is useful to determine fanout - free cones of AND - nodes which is helpful for rebalancing the AIG . ]
void Fraig_ManMarkRealFanouts( Fraig_Man_t * p )
{
    Fraig_NodeVec_t * vNodes;
    Fraig_Node_t * pNodeR;
    int i;
    vNodes = Fraig_Dfs( p, 0 );
    for ( i = 0; i < vNodes->nSize; i++ )
    {
        vNodes->pArray[i]->nFanouts = 0;
        vNodes->pArray[i]->pData0 = NULL;
    }
    for ( i = 0; i < vNodes->nSize; i++ )
    {
        pNodeR = Fraig_Regular(vNodes->pArray[i]->p1);
        if ( pNodeR && ++pNodeR->nFanouts == 3 )
            pNodeR->nFanouts = 2;
        pNodeR = Fraig_Regular(vNodes->pArray[i]->p2);
        if ( pNodeR && ++pNodeR->nFanouts == 3 )
            pNodeR->nFanouts = 2;
    }
    Fraig_NodeVecFree( vNodes );
}
void Fraig_ManMarkRealFanouts ( Fraig_Man_t * p ) { Fraig_NodeVec_t * vNodes ; Fraig_Node_t * pNodeR ; int i ; vNodes = Fraig_Dfs ( p , 0 ) ; for ( i = 0 ; i < vNodes -> nSize ; i ++ ) { vNodes -> pArray [ i ] -> nFanouts = 0 ; vNodes -> pArray [ i ] -> pData0 = NULL ; } for ( i = 0 ; i < vNodes -> nSize ; i ++ ) { pNodeR = Fraig_Regular ( vNodes -> pArray [ i ] -> p1 ) ; if ( pNodeR && ++ pNodeR -> nFanouts == 3 ) pNodeR -> nFanouts = 2 ; pNodeR = Fraig_Regular ( vNodes -> pArray [ i ] -> p2 ) ; if ( pNodeR && ++ pNodeR -> nFanouts == 3 ) pNodeR -> nFanouts = 2 ; } Fraig_NodeVecFree ( vNodes ) ; }
Function
Synopsis    [Sets the number of fanouts (none, one, or many).]
Function Synopsis [ Sets the number of fanouts ( none one or many ) . ]
// collect the nodes reachable // clean the fanouts field // mark reachable nodes by setting the two-bit counter pNode->nFans