abc/src/bdd/cudd/cuddAPI.c
/**Function********************************************************************

  Synopsis    [Returns a new ADD variable at a specified level.]

  Description [Creates a new ADD variable.  The new variable has an
  index equal to the largest previous index plus 1 and is positioned at
  the specified level in the order.  Returns a pointer to the new
  variable if successful; NULL otherwise.]

  SideEffects [None]

  SeeAlso     [Cudd_addNewVar Cudd_addIthVar Cudd_bddNewVarAtLevel]

******************************************************************************/
Function
Synopsis    [Returns a new ADD variable at a specified level.]

Description [Creates a new ADD variable.  The new variable has an
index equal to the largest previous index plus 1 and is positioned at
the specified level in the order.  Returns a pointer to the new
variable if successful; NULL otherwise.]




Function Synopsis [ Returns a new ADD variable at a specified level . ] Description [ Creates a new ADD variable . The new variable has an index equal to the largest previous index plus 1 and is positioned at the specified level in the order . Returns a pointer to the new variable if successful ; NULL otherwise . ]
DdNode *
Cudd_addNewVarAtLevel(
  DdManager * dd,
  int  level)
{
    DdNode *res;
    if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
    if (level >= dd->size) return(Cudd_addIthVar(dd,level));
    if (!cuddInsertSubtables(dd,1,level)) return(NULL);
    do {
        dd->reordered = 0;
        res = cuddUniqueInter(dd,dd->size - 1,DD_ONE(dd),DD_ZERO(dd));
    } while (dd->reordered == 1);
    return(res);
}
DdNode * Cudd_addNewVarAtLevel ( DdManager * dd , int level ) { DdNode * res ; if ( ( unsigned int ) dd -> size >= CUDD_MAXINDEX - 1 ) return ( NULL ) ; if ( level >= dd -> size ) return ( Cudd_addIthVar ( dd , level ) ) ; if ( ! cuddInsertSubtables ( dd , 1 , level ) ) return ( NULL ) ; do { dd -> reordered = 0 ; res = cuddUniqueInter ( dd , dd -> size - 1 , DD_ONE ( dd ) , DD_ZERO ( dd ) ) ; } while ( dd -> reordered == 1 ) ; return ( res ) ; }
Function
Synopsis    [Returns a new ADD variable at a specified level.]
Function Synopsis [ Returns a new ADD variable at a specified level . ]