cudd/cuddBddCorr.c File Reference

Correlation between BDDs. More...

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

Data Structures

struct  hashEntry

Typedefs

typedef struct hashEntry HashEntry

Functions

double Cudd_bddCorrelation (DdManager *manager, DdNode *f, DdNode *g)
 Computes the correlation of f and g.
double Cudd_bddCorrelationWeights (DdManager *manager, DdNode *f, DdNode *g, double *prob)
 Computes the correlation of f and g for given input probabilities.
static double bddCorrelationAux (DdManager *dd, DdNode *f, DdNode *g, st_table *table)
 Performs the recursive step of Cudd_bddCorrelation.
static double bddCorrelationWeightsAux (DdManager *dd, DdNode *f, DdNode *g, double *prob, st_table *table)
 Performs the recursive step of Cudd_bddCorrelationWeigths.
static int CorrelCompare (void const *key1, void const *key2)
 Compares two hash table entries.
static int CorrelHash (void const *key, int modulus)
 Hashes a hash table entry.
static enum st_retval CorrelCleanUp (void *key, void *value, void *arg)
 Frees memory associated with hash table.

Detailed Description

Correlation between BDDs.

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.


Typedef Documentation

typedef struct hashEntry HashEntry

Type of hash-table key.


Function Documentation

static double bddCorrelationAux ( DdManager dd,
DdNode f,
DdNode g,
st_table table 
) [static]

Performs the recursive step of Cudd_bddCorrelation.

Returns:
the fraction of minterms in the ON-set of the EXNOR of f and g.
Side effects
None
See also:
bddCorrelationWeightsAux
static double bddCorrelationWeightsAux ( DdManager dd,
DdNode f,
DdNode g,
double *  prob,
st_table table 
) [static]

Performs the recursive step of Cudd_bddCorrelationWeigths.

Side effects
None
See also:
bddCorrelationAux
static enum st_retval CorrelCleanUp ( void *  key,
void *  value,
void *  arg 
) [static]

Frees memory associated with hash table.

Returns:
ST_CONTINUE.
Side effects
None
static int CorrelCompare ( void const *  key1,
void const *  key2 
) [static]

Compares two hash table entries.

Returns:
0 if they are identical; 1 otherwise.
Side effects
None
static int CorrelHash ( void const *  key,
int  modulus 
) [static]

Hashes a hash table entry.

It is patterned after st_strhash.

Returns:
a value between 0 and modulus.
Side effects
None
double Cudd_bddCorrelation ( DdManager manager,
DdNode f,
DdNode g 
)

Computes the correlation of f and g.

If f == g, their correlation is 1. If f == g', their correlation is 0.

Returns:
the fraction of minterms in the ON-set of the EXNOR of f and g. If it runs out of memory, returns (double)CUDD_OUT_OF_MEM.
Side effects
None
See also:
Cudd_bddCorrelationWeights
double Cudd_bddCorrelationWeights ( DdManager manager,
DdNode f,
DdNode g,
double *  prob 
)

Computes the correlation of f and g for given input probabilities.

On input, prob\[i\] is supposed to contain the probability of the i-th input variable to be 1. If f == g, their correlation is 1. If f == g', their correlation is 0. The correlation of f and the constant one gives the probability of f.

Returns:
the probability that f and g have the same value. If it runs out of memory, returns (double)CUDD_OUT_OF_MEM.
Side effects
None
See also:
Cudd_bddCorrelation
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 31 Dec 2015 for cudd by  doxygen 1.6.1