cudd
3.0.0
The University of Colorado Decision Diagram Package
|
Utility functions for ZDDs. More...
Functions | |
int | Cudd_zddPrintMinterm (DdManager *zdd, DdNode *node) |
Prints a disjoint sum of product form for a ZDD. More... | |
int | Cudd_zddPrintCover (DdManager *zdd, DdNode *node) |
Prints a sum of products from a ZDD representing a cover. More... | |
int | Cudd_zddPrintDebug (DdManager *zdd, DdNode *f, int n, int pr) |
Prints to the standard output a ZDD and its statistics. More... | |
DdGen * | Cudd_zddFirstPath (DdManager *zdd, DdNode *f, int **path) |
Finds the first path of a ZDD. More... | |
int | Cudd_zddNextPath (DdGen *gen, int **path) |
Generates the next path of a ZDD. More... | |
char * | Cudd_zddCoverPathToString (DdManager *zdd, int *path, char *str) |
Converts a path of a ZDD representing a cover to a string. More... | |
DdNode * | Cudd_zddSupport (DdManager *dd, DdNode *f) |
Finds the variables on which a ZDD depends. More... | |
int | Cudd_zddDumpDot (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, FILE *fp) |
Writes a dot file representing the argument ZDDs. More... | |
int | cuddZddP (DdManager *zdd, DdNode *f) |
Prints a ZDD to the standard output. One line per node is printed. More... | |
static int | zp2 (DdManager *zdd, DdNode *f, st_table *t) |
Performs the recursive step of cuddZddP. More... | |
static void | zdd_print_minterm_aux (DdManager *zdd, DdNode *node, int level, int *list) |
Performs the recursive step of Cudd_zddPrintMinterm. More... | |
static void | zddPrintCoverAux (DdManager *zdd, DdNode *node, int level, int *list) |
Performs the recursive step of Cudd_zddPrintCover. More... | |
static void | zddSupportStep (DdNode *f, int *support) |
Performs the recursive step of Cudd_zddSupport. More... | |
static void | zddClearFlag (DdNode *f) |
Performs a DFS from f, clearing the LSB of the next pointers. More... | |
Utility functions for ZDDs.
Copyright (c) 1995-2015, 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.
char* Cudd_zddCoverPathToString | ( | DdManager * | zdd, |
int * | path, | ||
char * | str | ||
) |
Converts a path of a ZDD representing a cover to a string.
The string represents an implicant of the cover. The path is typically produced by Cudd_zddForeachPath. If the str input is NULL, it allocates a new string. The string passed to this function must have enough room for all variables and for the terminator.
zdd | DD manager |
path | path of ZDD representing a cover |
str | pointer to string to use if != NULL |
int Cudd_zddDumpDot | ( | DdManager * | dd, |
int | n, | ||
DdNode ** | f, | ||
char const *const * | inames, | ||
char const *const * | onames, | ||
FILE * | fp | ||
) |
Writes a dot file representing the argument ZDDs.
Writes a file representing the argument ZDDs in a format suitable for the graph drawing program dot. Cudd_zddDumpDot does not close the file: This is the caller responsibility. Cudd_zddDumpDot uses a minimal unique subset of the hexadecimal address of a node as name for it. If the argument inames is non-null, it is assumed to hold the pointers to the names of the inputs. Similarly for onames. Cudd_zddDumpDot uses the following convention to draw arcs:
The dot options are chosen so that the drawing fits on a letter-size sheet.
dd | manager |
n | number of output nodes to be dumped |
f | array of output nodes to be dumped |
inames | array of input names (or NULL) |
onames | array of output names (or NULL) |
fp | pointer to the dump file |
Finds the first path of a ZDD.
Defines an iterator on the paths of a ZDD and finds its first path.
A path is represented as an array of literals, which are integers in {0, 1, 2}; 0 represents an else arc out of a node, 1 represents a then arc out of a node, and 2 stands for the absence of a node. The size of the array equals the number of variables in the manager at the time Cudd_zddFirstCube is called.
The paths that end in the empty terminal are not enumerated.
int Cudd_zddNextPath | ( | DdGen * | gen, |
int ** | path | ||
) |
Generates the next path of a ZDD.
Generates the next path of a ZDD onset, using generator gen.
Prints a sum of products from a ZDD representing a cover.
Prints to the standard output a ZDD and its statistics.
The statistics include the number of nodes and the number of minterms. (The number of minterms is also the number of combinations in the set.) The statistics are printed if pr > 0. Specifically:
Prints a disjoint sum of product form for a ZDD.
Finds the variables on which a ZDD depends.
dd | manager |
f | ZDD whose support is sought |
Prints a ZDD to the standard output. One line per node is printed.
Performs the recursive step of Cudd_zddPrintMinterm.
|
static |
Performs a DFS from f, clearing the LSB of the next pointers.
Performs the recursive step of Cudd_zddPrintCover.
|
static |
Performs the recursive step of Cudd_zddSupport.
Performs a DFS from f. The support is accumulated in supp as a side effect. Uses the LSB of the then pointer as visited flag.