cudd  3.0.0
The University of Colorado Decision Diagram Package
Data Structures | Typedefs | Functions
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. More...
 
double Cudd_bddCorrelationWeights (DdManager *manager, DdNode *f, DdNode *g, double *prob)
 Computes the correlation of f and g for given input probabilities. More...
 
static double bddCorrelationAux (DdManager *dd, DdNode *f, DdNode *g, st_table *table)
 Performs the recursive step of Cudd_bddCorrelation. More...
 
static double bddCorrelationWeightsAux (DdManager *dd, DdNode *f, DdNode *g, double *prob, st_table *table)
 Performs the recursive step of Cudd_bddCorrelationWeigths. More...
 
static int CorrelCompare (void const *key1, void const *key2)
 Compares two hash table entries. More...
 
static int CorrelHash (void const *key, int modulus)
 Hashes a hash table entry. More...
 
static enum st_retval CorrelCleanUp (void *key, void *value, void *arg)
 Frees memory associated with hash table. More...
 

Detailed Description

Correlation between BDDs.

Author
Fabio Somenzi

Typedef Documentation

◆ HashEntry

typedef struct hashEntry HashEntry

Type of hash-table key.

Function Documentation

◆ bddCorrelationAux()

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

◆ 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

◆ CorrelCleanUp()

static enum st_retval CorrelCleanUp ( void *  key,
void *  value,
void *  arg 
)
static

Frees memory associated with hash table.

Returns
ST_CONTINUE.
Side effects None

◆ CorrelCompare()

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

◆ CorrelHash()

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

◆ Cudd_bddCorrelation()

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

◆ 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