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

Functions for BDD and ADD reduction by linear transformations. More...

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

Macros

#define CUDD_SWAP_MOVE   0
 
#define CUDD_LINEAR_TRANSFORM_MOVE   1
 
#define CUDD_INVERSE_TRANSFORM_MOVE   2
 
#define BPL   64
 
#define LOGBPL   6
 

Functions

int Cudd_PrintLinear (DdManager *table)
 Prints the linear transform matrix. More...
 
int Cudd_ReadLinear (DdManager *table, int x, int y)
 Reads an entry of the linear transform matrix. More...
 
int cuddLinearAndSifting (DdManager *table, int lower, int upper)
 BDD reduction based on combination of sifting and linear transformations. More...
 
int cuddLinearInPlace (DdManager *table, int x, int y)
 Linearly combines two adjacent variables. More...
 
void cuddUpdateInteractionMatrix (DdManager *table, int xindex, int yindex)
 Updates the interaction matrix. More...
 
int cuddInitLinear (DdManager *table)
 Initializes the linear transform matrix. More...
 
int cuddResizeLinear (DdManager *table)
 Resizes the linear transform matrix. More...
 
static int ddLinearUniqueCompare (void const *ptrX, void const *ptrY)
 Comparison function used by qsort. More...
 
static int ddLinearAndSiftingAux (DdManager *table, int x, int xLow, int xHigh)
 Given xLow <= x <= xHigh moves x up and down between the boundaries. More...
 
static MoveddLinearAndSiftingUp (DdManager *table, int y, int xLow, Move *prevMoves)
 Sifts a variable up and applies linear transformations. More...
 
static MoveddLinearAndSiftingDown (DdManager *table, int x, int xHigh, Move *prevMoves)
 Sifts a variable down and applies linear transformations. More...
 
static int ddLinearAndSiftingBackward (DdManager *table, int size, Move *moves)
 Given a set of moves, returns the DD heap to the order giving the minimum size. More...
 
static MoveddUndoMoves (DdManager *table, Move *moves)
 Given a set of moves, returns the DD heap to the order in effect before the moves. More...
 
static void cuddXorLinear (DdManager *table, int x, int y)
 XORs two rows of the linear transform matrix. More...
 

Detailed Description

Functions for BDD and ADD reduction by linear transformations.

Author
Fabio Somenzi

Function Documentation

◆ Cudd_PrintLinear()

int Cudd_PrintLinear ( DdManager table)

Prints the linear transform matrix.

Returns
1 in case of success; 0 otherwise.
Side effects none

◆ Cudd_ReadLinear()

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

Reads an entry of the linear transform matrix.

Side effects none
Parameters
tableCUDD manager
xrow index
ycolumn index

◆ cuddInitLinear()

int cuddInitLinear ( DdManager table)

Initializes the linear transform matrix.

Returns
1 if successful; 0 otherwise.
Side effects none

◆ cuddLinearAndSifting()

int cuddLinearAndSifting ( DdManager table,
int  lower,
int  upper 
)

BDD reduction based on combination of sifting and linear transformations.

Assumes that no dead nodes are present.

  1. Order all the variables according to the number of entries in each unique table.
  2. Sift the variable up and down, remembering each time the total size of the DD heap. At each position, linear transformation of the two adjacent variables is tried and is accepted if it reduces the size of the DD.
  3. Select the best permutation.
  4. Repeat 3 and 4 for all variables.
Returns
1 if successful; 0 otherwise.
Side effects None

◆ cuddLinearInPlace()

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

Linearly combines two adjacent variables.

Specifically, replaces the top variable with the exclusive nor of the two variables. It assumes that no dead nodes are present on entry to this procedure. The procedure then guarantees that no dead nodes will be present when it terminates. cuddLinearInPlace assumes that x < y.

Returns
the number of keys in the table if successful; 0 otherwise.
Side effects The two subtables corrresponding to variables x and y are
modified. The global counters of the unique table are also affected.
See also
cuddSwapInPlace

◆ cuddResizeLinear()

int cuddResizeLinear ( DdManager table)

Resizes the linear transform matrix.

Returns
1 if successful; 0 otherwise.
Side effects none

◆ cuddUpdateInteractionMatrix()

void cuddUpdateInteractionMatrix ( DdManager table,
int  xindex,
int  yindex 
)

Updates the interaction matrix.

Side effects none

◆ cuddXorLinear()

static void cuddXorLinear ( DdManager table,
int  x,
int  y 
)
static

XORs two rows of the linear transform matrix.

Replaces the first row with the result.

Side effects none

◆ ddLinearAndSiftingAux()

static int ddLinearAndSiftingAux ( DdManager table,
int  x,
int  xLow,
int  xHigh 
)
static

Given xLow <= x <= xHigh moves x up and down between the boundaries.

At each step a linear transformation is tried, and, if it decreases the size of the DD, it is accepted. Finds the best position and does the required changes.

Returns
1 if successful; 0 otherwise.
Side effects None

◆ ddLinearAndSiftingBackward()

static int ddLinearAndSiftingBackward ( DdManager table,
int  size,
Move moves 
)
static

Given a set of moves, returns the DD heap to the order giving the minimum size.

In case of ties, returns to the closest position giving the minimum size.

Returns
1 in case of success; 0 otherwise.
Side effects None

◆ ddLinearAndSiftingDown()

static Move* ddLinearAndSiftingDown ( DdManager table,
int  x,
int  xHigh,
Move prevMoves 
)
static

Sifts a variable down and applies linear transformations.

Moves x down until either it reaches the bound (xHigh) or the size of the DD heap increases too much.

Returns
the set of moves in case of success; NULL if memory is full.
Side effects None

◆ ddLinearAndSiftingUp()

static Move* ddLinearAndSiftingUp ( DdManager table,
int  y,
int  xLow,
Move prevMoves 
)
static

Sifts a variable up and applies linear transformations.

Moves y up until either it reaches the bound (xLow) or the size of the DD heap increases too much.

Returns
the set of moves in case of success; NULL if memory is full.
Side effects None

◆ ddLinearUniqueCompare()

static int ddLinearUniqueCompare ( void const *  ptrX,
void const *  ptrY 
)
static

Comparison function used by qsort.

Comparison function used by qsort to order the variables according to the number of keys in the subtables.

Returns
the difference in number of keys between the two variables being compared.
Side effects None

◆ ddUndoMoves()

static Move* ddUndoMoves ( DdManager table,
Move moves 
)
static

Given a set of moves, returns the DD heap to the order in effect before the moves.

Returns
1 in case of success; 0 otherwise.
Side effects None