abc/src/base/abci/abcBalance.c
/**Function*************************************************************

  Synopsis    [Collects the nodes in the cone delimited by fMarkA==1.]

  Description [Returns -1 if the AND-cone has the same node in both polarities.
  Returns 1 if the AND-cone has the same node in the same polarity. Returns 0
  if the AND-cone has no repeated nodes.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Collects the nodes in the cone delimited by fMarkA==1.]

Description [Returns -1 if the AND-cone has the same node in both polarities.
Returns 1 if the AND-cone has the same node in the same polarity. Returns 0
if the AND-cone has no repeated nodes.]




Function Synopsis [ Collects the nodes in the cone delimited by fMarkA == 1 . ] Description [ Returns - 1 if the AND - cone has the same node in both polarities . Returns 1 if the AND - cone has the same node in the same polarity . Returns 0 if the AND - cone has no repeated nodes . ]
Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, int fDuplicate, int fSelective )
{
    Vec_Ptr_t * vNodes;
    int RetValue, i;
    assert( !Abc_ObjIsComplement(pNode) );
    if ( Vec_VecSize( vStorage ) <= Level )
        Vec_VecPush( vStorage, Level, 0 );
    vNodes = Vec_VecEntry( vStorage, Level );
    Vec_PtrClear( vNodes );
    RetValue = Abc_NodeBalanceCone_rec( pNode, vNodes, 1, fDuplicate, fSelective );
    assert( vNodes->nSize > 1 );
    for ( i = 0; i < vNodes->nSize; i++ )
        Abc_ObjRegular((Abc_Obj_t *)vNodes->pArray[i])->fMarkB = 0;
    if ( RetValue == -1 )
        vNodes->nSize = 0;
    return vNodes;
}
Vec_Ptr_t * Abc_NodeBalanceCone ( Abc_Obj_t * pNode , Vec_Vec_t * vStorage , int Level , int fDuplicate , int fSelective ) { Vec_Ptr_t * vNodes ; int RetValue , i ; assert ( ! Abc_ObjIsComplement ( pNode ) ) ; if ( Vec_VecSize ( vStorage ) <= Level ) Vec_VecPush ( vStorage , Level , 0 ) ; vNodes = Vec_VecEntry ( vStorage , Level ) ; Vec_PtrClear ( vNodes ) ; RetValue = Abc_NodeBalanceCone_rec ( pNode , vNodes , 1 , fDuplicate , fSelective ) ; assert ( vNodes -> nSize > 1 ) ; for ( i = 0 ; i < vNodes -> nSize ; i ++ ) Abc_ObjRegular ( ( Abc_Obj_t * ) vNodes -> pArray [ i ] ) -> fMarkB = 0 ; if ( RetValue == -1 ) vNodes -> nSize = 0 ; return vNodes ; }
Function
Synopsis    [Collects the nodes in the cone delimited by fMarkA==1.]
Function Synopsis [ Collects the nodes in the cone delimited by fMarkA == 1 . ]
// extend the storage // get the temporary array of nodes // collect the nodes in the implication supergate // unmark the visited nodes // if we found the node and its complement in the same implication supergate,  // return empty set of nodes (meaning that we should use constant-0 node)