cudd  3.0.0
The University of Colorado Decision Diagram Package
Macros | Functions
cuddInteract.c File Reference

Functions to manipulate the variable interaction matrix. More...

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

Macros

#define BPL   64
 
#define LOGBPL   6
 

Functions

void cuddSetInteract (DdManager *table, int x, int y)
 Set interaction matrix entries. More...
 
int cuddTestInteract (DdManager *table, int x, int y)
 Test interaction matrix entries. More...
 
int cuddInitInteract (DdManager *table)
 Initializes the interaction matrix. More...
 
static void ddSuppInteract (DdNode *f, char *support)
 Find the support of f. More...
 
static void ddClearLocal (DdNode *f)
 Performs a DFS from f, clearing the LSB of the then pointers. More...
 
static void ddUpdateInteract (DdManager *table, char *support)
 Marks as interacting all pairs of variables that appear in support. More...
 
static void ddClearGlobal (DdManager *table)
 Scans the DD and clears the LSB of the next pointers. More...
 

Detailed Description

Functions to manipulate the variable interaction matrix.

The interaction matrix tells whether two variables are both in the support of some function of the DD. The main use of the interaction matrix is in the in-place swapping. Indeed, if two variables do not interact, there is no arc connecting the two layers; therefore, the swap can be performed in constant time, without scanning the subtables. Another use of the interaction matrix is in the computation of the lower bounds for sifting. Finally, the interaction matrix can be used to speed up aggregation checks in symmetric and group sifting.

The computation of the interaction matrix is done with a series of depth-first searches. The searches start from those nodes that have only external references. The matrix is stored as a packed array of bits; since it is symmetric, only the upper triangle is kept in memory. As a final remark, we note that there may be variables that do interact, but that for a given variable order have no arc connecting their layers when they are adjacent. For instance, in ite(a,b,c) with the order a<b<c, b and c interact, but are not connected.

Author
Fabio Somenzi

Function Documentation

◆ cuddInitInteract()

int cuddInitInteract ( DdManager table)

Initializes the interaction matrix.

The interaction matrix is implemented as a bit vector storing the upper triangle of the symmetric interaction matrix. The bit vector is kept in an array of ptruints. The computation is based on a series of depth-first searches, one for each root of the DAG. Two flags are needed: The local visited flag uses the LSB of the then pointer. The global visited flag uses the LSB of the next pointer.

Returns
1 if successful; 0 otherwise.
Side effects None

◆ cuddSetInteract()

void cuddSetInteract ( DdManager table,
int  x,
int  y 
)

Set interaction matrix entries.

Given a pair of variables 0 <= x < y < table->size, sets the corresponding bit of the interaction matrix to 1.

Side effects None

◆ cuddTestInteract()

int cuddTestInteract ( DdManager table,
int  x,
int  y 
)

Test interaction matrix entries.

Given a pair of variables 0 <= x < y < table->size, tests whether the corresponding bit of the interaction matrix is 1. Returns the value of the bit.

Side effects None

◆ ddClearGlobal()

static void ddClearGlobal ( DdManager table)
static

Scans the DD and clears the LSB of the next pointers.

The LSB of the next pointers are used as markers to tell whether a node was reached by at least one DFS. Once the interaction matrix is built, these flags are reset.

Side effects None

◆ ddClearLocal()

static void ddClearLocal ( DdNode f)
static

Performs a DFS from f, clearing the LSB of the then pointers.

Side effects None

◆ ddSuppInteract()

static void ddSuppInteract ( DdNode f,
char *  support 
)
static

Find the support of f.

Performs a DFS from f. Uses the LSB of the then pointer as visited flag.

Side effects Accumulates in support the variables on which f depends.

◆ ddUpdateInteract()

static void ddUpdateInteract ( DdManager table,
char *  support 
)
static

Marks as interacting all pairs of variables that appear in support.

If support[i == support[j] == 1, sets the (i,j) entry of the interaction matrix to 1.]

Side effects Clears support.