cudd/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.
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.
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.
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.
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.
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.
char * Cudd_FactoredFormString (DdManager *dd, DdNode *f, char const *const *inames)
 Returns a string with the factored form of the argument BDDs.
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.
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.
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.
static int ddDoDumpFactoredForm (DdManager *dd, DdNode *f, FILE *fp, char const *const *names)
 Performs the recursive step of Cudd_DumpFactoredForm.
static int ddDoFactoredFormString (DdManager *dd, DdNode *f, cstringstream stream, char const *const *names)
 Performs the recursive step of Cudd_DumpFactoredForm.

Detailed Description

Export functions.

Author:
Fabio Somenzi

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.


Function Documentation

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:
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)
mname model name (or NULL)
fp pointer to the dump file
mv 0: blif, 1: blif-MV
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:
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
mv 0: blif, 1: blif-MV
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:
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
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:
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
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:
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
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:
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
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
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
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
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
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
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
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 31 Dec 2015 for cudd by  doxygen 1.6.1