cudd  3.0.0
The University of Colorado Decision Diagram Package
Functions
cuddExport.c File Reference

Export functions. More...

#include "util.h"
#include "cstringstream.h"
#include "cuddInt.h"
Include dependency graph for cuddExport.c:

Functions

int Cudd_DumpBlif (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, char *mname, FILE *fp, int mv)
 Writes a blif file representing the argument BDDs. More...
 
int Cudd_DumpBlifBody (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, FILE *fp, int mv)
 Writes a blif body representing the argument BDDs. More...
 
int Cudd_DumpDot (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, FILE *fp)
 Writes a dot file representing the argument DDs. More...
 
int Cudd_DumpDaVinci (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, FILE *fp)
 Writes a daVinci file representing the argument BDDs. More...
 
int Cudd_DumpDDcal (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, FILE *fp)
 Writes a DDcal file representing the argument BDDs. More...
 
int Cudd_DumpFactoredForm (DdManager *dd, int n, DdNode **f, char const *const *inames, char const *const *onames, FILE *fp)
 Writes factored forms representing the argument BDDs. More...
 
char * Cudd_FactoredFormString (DdManager *dd, DdNode *f, char const *const *inames)
 Returns a string with the factored form of the argument BDDs. More...
 
static int ddDoDumpBlif (DdManager *dd, DdNode *f, FILE *fp, st_table *visited, char const *const *names, int mv)
 Performs the recursive step of Cudd_DumpBlif. More...
 
static int ddDoDumpDaVinci (DdManager *dd, DdNode *f, FILE *fp, st_table *visited, char const *const *names, ptruint mask)
 Performs the recursive step of Cudd_DumpDaVinci. More...
 
static int ddDoDumpDDcal (DdManager *dd, DdNode *f, FILE *fp, st_table *visited, char const *const *names, ptruint mask)
 Performs the recursive step of Cudd_DumpDDcal. More...
 
static int ddDoDumpFactoredForm (DdManager *dd, DdNode *f, FILE *fp, char const *const *names)
 Performs the recursive step of Cudd_DumpFactoredForm. More...
 
static int ddDoFactoredFormString (DdManager *dd, DdNode *f, cstringstream stream, char const *const *names)
 Performs the recursive step of Cudd_DumpFactoredForm. More...
 

Detailed Description

Export functions.

Author
Fabio Somenzi

Function Documentation

◆ Cudd_DumpBlif()

int Cudd_DumpBlif ( DdManager dd,
int  n,
DdNode **  f,
char const *const *  inames,
char const *const *  onames,
char *  mname,
FILE *  fp,
int  mv 
)

Writes a blif file representing the argument BDDs.

Each BDD is written as a network of multiplexers. Cudd_DumpBlif does not close the file: This is the caller responsibility. Cudd_DumpBlif 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.

Returns
1 in case of success; 0 otherwise (e.g., out-of-memory, file system full, or an ADD with constants different from 0 and 1).
Side effects None
See also
Cudd_DumpBlifBody Cudd_DumpDot Cudd_PrintDebug Cudd_DumpDDcal Cudd_DumpDaVinci Cudd_DumpFactoredForm
Parameters
ddmanager
nnumber of output nodes to be dumped
farray of output nodes to be dumped
inamesarray of input names (or NULL)
onamesarray of output names (or NULL)
mnamemodel name (or NULL)
fppointer to the dump file
mv0: blif, 1: blif-MV

◆ Cudd_DumpBlifBody()

int Cudd_DumpBlifBody ( DdManager dd,
int  n,
DdNode **  f,
char const *const *  inames,
char const *const *  onames,
FILE *  fp,
int  mv 
)

Writes a blif body representing the argument BDDs.

Each BDD is written as a network of multiplexers. No header (.model, .inputs, and .outputs) and footer (.end) are produced by this function. One multiplexer is written for each BDD node. Cudd_DumpBlifBody does not close the file: This is the caller responsibility. Cudd_DumpBlifBody 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. This function prints out only .names part.

