84 printf(
"Ivy_ManBalance(): The check has failed.\n" );
140 if ( vSuper->nSize == 0 )
145 if ( vSuper->nSize < 2 )
148 for ( i = 0; i < vSuper->nSize; i++ )
179 assert( vSuper->nSize > 1 );
183 while ( vSuper->nSize > 1 )
210 int RetValue1, RetValue2, i;
215 for ( i = 0; i < vSuper->nSize; i++ )
216 if ( vSuper->pArray[i] == pObj )
219 for ( i = 0; i < vSuper->nSize; i++ )
220 if ( vSuper->pArray[i] ==
Ivy_Not(pObj) )
237 if ( RetValue1 == -1 || RetValue2 == -1 )
240 return RetValue1 || RetValue2;
267 assert( vNodes->nSize > 1 );
273 if ( RetValue == -1 )
304 for ( Current--; Current >= 0; Current-- )
333 Ivy_Obj_t * pObj1, * pObj2, * pObj3, * pGhost;
337 assert( LeftBound <= RightBound );
338 if ( LeftBound == RightBound )
346 for ( i = RightBound; i >= LeftBound; i-- )
358 if ( pObj3 == pObj2 )
396 for ( i = vStore->nSize-1; i > 0; i-- )
399 pObj2 = (
Ivy_Obj_t *)vStore->pArray[i-1];
402 vStore->pArray[i ] = pObj2;
403 vStore->pArray[i-1] = pObj1;
static int Ivy_IsComplement(Ivy_Obj_t *p)
static Ivy_Obj_t * Ivy_EdgeToNode(Ivy_Man_t *p, Ivy_Edge_t Edge)
static Ivy_Edge_t Ivy_EdgeFromNode(Ivy_Obj_t *pNode)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static void Vec_VecPush(Vec_Vec_t *p, int Level, void *Entry)
static Vec_Vec_t * Vec_VecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
static int Ivy_NodeBalanceFindLeft(Vec_Ptr_t *vSuper)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static ABC_NAMESPACE_IMPL_START int Ivy_NodeBalance_rec(Ivy_Man_t *pNew, Ivy_Obj_t *pObj, Vec_Vec_t *vStore, int Level, int fUpdateLevel)
DECLARATIONS ///.
#define Ivy_ManForEachPi(p, pObj, i)
ITERATORS ///.
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
static Ivy_Obj_t * Ivy_ManConst0(Ivy_Man_t *p)
#define Ivy_ManForEachPo(p, pObj, i)
int Ivy_NodeBalanceCone_rec(Ivy_Obj_t *pRoot, Ivy_Obj_t *pObj, Vec_Ptr_t *vSuper)
static void Vec_PtrSort(Vec_Ptr_t *p, int(*Vec_PtrSortCompare)()) ___unused
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Ivy_Obj_t * Ivy_Oper(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1, Ivy_Type_t Type)
FUNCTION DEFINITIONS ///.
int Ivy_NodeCompareLevelsDecrease(Ivy_Obj_t **pp1, Ivy_Obj_t **pp2)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static void * Vec_PtrPop(Vec_Ptr_t *p)
Ivy_Obj_t * Ivy_NodeBalanceBuildSuper(Ivy_Man_t *p, Vec_Ptr_t *vSuper, Ivy_Type_t Type, int fUpdateLevel)
Ivy_Man_t * Ivy_ManStart()
DECLARATIONS ///.
Ivy_Obj_t * Ivy_ObjReal(Ivy_Obj_t *pObj)
Ivy_Obj_t * Ivy_TableLookup(Ivy_Man_t *p, Ivy_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Ivy_Obj_t * Ivy_ObjCreatePo(Ivy_Man_t *p, Ivy_Obj_t *pDriver)
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static Ivy_Edge_t Ivy_EdgeNotCond(Ivy_Edge_t Edge, int fCond)
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
Ivy_Man_t * Ivy_ManBalance(Ivy_Man_t *p, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
static Ivy_Type_t Ivy_ObjType(Ivy_Obj_t *pObj)
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjChild0(Ivy_Obj_t *pObj)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Vec_Ptr_t * Ivy_NodeBalanceCone(Ivy_Obj_t *pObj, Vec_Vec_t *vStore, int Level)
static Ivy_Obj_t * Ivy_ObjCreateGhost(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1, Ivy_Type_t Type, Ivy_Init_t Init)
void Ivy_ManCleanTravId(Ivy_Man_t *p)
static int Ivy_ObjIsConst1(Ivy_Obj_t *pObj)
static void Ivy_NodeBalancePushUniqueOrderByLevel(Vec_Ptr_t *vStore, Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_Not(Ivy_Obj_t *p)
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
static int Vec_VecSize(Vec_Vec_t *p)
static Ivy_Obj_t * Ivy_ObjChild1(Ivy_Obj_t *pObj)
static void Vec_PtrClear(Vec_Ptr_t *p)
Ivy_Obj_t * Ivy_ObjCreatePi(Ivy_Man_t *p)
DECLARATIONS ///.
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Ivy_ManCheck(Ivy_Man_t *p)
DECLARATIONS ///.
int Ivy_ManCleanup(Ivy_Man_t *p)
static void Ivy_NodeBalancePermute(Ivy_Man_t *p, Vec_Ptr_t *vSuper, int LeftBound, int fExor)