abc-master
|
Go to the source code of this file.
Macros | |
#define | DD_MAX_SUBTABLE_SPARSITY 8 |
#define | DD_SHRINK_FACTOR 2 |
Functions | |
static Move * | zddSwapAny (DdManager *table, int x, int y) |
static int | cuddZddSiftingAux (DdManager *table, int x, int x_low, int x_high) |
static Move * | cuddZddSiftingUp (DdManager *table, int x, int x_low, int initial_size) |
static Move * | cuddZddSiftingDown (DdManager *table, int x, int x_high, int initial_size) |
static int | cuddZddSiftingBackward (DdManager *table, Move *moves, int size) |
static void | zddReorderPreprocess (DdManager *table) |
static int | zddReorderPostprocess (DdManager *table) |
static int | zddShuffle (DdManager *table, int *permutation) |
static int | zddSiftUp (DdManager *table, int x, int xLow) |
static void | zddFixTree (DdManager *table, MtrNode *treenode) |
int | Cudd_zddReduceHeap (DdManager *table, Cudd_ReorderingType heuristic, int minsize) |
int | Cudd_zddShuffleHeap (DdManager *table, int *permutation) |
int | cuddZddAlignToBdd (DdManager *table) |
int | cuddZddNextHigh (DdManager *table, int x) |
int | cuddZddNextLow (DdManager *table, int x) |
int | cuddZddUniqueCompare (int *ptr_x, int *ptr_y) |
int | cuddZddSwapInPlace (DdManager *table, int x, int y) |
int | cuddZddSwapping (DdManager *table, int lower, int upper, Cudd_ReorderingType heuristic) |
int | cuddZddSifting (DdManager *table, int lower, int upper) |
Variables | |
static char rcsid[] | DD_UNUSED = "$Id: cuddZddReord.c,v 1.47 2004/08/13 18:04:53 fabio Exp $" |
int * | zdd_entry |
int | zddTotalNumberSwapping |
static DdNode * | empty |
#define DD_MAX_SUBTABLE_SPARSITY 8 |
CFile***********************************************************************
FileName [cuddZddReord.c]
PackageName [cudd]
Synopsis [Procedures for dynamic variable ordering of ZDDs.]
Description [External procedures included in this module:
Internal procedures included in this module:
Static procedures included in this module:
]
SeeAlso []
Author [Hyong-Kyoon Shin, In-Ho Moon]
Copyright [Copyright (c) 1995-2004, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]
Definition at line 87 of file cuddZddReord.c.
#define DD_SHRINK_FACTOR 2 |
Definition at line 88 of file cuddZddReord.c.
int Cudd_zddReduceHeap | ( | DdManager * | table, |
Cudd_ReorderingType | heuristic, | ||
int | minsize | ||
) |
AutomaticEnd Function********************************************************************
Synopsis [Main dynamic reordering routine for ZDDs.]
Description [Main dynamic reordering routine for ZDDs. Calls one of the possible reordering procedures:
For sifting and symmetric sifting it is possible to request reordering to convergence.
The core of all methods is the reordering procedure cuddZddSwapInPlace() which swaps two adjacent variables. Returns 1 in case of success; 0 otherwise. In the case of symmetric sifting (with and without convergence) returns 1 plus the number of symmetric variables, in case of success.]
SideEffects [Changes the variable order for all ZDDs and clears the cache.]
Definition at line 171 of file cuddZddReord.c.
int Cudd_zddShuffleHeap | ( | DdManager * | table, |
int * | permutation | ||
) |
Function********************************************************************
Synopsis [Reorders ZDD variables according to given permutation.]
Description [Reorders ZDD variables according to given permutation. The i-th entry of the permutation array contains the index of the variable that should be brought to the i-th level. The size of the array should be equal or greater to the number of variables currently in use. Returns 1 in case of success; 0 otherwise.]
SideEffects [Changes the ZDD variable order for all diagrams and clears the cache.]
SeeAlso [Cudd_zddReduceHeap]
Definition at line 304 of file cuddZddReord.c.
int cuddZddAlignToBdd | ( | DdManager * | table | ) |
Function********************************************************************
Synopsis [Reorders ZDD variables according to the order of the BDD variables.]
Description [Reorders ZDD variables according to the order of the BDD variables. This function can be called at the end of BDD reordering to insure that the order of the ZDD variables is consistent with the order of the BDD variables. The number of ZDD variables must be a multiple of the number of BDD variables. Let M
be the ratio of the two numbers. cuddZddAlignToBdd then considers the ZDD variables from M*i
to (M+1)*i-1
as corresponding to BDD variable i
. This function should be normally called from Cudd_ReduceHeap, which clears the cache. Returns 1 in case of success; 0 otherwise.]
SideEffects [Changes the ZDD variable order for all diagrams and performs garbage collection of the ZDD unique table.]
SeeAlso [Cudd_zddShuffleHeap Cudd_ReduceHeap]
Definition at line 352 of file cuddZddReord.c.
int cuddZddNextHigh | ( | DdManager * | table, |
int | x | ||
) |
Function********************************************************************
Synopsis [Finds the next subtable with a larger index.]
Description [Finds the next subtable with a larger index. Returns the index.]
SideEffects [None]
SeeAlso []
Definition at line 413 of file cuddZddReord.c.
int cuddZddNextLow | ( | DdManager * | table, |
int | x | ||
) |
Function********************************************************************
Synopsis [Finds the next subtable with a smaller index.]
Description [Finds the next subtable with a smaller index. Returns the index.]
SideEffects [None]
SeeAlso []
Definition at line 435 of file cuddZddReord.c.
int cuddZddSifting | ( | DdManager * | table, |
int | lower, | ||
int | upper | ||
) |
Function********************************************************************
Synopsis [Implementation of Rudell's sifting algorithm.]
Description [Implementation of Rudell's sifting algorithm. Assumes that no dead nodes are present.
Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 867 of file cuddZddReord.c.
|
static |
Function********************************************************************
Synopsis [Given xLow <= x <= xHigh moves x up and down between the boundaries.]
Description [Given xLow <= x <= xHigh moves x up and down between the boundaries. Finds the best position and does the required changes. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 1117 of file cuddZddReord.c.
Function********************************************************************
Synopsis [Given a set of moves, returns the ZDD heap to the position giving the minimum size.]
Description [Given a set of moves, returns the ZDD heap to the position giving the minimum size. In case of ties, returns to the closest position giving the minimum size. Returns 1 in case of success; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 1364 of file cuddZddReord.c.
Function********************************************************************
Synopsis [Sifts a variable down.]
Description [Sifts a variable down. Moves x down until either it reaches the bound (x_high) or the size of the ZDD heap increases too much. Returns the set of moves in case of success; NULL if memory is full.]
SideEffects [None]
SeeAlso []
Definition at line 1300 of file cuddZddReord.c.
Function********************************************************************
Synopsis [Sifts a variable up.]
Description [Sifts a variable up. Moves y up until either it reaches the bound (x_low) or the size of the ZDD heap increases too much. Returns the set of moves in case of success; NULL if memory is full.]
SideEffects [None]
SeeAlso []
Definition at line 1237 of file cuddZddReord.c.
int cuddZddSwapInPlace | ( | DdManager * | table, |
int | x, | ||
int | y | ||
) |
Function********************************************************************
Synopsis [Swaps two adjacent variables.]
Description [Swaps two adjacent variables. It assumes that no dead nodes are present on entry to this procedure. The procedure then guarantees that no dead nodes will be present when it terminates. cuddZddSwapInPlace assumes that x < y. Returns the number of keys in the table if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 484 of file cuddZddReord.c.
int cuddZddSwapping | ( | DdManager * | table, |
int | lower, | ||
int | upper, | ||
Cudd_ReorderingType | heuristic | ||
) |
Function********************************************************************
Synopsis [Reorders variables by a sequence of (non-adjacent) swaps.]
Description [Implementation of Plessier's algorithm that reorders variables by a sequence of (non-adjacent) swaps.
Returns 1 in case of success; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 746 of file cuddZddReord.c.
int cuddZddUniqueCompare | ( | int * | ptr_x, |
int * | ptr_y | ||
) |
Function********************************************************************
Synopsis [Comparison function used by qsort.]
Description [Comparison function used by qsort to order the variables according to the number of keys in the subtables. Returns the difference in number of keys between the two variables being compared.]
SideEffects [None]
SeeAlso []
Definition at line 459 of file cuddZddReord.c.
Function********************************************************************
Synopsis [Fixes the ZDD variable group tree after a shuffle.]
Description [Fixes the ZDD variable group tree after a shuffle. Assumes that the order of the variables in a terminal node has not been changed.]
SideEffects [Changes the ZDD variable group tree.]
SeeAlso []
Definition at line 1645 of file cuddZddReord.c.
|
static |
Function********************************************************************
Synopsis [Shrinks almost empty ZDD subtables at the end of reordering to guarantee that they have a reasonable load factor.]
Description [Shrinks almost empty subtables at the end of reordering to guarantee that they have a reasonable load factor. However, if there many nodes are being reclaimed, then no resizing occurs. Returns 1 in case of success; 0 otherwise.]
SideEffects [None]
Definition at line 1439 of file cuddZddReord.c.
|
static |
Function********************************************************************
Synopsis [Prepares the ZDD heap for dynamic reordering.]
Description [Prepares the ZDD heap for dynamic reordering. Does garbage collection, to guarantee that there are no dead nodes; and clears the cache, which is invalidated by dynamic reordering.]
SideEffects [None]
Definition at line 1410 of file cuddZddReord.c.
|
static |
Function********************************************************************
Synopsis [Reorders ZDD variables according to a given permutation.]
Description [Reorders ZDD variables according to a given permutation. The i-th permutation array contains the index of the variable that should be brought to the i-th level. zddShuffle assumes that no dead nodes are present. The reordering is achieved by a series of upward sifts. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 1534 of file cuddZddReord.c.
|
static |
Function********************************************************************
Synopsis [Moves one ZDD variable up.]
Description [Takes a ZDD variable from position x and sifts it up to position xLow; xLow should be less than or equal to x. Returns 1 if successful; 0 otherwise]
SideEffects [None]
SeeAlso []
Definition at line 1609 of file cuddZddReord.c.
AutomaticStart
Function********************************************************************
Synopsis [Swaps any two variables.]
Description [Swaps any two variables. Returns the set of moves.]
SideEffects [None]
SeeAlso []
Definition at line 961 of file cuddZddReord.c.
|
static |
Definition at line 105 of file cuddZddReord.c.
|
static |
Definition at line 112 of file cuddZddReord.c.
int* zdd_entry |
Definition at line 108 of file cuddZddReord.c.
int zddTotalNumberSwapping |
Definition at line 110 of file cuddZddReord.c.