Returns
1 in case of success; 0 otherwise (e.g., out-of-memory, file system full, or an ADD with constants different from 0 and 1).
Side effects None
See also
Cudd_DumpBlif Cudd_DumpDot Cudd_PrintDebug Cudd_DumpDDcal Cudd_DumpDaVinci Cudd_DumpFactoredForm
Parameters
ddmanager
nnumber of output nodes to be dumped
farray of output nodes to be dumped
inamesarray of input names (or NULL)
onamesarray of output names (or NULL)
fppointer to the dump file
mv0: blif, 1: blif-MV

◆ Cudd_DumpDaVinci()

int Cudd_DumpDaVinci ( DdManager dd,
int  n,
DdNode **  f,
char const *const *  inames,
char const *const *  onames,
FILE *  fp 
)

Writes a daVinci file representing the argument BDDs.

Writes a daVinci file representing the argument BDDs. Cudd_DumpDaVinci does not close the file: This is the caller responsibility. Cudd_DumpDaVinci 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.

Returns
1 in case of success; 0 otherwise (e.g., out-of-memory or file system full).
Side effects None
See also
Cudd_DumpDot Cudd_PrintDebug Cudd_DumpBlif Cudd_DumpDDcal Cudd_DumpFactoredForm
Parameters
ddmanager
nnumber of output nodes to be dumped
farray of output nodes to be dumped
inamesarray of input names (or NULL)
onamesarray of output names (or NULL)
fppointer to the dump file

◆ Cudd_DumpDDcal()

int Cudd_DumpDDcal ( DdManager dd,
int  n,
DdNode **  f,
char const *const *  inames,
char const *const *  onames,
FILE *  fp 
)

Writes a DDcal file representing the argument BDDs.

Writes a DDcal file representing the argument BDDs. Cudd_DumpDDcal does not close the file: This is the caller responsibility. Cudd_DumpDDcal 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.

Returns
1 in case of success; 0 otherwise (e.g., out-of-memory or file system full).
Side effects None
See also
Cudd_DumpDot Cudd_PrintDebug Cudd_DumpBlif Cudd_DumpDaVinci Cudd_DumpFactoredForm
Parameters
ddmanager
nnumber of output nodes to be dumped
farray of output nodes to be dumped
inamesarray of input names (or NULL)
onamesarray of output names (or NULL)
fppointer to the dump file

◆ Cudd_DumpDot()

int Cudd_DumpDot ( DdManager dd,
int  n,
DdNode **  f,
char const *const *  inames,
char const *const *  onames,
FILE *  fp 
)

Writes a dot file representing the argument DDs.

Writes a file representing the argument DDs in a format suitable for the graph drawing program dot. Cudd_DumpDot does not close the file: This is the caller responsibility. Cudd_DumpDot 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_DumpDot uses the following convention to draw arcs:

  • solid line: THEN arcs;
  • dotted line: complement arcs;
  • dashed line: regular ELSE arcs.

The dot options are chosen so that the drawing fits on a letter-size sheet.

Returns
1 in case of success; 0 otherwise (e.g., out-of-memory, file system full).
Side effects None
See also
Cudd_DumpBlif Cudd_PrintDebug Cudd_DumpDDcal Cudd_DumpDaVinci Cudd_DumpFactoredForm
Parameters
ddmanager
nnumber of output nodes to be dumped
farray of output nodes to be dumped
inamesarray of input names (or NULL)
onamesarray of output names (or NULL)
fppointer to the dump file

◆ Cudd_DumpFactoredForm()

int Cudd_DumpFactoredForm ( DdManager dd,
int  n,
DdNode **  f,
char const *const *  inames,
char const *const *  onames,
FILE *  fp 
)

Writes factored forms representing the argument BDDs.

