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

  Synopsis    [Fixes the BDD variable group tree after a shuffle.]

  Description [Fixes the BDD variable group tree after a
  shuffle. Assumes that the order of the variables in a terminal node
  has not been changed.]

  SideEffects [Changes the BDD variable group tree.]

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Fixes the BDD variable group tree after a shuffle.]

Description [Fixes the BDD variable group tree after a
shuffle. Assumes that the order of the variables in a terminal node
has not been changed.]

SideEffects [Changes the BDD variable group tree.]


Function Synopsis [ Fixes the BDD variable group tree after a shuffle . ] Description [ Fixes the BDD variable group tree after a shuffle . Assumes that the order of the variables in a terminal node has not been changed . ] SideEffects [ Changes the BDD variable group tree . ]
static void
bddFixTree(
  DdManager * table,
  MtrNode * treenode)
{
    if (treenode == NULL) return;
    treenode->low = ((int) treenode->index < table->size) ?
        table->perm[treenode->index] : treenode->index;
    if (treenode->child != NULL) {
        bddFixTree(table, treenode->child);
    }
    if (treenode->younger != NULL)
        bddFixTree(table, treenode->younger);
    if (treenode->parent != NULL && treenode->low < treenode->parent->low) {
        treenode->parent->low = treenode->low;
        treenode->parent->index = treenode->index;
    }
    return;
}
static void bddFixTree ( DdManager * table , MtrNode * treenode ) { if ( treenode == NULL ) return ; treenode -> low = ( ( int ) treenode -> index < table -> size ) ? table -> perm [ treenode -> index ] : treenode -> index ; if ( treenode -> child != NULL ) { bddFixTree ( table , treenode -> child ) ; } if ( treenode -> younger != NULL ) bddFixTree ( table , treenode -> younger ) ; if ( treenode -> parent != NULL && treenode -> low < treenode -> parent -> low ) { treenode -> parent -> low = treenode -> low ; treenode -> parent -> index = treenode -> index ; } return ; }
Function
Synopsis    [Fixes the BDD variable group tree after a shuffle.]
Function Synopsis [ Fixes the BDD variable group tree after a shuffle . ]