cudd/testcudd.c File Reference

Sanity check tests for some CUDD functions. More...

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

Defines

#define TESTCUDD_VERSION   "TestCudd Version #1.0, Release date 3/17/01"

Functions

int main (int argc, char *const *argv)
 Main function for testcudd.
static void usage (char *prog)
 Prints usage info for testcudd.
static FILE * open_file (char *filename, const char *mode)
 Opens a file.
static int testWalsh (DdManager *dd, int N, int cmu, int approach, int pr)
 Tests Walsh matrix multiplication.
static int testIterators (DdManager *dd, DdNode *M, DdNode *C, int pr)
 Tests iterators on cubes and nodes.
static int testXor (DdManager *dd, DdNode *f, int pr, int nvars)
 Tests the functions related to the exclusive OR.
static int testHamming (DdManager *dd, DdNode *f, int pr)
 Tests the Hamming distance functions.
static int testSupport (DdManager *dd, DdNode *f, DdNode *g, int pr)
 Tests the support functions.

Variables

static const char * onames [] = { "C", "M" }

Detailed Description

Sanity check tests for some CUDD functions.

testcudd reads a matrix with real coefficients and transforms it into an ADD. It then performs various operations on the ADD and on the BDD corresponding to the ADD pattern. Finally, testcudd tests functions relate to Walsh matrices and matrix multiplication.

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 main ( int  argc,
char *const *  argv 
)

Main function for testcudd.

Side effects
None
static FILE* open_file ( char *  filename,
const char *  mode 
) [static]

Opens a file.

Opens a file, or fails with an error message and exits. Allows '-' as a synonym for standard input.

Side effects
None
static int testHamming ( DdManager dd,
DdNode f,
int  pr 
) [static]

Tests the Hamming distance functions.

Returns:
1 if successful; 0 otherwise.
Side effects
None
static int testIterators ( DdManager dd,
DdNode M,
DdNode C,
int  pr 
) [static]

Tests iterators on cubes and nodes.

Side effects
None
static int testSupport ( DdManager dd,
DdNode f,
DdNode g,
int  pr 
) [static]

Tests the support functions.

Returns:
1 if successful; 0 otherwise.
Side effects
None
static int testWalsh ( DdManager dd,
int  N,
int  cmu,
int  approach,
int  pr 
) [static]

Tests Walsh matrix multiplication.

Returns:
1 if successful; 0 otherwise.
Side effects
May create new variables in the manager.
static int testXor ( DdManager dd,
DdNode f,
int  pr,
int  nvars 
) [static]

Tests the functions related to the exclusive OR.

Builds the boolean difference of the given function in three different ways and checks that the results is the same.

Returns:
1 if successful; 0 otherwise.
Side effects
None
static void usage ( char *  prog  )  [static]

Prints usage info for testcudd.

Side effects
None
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 31 Dec 2015 for cudd by  doxygen 1.6.1