Writes factored forms representing the argument BDDs. The format of the factored form is the one used in the genlib files for technology mapping in sis. Cudd_DumpFactoredForm does not close the file: This is the caller responsibility. Caution must be exercised because a factored form may be exponentially larger than the argument BDD. If the argument inames is non-null, it is assumed to hold the pointers to the names of the inputs. Similarly for onames. If the number of output nodes is 0, it is interpreted as 1, but no output name followed by equal sign is printed before the factored form.

Returns
1 in case of success; 0 otherwise (e.g., file system full).
Side effects None
See also
Cudd_DumpDot Cudd_PrintDebug Cudd_DumpBlif Cudd_DumpDaVinci Cudd_DumpDDcal
Parameters
ddmanager
nnumber of output nodes to be dumped
farray of output nodes to be dumped
inamesarray of input names (or NULL)
onamesarray of output names (or NULL)
fppointer to the dump file

◆ Cudd_FactoredFormString()

char* Cudd_FactoredFormString ( DdManager dd,
DdNode f,
char const *const *  inames 
)

Returns a string with the factored form of the argument BDDs.

The factored form uses & for conjunction, | for disjunction and ! for negation. Caution must be exercised because a factored form may be exponentially larger than the argument BDD. If the argument inames is non-null, it is assumed to hold the pointers to the names of the inputs.

Returns
a string in case of success; NULL otherwise.
Side effects None
See also
Cudd_DumpDot Cudd_PrintDebug Cudd_DumpBlif Cudd_DumpDaVinci Cudd_DumpDDcal Cudd_DumpFactoredForm

◆ ddDoDumpBlif()

static int ddDoDumpBlif ( DdManager dd,
DdNode f,
FILE *  fp,
st_table visited,
char const *const *  names,
int  mv 
)
static

Performs the recursive step of Cudd_DumpBlif.

Traverses the BDD f and writes a multiplexer-network description to the file pointed by fp in blif format. f is assumed to be a regular pointer and ddDoDumpBlif guarantees this assumption in the recursive calls.

Side effects None

◆ ddDoDumpDaVinci()

static int ddDoDumpDaVinci ( DdManager dd,
DdNode f,
FILE *  fp,
st_table visited,
char const *const *  names,
ptruint  mask 
)
static

Performs the recursive step of Cudd_DumpDaVinci.

Traverses the BDD f and writes a term expression to the file pointed by fp in daVinci format. f is assumed to be a regular pointer and ddDoDumpDaVinci guarantees this assumption in the recursive calls.

Side effects None

◆ ddDoDumpDDcal()

static int ddDoDumpDDcal ( DdManager dd,
DdNode f,
FILE *  fp,
st_table visited,
char const *const *  names,
ptruint  mask 
)
static

Performs the recursive step of Cudd_DumpDDcal.

Traverses the BDD f and writes a line for each node to the file pointed by fp in DDcal format. f is assumed to be a regular pointer and ddDoDumpDDcal guarantees this assumption in the recursive calls.

Side effects None

◆ ddDoDumpFactoredForm()

static int ddDoDumpFactoredForm ( DdManager dd,
DdNode f,
FILE *  fp,
char const *const *  names 
)
static

Performs the recursive step of Cudd_DumpFactoredForm.

Traverses the BDD f and writes a factored form for each node to the file pointed by fp in terms of the factored forms of the children. Constants are propagated, and absorption is applied. f is assumed to be a regular pointer and ddDoDumpFActoredForm guarantees this assumption in the recursive calls.

Side effects None
See also
Cudd_DumpFactoredForm

◆ ddDoFactoredFormString()

static int ddDoFactoredFormString ( DdManager dd,
DdNode f,
cstringstream  stream,
char const *const *  names 
)
static

Performs the recursive step of Cudd_DumpFactoredForm.

Traverses the BDD f and writes a factored form for each node to the file pointed by fp in terms of the factored forms of the children. Constants are propagated, and absorption is applied. f is assumed to be a regular pointer and ddDoDumpFActoredForm guarantees this assumption in the recursive calls.

Side effects None
See also
Cudd_DumpFactoredForm