abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cuddAPI.c File Reference
#include "misc/util/util_hack.h"
#include "cuddInt.h"

Go to the source code of this file.

Functions

static void fixVarTree (MtrNode *treenode, int *perm, int size)
 
static int addMultiplicityGroups (DdManager *dd, MtrNode *treenode, int multiplicity, char *vmask, char *lmask)
 
DdNodeCudd_addNewVar (DdManager *dd)
 
DdNodeCudd_addNewVarAtLevel (DdManager *dd, int level)
 
DdNodeCudd_bddNewVar (DdManager *dd)
 
DdNodeCudd_bddNewVarAtLevel (DdManager *dd, int level)
 
DdNodeCudd_addIthVar (DdManager *dd, int i)
 
DdNodeCudd_bddIthVar (DdManager *dd, int i)
 
DdNodeCudd_zddIthVar (DdManager *dd, int i)
 
int Cudd_zddVarsFromBddVars (DdManager *dd, int multiplicity)
 
DdNodeCudd_addConst (DdManager *dd, CUDD_VALUE_TYPE c)
 
int Cudd_IsNonConstant (DdNode *f)
 
void Cudd_AutodynEnable (DdManager *unique, Cudd_ReorderingType method)
 
void Cudd_AutodynDisable (DdManager *unique)
 
int Cudd_ReorderingStatus (DdManager *unique, Cudd_ReorderingType *method)
 
void Cudd_AutodynEnableZdd (DdManager *unique, Cudd_ReorderingType method)
 
void Cudd_AutodynDisableZdd (DdManager *unique)
 
int Cudd_ReorderingStatusZdd (DdManager *unique, Cudd_ReorderingType *method)
 
int Cudd_zddRealignmentEnabled (DdManager *unique)
 
void Cudd_zddRealignEnable (DdManager *unique)
 
void Cudd_zddRealignDisable (DdManager *unique)
 
int Cudd_bddRealignmentEnabled (DdManager *unique)
 
void Cudd_bddRealignEnable (DdManager *unique)
 
void Cudd_bddRealignDisable (DdManager *unique)
 
DdNodeCudd_ReadOne (DdManager *dd)
 
DdNodeCudd_ReadZddOne (DdManager *dd, int i)
 
DdNodeCudd_ReadZero (DdManager *dd)
 
DdNodeCudd_ReadLogicZero (DdManager *dd)
 
DdNodeCudd_ReadPlusInfinity (DdManager *dd)
 
DdNodeCudd_ReadMinusInfinity (DdManager *dd)
 
DdNodeCudd_ReadBackground (DdManager *dd)
 
void Cudd_SetBackground (DdManager *dd, DdNode *bck)
 
unsigned int Cudd_ReadCacheSlots (DdManager *dd)
 
double Cudd_ReadCacheUsedSlots (DdManager *dd)
 
double Cudd_ReadCacheLookUps (DdManager *dd)
 
double Cudd_ReadCacheHits (DdManager *dd)
 
double Cudd_ReadRecursiveCalls (DdManager *dd)
 
unsigned int Cudd_ReadMinHit (DdManager *dd)
 
void Cudd_SetMinHit (DdManager *dd, unsigned int hr)
 
unsigned int Cudd_ReadLooseUpTo (DdManager *dd)
 
void Cudd_SetLooseUpTo (DdManager *dd, unsigned int lut)
 
unsigned int Cudd_ReadMaxCache (DdManager *dd)
 
unsigned int Cudd_ReadMaxCacheHard (DdManager *dd)
 
void Cudd_SetMaxCacheHard (DdManager *dd, unsigned int mc)
 
int Cudd_ReadSize (DdManager *dd)
 
int Cudd_ReadZddSize (DdManager *dd)
 
unsigned int Cudd_ReadSlots (DdManager *dd)
 
double Cudd_ReadUsedSlots (DdManager *dd)
 
double Cudd_ExpectedUsedSlots (DdManager *dd)
 
unsigned int Cudd_ReadKeys (DdManager *dd)
 
unsigned int Cudd_ReadDead (DdManager *dd)
 
unsigned int Cudd_ReadMinDead (DdManager *dd)
 
int Cudd_ReadReorderings (DdManager *dd)
 
long Cudd_ReadReorderingTime (DdManager *dd)
 
int Cudd_ReadGarbageCollections (DdManager *dd)
 
long Cudd_ReadGarbageCollectionTime (DdManager *dd)
 
double Cudd_ReadNodesFreed (DdManager *dd)
 
double Cudd_ReadNodesDropped (DdManager *dd)
 
double Cudd_ReadUniqueLookUps (DdManager *dd)
 
double Cudd_ReadUniqueLinks (DdManager *dd)
 
int Cudd_ReadSiftMaxVar (DdManager *dd)
 
void Cudd_SetSiftMaxVar (DdManager *dd, int smv)
 
int Cudd_ReadSiftMaxSwap (DdManager *dd)
 
void Cudd_SetSiftMaxSwap (DdManager *dd, int sms)
 
double Cudd_ReadMaxGrowth (DdManager *dd)
 
void Cudd_SetMaxGrowth (DdManager *dd, double mg)
 
double Cudd_ReadMaxGrowthAlternate (DdManager *dd)
 
void Cudd_SetMaxGrowthAlternate (DdManager *dd, double mg)
 
int Cudd_ReadReorderingCycle (DdManager *dd)
 
void Cudd_SetReorderingCycle (DdManager *dd, int cycle)
 
MtrNodeCudd_ReadTree (DdManager *dd)
 
void Cudd_SetTree (DdManager *dd, MtrNode *tree)
 
void Cudd_FreeTree (DdManager *dd)
 
MtrNodeCudd_ReadZddTree (DdManager *dd)
 
void Cudd_SetZddTree (DdManager *dd, MtrNode *tree)
 
void Cudd_FreeZddTree (DdManager *dd)
 
unsigned int Cudd_NodeReadIndex (DdNode *node)
 
int Cudd_ReadPerm (DdManager *dd, int i)
 
int Cudd_ReadPermZdd (DdManager *dd, int i)
 
int Cudd_ReadInvPerm (DdManager *dd, int i)
 
int Cudd_ReadInvPermZdd (DdManager *dd, int i)
 
DdNodeCudd_ReadVars (DdManager *dd, int i)
 
CUDD_VALUE_TYPE Cudd_ReadEpsilon (DdManager *dd)
 
void Cudd_SetEpsilon (DdManager *dd, CUDD_VALUE_TYPE ep)
 
Cudd_AggregationType Cudd_ReadGroupcheck (DdManager *dd)
 
void Cudd_SetGroupcheck (DdManager *dd, Cudd_AggregationType gc)
 
int Cudd_GarbageCollectionEnabled (DdManager *dd)
 
void Cudd_EnableGarbageCollection (DdManager *dd)
 
void Cudd_DisableGarbageCollection (DdManager *dd)
 
int Cudd_DeadAreCounted (DdManager *dd)
 
void Cudd_TurnOnCountDead (DdManager *dd)
 
void Cudd_TurnOffCountDead (DdManager *dd)
 
int Cudd_ReadRecomb (DdManager *dd)
 
void Cudd_SetRecomb (DdManager *dd, int recomb)
 
int Cudd_ReadSymmviolation (DdManager *dd)
 
void Cudd_SetSymmviolation (DdManager *dd, int symmviolation)
 
int Cudd_ReadArcviolation (DdManager *dd)
 
void Cudd_SetArcviolation (DdManager *dd, int arcviolation)
 
int Cudd_ReadPopulationSize (DdManager *dd)
 
void Cudd_SetPopulationSize (DdManager *dd, int populationSize)
 
int Cudd_ReadNumberXovers (DdManager *dd)
 
void Cudd_SetNumberXovers (DdManager *dd, int numberXovers)
 
unsigned long Cudd_ReadMemoryInUse (DdManager *dd)
 
int Cudd_PrintInfo (DdManager *dd, FILE *fp)
 
long Cudd_ReadPeakNodeCount (DdManager *dd)
 
int Cudd_ReadPeakLiveNodeCount (DdManager *dd)
 
long Cudd_ReadNodeCount (DdManager *dd)
 
long Cudd_zddReadNodeCount (DdManager *dd)
 
int Cudd_AddHook (DdManager *dd, DD_HFP f, Cudd_HookType where)
 
int Cudd_RemoveHook (DdManager *dd, DD_HFP f, Cudd_HookType where)
 
int Cudd_IsInHook (DdManager *dd, DD_HFP f, Cudd_HookType where)
 
int Cudd_StdPreReordHook (DdManager *dd, const char *str, void *data)
 
int Cudd_StdPostReordHook (DdManager *dd, const char *str, void *data)
 
int Cudd_EnableReorderingReporting (DdManager *dd)
 
int Cudd_DisableReorderingReporting (DdManager *dd)
 
int Cudd_ReorderingReporting (DdManager *dd)
 
Cudd_ErrorType Cudd_ReadErrorCode (DdManager *dd)
 
void Cudd_ClearErrorCode (DdManager *dd)
 
FILE * Cudd_ReadStdout (DdManager *dd)
 
void Cudd_SetStdout (DdManager *dd, FILE *fp)
 
FILE * Cudd_ReadStderr (DdManager *dd)
 
void Cudd_SetStderr (DdManager *dd, FILE *fp)
 
unsigned int Cudd_ReadNextReordering (DdManager *dd)
 
void Cudd_SetNextReordering (DdManager *dd, unsigned int next)
 
double Cudd_ReadSwapSteps (DdManager *dd)
 
unsigned int Cudd_ReadMaxLive (DdManager *dd)
 
void Cudd_SetMaxLive (DdManager *dd, unsigned int maxLive)
 
unsigned long Cudd_ReadMaxMemory (DdManager *dd)
 
void Cudd_SetMaxMemory (DdManager *dd, unsigned long maxMemory)
 
int Cudd_bddBindVar (DdManager *dd, int index)
 
int Cudd_bddUnbindVar (DdManager *dd, int index)
 
int Cudd_bddVarIsBound (DdManager *dd, int index)
 
int Cudd_bddSetPiVar (DdManager *dd, int index)
 
int Cudd_bddSetPsVar (DdManager *dd, int index)
 
int Cudd_bddSetNsVar (DdManager *dd, int index)
 
int Cudd_bddIsPiVar (DdManager *dd, int index)
 
int Cudd_bddIsPsVar (DdManager *dd, int index)
 
int Cudd_bddIsNsVar (DdManager *dd, int index)
 
int Cudd_bddSetPairIndex (DdManager *dd, int index, int pairIndex)
 
int Cudd_bddReadPairIndex (DdManager *dd, int index)
 
int Cudd_bddSetVarToBeGrouped (DdManager *dd, int index)
 
int Cudd_bddSetVarHardGroup (DdManager *dd, int index)
 
int Cudd_bddResetVarToBeGrouped (DdManager *dd, int index)
 
int Cudd_bddIsVarToBeGrouped (DdManager *dd, int index)
 
int Cudd_bddSetVarToBeUngrouped (DdManager *dd, int index)
 
int Cudd_bddIsVarToBeUngrouped (DdManager *dd, int index)
 
int Cudd_bddIsVarHardGroup (DdManager *dd, int index)
 

Variables

static
ABC_NAMESPACE_IMPL_START char
rcsid[] 
DD_UNUSED = "$Id: cuddAPI.c,v 1.59 2009/02/19 16:14:14 fabio Exp $"
 

Function Documentation

static int addMultiplicityGroups ( DdManager dd,
MtrNode treenode,
int  multiplicity,
char *  vmask,
char *  lmask 
)
static

Function********************************************************************

Synopsis [Adds multiplicity groups to a ZDD variable group tree.]

Description [Adds multiplicity groups to a ZDD variable group tree. Returns 1 if successful; 0 otherwise. This function creates the groups for set of ZDD variables (whose cardinality is given by parameter multiplicity) that are created for each BDD variable in Cudd_zddVarsFromBddVars. The crux of the matter is to determine the index each new group. (The index of the first variable in the group.) We first build all the groups for the children of a node, and then deal with the ZDD variables that are directly attached to the node. The problem for these is that the tree itself does not provide information on their position inside the group. While we deal with the children of the node, therefore, we keep track of all the positions they occupy. The remaining positions in the tree can be freely used. Also, we keep track of all the variables placed in the children. All the remaining variables are directly attached to the group. We can then place any pair of variables not yet grouped in any pair of available positions in the node.]

SideEffects [Changes the variable group tree.]

SeeAlso [Cudd_zddVarsFromBddVars]

Definition at line 4402 of file cuddAPI.c.

4408 {
4409  int startV, stopV, startL;
4410  int i, j;
4411  MtrNode *auxnode = treenode;
4412 
4413  while (auxnode != NULL) {
4414  if (auxnode->child != NULL) {
4415  addMultiplicityGroups(dd,auxnode->child,multiplicity,vmask,lmask);
4416  }
4417  /* Build remaining groups. */
4418  startV = dd->permZ[auxnode->index] / multiplicity;
4419  startL = auxnode->low / multiplicity;
4420  stopV = startV + auxnode->size / multiplicity;
4421  /* Walk down vmask starting at startV and build missing groups. */
4422  for (i = startV, j = startL; i < stopV; i++) {
4423  if (vmask[i] == 0) {
4424  MtrNode *node;
4425  while (lmask[j] == 1) j++;
4426  node = Mtr_MakeGroup(auxnode, j * multiplicity, multiplicity,
4427  MTR_FIXED);
4428  if (node == NULL) {
4429  return(0);
4430  }
4431  node->index = dd->invpermZ[i * multiplicity];
4432  vmask[i] = 1;
4433  lmask[j] = 1;
4434  }
4435  }
4436  auxnode = auxnode->younger;
4437  }
4438  return(1);
4439 
4440 } /* end of addMultiplicityGroups */
MtrHalfWord size
Definition: mtr.h:134
int * invpermZ
Definition: cuddInt.h:389
#define MTR_FIXED
Definition: mtr.h:102
int * permZ
Definition: cuddInt.h:387
struct MtrNode * younger
Definition: mtr.h:139
MtrHalfWord index
Definition: mtr.h:135
static int addMultiplicityGroups(DdManager *dd, MtrNode *treenode, int multiplicity, char *vmask, char *lmask)
Definition: cuddAPI.c:4402
MtrHalfWord low
Definition: mtr.h:133
Definition: mtr.h:131
MtrNode * Mtr_MakeGroup(MtrNode *root, unsigned int low, unsigned int high, unsigned int flags)
Definition: mtrGroup.c:158
struct MtrNode * child
Definition: mtr.h:137
DdNode* Cudd_addConst ( DdManager dd,
CUDD_VALUE_TYPE  c 
)

Function********************************************************************

Synopsis [Returns the ADD for constant c.]

Description [Retrieves the ADD for constant c if it already exists, or creates a new ADD. Returns a pointer to the ADD if successful; NULL otherwise.]

SideEffects [None]

SeeAlso [Cudd_addNewVar Cudd_addIthVar]

Definition at line 620 of file cuddAPI.c.

623 {
624  return(cuddUniqueConst(dd,c));
625 
626 } /* end of Cudd_addConst */
DdNode * cuddUniqueConst(DdManager *unique, CUDD_VALUE_TYPE value)
Definition: cuddTable.c:1450
int Cudd_AddHook ( DdManager dd,
DD_HFP  f,
Cudd_HookType  where 
)

Function********************************************************************

Synopsis [Adds a function to a hook.]

Description [Adds a function to a hook. A hook is a list of application-provided functions called on certain occasions by the package. Returns 1 if the function is successfully added; 2 if the function was already in the list; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_RemoveHook]

Definition at line 3244 of file cuddAPI.c.

3248 {
3249  DdHook **hook, *nextHook, *newHook;
3250 
3251  switch (where) {
3252  case CUDD_PRE_GC_HOOK:
3253  hook = &(dd->preGCHook);
3254  break;
3255  case CUDD_POST_GC_HOOK:
3256  hook = &(dd->postGCHook);
3257  break;
3259  hook = &(dd->preReorderingHook);
3260  break;
3262  hook = &(dd->postReorderingHook);
3263  break;
3264  default:
3265  return(0);
3266  }
3267  /* Scan the list and find whether the function is already there.
3268  ** If so, just return. */
3269  nextHook = *hook;
3270  while (nextHook != NULL) {
3271  if (nextHook->f == f) {
3272  return(2);
3273  }
3274  hook = &(nextHook->next);
3275  nextHook = nextHook->next;
3276  }
3277  /* The function was not in the list. Create a new item and append it
3278  ** to the end of the list. */
3279  newHook = ABC_ALLOC(DdHook,1);
3280  if (newHook == NULL) {
3281  dd->errorCode = CUDD_MEMORY_OUT;
3282  return(0);
3283  }
3284  newHook->next = NULL;
3285  newHook->f = f;
3286  *hook = newHook;
3287  return(1);
3288 
3289 } /* end of Cudd_AddHook */
DdHook * preReorderingHook
Definition: cuddInt.h:439
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
DD_HFP f
Definition: cuddInt.h:246
DdHook * postReorderingHook
Definition: cuddInt.h:440
struct DdHook * next
Definition: cuddInt.h:247
DdHook * postGCHook
Definition: cuddInt.h:438
DdHook * preGCHook
Definition: cuddInt.h:437
Cudd_ErrorType errorCode
Definition: cuddInt.h:447
DdNode* Cudd_addIthVar ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the ADD variable with index i.]

Description [Retrieves the ADD variable with index i if it already exists, or creates a new ADD variable. Returns a pointer to the variable if successful; NULL otherwise. An ADD variable differs from a BDD variable because it points to the arithmetic zero, instead of having a complement pointer to 1. ]

SideEffects [None]

SeeAlso [Cudd_addNewVar Cudd_bddIthVar Cudd_addConst Cudd_addNewVarAtLevel]

Definition at line 384 of file cuddAPI.c.

387 {
388  DdNode *res;
389 
390  if ((unsigned int) i >= CUDD_MAXINDEX - 1) return(NULL);
391  do {
392  dd->reordered = 0;
393  res = cuddUniqueInter(dd,i,DD_ONE(dd),DD_ZERO(dd));
394  } while (dd->reordered == 1);
395 
396  return(res);
397 
398 } /* end of Cudd_addIthVar */
Definition: cudd.h:278
int reordered
Definition: cuddInt.h:409
#define CUDD_MAXINDEX
Definition: cudd.h:112
#define DD_ONE(dd)
Definition: cuddInt.h:911
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1128
#define DD_ZERO(dd)
Definition: cuddInt.h:927
DdNode* Cudd_addNewVar ( DdManager dd)

AutomaticEnd Function********************************************************************

Synopsis [Returns a new ADD variable.]

Description [Creates a new ADD variable. The new variable has an index equal to the largest previous index plus 1. Returns a pointer to the new variable if successful; NULL otherwise. An ADD variable differs from a BDD variable because it points to the arithmetic zero, instead of having a complement pointer to 1. ]

SideEffects [None]

SeeAlso [Cudd_bddNewVar Cudd_addIthVar Cudd_addConst Cudd_addNewVarAtLevel]

Definition at line 259 of file cuddAPI.c.

261 {
262  DdNode *res;
263 
264  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
265  do {
266  dd->reordered = 0;
267  res = cuddUniqueInter(dd,dd->size,DD_ONE(dd),DD_ZERO(dd));
268  } while (dd->reordered == 1);
269 
270  return(res);
271 
272 } /* end of Cudd_addNewVar */
Definition: cudd.h:278
int size
Definition: cuddInt.h:361
int reordered
Definition: cuddInt.h:409
#define CUDD_MAXINDEX
Definition: cudd.h:112
#define DD_ONE(dd)
Definition: cuddInt.h:911
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1128
#define DD_ZERO(dd)
Definition: cuddInt.h:927
DdNode* Cudd_addNewVarAtLevel ( DdManager dd,
int  level 
)

Function********************************************************************

Synopsis [Returns a new ADD variable at a specified level.]

Description [Creates a new ADD variable. The new variable has an index equal to the largest previous index plus 1 and is positioned at the specified level in the order. Returns a pointer to the new variable if successful; NULL otherwise.]

SideEffects [None]

SeeAlso [Cudd_addNewVar Cudd_addIthVar Cudd_bddNewVarAtLevel]

Definition at line 290 of file cuddAPI.c.

293 {
294  DdNode *res;
295 
296  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
297  if (level >= dd->size) return(Cudd_addIthVar(dd,level));
298  if (!cuddInsertSubtables(dd,1,level)) return(NULL);
299  do {
300  dd->reordered = 0;
301  res = cuddUniqueInter(dd,dd->size - 1,DD_ONE(dd),DD_ZERO(dd));
302  } while (dd->reordered == 1);
303 
304  return(res);
305 
306 } /* end of Cudd_addNewVarAtLevel */
Definition: cudd.h:278
int size
Definition: cuddInt.h:361
int reordered
Definition: cuddInt.h:409
int cuddInsertSubtables(DdManager *unique, int n, int level)
Definition: cuddTable.c:1795
DdNode * Cudd_addIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:384
#define CUDD_MAXINDEX
Definition: cudd.h:112
#define DD_ONE(dd)
Definition: cuddInt.h:911
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1128
#define DD_ZERO(dd)
Definition: cuddInt.h:927
void Cudd_AutodynDisable ( DdManager unique)

Function********************************************************************

Synopsis [Disables automatic dynamic reordering.]

Description []

SideEffects [None]

SeeAlso [Cudd_AutodynEnable Cudd_ReorderingStatus Cudd_AutodynDisableZdd]

Definition at line 708 of file cuddAPI.c.

710 {
711  unique->autoDyn = 0;
712  return;
713 
714 } /* end of Cudd_AutodynDisable */
int autoDyn
Definition: cuddInt.h:416
void Cudd_AutodynDisableZdd ( DdManager unique)

Function********************************************************************

Synopsis [Disables automatic dynamic reordering of ZDDs.]

Description []

SideEffects [None]

SeeAlso [Cudd_AutodynEnableZdd Cudd_ReorderingStatusZdd Cudd_AutodynDisable]

Definition at line 786 of file cuddAPI.c.

788 {
789  unique->autoDynZ = 0;
790  return;
791 
792 } /* end of Cudd_AutodynDisableZdd */
int autoDynZ
Definition: cuddInt.h:417
void Cudd_AutodynEnable ( DdManager unique,
Cudd_ReorderingType  method 
)

Function********************************************************************

Synopsis [Enables automatic dynamic reordering of BDDs and ADDs.]

Description [Enables automatic dynamic reordering of BDDs and ADDs. Parameter method is used to determine the method used for reordering. If CUDD_REORDER_SAME is passed, the method is unchanged.]

SideEffects [None]

SeeAlso [Cudd_AutodynDisable Cudd_ReorderingStatus Cudd_AutodynEnableZdd]

Definition at line 669 of file cuddAPI.c.

672 {
673  unique->autoDyn = 1;
674  if (method != CUDD_REORDER_SAME) {
675  unique->autoMethod = method;
676  }
677 #ifndef DD_NO_DEATH_ROW
678  /* If reordering is enabled, using the death row causes too many
679  ** invocations. Hence, we shrink the death row to just one entry.
680  */
681  cuddClearDeathRow(unique);
682  unique->deathRowDepth = 1;
683  unique->deadMask = unique->deathRowDepth - 1;
684  if ((unsigned) unique->nextDead > unique->deadMask) {
685  unique->nextDead = 0;
686  }
687  unique->deathRow = ABC_REALLOC(DdNodePtr, unique->deathRow,
688  unique->deathRowDepth);
689 #endif
690  return;
691 
692 } /* end of Cudd_AutodynEnable */
Cudd_ReorderingType autoMethod
Definition: cuddInt.h:418
Definition: cudd.h:278
unsigned deadMask
Definition: cuddInt.h:404
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
DdNode ** deathRow
Definition: cuddInt.h:401
int nextDead
Definition: cuddInt.h:403
int deathRowDepth
Definition: cuddInt.h:402
void cuddClearDeathRow(DdManager *table)
Definition: cuddRef.c:726
int autoDyn
Definition: cuddInt.h:416
void Cudd_AutodynEnableZdd ( DdManager unique,
Cudd_ReorderingType  method 
)

Function********************************************************************

Synopsis [Enables automatic dynamic reordering of ZDDs.]

Description [Enables automatic dynamic reordering of ZDDs. Parameter method is used to determine the method used for reordering ZDDs. If CUDD_REORDER_SAME is passed, the method is unchanged.]

SideEffects [None]

SeeAlso [Cudd_AutodynDisableZdd Cudd_ReorderingStatusZdd Cudd_AutodynEnable]

Definition at line 760 of file cuddAPI.c.

763 {
764  unique->autoDynZ = 1;
765  if (method != CUDD_REORDER_SAME) {
766  unique->autoMethodZ = method;
767  }
768  return;
769 
770 } /* end of Cudd_AutodynEnableZdd */
Cudd_ReorderingType autoMethodZ
Definition: cuddInt.h:419
int autoDynZ
Definition: cuddInt.h:417
int Cudd_bddBindVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Prevents sifting of a variable.]

Description [This function sets a flag to prevent sifting of a variable. Returns 1 if successful; 0 otherwise (i.e., invalid variable index).]

SideEffects [Changes the "bindVar" flag in DdSubtable.]

SeeAlso [Cudd_bddUnbindVar]

Definition at line 3899 of file cuddAPI.c.

3902 {
3903  if (index >= dd->size || index < 0) return(0);
3904  dd->subtables[dd->perm[index]].bindVar = 1;
3905  return(1);
3906 
3907 } /* end of Cudd_bddBindVar */
int size
Definition: cuddInt.h:361
int bindVar
Definition: cuddInt.h:334
DdSubtable * subtables
Definition: cuddInt.h:365
int * perm
Definition: cuddInt.h:386
int Cudd_bddIsNsVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Checks whether a variable is next state.]

Description [Checks whether a variable is next state. Returns 1 if the variable's type is present state; 0 if the variable exists but is not a present state; -1 if the variable does not exist.]

SideEffects [none]

SeeAlso [Cudd_bddSetNsVar Cudd_bddIsPiVar Cudd_bddIsPsVar]

Definition at line 4098 of file cuddAPI.c.

4101 {
4102  if (index >= dd->size || index < 0) return -1;
4103  return (dd->subtables[dd->perm[index]].varType == CUDD_VAR_NEXT_STATE);
4104 
4105 } /* end of Cudd_bddIsNsVar */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_VariableType varType
Definition: cuddInt.h:336
int * perm
Definition: cuddInt.h:386
int Cudd_bddIsPiVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Checks whether a variable is primary input.]

Description [Checks whether a variable is primary input. Returns 1 if the variable's type is primary input; 0 if the variable exists but is not a primary input; -1 if the variable does not exist.]

SideEffects [none]

SeeAlso [Cudd_bddSetPiVar Cudd_bddIsPsVar Cudd_bddIsNsVar]

Definition at line 4050 of file cuddAPI.c.

4053 {
4054  if (index >= dd->size || index < 0) return -1;
4055  return (dd->subtables[dd->perm[index]].varType == CUDD_VAR_PRIMARY_INPUT);
4056 
4057 } /* end of Cudd_bddIsPiVar */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_VariableType varType
Definition: cuddInt.h:336
int * perm
Definition: cuddInt.h:386
int Cudd_bddIsPsVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Checks whether a variable is present state.]

Description [Checks whether a variable is present state. Returns 1 if the variable's type is present state; 0 if the variable exists but is not a present state; -1 if the variable does not exist.]

SideEffects [none]

SeeAlso [Cudd_bddSetPsVar Cudd_bddIsPiVar Cudd_bddIsNsVar]

Definition at line 4074 of file cuddAPI.c.

4077 {
4078  if (index >= dd->size || index < 0) return -1;
4079  return (dd->subtables[dd->perm[index]].varType == CUDD_VAR_PRESENT_STATE);
4080 
4081 } /* end of Cudd_bddIsPsVar */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_VariableType varType
Definition: cuddInt.h:336
int * perm
Definition: cuddInt.h:386
int Cudd_bddIsVarHardGroup ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Checks whether a variable is set to be in a hard group.]

Description [Checks whether a variable is set to be in a hard group. This function is used for lazy sifting. Returns 1 if the variable is marked to be in a hard group; 0 if the variable exists, but it is not marked to be in a hard group; -1 if the variable does not exist.]

SideEffects [none]

SeeAlso [Cudd_bddSetVarHardGroup]

Definition at line 4326 of file cuddAPI.c.

4329 {
4330  if (index >= dd->size || index < 0) return(-1);
4331  if (dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_HARD_GROUP)
4332  return(1);
4333  return(0);
4334 
4335 } /* end of Cudd_bddIsVarToBeGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
int Cudd_bddIsVarToBeGrouped ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Checks whether a variable is set to be grouped.]

Description [Checks whether a variable is set to be grouped. This function is used for lazy sifting.]

SideEffects [none]

SeeAlso []

Definition at line 4249 of file cuddAPI.c.

4252 {
4253  if (index >= dd->size || index < 0) return(-1);
4254  if (dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_UNGROUP)
4255  return(0);
4256  else
4257  return(dd->subtables[dd->perm[index]].varToBeGrouped);
4258 
4259 } /* end of Cudd_bddIsVarToBeGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
int Cudd_bddIsVarToBeUngrouped ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Checks whether a variable is set to be ungrouped.]

Description [Checks whether a variable is set to be ungrouped. This function is used for lazy sifting. Returns 1 if the variable is marked to be ungrouped; 0 if the variable exists, but it is not marked to be ungrouped; -1 if the variable does not exist.]

SideEffects [none]

SeeAlso [Cudd_bddSetVarToBeUngrouped]

Definition at line 4301 of file cuddAPI.c.

4304 {
4305  if (index >= dd->size || index < 0) return(-1);
4306  return dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_UNGROUP;
4307 
4308 } /* end of Cudd_bddIsVarToBeGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
DdNode* Cudd_bddIthVar ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the BDD variable with index i.]

Description [Retrieves the BDD variable with index i if it already exists, or creates a new BDD variable. Returns a pointer to the variable if successful; NULL otherwise.]

SideEffects [None]

SeeAlso [Cudd_bddNewVar Cudd_addIthVar Cudd_bddNewVarAtLevel Cudd_ReadVars]

Definition at line 416 of file cuddAPI.c.

419 {
420  DdNode *res;
421 
422  if ((unsigned int) i >= CUDD_MAXINDEX - 1) return(NULL);
423  if (i < dd->size) {
424  res = dd->vars[i];
425  } else {
426  res = cuddUniqueInter(dd,i,dd->one,Cudd_Not(dd->one));
427  }
428 
429  return(res);
430 
431 } /* end of Cudd_bddIthVar */
Definition: cudd.h:278
#define Cudd_Not(node)
Definition: cudd.h:367
static int size
Definition: cuddSign.c:86
DdNode ** vars
Definition: cuddInt.h:390
DdNode * one
Definition: cuddInt.h:345
#define CUDD_MAXINDEX
Definition: cudd.h:112
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1128
DdNode* Cudd_bddNewVar ( DdManager dd)

Function********************************************************************

Synopsis [Returns a new BDD variable.]

Description [Creates a new BDD variable. The new variable has an index equal to the largest previous index plus 1. Returns a pointer to the new variable if successful; NULL otherwise.]

SideEffects [None]

SeeAlso [Cudd_addNewVar Cudd_bddIthVar Cudd_bddNewVarAtLevel]

Definition at line 323 of file cuddAPI.c.

325 {
326  DdNode *res;
327 
328  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
329  res = cuddUniqueInter(dd,dd->size,dd->one,Cudd_Not(dd->one));
330 
331  return(res);
332 
333 } /* end of Cudd_bddNewVar */
Definition: cudd.h:278
#define Cudd_Not(node)
Definition: cudd.h:367
int size
Definition: cuddInt.h:361
DdNode * one
Definition: cuddInt.h:345
#define CUDD_MAXINDEX
Definition: cudd.h:112
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1128
DdNode* Cudd_bddNewVarAtLevel ( DdManager dd,
int  level 
)

Function********************************************************************

Synopsis [Returns a new BDD variable at a specified level.]

Description [Creates a new BDD variable. The new variable has an index equal to the largest previous index plus 1 and is positioned at the specified level in the order. Returns a pointer to the new variable if successful; NULL otherwise.]

SideEffects [None]

SeeAlso [Cudd_bddNewVar Cudd_bddIthVar Cudd_addNewVarAtLevel]

Definition at line 351 of file cuddAPI.c.

354 {
355  DdNode *res;
356 
357  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
358  if (level >= dd->size) return(Cudd_bddIthVar(dd,level));
359  if (!cuddInsertSubtables(dd,1,level)) return(NULL);
360  res = dd->vars[dd->size - 1];
361 
362  return(res);
363 
364 } /* end of Cudd_bddNewVarAtLevel */
Definition: cudd.h:278
int size
Definition: cuddInt.h:361
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:416
int cuddInsertSubtables(DdManager *unique, int n, int level)
Definition: cuddTable.c:1795
DdNode ** vars
Definition: cuddInt.h:390
#define CUDD_MAXINDEX
Definition: cudd.h:112
int Cudd_bddReadPairIndex ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Reads a corresponding pair index for a given index.]

Description [Reads a corresponding pair index for a given index. These pair indices are present and next state variable. Returns the corresponding variable index if the variable exists; -1 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetPairIndex]

Definition at line 4148 of file cuddAPI.c.

4151 {
4152  if (index >= dd->size || index < 0) return -1;
4153  return dd->subtables[dd->perm[index]].pairIndex;
4154 
4155 } /* end of Cudd_bddReadPairIndex */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
int pairIndex
Definition: cuddInt.h:337
int * perm
Definition: cuddInt.h:386
void Cudd_bddRealignDisable ( DdManager unique)

Function********************************************************************

Synopsis [Disables realignment of ZDD order to BDD order.]

Description []

SideEffects [None]

SeeAlso [Cudd_bddRealignEnable Cudd_bddRealignmentEnabled Cudd_zddRealignEnable Cudd_zddRealignmentEnabled]

Definition at line 965 of file cuddAPI.c.

967 {
968  unique->realignZ = 0;
969  return;
970 
971 } /* end of Cudd_bddRealignDisable */
int realignZ
Definition: cuddInt.h:421
void Cudd_bddRealignEnable ( DdManager unique)

Function********************************************************************

Synopsis [Enables realignment of BDD order to ZDD order.]

Description [Enables realignment of the BDD variable order to the ZDD variable order after the ZDDs have been reordered. The number of ZDD variables must be a multiple of the number of BDD variables for realignment to make sense. If this condition is not met, Cudd_zddReduceHeap will return 0. Let M be the ratio of the two numbers. For the purpose of realignment, the ZDD variables from M*i to (M+1)*i-1 are reagarded as corresponding to BDD variable i. Realignment is initially disabled.]

SideEffects [None]

SeeAlso [Cudd_zddReduceHeap Cudd_bddRealignDisable Cudd_bddRealignmentEnabled Cudd_zddRealignDisable Cudd_zddRealignmentEnabled]

Definition at line 943 of file cuddAPI.c.

945 {
946  unique->realignZ = 1;
947  return;
948 
949 } /* end of Cudd_bddRealignEnable */
int realignZ
Definition: cuddInt.h:421
int Cudd_bddRealignmentEnabled ( DdManager unique)

Function********************************************************************

Synopsis [Tells whether the realignment of BDD order to ZDD order is enabled.]

Description [Returns 1 if the realignment of BDD order to ZDD order is enabled; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_bddRealignEnable Cudd_bddRealignDisable Cudd_zddRealignEnable Cudd_zddRealignDisable]

Definition at line 913 of file cuddAPI.c.

915 {
916  return(unique->realignZ);
917 
918 } /* end of Cudd_bddRealignmentEnabled */
int realignZ
Definition: cuddInt.h:421
int Cudd_bddResetVarToBeGrouped ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Resets a variable not to be grouped.]

Description [Resets a variable not to be grouped. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetVarToBeGrouped Cudd_bddSetVarHardGroup]

Definition at line 4222 of file cuddAPI.c.

4225 {
4226  if (index >= dd->size || index < 0) return(0);
4227  if (dd->subtables[dd->perm[index]].varToBeGrouped <=
4229  dd->subtables[dd->perm[index]].varToBeGrouped = CUDD_LAZY_NONE;
4230  }
4231  return(1);
4232 
4233 } /* end of Cudd_bddResetVarToBeGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetNsVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Sets a variable type to next state.]

Description [Sets a variable type to next state. The variable type is used by lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetPiVar Cudd_bddSetPsVar Cudd_bddIsNsVar]

Definition at line 4025 of file cuddAPI.c.

4028 {
4029  if (index >= dd->size || index < 0) return (0);
4030  dd->subtables[dd->perm[index]].varType = CUDD_VAR_NEXT_STATE;
4031  return(1);
4032 
4033 } /* end of Cudd_bddSetNsVar */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_VariableType varType
Definition: cuddInt.h:336
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetPairIndex ( DdManager dd,
int  index,
int  pairIndex 
)

Function********************************************************************

Synopsis [Sets a corresponding pair index for a given index.]

Description [Sets a corresponding pair index for a given index. These pair indices are present and next state variable. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddReadPairIndex]

Definition at line 4122 of file cuddAPI.c.

4126 {
4127  if (index >= dd->size || index < 0) return(0);
4128  dd->subtables[dd->perm[index]].pairIndex = pairIndex;
4129  return(1);
4130 
4131 } /* end of Cudd_bddSetPairIndex */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
int pairIndex
Definition: cuddInt.h:337
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetPiVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Sets a variable type to primary input.]

Description [Sets a variable type to primary input. The variable type is used by lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetPsVar Cudd_bddSetNsVar Cudd_bddIsPiVar]

Definition at line 3977 of file cuddAPI.c.

3980 {
3981  if (index >= dd->size || index < 0) return (0);
3982  dd->subtables[dd->perm[index]].varType = CUDD_VAR_PRIMARY_INPUT;
3983  return(1);
3984 
3985 } /* end of Cudd_bddSetPiVar */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_VariableType varType
Definition: cuddInt.h:336
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetPsVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Sets a variable type to present state.]

Description [Sets a variable type to present state. The variable type is used by lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetPiVar Cudd_bddSetNsVar Cudd_bddIsPsVar]

Definition at line 4001 of file cuddAPI.c.

4004 {
4005  if (index >= dd->size || index < 0) return (0);
4006  dd->subtables[dd->perm[index]].varType = CUDD_VAR_PRESENT_STATE;
4007  return(1);
4008 
4009 } /* end of Cudd_bddSetPsVar */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_VariableType varType
Definition: cuddInt.h:336
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetVarHardGroup ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Sets a variable to be a hard group.]

Description [Sets a variable to be a hard group. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetVarToBeGrouped Cudd_bddResetVarToBeGrouped Cudd_bddIsVarHardGroup]

Definition at line 4198 of file cuddAPI.c.

4201 {
4202  if (index >= dd->size || index < 0) return(0);
4204  return(1);
4205 
4206 } /* end of Cudd_bddSetVarHardGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetVarToBeGrouped ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Sets a variable to be grouped.]

Description [Sets a variable to be grouped. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddSetVarHardGroup Cudd_bddResetVarToBeGrouped]

Definition at line 4171 of file cuddAPI.c.

4174 {
4175  if (index >= dd->size || index < 0) return(0);
4176  if (dd->subtables[dd->perm[index]].varToBeGrouped <= CUDD_LAZY_SOFT_GROUP) {
4178  }
4179  return(1);
4180 
4181 } /* end of Cudd_bddSetVarToBeGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
int Cudd_bddSetVarToBeUngrouped ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Sets a variable to be ungrouped.]

Description [Sets a variable to be ungrouped. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise.]

SideEffects [modifies the manager]

SeeAlso [Cudd_bddIsVarToBeUngrouped]

Definition at line 4275 of file cuddAPI.c.

4278 {
4279  if (index >= dd->size || index < 0) return(0);
4280  dd->subtables[dd->perm[index]].varToBeGrouped = CUDD_LAZY_UNGROUP;
4281  return(1);
4282 
4283 } /* end of Cudd_bddSetVarToBeGrouped */
int size
Definition: cuddInt.h:361
DdSubtable * subtables
Definition: cuddInt.h:365
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:339
int * perm
Definition: cuddInt.h:386
int Cudd_bddUnbindVar ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Allows the sifting of a variable.]

Description [This function resets the flag that prevents the sifting of a variable. In successive variable reorderings, the variable will NOT be skipped, that is, sifted. Initially all variables can be sifted. It is necessary to call this function only to re-enable sifting after a call to Cudd_bddBindVar. Returns 1 if successful; 0 otherwise (i.e., invalid variable index).]

SideEffects [Changes the "bindVar" flag in DdSubtable.]

SeeAlso [Cudd_bddBindVar]

Definition at line 3927 of file cuddAPI.c.

3930 {
3931  if (index >= dd->size || index < 0) return(0);
3932  dd->subtables[dd->perm[index]].bindVar = 0;
3933  return(1);
3934 
3935 } /* end of Cudd_bddUnbindVar */
int size
Definition: cuddInt.h:361
int bindVar
Definition: cuddInt.h:334
DdSubtable * subtables
Definition: cuddInt.h:365
int * perm
Definition: cuddInt.h:386
int Cudd_bddVarIsBound ( DdManager dd,
int  index 
)

Function********************************************************************

Synopsis [Tells whether a variable can be sifted.]

Description [This function returns 1 if a variable is enabled for sifting. Initially all variables can be sifted. This function returns 0 only if there has been a previous call to Cudd_bddBindVar for that variable not followed by a call to Cudd_bddUnbindVar. The function returns 0 also in the case in which the index of the variable is out of bounds.]

SideEffects [none]

SeeAlso [Cudd_bddBindVar Cudd_bddUnbindVar]

Definition at line 3954 of file cuddAPI.c.

3957 {
3958  if (index >= dd->size || index < 0) return(0);
3959  return(dd->subtables[dd->perm[index]].bindVar);
3960 
3961 } /* end of Cudd_bddVarIsBound */
int size
Definition: cuddInt.h:361
int bindVar
Definition: cuddInt.h:334
DdSubtable * subtables
Definition: cuddInt.h:365
int * perm
Definition: cuddInt.h:386
void Cudd_ClearErrorCode ( DdManager dd)

Function********************************************************************

Synopsis [Clear the error code of a manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadErrorCode]

Definition at line 3632 of file cuddAPI.c.

3634 {
3635  dd->errorCode = CUDD_NO_ERROR;
3636 
3637 } /* end of Cudd_ClearErrorCode */
Cudd_ErrorType errorCode
Definition: cuddInt.h:447
int Cudd_DeadAreCounted ( DdManager dd)

Function********************************************************************

Synopsis [Tells whether dead nodes are counted towards triggering reordering.]

Description [Tells whether dead nodes are counted towards triggering reordering. Returns 1 if dead nodes are counted; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_TurnOnCountDead Cudd_TurnOffCountDead]

Definition at line 2585 of file cuddAPI.c.

2587 {
2588  return(dd->countDead == 0 ? 1 : 0);
2589 
2590 } /* end of Cudd_DeadAreCounted */
unsigned int countDead
Definition: cuddInt.h:423
void Cudd_DisableGarbageCollection ( DdManager dd)

Function********************************************************************

Synopsis [Disables garbage collection.]

Description [Disables garbage collection. Garbage collection is initially enabled. This function may be called to disable it. However, garbage collection will still occur when a new node must be created and no memory is left, or when garbage collection is required for correctness. (E.g., before reordering.)]

SideEffects [None]

SeeAlso [Cudd_EnableGarbageCollection Cudd_GarbageCollectionEnabled]

Definition at line 2563 of file cuddAPI.c.

2565 {
2566  dd->gcEnabled = 0;
2567 
2568 } /* end of Cudd_DisableGarbageCollection */
int gcEnabled
Definition: cuddInt.h:376
int Cudd_DisableReorderingReporting ( DdManager dd)

Function********************************************************************

Synopsis [Disables reporting of reordering stats.]

Description [Disables reporting of reordering stats. Returns 1 if successful; 0 otherwise.]

SideEffects [Removes functions from the pre-reordering and post-reordering hooks.]

SeeAlso [Cudd_EnableReorderingReporting Cudd_ReorderingReporting]

Definition at line 3564 of file cuddAPI.c.

3566 {
3568  return(0);
3569  }
3571  return(0);
3572  }
3573  return(1);
3574 
3575 } /* end of Cudd_DisableReorderingReporting */
int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3501
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3408
int Cudd_RemoveHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3306
void Cudd_EnableGarbageCollection ( DdManager dd)

Function********************************************************************

Synopsis [Enables garbage collection.]

Description [Enables garbage collection. Garbage collection is initially enabled. Therefore it is necessary to call this function only if garbage collection has been explicitly disabled.]

SideEffects [None]

SeeAlso [Cudd_DisableGarbageCollection Cudd_GarbageCollectionEnabled]

Definition at line 2539 of file cuddAPI.c.

2541 {
2542  dd->gcEnabled = 1;
2543 
2544 } /* end of Cudd_EnableGarbageCollection */
int gcEnabled
Definition: cuddInt.h:376
int Cudd_EnableReorderingReporting ( DdManager dd)

Function********************************************************************

Synopsis [Enables reporting of reordering stats.]

Description [Enables reporting of reordering stats. Returns 1 if successful; 0 otherwise.]

SideEffects [Installs functions in the pre-reordering and post-reordering hooks.]

SeeAlso [Cudd_DisableReorderingReporting Cudd_ReorderingReporting]

Definition at line 3536 of file cuddAPI.c.

3538 {
3540  return(0);
3541  }
3543  return(0);
3544  }
3545  return(1);
3546 
3547 } /* end of Cudd_EnableReorderingReporting */
int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3501
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3408
int Cudd_AddHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3244
double Cudd_ExpectedUsedSlots ( DdManager dd)

Function********************************************************************

Synopsis [Computes the expected fraction of used slots in the unique table.]

Description [Computes the fraction of slots in the unique table that should be in use. This expected value is based on the assumption that the hash function distributes the keys randomly; it can be compared with the result of Cudd_ReadUsedSlots to monitor the performance of the unique table hash function.]

SideEffects [None]

SeeAlso [Cudd_ReadSlots Cudd_ReadUsedSlots]

Definition at line 1572 of file cuddAPI.c.

1574 {
1575  int i;
1576  int size = dd->size;
1577  DdSubtable *subtable;
1578  double empty = 0.0;
1579 
1580  /* To each subtable we apply the corollary to Theorem 8.5 (occupancy
1581  ** distribution) from Sedgewick and Flajolet's Analysis of Algorithms.
1582  ** The corollary says that for a table with M buckets and a load ratio
1583  ** of r, the expected number of empty buckets is asymptotically given
1584  ** by M * exp(-r).
1585  */
1586 
1587  /* Scan each BDD/ADD subtable. */
1588  for (i = 0; i < size; i++) {
1589  subtable = &(dd->subtables[i]);
1590  empty += (double) subtable->slots *
1591  exp(-(double) subtable->keys / (double) subtable->slots);
1592  }
1593 
1594  /* Scan the ZDD subtables. */
1595  size = dd->sizeZ;
1596 
1597  for (i = 0; i < size; i++) {
1598  subtable = &(dd->subtableZ[i]);
1599  empty += (double) subtable->slots *
1600  exp(-(double) subtable->keys / (double) subtable->slots);
1601  }
1602 
1603  /* Constant table. */
1604  subtable = &(dd->constants);
1605  empty += (double) subtable->slots *
1606  exp(-(double) subtable->keys / (double) subtable->slots);
1607 
1608  return(1.0 - empty / (double) dd->slots);
1609 
1610 } /* end of Cudd_ExpectedUsedSlots */
unsigned int keys
Definition: cuddInt.h:330
int size
Definition: cuddInt.h:361
unsigned int slots
Definition: cuddInt.h:368
DdSubtable * subtables
Definition: cuddInt.h:365
static int size
Definition: cuddSign.c:86
int sizeZ
Definition: cuddInt.h:362
unsigned int slots
Definition: cuddInt.h:329
DdSubtable constants
Definition: cuddInt.h:367
static DdNode * empty
Definition: cuddZddLin.c:98
DdSubtable * subtableZ
Definition: cuddInt.h:366
void Cudd_FreeTree ( DdManager dd)

Function********************************************************************

Synopsis [Frees the variable group tree of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetTree Cudd_ReadTree Cudd_FreeZddTree]

Definition at line 2180 of file cuddAPI.c.

2182 {
2183  if (dd->tree != NULL) {
2184  Mtr_FreeTree(dd->tree);
2185  dd->tree = NULL;
2186  }
2187  return;
2188 
2189 } /* end of Cudd_FreeTree */
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:188
MtrNode * tree
Definition: cuddInt.h:424
void Cudd_FreeZddTree ( DdManager dd)

Function********************************************************************

Synopsis [Frees the variable group tree of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetZddTree Cudd_ReadZddTree Cudd_FreeTree]

Definition at line 2252 of file cuddAPI.c.

2254 {
2255  if (dd->treeZ != NULL) {
2256  Mtr_FreeTree(dd->treeZ);
2257  dd->treeZ = NULL;
2258  }
2259  return;
2260 
2261 } /* end of Cudd_FreeZddTree */
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:188
MtrNode * treeZ
Definition: cuddInt.h:425
int Cudd_GarbageCollectionEnabled ( DdManager dd)

Function********************************************************************

Synopsis [Tells whether garbage collection is enabled.]

Description [Returns 1 if garbage collection is enabled; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_EnableGarbageCollection Cudd_DisableGarbageCollection]

Definition at line 2517 of file cuddAPI.c.

2519 {
2520  return(dd->gcEnabled);
2521 
2522 } /* end of Cudd_GarbageCollectionEnabled */
int gcEnabled
Definition: cuddInt.h:376
int Cudd_IsInHook ( DdManager dd,
DD_HFP  f,
Cudd_HookType  where 
)

Function********************************************************************

Synopsis [Checks whether a function is in a hook.]

Description [Checks whether a function is in a hook. A hook is a list of application-provided functions called on certain occasions by the package. Returns 1 if the function is found; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_AddHook Cudd_RemoveHook]

Definition at line 3359 of file cuddAPI.c.

3363 {
3364  DdHook *hook;
3365 
3366  switch (where) {
3367  case CUDD_PRE_GC_HOOK:
3368  hook = dd->preGCHook;
3369  break;
3370  case CUDD_POST_GC_HOOK:
3371  hook = dd->postGCHook;
3372  break;
3374  hook = dd->preReorderingHook;
3375  break;
3377  hook = dd->postReorderingHook;
3378  break;
3379  default:
3380  return(0);
3381  }
3382  /* Scan the list and find whether the function is already there. */
3383  while (hook != NULL) {
3384  if (hook->f == f) {
3385  return(1);
3386  }
3387  hook = hook->next;
3388  }
3389  return(0);
3390 
3391 } /* end of Cudd_IsInHook */
DdHook * preReorderingHook
Definition: cuddInt.h:439
DD_HFP f
Definition: cuddInt.h:246
DdHook * postReorderingHook
Definition: cuddInt.h:440
struct DdHook * next
Definition: cuddInt.h:247
DdHook * postGCHook
Definition: cuddInt.h:438
DdHook * preGCHook
Definition: cuddInt.h:437
int Cudd_IsNonConstant ( DdNode f)

Function********************************************************************

Synopsis [Returns 1 if a DD node is not constant.]

Description [Returns 1 if a DD node is not constant. This function is useful to test the results of Cudd_bddIteConstant, Cudd_addIteConstant, Cudd_addEvalConst. These results may be a special value signifying non-constant. In the other cases the macro Cudd_IsConstant can be used.]

SideEffects [None]

SeeAlso [Cudd_IsConstant Cudd_bddIteConstant Cudd_addIteConstant Cudd_addEvalConst]

Definition at line 645 of file cuddAPI.c.

647 {
648  return(f == DD_NON_CONSTANT || !Cudd_IsConstant(f));
649 
650 } /* end of Cudd_IsNonConstant */
#define Cudd_IsConstant(node)
Definition: cudd.h:352
#define DD_NON_CONSTANT
Definition: cuddInt.h:123
unsigned int Cudd_NodeReadIndex ( DdNode node)

Function********************************************************************

Synopsis [Returns the index of the node.]

Description [Returns the index of the node. The node pointer can be either regular or complemented.]

SideEffects [None]

SeeAlso [Cudd_ReadIndex]

Definition at line 2277 of file cuddAPI.c.

2279 {
2280  return((unsigned int) Cudd_Regular(node)->index);
2281 
2282 } /* end of Cudd_NodeReadIndex */
#define Cudd_Regular(node)
Definition: cudd.h:397
int Cudd_PrintInfo ( DdManager dd,
FILE *  fp 
)

Function********************************************************************

Synopsis [Prints out statistics and settings for a CUDD manager.]

Description [Prints out statistics and settings for a CUDD manager. Returns 1 if successful; 0 otherwise.]

SideEffects [None]

SeeAlso []

Definition at line 2937 of file cuddAPI.c.

2940 {
2941  int retval;
2942  Cudd_ReorderingType autoMethod, autoMethodZ;
2943 
2944  /* Modifiable parameters. */
2945  retval = fprintf(fp,"**** CUDD modifiable parameters ****\n");
2946  if (retval == EOF) return(0);
2947  retval = fprintf(fp,"Hard limit for cache size: %u\n",
2948  Cudd_ReadMaxCacheHard(dd));
2949  if (retval == EOF) return(0);
2950  retval = fprintf(fp,"Cache hit threshold for resizing: %u%%\n",
2951  Cudd_ReadMinHit(dd));
2952  if (retval == EOF) return(0);
2953  retval = fprintf(fp,"Garbage collection enabled: %s\n",
2954  Cudd_GarbageCollectionEnabled(dd) ? "yes" : "no");
2955  if (retval == EOF) return(0);
2956  retval = fprintf(fp,"Limit for fast unique table growth: %u\n",
2957  Cudd_ReadLooseUpTo(dd));
2958  if (retval == EOF) return(0);
2959  retval = fprintf(fp,
2960  "Maximum number of variables sifted per reordering: %d\n",
2961  Cudd_ReadSiftMaxVar(dd));
2962  if (retval == EOF) return(0);
2963  retval = fprintf(fp,
2964  "Maximum number of variable swaps per reordering: %d\n",
2965  Cudd_ReadSiftMaxSwap(dd));
2966  if (retval == EOF) return(0);
2967  retval = fprintf(fp,"Maximum growth while sifting a variable: %g\n",
2968  Cudd_ReadMaxGrowth(dd));
2969  if (retval == EOF) return(0);
2970  retval = fprintf(fp,"Dynamic reordering of BDDs enabled: %s\n",
2971  Cudd_ReorderingStatus(dd,&autoMethod) ? "yes" : "no");
2972  if (retval == EOF) return(0);
2973  retval = fprintf(fp,"Default BDD reordering method: %d\n",
2974  (int) autoMethod);
2975  if (retval == EOF) return(0);
2976  retval = fprintf(fp,"Dynamic reordering of ZDDs enabled: %s\n",
2977  Cudd_ReorderingStatusZdd(dd,&autoMethodZ) ? "yes" : "no");
2978  if (retval == EOF) return(0);
2979  retval = fprintf(fp,"Default ZDD reordering method: %d\n",
2980  (int) autoMethodZ);
2981  if (retval == EOF) return(0);
2982  retval = fprintf(fp,"Realignment of ZDDs to BDDs enabled: %s\n",
2983  Cudd_zddRealignmentEnabled(dd) ? "yes" : "no");
2984  if (retval == EOF) return(0);
2985  retval = fprintf(fp,"Realignment of BDDs to ZDDs enabled: %s\n",
2986  Cudd_bddRealignmentEnabled(dd) ? "yes" : "no");
2987  if (retval == EOF) return(0);
2988  retval = fprintf(fp,"Dead nodes counted in triggering reordering: %s\n",
2989  Cudd_DeadAreCounted(dd) ? "yes" : "no");
2990  if (retval == EOF) return(0);
2991  retval = fprintf(fp,"Group checking criterion: %d\n",
2992  (int) Cudd_ReadGroupcheck(dd));
2993  if (retval == EOF) return(0);
2994  retval = fprintf(fp,"Recombination threshold: %d\n", Cudd_ReadRecomb(dd));
2995  if (retval == EOF) return(0);
2996  retval = fprintf(fp,"Symmetry violation threshold: %d\n",
2998  if (retval == EOF) return(0);
2999  retval = fprintf(fp,"Arc violation threshold: %d\n",
3000  Cudd_ReadArcviolation(dd));
3001  if (retval == EOF) return(0);
3002  retval = fprintf(fp,"GA population size: %d\n",
3004  if (retval == EOF) return(0);
3005  retval = fprintf(fp,"Number of crossovers for GA: %d\n",
3006  Cudd_ReadNumberXovers(dd));
3007  if (retval == EOF) return(0);
3008  retval = fprintf(fp,"Next reordering threshold: %u\n",
3010  if (retval == EOF) return(0);
3011 
3012  /* Non-modifiable parameters. */
3013  retval = fprintf(fp,"**** CUDD non-modifiable parameters ****\n");
3014  if (retval == EOF) return(0);
3015  retval = fprintf(fp,"Memory in use: %lu\n", Cudd_ReadMemoryInUse(dd));
3016  if (retval == EOF) return(0);
3017  retval = fprintf(fp,"Peak number of nodes: %ld\n",
3019  if (retval == EOF) return(0);
3020  retval = fprintf(fp,"Peak number of live nodes: %d\n",
3022  if (retval == EOF) return(0);
3023  retval = fprintf(fp,"Number of BDD variables: %d\n", dd->size);
3024  if (retval == EOF) return(0);
3025  retval = fprintf(fp,"Number of ZDD variables: %d\n", dd->sizeZ);
3026  if (retval == EOF) return(0);
3027  retval = fprintf(fp,"Number of cache entries: %u\n", dd->cacheSlots);
3028  if (retval == EOF) return(0);
3029  retval = fprintf(fp,"Number of cache look-ups: %.0f\n",
3030  Cudd_ReadCacheLookUps(dd));
3031  if (retval == EOF) return(0);
3032  retval = fprintf(fp,"Number of cache hits: %.0f\n",
3033  Cudd_ReadCacheHits(dd));
3034  if (retval == EOF) return(0);
3035  retval = fprintf(fp,"Number of cache insertions: %.0f\n",
3036  dd->cacheinserts);
3037  if (retval == EOF) return(0);
3038  retval = fprintf(fp,"Number of cache collisions: %.0f\n",
3039  dd->cachecollisions);
3040  if (retval == EOF) return(0);
3041  retval = fprintf(fp,"Number of cache deletions: %.0f\n",
3042  dd->cachedeletions);
3043  if (retval == EOF) return(0);
3044  retval = cuddCacheProfile(dd,fp);
3045  if (retval == 0) return(0);
3046  retval = fprintf(fp,"Soft limit for cache size: %u\n",
3047  Cudd_ReadMaxCache(dd));
3048  if (retval == EOF) return(0);
3049  retval = fprintf(fp,"Number of buckets in unique table: %u\n", dd->slots);
3050  if (retval == EOF) return(0);
3051  retval = fprintf(fp,"Used buckets in unique table: %.2f%% (expected %.2f%%)\n",
3052  100.0 * Cudd_ReadUsedSlots(dd),
3053  100.0 * Cudd_ExpectedUsedSlots(dd));
3054  if (retval == EOF) return(0);
3055 #ifdef DD_UNIQUE_PROFILE
3056  retval = fprintf(fp,"Unique lookups: %.0f\n", dd->uniqueLookUps);
3057  if (retval == EOF) return(0);
3058  retval = fprintf(fp,"Unique links: %.0f (%g per lookup)\n",
3059  dd->uniqueLinks, dd->uniqueLinks / dd->uniqueLookUps);
3060  if (retval == EOF) return(0);
3061 #endif
3062  retval = fprintf(fp,"Number of BDD and ADD nodes: %u\n", dd->keys);
3063  if (retval == EOF) return(0);
3064  retval = fprintf(fp,"Number of ZDD nodes: %u\n", dd->keysZ);
3065  if (retval == EOF) return(0);
3066  retval = fprintf(fp,"Number of dead BDD and ADD nodes: %u\n", dd->dead);
3067  if (retval == EOF) return(0);
3068  retval = fprintf(fp,"Number of dead ZDD nodes: %u\n", dd->deadZ);
3069  if (retval == EOF) return(0);
3070  retval = fprintf(fp,"Total number of nodes allocated: %d\n", (int)dd->allocated);
3071  if (retval == EOF) return(0);
3072  retval = fprintf(fp,"Total number of nodes reclaimed: %.0f\n",
3073  dd->reclaimed);
3074  if (retval == EOF) return(0);
3075 #ifdef DD_STATS
3076  retval = fprintf(fp,"Nodes freed: %.0f\n", dd->nodesFreed);
3077  if (retval == EOF) return(0);
3078  retval = fprintf(fp,"Nodes dropped: %.0f\n", dd->nodesDropped);
3079  if (retval == EOF) return(0);
3080 #endif
3081 #ifdef DD_COUNT
3082  retval = fprintf(fp,"Number of recursive calls: %.0f\n",
3084  if (retval == EOF) return(0);
3085 #endif
3086  retval = fprintf(fp,"Garbage collections so far: %d\n",
3088  if (retval == EOF) return(0);
3089  retval = fprintf(fp,"Time for garbage collection: %.2f sec\n",
3090  ((double)Cudd_ReadGarbageCollectionTime(dd)/1000.0));
3091  if (retval == EOF) return(0);
3092  retval = fprintf(fp,"Reorderings so far: %d\n", dd->reorderings);
3093  if (retval == EOF) return(0);
3094  retval = fprintf(fp,"Time for reordering: %.2f sec\n",
3095  ((double)Cudd_ReadReorderingTime(dd)/1000.0));
3096  if (retval == EOF) return(0);
3097 #ifdef DD_COUNT
3098  retval = fprintf(fp,"Node swaps in reordering: %.0f\n",
3099  Cudd_ReadSwapSteps(dd));
3100  if (retval == EOF) return(0);
3101 #endif
3102 
3103  return(1);
3104 
3105 } /* end of Cudd_PrintInfo */
ABC_INT64_T allocated
Definition: cuddInt.h:382
int Cudd_ReadSiftMaxSwap(DdManager *dd)
Definition: cuddAPI.c:1938
unsigned int deadZ
Definition: cuddInt.h:372
double Cudd_ExpectedUsedSlots(DdManager *dd)
Definition: cuddAPI.c:1572
unsigned int Cudd_ReadMaxCache(DdManager *dd)
Definition: cuddAPI.c:1371
long Cudd_ReadPeakNodeCount(DdManager *dd)
Definition: cuddAPI.c:3122
int Cudd_ReorderingStatusZdd(DdManager *unique, Cudd_ReorderingType *method)
Definition: cuddAPI.c:812
int size
Definition: cuddInt.h:361
int Cudd_ReadRecomb(DdManager *dd)
Definition: cuddAPI.c:2657
double Cudd_ReadSwapSteps(DdManager *dd)
Definition: cuddAPI.c:3787
unsigned int slots
Definition: cuddInt.h:368
Cudd_AggregationType Cudd_ReadGroupcheck(DdManager *dd)
Definition: cuddAPI.c:2474
unsigned int Cudd_ReadMaxCacheHard(DdManager *dd)
Definition: cuddAPI.c:1391
int Cudd_GarbageCollectionEnabled(DdManager *dd)
Definition: cuddAPI.c:2517
unsigned int Cudd_ReadMinHit(DdManager *dd)
Definition: cuddAPI.c:1272
int Cudd_DeadAreCounted(DdManager *dd)
Definition: cuddAPI.c:2585
unsigned long Cudd_ReadMemoryInUse(DdManager *dd)
Definition: cuddAPI.c:2916
double cachecollisions
Definition: cuddInt.h:457
int Cudd_ReadArcviolation(DdManager *dd)
Definition: cuddAPI.c:2764
double cacheinserts
Definition: cuddInt.h:458
unsigned int dead
Definition: cuddInt.h:371
unsigned int cacheSlots
Definition: cuddInt.h:353
unsigned int keys
Definition: cuddInt.h:369
int Cudd_ReadSymmviolation(DdManager *dd)
Definition: cuddAPI.c:2710
unsigned int Cudd_ReadNextReordering(DdManager *dd)
Definition: cuddAPI.c:3742
double Cudd_ReadCacheLookUps(DdManager *dd)
Definition: cuddAPI.c:1204
int Cudd_ReadPopulationSize(DdManager *dd)
Definition: cuddAPI.c:2817
int Cudd_bddRealignmentEnabled(DdManager *unique)
Definition: cuddAPI.c:913
int reorderings
Definition: cuddInt.h:410
int Cudd_ReadPeakLiveNodeCount(DdManager *dd)
Definition: cuddAPI.c:3151
double Cudd_ReadUsedSlots(DdManager *dd)
Definition: cuddAPI.c:1503
double Cudd_ReadCacheHits(DdManager *dd)
Definition: cuddAPI.c:1225
int Cudd_zddRealignmentEnabled(DdManager *unique)
Definition: cuddAPI.c:837
unsigned int Cudd_ReadLooseUpTo(DdManager *dd)
Definition: cuddAPI.c:1321
int cuddCacheProfile(DdManager *table, FILE *fp)
Definition: cuddCache.c:785
int Cudd_ReadSiftMaxVar(DdManager *dd)
Definition: cuddAPI.c:1891
long Cudd_ReadReorderingTime(DdManager *dd)
Definition: cuddAPI.c:1718
double Cudd_ReadMaxGrowth(DdManager *dd)
Definition: cuddAPI.c:1988
int Cudd_ReadGarbageCollections(DdManager *dd)
Definition: cuddAPI.c:1741
int Cudd_ReadNumberXovers(DdManager *dd)
Definition: cuddAPI.c:2870
int sizeZ
Definition: cuddInt.h:362
int Cudd_ReorderingStatus(DdManager *unique, Cudd_ReorderingType *method)
Definition: cuddAPI.c:735
double cachedeletions
Definition: cuddInt.h:460
unsigned int keysZ
Definition: cuddInt.h:370
double Cudd_ReadRecursiveCalls(DdManager *dd)
Definition: cuddAPI.c:1246
Cudd_ReorderingType
Definition: cudd.h:151
long Cudd_ReadGarbageCollectionTime(DdManager *dd)
Definition: cuddAPI.c:1762
double reclaimed
Definition: cuddInt.h:384
int Cudd_ReadArcviolation ( DdManager dd)

Function********************************************************************

Synopsis [Returns the current value of the arcviolation parameter used in group sifting.]

Description [Returns the current value of the arcviolation parameter. This parameter is used in group sifting to decide how many arcs into y not coming from x are tolerable when checking for aggregation due to extended symmetry. The value should be between 0 and 100. A small value causes fewer variables to be aggregated. The default value is 0.]

SideEffects [None]

SeeAlso [Cudd_SetArcviolation]

Definition at line 2764 of file cuddAPI.c.

2766 {
2767  return(dd->arcviolation);
2768 
2769 } /* end of Cudd_ReadArcviolation */
int arcviolation
Definition: cuddInt.h:429
DdNode* Cudd_ReadBackground ( DdManager dd)

Function********************************************************************

Synopsis [Reads the background constant of the manager.]

Description []

SideEffects [None]

Definition at line 1112 of file cuddAPI.c.

1114 {
1115  return(dd->background);
1116 
1117 } /* end of Cudd_ReadBackground */
DdNode * background
Definition: cuddInt.h:349
double Cudd_ReadCacheHits ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of cache hits.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadCacheLookUps]

Definition at line 1225 of file cuddAPI.c.

1227 {
1228  return(dd->cacheHits + dd->totCachehits);
1229 
1230 } /* end of Cudd_ReadCacheHits */
double cacheHits
Definition: cuddInt.h:356
double totCachehits
Definition: cuddInt.h:455
double Cudd_ReadCacheLookUps ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of cache look-ups.]

Description [Returns the number of cache look-ups.]

SideEffects [None]

SeeAlso [Cudd_ReadCacheHits]

Definition at line 1204 of file cuddAPI.c.

1206 {
1207  return(dd->cacheHits + dd->cacheMisses +
1208  dd->totCachehits + dd->totCacheMisses);
1209 
1210 } /* end of Cudd_ReadCacheLookUps */
double totCacheMisses
Definition: cuddInt.h:456
double cacheHits
Definition: cuddInt.h:356
double cacheMisses
Definition: cuddInt.h:355
double totCachehits
Definition: cuddInt.h:455
unsigned int Cudd_ReadCacheSlots ( DdManager dd)

Function********************************************************************

Synopsis [Reads the number of slots in the cache.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadCacheUsedSlots]

Definition at line 1152 of file cuddAPI.c.

1154 {
1155  return(dd->cacheSlots);
1156 
1157 } /* end of Cudd_ReadCacheSlots */
unsigned int cacheSlots
Definition: cuddInt.h:353
double Cudd_ReadCacheUsedSlots ( DdManager dd)

Function********************************************************************

Synopsis [Reads the fraction of used slots in the cache.]

Description [Reads the fraction of used slots in the cache. The unused slots are those in which no valid data is stored. Garbage collection, variable reordering, and cache resizing may cause used slots to become unused.]

SideEffects [None]

SeeAlso [Cudd_ReadCacheSlots]

Definition at line 1175 of file cuddAPI.c.

1177 {
1178  unsigned long used = 0;
1179  int slots = dd->cacheSlots;
1180  DdCache *cache = dd->cache;
1181  int i;
1182 
1183  for (i = 0; i < slots; i++) {
1184  used += cache[i].h != 0;
1185  }
1186 
1187  return((double)used / (double) dd->cacheSlots);
1188 
1189 } /* end of Cudd_ReadCacheUsedSlots */
ptruint h
Definition: cuddInt.h:318
unsigned int cacheSlots
Definition: cuddInt.h:353
DdCache * cache
Definition: cuddInt.h:352
unsigned int Cudd_ReadDead ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of dead nodes in the unique table.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadKeys]

Definition at line 1646 of file cuddAPI.c.

1648 {
1649  return(dd->dead);
1650 
1651 } /* end of Cudd_ReadDead */
unsigned int dead
Definition: cuddInt.h:371
CUDD_VALUE_TYPE Cudd_ReadEpsilon ( DdManager dd)

Function********************************************************************

Synopsis [Reads the epsilon parameter of the manager.]

Description [Reads the epsilon parameter of the manager. The epsilon parameter control the comparison between floating point numbers.]

SideEffects [None]

SeeAlso [Cudd_SetEpsilon]

Definition at line 2430 of file cuddAPI.c.

2432 {
2433  return(dd->epsilon);
2434 
2435 } /* end of Cudd_ReadEpsilon */
CUDD_VALUE_TYPE epsilon
Definition: cuddInt.h:407
Cudd_ErrorType Cudd_ReadErrorCode ( DdManager dd)

Function********************************************************************

Synopsis [Returns the code of the last error.]

Description [Returns the code of the last error. The error codes are defined in cudd.h.]

SideEffects [None]

SeeAlso [Cudd_ClearErrorCode]

Definition at line 3612 of file cuddAPI.c.

3614 {
3615  return(dd->errorCode);
3616 
3617 } /* end of Cudd_ReadErrorCode */
Cudd_ErrorType errorCode
Definition: cuddInt.h:447
int Cudd_ReadGarbageCollections ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of times garbage collection has occurred.]

Description [Returns the number of times garbage collection has occurred in the manager. The number includes both the calls from reordering procedures and those caused by requests to create new nodes.]

SideEffects [None]

SeeAlso [Cudd_ReadGarbageCollectionTime]

Definition at line 1741 of file cuddAPI.c.

1743 {
1744  return(dd->garbageCollections);
1745 
1746 } /* end of Cudd_ReadGarbageCollections */
int garbageCollections
Definition: cuddInt.h:452
long Cudd_ReadGarbageCollectionTime ( DdManager dd)

Function********************************************************************

Synopsis [Returns the time spent in garbage collection.]

Description [Returns the number of milliseconds spent doing garbage collection since the manager was initialized.]

SideEffects [None]

SeeAlso [Cudd_ReadGarbageCollections]

Definition at line 1762 of file cuddAPI.c.

1764 {
1765  return(dd->GCTime);
1766 
1767 } /* end of Cudd_ReadGarbageCollectionTime */
long GCTime
Definition: cuddInt.h:453
Cudd_AggregationType Cudd_ReadGroupcheck ( DdManager dd)

Function********************************************************************

Synopsis [Reads the groupcheck parameter of the manager.]

Description [Reads the groupcheck parameter of the manager. The groupcheck parameter determines the aggregation criterion in group sifting.]

SideEffects [None]

SeeAlso [Cudd_SetGroupcheck]

Definition at line 2474 of file cuddAPI.c.

2476 {
2477  return(dd->groupcheck);
2478 
2479 } /* end of Cudd_ReadGroupCheck */
Cudd_AggregationType groupcheck
Definition: cuddInt.h:426
int Cudd_ReadInvPerm ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the index of the variable currently in the i-th position of the order.]

Description [Returns the index of the variable currently in the i-th position of the order. If the index is CUDD_CONST_INDEX, returns CUDD_CONST_INDEX; otherwise, if the index is out of bounds returns -1.]

SideEffects [None]

SeeAlso [Cudd_ReadPerm Cudd_ReadInvPermZdd]

Definition at line 2354 of file cuddAPI.c.

2357 {
2358  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2359  if (i < 0 || i >= dd->size) return(-1);
2360  return(dd->invperm[i]);
2361 
2362 } /* end of Cudd_ReadInvPerm */
int size
Definition: cuddInt.h:361
#define CUDD_CONST_INDEX
Definition: cudd.h:117
int * invperm
Definition: cuddInt.h:388
int Cudd_ReadInvPermZdd ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the index of the ZDD variable currently in the i-th position of the order.]

Description [Returns the index of the ZDD variable currently in the i-th position of the order. If the index is CUDD_CONST_INDEX, returns CUDD_CONST_INDEX; otherwise, if the index is out of bounds returns -1.]

SideEffects [None]

SeeAlso [Cudd_ReadPerm Cudd_ReadInvPermZdd]

Definition at line 2380 of file cuddAPI.c.

2383 {
2384  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2385  if (i < 0 || i >= dd->sizeZ) return(-1);
2386  return(dd->invpermZ[i]);
2387 
2388 } /* end of Cudd_ReadInvPermZdd */
int * invpermZ
Definition: cuddInt.h:389
#define CUDD_CONST_INDEX
Definition: cudd.h:117
int sizeZ
Definition: cuddInt.h:362
unsigned int Cudd_ReadKeys ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of nodes in the unique table.]

Description [Returns the total number of nodes currently in the unique table, including the dead nodes.]

SideEffects [None]

SeeAlso [Cudd_ReadDead]

Definition at line 1626 of file cuddAPI.c.

1628 {
1629  return(dd->keys);
1630 
1631 } /* end of Cudd_ReadKeys */
unsigned int keys
Definition: cuddInt.h:369
DdNode* Cudd_ReadLogicZero ( DdManager dd)

Function********************************************************************

Synopsis [Returns the logic zero constant of the manager.]

Description [Returns the zero constant of the manager. The logic zero constant is the complement of the one constant, and is distinct from the arithmetic zero.]

SideEffects [None]

SeeAlso [Cudd_ReadOne Cudd_ReadZero]

Definition at line 1058 of file cuddAPI.c.

1060 {
1061  return(Cudd_Not(DD_ONE(dd)));
1062 
1063 } /* end of Cudd_ReadLogicZero */
#define Cudd_Not(node)
Definition: cudd.h:367
#define DD_ONE(dd)
Definition: cuddInt.h:911
unsigned int Cudd_ReadLooseUpTo ( DdManager dd)

Function********************************************************************

Synopsis [Reads the looseUpTo parameter of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetLooseUpTo Cudd_ReadMinHit Cudd_ReadMinDead]

Definition at line 1321 of file cuddAPI.c.

1323 {
1324  return(dd->looseUpTo);
1325 
1326 } /* end of Cudd_ReadLooseUpTo */
unsigned int looseUpTo
Definition: cuddInt.h:377
unsigned int Cudd_ReadMaxCache ( DdManager dd)

Function********************************************************************

Synopsis [Returns the soft limit for the cache size.]

Description [Returns the soft limit for the cache size. The soft limit]

SideEffects [None]

SeeAlso [Cudd_ReadMaxCache]

Definition at line 1371 of file cuddAPI.c.

1373 {
1374  return(2 * dd->cacheSlots + dd->cacheSlack);
1375 
1376 } /* end of Cudd_ReadMaxCache */
unsigned int cacheSlots
Definition: cuddInt.h:353
int cacheSlack
Definition: cuddInt.h:358
unsigned int Cudd_ReadMaxCacheHard ( DdManager dd)

Function********************************************************************

Synopsis [Reads the maxCacheHard parameter of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetMaxCacheHard Cudd_ReadMaxCache]

Definition at line 1391 of file cuddAPI.c.

1393 {
1394  return(dd->maxCacheHard);
1395 
1396 } /* end of Cudd_ReadMaxCache */
unsigned int maxCacheHard
Definition: cuddInt.h:359
double Cudd_ReadMaxGrowth ( DdManager dd)

Function********************************************************************

Synopsis [Reads the maxGrowth parameter of the manager.]

Description [Reads the maxGrowth parameter of the manager. This parameter determines how much the number of nodes can grow during sifting of a variable. Overall, sifting never increases the size of the decision diagrams. This parameter only refers to intermediate results. A lower value will speed up sifting, possibly at the expense of quality.]

SideEffects [None]

SeeAlso [Cudd_SetMaxGrowth Cudd_ReadMaxGrowthAlternate]

Definition at line 1988 of file cuddAPI.c.

1990 {
1991  return(dd->maxGrowth);
1992 
1993 } /* end of Cudd_ReadMaxGrowth */
double maxGrowth
Definition: cuddInt.h:413
double Cudd_ReadMaxGrowthAlternate ( DdManager dd)

Function********************************************************************

Synopsis [Reads the maxGrowthAlt parameter of the manager.]

Description [Reads the maxGrowthAlt parameter of the manager. This parameter is analogous to the maxGrowth paramter, and is used every given number of reorderings instead of maxGrowth. The number of reorderings is set with Cudd_SetReorderingCycle. If the number of reorderings is 0 (default) maxGrowthAlt is never used.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxGrowth Cudd_SetMaxGrowthAlternate Cudd_SetReorderingCycle Cudd_ReadReorderingCycle]

Definition at line 2039 of file cuddAPI.c.

2041 {
2042  return(dd->maxGrowthAlt);
2043 
2044 } /* end of Cudd_ReadMaxGrowthAlternate */
double maxGrowthAlt
Definition: cuddInt.h:414
unsigned int Cudd_ReadMaxLive ( DdManager dd)

Function********************************************************************

Synopsis [Reads the maximum allowed number of live nodes.]

Description [Reads the maximum allowed number of live nodes. When this number is exceeded, the package returns NULL.]

SideEffects [none]

SeeAlso [Cudd_SetMaxLive]

Definition at line 3812 of file cuddAPI.c.

3814 {
3815  return(dd->maxLive);
3816 
3817 } /* end of Cudd_ReadMaxLive */
unsigned int maxLive
Definition: cuddInt.h:373
unsigned long Cudd_ReadMaxMemory ( DdManager dd)

Function********************************************************************

Synopsis [Reads the maximum allowed memory.]

Description [Reads the maximum allowed memory. When this number is exceeded, the package returns NULL.]

SideEffects [none]

SeeAlso [Cudd_SetMaxMemory]

Definition at line 3855 of file cuddAPI.c.

3857 {
3858  return(dd->maxmemhard);
3859 
3860 } /* end of Cudd_ReadMaxMemory */
unsigned long maxmemhard
Definition: cuddInt.h:451
unsigned long Cudd_ReadMemoryInUse ( DdManager dd)

Function********************************************************************

Synopsis [Returns the memory in use by the manager measured in bytes.]

Description []

SideEffects [None]

SeeAlso []

Definition at line 2916 of file cuddAPI.c.

2918 {
2919  return(dd->memused);
2920 
2921 } /* end of Cudd_ReadMemoryInUse */
unsigned long memused
Definition: cuddInt.h:449
unsigned int Cudd_ReadMinDead ( DdManager dd)

Function********************************************************************

Synopsis [Reads the minDead parameter of the manager.]

Description [Reads the minDead parameter of the manager. The minDead parameter is used by the package to decide whether to collect garbage or resize a subtable of the unique table when the subtable becomes too full. The application can indirectly control the value of minDead by setting the looseUpTo parameter.]

SideEffects [None]

SeeAlso [Cudd_ReadDead Cudd_ReadLooseUpTo Cudd_SetLooseUpTo]

Definition at line 1670 of file cuddAPI.c.

1672 {
1673  return(dd->minDead);
1674 
1675 } /* end of Cudd_ReadMinDead */
unsigned int minDead
Definition: cuddInt.h:374
unsigned int Cudd_ReadMinHit ( DdManager dd)

Function********************************************************************

Synopsis [Reads the hit rate that causes resizinig of the computed table.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetMinHit]

Definition at line 1272 of file cuddAPI.c.

1274 {
1275  /* Internally, the package manipulates the ratio of hits to
1276  ** misses instead of the ratio of hits to accesses. */
1277  return((unsigned int) (0.5 + 100 * dd->minHit / (1 + dd->minHit)));
1278 
1279 } /* end of Cudd_ReadMinHit */
double minHit
Definition: cuddInt.h:357
DdNode* Cudd_ReadMinusInfinity ( DdManager dd)

Function********************************************************************

Synopsis [Reads the minus-infinity constant from the manager.]

Description []

SideEffects [None]

Definition at line 1094 of file cuddAPI.c.

1096 {
1097  return(dd->minusinfinity);
1098 
1099 } /* end of Cudd_ReadMinusInfinity */
DdNode * minusinfinity
Definition: cuddInt.h:348
unsigned int Cudd_ReadNextReordering ( DdManager dd)

Function********************************************************************

Synopsis [Returns the threshold for the next dynamic reordering.]

Description [Returns the threshold for the next dynamic reordering. The threshold is in terms of number of nodes and is in effect only if reordering is enabled. The count does not include the dead nodes, unless the countDead parameter of the manager has been changed from its default setting.]

SideEffects [None]

SeeAlso [Cudd_SetNextReordering]

Definition at line 3742 of file cuddAPI.c.

3744 {
3745  return(dd->nextDyn);
3746 
3747 } /* end of Cudd_ReadNextReordering */
unsigned int nextDyn
Definition: cuddInt.h:422
long Cudd_ReadNodeCount ( DdManager dd)

Function********************************************************************

Synopsis [Reports the number of nodes in BDDs and ADDs.]

Description [Reports the number of live nodes in BDDs and ADDs. This number does not include the isolated projection functions and the unused constants. These nodes that are not counted are not part of the DDs manipulated by the application.]

SideEffects [None]

SeeAlso [Cudd_ReadPeakNodeCount Cudd_zddReadNodeCount]

Definition at line 3179 of file cuddAPI.c.

3181 {
3182  long count;
3183  int i;
3184 
3185 #ifndef DD_NO_DEATH_ROW
3186  cuddClearDeathRow(dd);
3187 #endif
3188 
3189  count = (long) (dd->keys - dd->dead);
3190 
3191  /* Count isolated projection functions. Their number is subtracted
3192  ** from the node count because they are not part of the BDDs.
3193  */
3194  for (i=0; i < dd->size; i++) {
3195  if (dd->vars[i]->ref == 1) count--;
3196  }
3197  /* Subtract from the count the unused constants. */
3198  if (DD_ZERO(dd)->ref == 1) count--;
3199  if (DD_PLUS_INFINITY(dd)->ref == 1) count--;
3200  if (DD_MINUS_INFINITY(dd)->ref == 1) count--;
3201 
3202  return(count);
3203 
3204 } /* end of Cudd_ReadNodeCount */
DdHalfWord ref
Definition: cudd.h:280
int size
Definition: cuddInt.h:361
#define DD_MINUS_INFINITY(dd)
Definition: cuddInt.h:955
unsigned int dead
Definition: cuddInt.h:371
unsigned int keys
Definition: cuddInt.h:369
void cuddClearDeathRow(DdManager *table)
Definition: cuddRef.c:726
DdNode ** vars
Definition: cuddInt.h:390
#define DD_PLUS_INFINITY(dd)
Definition: cuddInt.h:941
#define DD_ZERO(dd)
Definition: cuddInt.h:927
double Cudd_ReadNodesDropped ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of nodes dropped.]

Description [Returns the number of nodes killed by dereferencing if the keeping of this statistic is enabled; -1 otherwise. This statistic is enabled only if the package is compiled with DD_STATS defined.]

SideEffects [None]

SeeAlso [Cudd_ReadNodesFreed]

Definition at line 1810 of file cuddAPI.c.

1812 {
1813 #ifdef DD_STATS
1814  return(dd->nodesDropped);
1815 #else
1816  return(-1.0);
1817 #endif
1818 
1819 } /* end of Cudd_ReadNodesDropped */
double Cudd_ReadNodesFreed ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of nodes freed.]

Description [Returns the number of nodes returned to the free list if the keeping of this statistic is enabled; -1 otherwise. This statistic is enabled only if the package is compiled with DD_STATS defined.]

SideEffects [None]

SeeAlso [Cudd_ReadNodesDropped]

Definition at line 1784 of file cuddAPI.c.

1786 {
1787 #ifdef DD_STATS
1788  return(dd->nodesFreed);
1789 #else
1790  return(-1.0);
1791 #endif
1792 
1793 } /* end of Cudd_ReadNodesFreed */
int Cudd_ReadNumberXovers ( DdManager dd)

Function********************************************************************

Synopsis [Reads the current number of crossovers used by the genetic algorithm for reordering.]

Description [Reads the current number of crossovers used by the genetic algorithm for variable reordering. A larger number of crossovers will cause the genetic algorithm to take more time, but will generally produce better results. The default value is 0, in which case the package uses three times the number of variables as number of crossovers, with a maximum of 60.]

SideEffects [None]

SeeAlso [Cudd_SetNumberXovers]

Definition at line 2870 of file cuddAPI.c.

2872 {
2873  return(dd->numberXovers);
2874 
2875 } /* end of Cudd_ReadNumberXovers */
int numberXovers
Definition: cuddInt.h:431
DdNode* Cudd_ReadOne ( DdManager dd)

Function********************************************************************

Synopsis [Returns the one constant of the manager.]

Description [Returns the one constant of the manager. The one constant is common to ADDs and BDDs.]

SideEffects [None]

SeeAlso [Cudd_ReadZero Cudd_ReadLogicZero Cudd_ReadZddOne]

Definition at line 987 of file cuddAPI.c.

989 {
990  return(dd->one);
991 
992 } /* end of Cudd_ReadOne */
DdNode * one
Definition: cuddInt.h:345
int Cudd_ReadPeakLiveNodeCount ( DdManager dd)

Function********************************************************************

Synopsis [Reports the peak number of live nodes.]

Description [Reports the peak number of live nodes. This count is kept only if CUDD is compiled with DD_STATS defined. If DD_STATS is not defined, this function returns -1.]

SideEffects [None]

SeeAlso [Cudd_ReadNodeCount Cudd_PrintInfo Cudd_ReadPeakNodeCount]

Definition at line 3151 of file cuddAPI.c.

3153 {
3154  unsigned int live = dd->keys - dd->dead;
3155 
3156  if (live > dd->peakLiveNodes) {
3157  dd->peakLiveNodes = live;
3158  }
3159  return((int)dd->peakLiveNodes);
3160 
3161 } /* end of Cudd_ReadPeakLiveNodeCount */
unsigned int peakLiveNodes
Definition: cuddInt.h:465
unsigned int dead
Definition: cuddInt.h:371
unsigned int keys
Definition: cuddInt.h:369
long Cudd_ReadPeakNodeCount ( DdManager dd)

Function********************************************************************

Synopsis [Reports the peak number of nodes.]

Description [Reports the peak number of nodes. This number includes node on the free list. At the peak, the number of nodes on the free list is guaranteed to be less than DD_MEM_CHUNK.]

SideEffects [None]

SeeAlso [Cudd_ReadNodeCount Cudd_PrintInfo]

Definition at line 3122 of file cuddAPI.c.

3124 {
3125  long count = 0;
3126  DdNodePtr *scan = dd->memoryList;
3127 
3128  while (scan != NULL) {
3129  count += DD_MEM_CHUNK;
3130  scan = (DdNodePtr *) *scan;
3131  }
3132  return(count);
3133 
3134 } /* end of Cudd_ReadPeakNodeCount */
Definition: cudd.h:278
DdNode ** memoryList
Definition: cuddInt.h:397
#define DD_MEM_CHUNK
Definition: cuddInt.h:104
int Cudd_ReadPerm ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the current position of the i-th variable in the order.]

Description [Returns the current position of the i-th variable in the order. If the index is CUDD_CONST_INDEX, returns CUDD_CONST_INDEX; otherwise, if the index is out of bounds returns -1.]

SideEffects [None]

SeeAlso [Cudd_ReadInvPerm Cudd_ReadPermZdd]

Definition at line 2301 of file cuddAPI.c.

2304 {
2305  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2306  if (i < 0 || i >= dd->size) return(-1);
2307  return(dd->perm[i]);
2308 
2309 } /* end of Cudd_ReadPerm */
int size
Definition: cuddInt.h:361
#define CUDD_CONST_INDEX
Definition: cudd.h:117
int * perm
Definition: cuddInt.h:386
int Cudd_ReadPermZdd ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the current position of the i-th ZDD variable in the order.]

Description [Returns the current position of the i-th ZDD variable in the order. If the index is CUDD_CONST_INDEX, returns CUDD_CONST_INDEX; otherwise, if the index is out of bounds returns -1.]

SideEffects [None]

SeeAlso [Cudd_ReadInvPermZdd Cudd_ReadPerm]

Definition at line 2328 of file cuddAPI.c.

2331 {
2332  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2333  if (i < 0 || i >= dd->sizeZ) return(-1);
2334  return(dd->permZ[i]);
2335 
2336 } /* end of Cudd_ReadPermZdd */
int * permZ
Definition: cuddInt.h:387
#define CUDD_CONST_INDEX
Definition: cudd.h:117
int sizeZ
Definition: cuddInt.h:362
DdNode* Cudd_ReadPlusInfinity ( DdManager dd)

Function********************************************************************

Synopsis [Reads the plus-infinity constant from the manager.]

Description []

SideEffects [None]

Definition at line 1076 of file cuddAPI.c.

1078 {
1079  return(dd->plusinfinity);
1080 
1081 } /* end of Cudd_ReadPlusInfinity */
DdNode * plusinfinity
Definition: cuddInt.h:347
int Cudd_ReadPopulationSize ( DdManager dd)

Function********************************************************************

Synopsis [Reads the current size of the population used by the genetic algorithm for reordering.]

Description [Reads the current size of the population used by the genetic algorithm for variable reordering. A larger population size will cause the genetic algorithm to take more time, but will generally produce better results. The default value is 0, in which case the package uses three times the number of variables as population size, with a maximum of 120.]

SideEffects [None]

SeeAlso [Cudd_SetPopulationSize]

Definition at line 2817 of file cuddAPI.c.

2819 {
2820  return(dd->populationSize);
2821 
2822 } /* end of Cudd_ReadPopulationSize */
int populationSize
Definition: cuddInt.h:430
int Cudd_ReadRecomb ( DdManager dd)

Function********************************************************************

Synopsis [Returns the current value of the recombination parameter used in group sifting.]

Description [Returns the current value of the recombination parameter used in group sifting. A larger (positive) value makes the aggregation of variables due to the second difference criterion more likely. A smaller (negative) value makes aggregation less likely.]

SideEffects [None]

SeeAlso [Cudd_SetRecomb]

Definition at line 2657 of file cuddAPI.c.

2659 {
2660  return(dd->recomb);
2661 
2662 } /* end of Cudd_ReadRecomb */
int recomb
Definition: cuddInt.h:427
double Cudd_ReadRecursiveCalls ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of recursive calls.]

Description [Returns the number of recursive calls if the package is compiled with DD_COUNT defined.]

SideEffects [None]

SeeAlso []

Definition at line 1246 of file cuddAPI.c.

1248 {
1249 #ifdef DD_COUNT
1250  return(dd->recursiveCalls);
1251 #else
1252  return(-1.0);
1253 #endif
1254 
1255 } /* end of Cudd_ReadRecursiveCalls */
int Cudd_ReadReorderingCycle ( DdManager dd)

Function********************************************************************

Synopsis [Reads the reordCycle parameter of the manager.]

Description [Reads the reordCycle parameter of the manager. This parameter determines how often the alternate threshold on maximum growth is used in reordering.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxGrowthAlternate Cudd_SetMaxGrowthAlternate Cudd_SetReorderingCycle]

Definition at line 2088 of file cuddAPI.c.

2090 {
2091  return(dd->reordCycle);
2092 
2093 } /* end of Cudd_ReadReorderingCycle */
int reordCycle
Definition: cuddInt.h:415
int Cudd_ReadReorderings ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of times reordering has occurred.]

Description [Returns the number of times reordering has occurred in the manager. The number includes both the calls to Cudd_ReduceHeap from the application program and those automatically performed by the package. However, calls that do not even initiate reordering are not counted. A call may not initiate reordering if there are fewer than minsize live nodes in the manager, or if CUDD_REORDER_NONE is specified as reordering method. The calls to Cudd_ShuffleHeap are not counted.]

SideEffects [None]

SeeAlso [Cudd_ReduceHeap Cudd_ReadReorderingTime]

Definition at line 1696 of file cuddAPI.c.

1698 {
1699  return(dd->reorderings);
1700 
1701 } /* end of Cudd_ReadReorderings */
int reorderings
Definition: cuddInt.h:410
long Cudd_ReadReorderingTime ( DdManager dd)

Function********************************************************************

Synopsis [Returns the time spent in reordering.]

Description [Returns the number of milliseconds spent reordering variables since the manager was initialized. The time spent in collecting garbage before reordering is included.]

SideEffects [None]

SeeAlso [Cudd_ReadReorderings]

Definition at line 1718 of file cuddAPI.c.

1720 {
1721  return(dd->reordTime);
1722 
1723 } /* end of Cudd_ReadReorderingTime */
long reordTime
Definition: cuddInt.h:454
int Cudd_ReadSiftMaxSwap ( DdManager dd)

Function********************************************************************

Synopsis [Reads the siftMaxSwap parameter of the manager.]

Description [Reads the siftMaxSwap parameter of the manager. This parameter gives the maximum number of swaps that will be attempted for each invocation of sifting. The real number of swaps may exceed the set limit because the package will always complete the sifting of the variable that causes the limit to be reached.]

SideEffects [None]

SeeAlso [Cudd_ReadSiftMaxVar Cudd_SetSiftMaxSwap]

Definition at line 1938 of file cuddAPI.c.

1940 {
1941  return(dd->siftMaxSwap);
1942 
1943 } /* end of Cudd_ReadSiftMaxSwap */
int siftMaxSwap
Definition: cuddInt.h:412
int Cudd_ReadSiftMaxVar ( DdManager dd)

Function********************************************************************

Synopsis [Reads the siftMaxVar parameter of the manager.]

Description [Reads the siftMaxVar parameter of the manager. This parameter gives the maximum number of variables that will be sifted for each invocation of sifting.]

SideEffects [None]

SeeAlso [Cudd_ReadSiftMaxSwap Cudd_SetSiftMaxVar]

Definition at line 1891 of file cuddAPI.c.

1893 {
1894  return(dd->siftMaxVar);
1895 
1896 } /* end of Cudd_ReadSiftMaxVar */
int siftMaxVar
Definition: cuddInt.h:411
int Cudd_ReadSize ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of BDD variables in existance.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadZddSize]

Definition at line 1441 of file cuddAPI.c.

1443 {
1444  return(dd->size);
1445 
1446 } /* end of Cudd_ReadSize */
int size
Definition: cuddInt.h:361
unsigned int Cudd_ReadSlots ( DdManager dd)

Function********************************************************************

Synopsis [Returns the total number of slots of the unique table.]

Description [Returns the total number of slots of the unique table. This number ismainly for diagnostic purposes.]

SideEffects [None]

Definition at line 1480 of file cuddAPI.c.

1482 {
1483  return(dd->slots);
1484 
1485 } /* end of Cudd_ReadSlots */
unsigned int slots
Definition: cuddInt.h:368
FILE* Cudd_ReadStderr ( DdManager dd)

Function********************************************************************

Synopsis [Reads the stderr of a manager.]

Description [Reads the stderr of a manager. This is the file pointer to which messages normally going to stderr are written. It is initialized to stderr. Cudd_SetStderr allows the application to redirect it.]

SideEffects [None]

SeeAlso [Cudd_SetStderr Cudd_ReadStdout]

Definition at line 3697 of file cuddAPI.c.

3699 {
3700  return(dd->err);
3701 
3702 } /* end of Cudd_ReadStderr */
FILE * err
Definition: cuddInt.h:442
FILE* Cudd_ReadStdout ( DdManager dd)

Function********************************************************************

Synopsis [Reads the stdout of a manager.]

Description [Reads the stdout of a manager. This is the file pointer to which messages normally going to stdout are written. It is initialized to stdout. Cudd_SetStdout allows the application to redirect it.]

SideEffects [None]

SeeAlso [Cudd_SetStdout Cudd_ReadStderr]

Definition at line 3654 of file cuddAPI.c.

3656 {
3657  return(dd->out);
3658 
3659 } /* end of Cudd_ReadStdout */
FILE * out
Definition: cuddInt.h:441
double Cudd_ReadSwapSteps ( DdManager dd)

Function********************************************************************

Synopsis [Reads the number of elementary reordering steps.]

Description []

SideEffects [none]

SeeAlso []

Definition at line 3787 of file cuddAPI.c.

3789 {
3790 #ifdef DD_COUNT
3791  return(dd->swapSteps);
3792 #else
3793  return(-1);
3794 #endif
3795 
3796 } /* end of Cudd_ReadSwapSteps */
int Cudd_ReadSymmviolation ( DdManager dd)

Function********************************************************************

Synopsis [Returns the current value of the symmviolation parameter used in group sifting.]

Description [Returns the current value of the symmviolation parameter. This parameter is used in group sifting to decide how many violations to the symmetry conditions f10 = f01 or f11 = f00 are tolerable when checking for aggregation due to extended symmetry. The value should be between 0 and 100. A small value causes fewer variables to be aggregated. The default value is 0.]

SideEffects [None]

SeeAlso [Cudd_SetSymmviolation]

Definition at line 2710 of file cuddAPI.c.

2712 {
2713  return(dd->symmviolation);
2714 
2715 } /* end of Cudd_ReadSymmviolation */
int symmviolation
Definition: cuddInt.h:428
MtrNode* Cudd_ReadTree ( DdManager dd)

Function********************************************************************

Synopsis [Returns the variable group tree of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetTree Cudd_FreeTree Cudd_ReadZddTree]

Definition at line 2132 of file cuddAPI.c.

2134 {
2135  return(dd->tree);
2136 
2137 } /* end of Cudd_ReadTree */
MtrNode * tree
Definition: cuddInt.h:424
double Cudd_ReadUniqueLinks ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of links followed in the unique table.]

Description [Returns the number of links followed during look-ups in the unique table if the keeping of this statistic is enabled; -1 otherwise. If an item is found in the first position of its collision list, the number of links followed is taken to be 0. If it is in second position, the number of links is 1, and so on. This statistic is enabled only if the package is compiled with DD_UNIQUE_PROFILE defined.]

SideEffects [None]

SeeAlso [Cudd_ReadUniqueLookUps]

Definition at line 1865 of file cuddAPI.c.

1867 {
1868 #ifdef DD_UNIQUE_PROFILE
1869  return(dd->uniqueLinks);
1870 #else
1871  return(-1.0);
1872 #endif
1873 
1874 } /* end of Cudd_ReadUniqueLinks */
double Cudd_ReadUniqueLookUps ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of look-ups in the unique table.]

Description [Returns the number of look-ups in the unique table if the keeping of this statistic is enabled; -1 otherwise. This statistic is enabled only if the package is compiled with DD_UNIQUE_PROFILE defined.]

SideEffects [None]

SeeAlso [Cudd_ReadUniqueLinks]

Definition at line 1836 of file cuddAPI.c.

1838 {
1839 #ifdef DD_UNIQUE_PROFILE
1840  return(dd->uniqueLookUps);
1841 #else
1842  return(-1.0);
1843 #endif
1844 
1845 } /* end of Cudd_ReadUniqueLookUps */
double Cudd_ReadUsedSlots ( DdManager dd)

Function********************************************************************

Synopsis [Reads the fraction of used slots in the unique table.]

Description [Reads the fraction of used slots in the unique table. The unused slots are those in which no valid data is stored. Garbage collection, variable reordering, and subtable resizing may cause used slots to become unused.]

SideEffects [None]

SeeAlso [Cudd_ReadSlots]

Definition at line 1503 of file cuddAPI.c.

1505 {
1506  unsigned long used = 0;
1507  int i, j;
1508  int size = dd->size;
1509  DdNodePtr *nodelist;
1510  DdSubtable *subtable;
1511  DdNode *node;
1512  DdNode *sentinel = &(dd->sentinel);
1513 
1514  /* Scan each BDD/ADD subtable. */
1515  for (i = 0; i < size; i++) {
1516  subtable = &(dd->subtables[i]);
1517  nodelist = subtable->nodelist;
1518  for (j = 0; (unsigned) j < subtable->slots; j++) {
1519  node = nodelist[j];
1520  if (node != sentinel) {
1521  used++;
1522  }
1523  }
1524  }
1525 
1526  /* Scan the ZDD subtables. */
1527  size = dd->sizeZ;
1528 
1529  for (i = 0; i < size; i++) {
1530  subtable = &(dd->subtableZ[i]);
1531  nodelist = subtable->nodelist;
1532  for (j = 0; (unsigned) j < subtable->slots; j++) {
1533  node = nodelist[j];
1534  if (node != NULL) {
1535  used++;
1536  }
1537  }
1538  }
1539 
1540  /* Constant table. */
1541  subtable = &(dd->constants);
1542  nodelist = subtable->nodelist;
1543  for (j = 0; (unsigned) j < subtable->slots; j++) {
1544  node = nodelist[j];
1545  if (node != NULL) {
1546  used++;
1547  }
1548  }
1549 
1550  return((double)used / (double) dd->slots);
1551 
1552 } /* end of Cudd_ReadUsedSlots */
Definition: cudd.h:278
int size
Definition: cuddInt.h:361
unsigned int slots
Definition: cuddInt.h:368
DdSubtable * subtables
Definition: cuddInt.h:365
DdNode sentinel
Definition: cuddInt.h:344
DdNode ** nodelist
Definition: cuddInt.h:327
static int size
Definition: cuddSign.c:86
int sizeZ
Definition: cuddInt.h:362
DdSubtable constants
Definition: cuddInt.h:367
DdSubtable * subtableZ
Definition: cuddInt.h:366
DdNode* Cudd_ReadVars ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the i-th element of the vars array.]

Description [Returns the i-th element of the vars array if it falls within the array bounds; NULL otherwise. If i is the index of an existing variable, this function produces the same result as Cudd_bddIthVar. However, if the i-th var does not exist yet, Cudd_bddIthVar will create it, whereas Cudd_ReadVars will not.]

SideEffects [None]

SeeAlso [Cudd_bddIthVar]

Definition at line 2407 of file cuddAPI.c.

2410 {
2411  if (i < 0 || i > dd->size) return(NULL);
2412  return(dd->vars[i]);
2413 
2414 } /* end of Cudd_ReadVars */
int size
Definition: cuddInt.h:361
DdNode ** vars
Definition: cuddInt.h:390
DdNode* Cudd_ReadZddOne ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the ZDD for the constant 1 function.]

Description [Returns the ZDD for the constant 1 function. The representation of the constant 1 function as a ZDD depends on how many variables it (nominally) depends on. The index of the topmost variable in the support is given as argument i.]

SideEffects [None]

SeeAlso [Cudd_ReadOne]

Definition at line 1010 of file cuddAPI.c.

1013 {
1014  if (i < 0)
1015  return(NULL);
1016  return(i < dd->sizeZ ? dd->univ[i] : DD_ONE(dd));
1017 
1018 } /* end of Cudd_ReadZddOne */
#define DD_ONE(dd)
Definition: cuddInt.h:911
DdNode ** univ
Definition: cuddInt.h:392
int Cudd_ReadZddSize ( DdManager dd)

Function********************************************************************

Synopsis [Returns the number of ZDD variables in existance.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadSize]

Definition at line 1461 of file cuddAPI.c.

1463 {
1464  return(dd->sizeZ);
1465 
1466 } /* end of Cudd_ReadZddSize */
int sizeZ
Definition: cuddInt.h:362
MtrNode* Cudd_ReadZddTree ( DdManager dd)

Function********************************************************************

Synopsis [Returns the variable group tree of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_SetZddTree Cudd_FreeZddTree Cudd_ReadTree]

Definition at line 2204 of file cuddAPI.c.

2206 {
2207  return(dd->treeZ);
2208 
2209 } /* end of Cudd_ReadZddTree */
MtrNode * treeZ
Definition: cuddInt.h:425
DdNode* Cudd_ReadZero ( DdManager dd)

Function********************************************************************

Synopsis [Returns the zero constant of the manager.]

Description [Returns the zero constant of the manager. The zero constant is the arithmetic zero, rather than the logic zero. The latter is the complement of the one constant.]

SideEffects [None]

SeeAlso [Cudd_ReadOne Cudd_ReadLogicZero]

Definition at line 1036 of file cuddAPI.c.

1038 {
1039  return(DD_ZERO(dd));
1040 
1041 } /* end of Cudd_ReadZero */
#define DD_ZERO(dd)
Definition: cuddInt.h:927
int Cudd_RemoveHook ( DdManager dd,
DD_HFP  f,
Cudd_HookType  where 
)

Function********************************************************************

Synopsis [Removes a function from a hook.]

Description [Removes a function from a hook. A hook is a list of application-provided functions called on certain occasions by the package. Returns 1 if successful; 0 the function was not in the list.]

SideEffects [None]

SeeAlso [Cudd_AddHook]

Definition at line 3306 of file cuddAPI.c.

3310 {
3311  DdHook **hook, *nextHook;
3312 
3313  switch (where) {
3314  case CUDD_PRE_GC_HOOK:
3315  hook = &(dd->preGCHook);
3316  break;
3317  case CUDD_POST_GC_HOOK:
3318  hook = &(dd->postGCHook);
3319  break;
3321  hook = &(dd->preReorderingHook);
3322  break;
3324  hook = &(dd->postReorderingHook);
3325  break;
3326  default:
3327  return(0);
3328  }
3329  nextHook = *hook;
3330  while (nextHook != NULL) {
3331  if (nextHook->f == f) {
3332  *hook = nextHook->next;
3333  ABC_FREE(nextHook);
3334  return(1);
3335  }
3336  hook = &(nextHook->next);
3337  nextHook = nextHook->next;
3338  }
3339 
3340  return(0);
3341 
3342 } /* end of Cudd_RemoveHook */
DdHook * preReorderingHook
Definition: cuddInt.h:439
DD_HFP f
Definition: cuddInt.h:246
DdHook * postReorderingHook
Definition: cuddInt.h:440
struct DdHook * next
Definition: cuddInt.h:247
#define ABC_FREE(obj)
Definition: abc_global.h:232
DdHook * postGCHook
Definition: cuddInt.h:438
DdHook * preGCHook
Definition: cuddInt.h:437
int Cudd_ReorderingReporting ( DdManager dd)

Function********************************************************************

Synopsis [Returns 1 if reporting of reordering stats is enabled.]

Description [Returns 1 if reporting of reordering stats is enabled; 0 otherwise.]

SideEffects [none]

SeeAlso [Cudd_EnableReorderingReporting Cudd_DisableReorderingReporting]

Definition at line 3591 of file cuddAPI.c.

3593 {
3595 
3596 } /* end of Cudd_ReorderingReporting */
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3408
int Cudd_IsInHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3359
int Cudd_ReorderingStatus ( DdManager unique,
Cudd_ReorderingType method 
)

Function********************************************************************

Synopsis [Reports the status of automatic dynamic reordering of BDDs and ADDs.]

Description [Reports the status of automatic dynamic reordering of BDDs and ADDs. Parameter method is set to the reordering method currently selected. Returns 1 if automatic reordering is enabled; 0 otherwise.]

SideEffects [Parameter method is set to the reordering method currently selected.]

SeeAlso [Cudd_AutodynEnable Cudd_AutodynDisable Cudd_ReorderingStatusZdd]

Definition at line 735 of file cuddAPI.c.

738 {
739  *method = unique->autoMethod;
740  return(unique->autoDyn);
741 
742 } /* end of Cudd_ReorderingStatus */
Cudd_ReorderingType autoMethod
Definition: cuddInt.h:418
int autoDyn
Definition: cuddInt.h:416
int Cudd_ReorderingStatusZdd ( DdManager unique,
Cudd_ReorderingType method 
)

Function********************************************************************

Synopsis [Reports the status of automatic dynamic reordering of ZDDs.]

Description [Reports the status of automatic dynamic reordering of ZDDs. Parameter method is set to the ZDD reordering method currently selected. Returns 1 if automatic reordering is enabled; 0 otherwise.]

SideEffects [Parameter method is set to the ZDD reordering method currently selected.]

SeeAlso [Cudd_AutodynEnableZdd Cudd_AutodynDisableZdd Cudd_ReorderingStatus]

Definition at line 812 of file cuddAPI.c.

815 {
816  *method = unique->autoMethodZ;
817  return(unique->autoDynZ);
818 
819 } /* end of Cudd_ReorderingStatusZdd */
Cudd_ReorderingType autoMethodZ
Definition: cuddInt.h:419
int autoDynZ
Definition: cuddInt.h:417
void Cudd_SetArcviolation ( DdManager dd,
int  arcviolation 
)

Function********************************************************************

Synopsis [Sets the value of the arcviolation parameter used in group sifting.]

Description [Sets the value of the arcviolation parameter. This parameter is used in group sifting to decide how many arcs into y not coming from x are tolerable when checking for aggregation due to extended symmetry. The value should be between 0 and 100. A small value causes fewer variables to be aggregated. The default value is 0.]

SideEffects [None]

SeeAlso [Cudd_ReadArcviolation]

Definition at line 2790 of file cuddAPI.c.

2793 {
2794  dd->arcviolation = arcviolation;
2795 
2796 } /* end of Cudd_SetArcviolation */
int arcviolation
Definition: cuddInt.h:429
void Cudd_SetBackground ( DdManager dd,
DdNode bck 
)

Function********************************************************************

Synopsis [Sets the background constant of the manager.]

Description [Sets the background constant of the manager. It assumes that the DdNode pointer bck is already referenced.]

SideEffects [None]

Definition at line 1131 of file cuddAPI.c.

1134 {
1135  dd->background = bck;
1136 
1137 } /* end of Cudd_SetBackground */
DdNode * background
Definition: cuddInt.h:349
void Cudd_SetEpsilon ( DdManager dd,
CUDD_VALUE_TYPE  ep 
)

Function********************************************************************

Synopsis [Sets the epsilon parameter of the manager to ep.]

Description [Sets the epsilon parameter of the manager to ep. The epsilon parameter control the comparison between floating point numbers.]

SideEffects [None]

SeeAlso [Cudd_ReadEpsilon]

Definition at line 2451 of file cuddAPI.c.

2454 {
2455  dd->epsilon = ep;
2456 
2457 } /* end of Cudd_SetEpsilon */
CUDD_VALUE_TYPE epsilon
Definition: cuddInt.h:407
void Cudd_SetGroupcheck ( DdManager dd,
Cudd_AggregationType  gc 
)

Function********************************************************************

Synopsis [Sets the parameter groupcheck of the manager to gc.]

Description [Sets the parameter groupcheck of the manager to gc. The groupcheck parameter determines the aggregation criterion in group sifting.]

SideEffects [None]

SeeAlso [Cudd_ReadGroupCheck]

Definition at line 2496 of file cuddAPI.c.

2499 {
2500  dd->groupcheck = gc;
2501 
2502 } /* end of Cudd_SetGroupcheck */
Cudd_AggregationType groupcheck
Definition: cuddInt.h:426
void Cudd_SetLooseUpTo ( DdManager dd,
unsigned int  lut 
)

Function********************************************************************

Synopsis [Sets the looseUpTo parameter of the manager.]

Description [Sets the looseUpTo parameter of the manager. This parameter of the manager controls the threshold beyond which no fast growth of the unique table is allowed. The threshold is given as a number of slots. If the value passed to this function is 0, the function determines a suitable value based on the available memory.]

SideEffects [None]

SeeAlso [Cudd_ReadLooseUpTo Cudd_SetMinHit]

Definition at line 1345 of file cuddAPI.c.

1348 {
1349  if (lut == 0) {
1350  unsigned long datalimit = getSoftDataLimit();
1351  lut = (unsigned int) (datalimit / (sizeof(DdNode) *
1353  }
1354  dd->looseUpTo = lut;
1355 
1356 } /* end of Cudd_SetLooseUpTo */
Definition: cudd.h:278
#define DD_MAX_LOOSE_FRACTION
Definition: cuddInt.h:138
EXTERN long getSoftDataLimit()
unsigned int looseUpTo
Definition: cuddInt.h:377
void Cudd_SetMaxCacheHard ( DdManager dd,
unsigned int  mc 
)

Function********************************************************************

Synopsis [Sets the maxCacheHard parameter of the manager.]

Description [Sets the maxCacheHard parameter of the manager. The cache cannot grow larger than maxCacheHard entries. This parameter allows an application to control the trade-off of memory versus speed. If the value passed to this function is 0, the function determines a suitable maximum cache size based on the available memory.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxCacheHard Cudd_SetMaxCache]

Definition at line 1415 of file cuddAPI.c.

1418 {
1419  if (mc == 0) {
1420  unsigned long datalimit = getSoftDataLimit();
1421  mc = (unsigned int) (datalimit / (sizeof(DdCache) *
1423  }
1424  dd->maxCacheHard = mc;
1425 
1426 } /* end of Cudd_SetMaxCacheHard */
#define DD_MAX_CACHE_FRACTION
Definition: cuddInt.h:140
unsigned int maxCacheHard
Definition: cuddInt.h:359
EXTERN long getSoftDataLimit()
void Cudd_SetMaxGrowth ( DdManager dd,
double  mg 
)

Function********************************************************************

Synopsis [Sets the maxGrowth parameter of the manager.]

Description [Sets the maxGrowth parameter of the manager. This parameter determines how much the number of nodes can grow during sifting of a variable. Overall, sifting never increases the size of the decision diagrams. This parameter only refers to intermediate results. A lower value will speed up sifting, possibly at the expense of quality.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxGrowth Cudd_SetMaxGrowthAlternate]

Definition at line 2013 of file cuddAPI.c.

2016 {
2017  dd->maxGrowth = mg;
2018 
2019 } /* end of Cudd_SetMaxGrowth */
double maxGrowth
Definition: cuddInt.h:413
void Cudd_SetMaxGrowthAlternate ( DdManager dd,
double  mg 
)

Function********************************************************************

Synopsis [Sets the maxGrowthAlt parameter of the manager.]

Description [Sets the maxGrowthAlt parameter of the manager. This parameter is analogous to the maxGrowth paramter, and is used every given number of reorderings instead of maxGrowth. The number of reorderings is set with Cudd_SetReorderingCycle. If the number of reorderings is 0 (default) maxGrowthAlt is never used.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxGrowthAlternate Cudd_SetMaxGrowth Cudd_SetReorderingCycle Cudd_ReadReorderingCycle]

Definition at line 2064 of file cuddAPI.c.

2067 {
2068  dd->maxGrowthAlt = mg;
2069 
2070 } /* end of Cudd_SetMaxGrowthAlternate */
double maxGrowthAlt
Definition: cuddInt.h:414
void Cudd_SetMaxLive ( DdManager dd,
unsigned int  maxLive 
)

Function********************************************************************

Synopsis [Sets the maximum allowed number of live nodes.]

Description [Sets the maximum allowed number of live nodes. When this number is exceeded, the package returns NULL.]

SideEffects [none]

SeeAlso [Cudd_ReadMaxLive]

Definition at line 3833 of file cuddAPI.c.

3836 {
3837  dd->maxLive = maxLive;
3838 
3839 } /* end of Cudd_SetMaxLive */
unsigned int maxLive
Definition: cuddInt.h:373
void Cudd_SetMaxMemory ( DdManager dd,
unsigned long  maxMemory 
)

Function********************************************************************

Synopsis [Sets the maximum allowed memory.]

Description [Sets the maximum allowed memory. When this number is exceeded, the package returns NULL.]

SideEffects [none]

SeeAlso [Cudd_ReadMaxMemory]

Definition at line 3876 of file cuddAPI.c.

3879 {
3880  dd->maxmemhard = maxMemory;
3881 
3882 } /* end of Cudd_SetMaxMemory */
unsigned long maxmemhard
Definition: cuddInt.h:451
void Cudd_SetMinHit ( DdManager dd,
unsigned int  hr 
)

Function********************************************************************

Synopsis [Sets the hit rate that causes resizinig of the computed table.]

Description [Sets the minHit parameter of the manager. This parameter controls the resizing of the computed table. If the hit rate is larger than the specified value, and the cache is not already too large, then its size is doubled.]

SideEffects [None]

SeeAlso [Cudd_ReadMinHit]

Definition at line 1298 of file cuddAPI.c.

1301 {
1302  /* Internally, the package manipulates the ratio of hits to
1303  ** misses instead of the ratio of hits to accesses. */
1304  dd->minHit = (double) hr / (100.0 - (double) hr);
1305 
1306 } /* end of Cudd_SetMinHit */
double minHit
Definition: cuddInt.h:357
void Cudd_SetNextReordering ( DdManager dd,
unsigned int  next 
)

Function********************************************************************

Synopsis [Sets the threshold for the next dynamic reordering.]

Description [Sets the threshold for the next dynamic reordering. The threshold is in terms of number of nodes and is in effect only if reordering is enabled. The count does not include the dead nodes, unless the countDead parameter of the manager has been changed from its default setting.]

SideEffects [None]

SeeAlso [Cudd_ReadNextReordering]

Definition at line 3766 of file cuddAPI.c.

3769 {
3770  dd->nextDyn = next;
3771 
3772 } /* end of Cudd_SetNextReordering */
unsigned int nextDyn
Definition: cuddInt.h:422
void Cudd_SetNumberXovers ( DdManager dd,
int  numberXovers 
)

Function********************************************************************

Synopsis [Sets the number of crossovers used by the genetic algorithm for reordering.]

Description [Sets the number of crossovers used by the genetic algorithm for variable reordering. A larger number of crossovers will cause the genetic algorithm to take more time, but will generally produce better results. The default value is 0, in which case the package uses three times the number of variables as number of crossovers, with a maximum of 60.]

SideEffects [None]

SeeAlso [Cudd_ReadNumberXovers]

Definition at line 2896 of file cuddAPI.c.

2899 {
2900  dd->numberXovers = numberXovers;
2901 
2902 } /* end of Cudd_SetNumberXovers */
int numberXovers
Definition: cuddInt.h:431
void Cudd_SetPopulationSize ( DdManager dd,
int  populationSize 
)

Function********************************************************************

Synopsis [Sets the size of the population used by the genetic algorithm for reordering.]

Description [Sets the size of the population used by the genetic algorithm for variable reordering. A larger population size will cause the genetic algorithm to take more time, but will generally produce better results. The default value is 0, in which case the package uses three times the number of variables as population size, with a maximum of 120.]

SideEffects [Changes the manager.]

SeeAlso [Cudd_ReadPopulationSize]

Definition at line 2843 of file cuddAPI.c.

2846 {
2847  dd->populationSize = populationSize;
2848 
2849 } /* end of Cudd_SetPopulationSize */
int populationSize
Definition: cuddInt.h:430
void Cudd_SetRecomb ( DdManager dd,
int  recomb 
)

Function********************************************************************

Synopsis [Sets the value of the recombination parameter used in group sifting.]

Description [Sets the value of the recombination parameter used in group sifting. A larger (positive) value makes the aggregation of variables due to the second difference criterion more likely. A smaller (negative) value makes aggregation less likely. The default value is 0.]

SideEffects [Changes the manager.]

SeeAlso [Cudd_ReadRecomb]

Definition at line 2682 of file cuddAPI.c.

2685 {
2686  dd->recomb = recomb;
2687 
2688 } /* end of Cudd_SetRecomb */
int recomb
Definition: cuddInt.h:427
void Cudd_SetReorderingCycle ( DdManager dd,
int  cycle 
)

Function********************************************************************

Synopsis [Sets the reordCycle parameter of the manager.]

Description [Sets the reordCycle parameter of the manager. This parameter determines how often the alternate threshold on maximum growth is used in reordering.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxGrowthAlternate Cudd_SetMaxGrowthAlternate Cudd_ReadReorderingCycle]

Definition at line 2111 of file cuddAPI.c.

2114 {
2115  dd->reordCycle = cycle;
2116 
2117 } /* end of Cudd_SetReorderingCycle */
int reordCycle
Definition: cuddInt.h:415
void Cudd_SetSiftMaxSwap ( DdManager dd,
int  sms 
)

Function********************************************************************

Synopsis [Sets the siftMaxSwap parameter of the manager.]

Description [Sets the siftMaxSwap parameter of the manager. This parameter gives the maximum number of swaps that will be attempted for each invocation of sifting. The real number of swaps may exceed the set limit because the package will always complete the sifting of the variable that causes the limit to be reached.]

SideEffects [None]

SeeAlso [Cudd_SetSiftMaxVar Cudd_ReadSiftMaxSwap]

Definition at line 1962 of file cuddAPI.c.

1965 {
1966  dd->siftMaxSwap = sms;
1967 
1968 } /* end of Cudd_SetSiftMaxSwap */
int siftMaxSwap
Definition: cuddInt.h:412
void Cudd_SetSiftMaxVar ( DdManager dd,
int  smv 
)

Function********************************************************************

Synopsis [Sets the siftMaxVar parameter of the manager.]

Description [Sets the siftMaxVar parameter of the manager. This parameter gives the maximum number of variables that will be sifted for each invocation of sifting.]

SideEffects [None]

SeeAlso [Cudd_SetSiftMaxSwap Cudd_ReadSiftMaxVar]

Definition at line 1913 of file cuddAPI.c.

1916 {
1917  dd->siftMaxVar = smv;
1918 
1919 } /* end of Cudd_SetSiftMaxVar */
int siftMaxVar
Definition: cuddInt.h:411
void Cudd_SetStderr ( DdManager dd,
FILE *  fp 
)

Function********************************************************************

Synopsis [Sets the stderr of a manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadStderr Cudd_SetStdout]

Definition at line 3717 of file cuddAPI.c.

3720 {
3721  dd->err = fp;
3722 
3723 } /* end of Cudd_SetStderr */
FILE * err
Definition: cuddInt.h:442
void Cudd_SetStdout ( DdManager dd,
FILE *  fp 
)

Function********************************************************************

Synopsis [Sets the stdout of a manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadStdout Cudd_SetStderr]

Definition at line 3674 of file cuddAPI.c.

3677 {
3678  dd->out = fp;
3679 
3680 } /* end of Cudd_SetStdout */
FILE * out
Definition: cuddInt.h:441
void Cudd_SetSymmviolation ( DdManager dd,
int  symmviolation 
)

Function********************************************************************

Synopsis [Sets the value of the symmviolation parameter used in group sifting.]

Description [Sets the value of the symmviolation parameter. This parameter is used in group sifting to decide how many violations to the symmetry conditions f10 = f01 or f11 = f00 are tolerable when checking for aggregation due to extended symmetry. The value should be between 0 and 100. A small value causes fewer variables to be aggregated. The default value is 0.]

SideEffects [Changes the manager.]

SeeAlso [Cudd_ReadSymmviolation]

Definition at line 2737 of file cuddAPI.c.

2740 {
2741  dd->symmviolation = symmviolation;
2742 
2743 } /* end of Cudd_SetSymmviolation */
int symmviolation
Definition: cuddInt.h:428
void Cudd_SetTree ( DdManager dd,
MtrNode tree 
)

Function********************************************************************

Synopsis [Sets the variable group tree of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_FreeTree Cudd_ReadTree Cudd_SetZddTree]

Definition at line 2152 of file cuddAPI.c.

2155 {
2156  if (dd->tree != NULL) {
2157  Mtr_FreeTree(dd->tree);
2158  }
2159  dd->tree = tree;
2160  if (tree == NULL) return;
2161 
2162  fixVarTree(tree, dd->perm, dd->size);
2163  return;
2164 
2165 } /* end of Cudd_SetTree */
int size
Definition: cuddInt.h:361
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:188
MtrNode * tree
Definition: cuddInt.h:424
static void fixVarTree(MtrNode *treenode, int *perm, int size)
Definition: cuddAPI.c:4359
int * perm
Definition: cuddInt.h:386
void Cudd_SetZddTree ( DdManager dd,
MtrNode tree 
)

Function********************************************************************

Synopsis [Sets the ZDD variable group tree of the manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_FreeZddTree Cudd_ReadZddTree Cudd_SetTree]

Definition at line 2224 of file cuddAPI.c.

2227 {
2228  if (dd->treeZ != NULL) {
2229  Mtr_FreeTree(dd->treeZ);
2230  }
2231  dd->treeZ = tree;
2232  if (tree == NULL) return;
2233 
2234  fixVarTree(tree, dd->permZ, dd->sizeZ);
2235  return;
2236 
2237 } /* end of Cudd_SetZddTree */
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:188
int * permZ
Definition: cuddInt.h:387
int sizeZ
Definition: cuddInt.h:362
MtrNode * treeZ
Definition: cuddInt.h:425
static void fixVarTree(MtrNode *treenode, int *perm, int size)
Definition: cuddAPI.c:4359
int Cudd_StdPostReordHook ( DdManager dd,
const char *  str,
void *  data 
)

Function********************************************************************

Synopsis [Sample hook function to call after reordering.]

Description [Sample hook function to call after reordering. Prints on the manager's stdout final size and reordering time. Returns 1 if successful; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_StdPreReordHook]

Definition at line 3501 of file cuddAPI.c.

3505 {
3506  long initialTime = (long) data;
3507  int retval;
3508  long finalTime = util_cpu_time();
3509  double totalTimeSec = (double)(finalTime - initialTime) / 1000.0;
3510 
3511  retval = fprintf(dd->out,"%ld nodes in %g sec\n", strcmp(str, "BDD") == 0 ?
3513  totalTimeSec);
3514  if (retval == EOF) return(0);
3515  retval = fflush(dd->out);
3516  if (retval == EOF) return(0);
3517  return(1);
3518 
3519 } /* end of Cudd_StdPostReordHook */
long Cudd_ReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3179
#define util_cpu_time
Definition: util_hack.h:36
int strcmp()
FILE * out
Definition: cuddInt.h:441
long Cudd_zddReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3221
int Cudd_StdPreReordHook ( DdManager dd,
const char *  str,
void *  data 
)

Function********************************************************************

Synopsis [Sample hook function to call before reordering.]

Description [Sample hook function to call before reordering. Prints on the manager's stdout reordering method and initial size. Returns 1 if successful; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_StdPostReordHook]

Definition at line 3408 of file cuddAPI.c.

3412 {
3414  int retval;
3415 
3416  retval = fprintf(dd->out,"%s reordering with ", str);
3417  if (retval == EOF) return(0);
3418  switch (method) {
3426  retval = fprintf(dd->out,"converging ");
3427  if (retval == EOF) return(0);
3428  break;
3429  default:
3430  break;
3431  }
3432  switch (method) {
3433  case CUDD_REORDER_RANDOM:
3435  retval = fprintf(dd->out,"random");
3436  break;
3437  case CUDD_REORDER_SIFT:
3439  retval = fprintf(dd->out,"sifting");
3440  break;
3443  retval = fprintf(dd->out,"symmetric sifting");
3444  break;
3446  retval = fprintf(dd->out,"lazy sifting");
3447  break;
3450  retval = fprintf(dd->out,"group sifting");
3451  break;
3452  case CUDD_REORDER_WINDOW2:
3453  case CUDD_REORDER_WINDOW3:
3454  case CUDD_REORDER_WINDOW4:
3458  retval = fprintf(dd->out,"window");
3459  break;
3461  retval = fprintf(dd->out,"annealing");
3462  break;
3463  case CUDD_REORDER_GENETIC:
3464  retval = fprintf(dd->out,"genetic");
3465  break;
3466  case CUDD_REORDER_LINEAR:
3468  retval = fprintf(dd->out,"linear sifting");
3469  break;
3470  case CUDD_REORDER_EXACT:
3471  retval = fprintf(dd->out,"exact");
3472  break;
3473  default:
3474  return(0);
3475  }
3476  if (retval == EOF) return(0);
3477 
3478  retval = fprintf(dd->out,": from %ld to ... ", strcmp(str, "BDD") == 0 ?
3480  if (retval == EOF) return(0);
3481  fflush(dd->out);
3482  return(1);
3483 
3484 } /* end of Cudd_StdPreReordHook */
long Cudd_ReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3179
int strcmp()
ABC_PTRUINT_T ptruint
Definition: cuddInt.h:261
FILE * out
Definition: cuddInt.h:441
long Cudd_zddReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3221
Cudd_ReorderingType
Definition: cudd.h:151
void Cudd_TurnOffCountDead ( DdManager dd)

Function********************************************************************

Synopsis [Causes the dead nodes not to be counted towards triggering reordering.]

Description [Causes the dead nodes not to be counted towards triggering reordering. This causes less frequent reorderings. By default dead nodes are not counted. Therefore there is no need to call this function unless Cudd_TurnOnCountDead has been previously called.]

SideEffects [Changes the manager.]

SeeAlso [Cudd_TurnOnCountDead Cudd_DeadAreCounted]

Definition at line 2633 of file cuddAPI.c.

2635 {
2636  dd->countDead = ~0;
2637 
2638 } /* end of Cudd_TurnOffCountDead */
unsigned int countDead
Definition: cuddInt.h:423
void Cudd_TurnOnCountDead ( DdManager dd)

Function********************************************************************

Synopsis [Causes the dead nodes to be counted towards triggering reordering.]

Description [Causes the dead nodes to be counted towards triggering reordering. This causes more frequent reorderings. By default dead nodes are not counted.]

SideEffects [Changes the manager.]

SeeAlso [Cudd_TurnOffCountDead Cudd_DeadAreCounted]

Definition at line 2608 of file cuddAPI.c.

2610 {
2611  dd->countDead = 0;
2612 
2613 } /* end of Cudd_TurnOnCountDead */
unsigned int countDead
Definition: cuddInt.h:423
DdNode* Cudd_zddIthVar ( DdManager dd,
int  i 
)

Function********************************************************************

Synopsis [Returns the ZDD variable with index i.]

Description [Retrieves the ZDD variable with index i if it already exists, or creates a new ZDD variable. Returns a pointer to the variable if successful; NULL otherwise.]

SideEffects [None]

SeeAlso [Cudd_bddIthVar Cudd_addIthVar]

Definition at line 448 of file cuddAPI.c.

451 {
452  DdNode *res;
453  DdNode *zvar;
454  DdNode *lower;
455  int j;
456 
457  if ((unsigned int) i >= CUDD_MAXINDEX - 1) return(NULL);
458 
459  /* The i-th variable function has the following structure:
460  ** at the level corresponding to index i there is a node whose "then"
461  ** child points to the universe, and whose "else" child points to zero.
462  ** Above that level there are nodes with identical children.
463  */
464 
465  /* First we build the node at the level of index i. */
466  lower = (i < dd->sizeZ - 1) ? dd->univ[dd->permZ[i]+1] : DD_ONE(dd);
467  do {
468  dd->reordered = 0;
469  zvar = cuddUniqueInterZdd(dd, i, lower, DD_ZERO(dd));
470  } while (dd->reordered == 1);
471 
472  if (zvar == NULL)
473  return(NULL);
474  cuddRef(zvar);
475 
476  /* Now we add the "filler" nodes above the level of index i. */
477  for (j = dd->permZ[i] - 1; j >= 0; j--) {
478  do {
479  dd->reordered = 0;
480  res = cuddUniqueInterZdd(dd, dd->invpermZ[j], zvar, zvar);
481  } while (dd->reordered == 1);
482  if (res == NULL) {
483  Cudd_RecursiveDerefZdd(dd,zvar);
484  return(NULL);
485  }
486  cuddRef(res);
487  Cudd_RecursiveDerefZdd(dd,zvar);
488  zvar = res;
489  }
490  cuddDeref(zvar);
491  return(zvar);
492 
493 } /* end of Cudd_zddIthVar */
#define cuddRef(n)
Definition: cuddInt.h:584
void Cudd_RecursiveDerefZdd(DdManager *table, DdNode *n)
Definition: cuddRef.c:385
#define cuddDeref(n)
Definition: cuddInt.h:604
Definition: cudd.h:278
int * invpermZ
Definition: cuddInt.h:389
int * permZ
Definition: cuddInt.h:387
int reordered
Definition: cuddInt.h:409
DdNode * cuddUniqueInterZdd(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1343
int sizeZ
Definition: cuddInt.h:362
#define CUDD_MAXINDEX
Definition: cudd.h:112
#define DD_ONE(dd)
Definition: cuddInt.h:911
DdNode ** univ
Definition: cuddInt.h:392
#define DD_ZERO(dd)
Definition: cuddInt.h:927
long Cudd_zddReadNodeCount ( DdManager dd)

Function********************************************************************

Synopsis [Reports the number of nodes in ZDDs.]

Description [Reports the number of nodes in ZDDs. This number always includes the two constants 1 and 0.]

SideEffects [None]

SeeAlso [Cudd_ReadPeakNodeCount Cudd_ReadNodeCount]

Definition at line 3221 of file cuddAPI.c.

3223 {
3224  return((long)(dd->keysZ - dd->deadZ + 2));
3225 
3226 } /* end of Cudd_zddReadNodeCount */
unsigned int deadZ
Definition: cuddInt.h:372
unsigned int keysZ
Definition: cuddInt.h:370
void Cudd_zddRealignDisable ( DdManager unique)

Function********************************************************************

Synopsis [Disables realignment of ZDD order to BDD order.]

Description []

SideEffects [None]

SeeAlso [Cudd_zddRealignEnable Cudd_zddRealignmentEnabled Cudd_bddRealignEnable Cudd_bddRealignmentEnabled]

Definition at line 889 of file cuddAPI.c.

891 {
892  unique->realign = 0;
893  return;
894 
895 } /* end of Cudd_zddRealignDisable */
int realign
Definition: cuddInt.h:420
void Cudd_zddRealignEnable ( DdManager unique)

Function********************************************************************

Synopsis [Enables realignment of ZDD order to BDD order.]

Description [Enables realignment of the ZDD variable order to the BDD variable order after the BDDs and ADDs have been reordered. The number of ZDD variables must be a multiple of the number of BDD variables for realignment to make sense. If this condition is not met, Cudd_ReduceHeap will return 0. Let M be the ratio of the two numbers. For the purpose of realignment, the ZDD variables from M*i to (M+1)*i-1 are reagarded as corresponding to BDD variable i. Realignment is initially disabled.]

SideEffects [None]

SeeAlso [Cudd_ReduceHeap Cudd_zddRealignDisable Cudd_zddRealignmentEnabled Cudd_bddRealignDisable Cudd_bddRealignmentEnabled]

Definition at line 867 of file cuddAPI.c.

869 {
870  unique->realign = 1;
871  return;
872 
873 } /* end of Cudd_zddRealignEnable */
int realign
Definition: cuddInt.h:420
int Cudd_zddRealignmentEnabled ( DdManager unique)

Function********************************************************************

Synopsis [Tells whether the realignment of ZDD order to BDD order is enabled.]

Description [Returns 1 if the realignment of ZDD order to BDD order is enabled; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_zddRealignEnable Cudd_zddRealignDisable Cudd_bddRealignEnable Cudd_bddRealignDisable]

Definition at line 837 of file cuddAPI.c.

839 {
840  return(unique->realign);
841 
842 } /* end of Cudd_zddRealignmentEnabled */
int realign
Definition: cuddInt.h:420
int Cudd_zddVarsFromBddVars ( DdManager dd,
int  multiplicity 
)

Function********************************************************************

Synopsis [Creates one or more ZDD variables for each BDD variable.]

Description [Creates one or more ZDD variables for each BDD variable. If some ZDD variables already exist, only the missing variables are created. Parameter multiplicity allows the caller to control how many variables are created for each BDD variable in existence. For instance, if ZDDs are used to represent covers, two ZDD variables are required for each BDD variable. The order of the BDD variables is transferred to the ZDD variables. If a variable group tree exists for the BDD variables, a corresponding ZDD variable group tree is created by expanding the BDD variable tree. In any case, the ZDD variables derived from the same BDD variable are merged in a ZDD variable group. If a ZDD variable group tree exists, it is freed. Returns 1 if successful; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_bddNewVar Cudd_bddIthVar Cudd_bddNewVarAtLevel]

Definition at line 519 of file cuddAPI.c.

522 {
523  int res;
524  int i, j;
525  int allnew;
526  int *permutation;
527 
528  if (multiplicity < 1) return(0);
529  allnew = dd->sizeZ == 0;
530  if (dd->size * multiplicity > dd->sizeZ) {
531  res = cuddResizeTableZdd(dd,dd->size * multiplicity - 1);
532  if (res == 0) return(0);
533  }
534  /* Impose the order of the BDD variables to the ZDD variables. */
535  if (allnew) {
536  for (i = 0; i < dd->size; i++) {
537  for (j = 0; j < multiplicity; j++) {
538  dd->permZ[i * multiplicity + j] =
539  dd->perm[i] * multiplicity + j;
540  dd->invpermZ[dd->permZ[i * multiplicity + j]] =
541  i * multiplicity + j;
542  }
543  }
544  for (i = 0; i < dd->sizeZ; i++) {
545  dd->univ[i]->index = dd->invpermZ[i];
546  }
547  } else {
548  permutation = ABC_ALLOC(int,dd->sizeZ);
549  if (permutation == NULL) {
551  return(0);
552  }
553  for (i = 0; i < dd->size; i++) {
554  for (j = 0; j < multiplicity; j++) {
555  permutation[i * multiplicity + j] =
556  dd->invperm[i] * multiplicity + j;
557  }
558  }
559  for (i = dd->size * multiplicity; i < dd->sizeZ; i++) {
560  permutation[i] = i;
561  }
562  res = Cudd_zddShuffleHeap(dd, permutation);
563  ABC_FREE(permutation);
564  if (res == 0) return(0);
565  }
566  /* Copy and expand the variable group tree if it exists. */
567  if (dd->treeZ != NULL) {
568  Cudd_FreeZddTree(dd);
569  }
570  if (dd->tree != NULL) {
571  dd->treeZ = Mtr_CopyTree(dd->tree, multiplicity);
572  if (dd->treeZ == NULL) return(0);
573  } else if (multiplicity > 1) {
574  dd->treeZ = Mtr_InitGroupTree(0, dd->sizeZ);
575  if (dd->treeZ == NULL) return(0);
576  dd->treeZ->index = dd->invpermZ[0];
577  }
578  /* Create groups for the ZDD variables derived from the same BDD variable.
579  */
580  if (multiplicity > 1) {
581  char *vmask, *lmask;
582 
583  vmask = ABC_ALLOC(char, dd->size);
584  if (vmask == NULL) {
586  return(0);
587  }
588  lmask = ABC_ALLOC(char, dd->size);
589  if (lmask == NULL) {
591  return(0);
592  }
593  for (i = 0; i < dd->size; i++) {
594  vmask[i] = lmask[i] = 0;
595  }
596  res = addMultiplicityGroups(dd,dd->treeZ,multiplicity,vmask,lmask);
597  ABC_FREE(vmask);
598  ABC_FREE(lmask);
599  if (res == 0) return(0);
600  }
601  return(1);
602 
603 } /* end of Cudd_zddVarsFromBddVars */
int * invpermZ
Definition: cuddInt.h:389
int size
Definition: cuddInt.h:361
void Cudd_FreeZddTree(DdManager *dd)
Definition: cuddAPI.c:2252
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
int * permZ
Definition: cuddInt.h:387
MtrNode * tree
Definition: cuddInt.h:424
MtrHalfWord index
Definition: mtr.h:135
int Cudd_zddShuffleHeap(DdManager *table, int *permutation)
Definition: cuddZddReord.c:304
int cuddResizeTableZdd(DdManager *unique, int index)
Definition: cuddTable.c:2241
static int addMultiplicityGroups(DdManager *dd, MtrNode *treenode, int multiplicity, char *vmask, char *lmask)
Definition: cuddAPI.c:4402
MtrNode * Mtr_InitGroupTree(int lower, int size)
Definition: mtrGroup.c:121
int sizeZ
Definition: cuddInt.h:362
DdHalfWord index
Definition: cudd.h:279
#define ABC_FREE(obj)
Definition: abc_global.h:232
MtrNode * treeZ
Definition: cuddInt.h:425
int * invperm
Definition: cuddInt.h:388
MtrNode * Mtr_CopyTree(MtrNode *node, int expansion)
Definition: mtrBasic.c:215
int * perm
Definition: cuddInt.h:386
Cudd_ErrorType errorCode
Definition: cuddInt.h:447
DdNode ** univ
Definition: cuddInt.h:392
static void fixVarTree ( MtrNode treenode,
int *  perm,
int  size 
)
static

AutomaticStart

Function********************************************************************

Synopsis [Fixes a variable group tree.]

Description []

SideEffects [Changes the variable group tree.]

SeeAlso []

Definition at line 4359 of file cuddAPI.c.

4363 {
4364  treenode->index = treenode->low;
4365  treenode->low = ((int) treenode->index < size) ?
4366  perm[treenode->index] : treenode->index;
4367  if (treenode->child != NULL)
4368  fixVarTree(treenode->child, perm, size);
4369  if (treenode->younger != NULL)
4370  fixVarTree(treenode->younger, perm, size);
4371  return;
4372 
4373 } /* end of fixVarTree */
struct MtrNode * younger
Definition: mtr.h:139
MtrHalfWord index
Definition: mtr.h:135
static int size
Definition: cuddSign.c:86
MtrHalfWord low
Definition: mtr.h:133
static void fixVarTree(MtrNode *treenode, int *perm, int size)
Definition: cuddAPI.c:4359
struct MtrNode * child
Definition: mtr.h:137

Variable Documentation

ABC_NAMESPACE_IMPL_START char rcsid [] DD_UNUSED = "$Id: cuddAPI.c,v 1.59 2009/02/19 16:14:14 fabio Exp $"
static

CFile***********************************************************************

FileName [cuddAPI.c]

PackageName [cudd]

Synopsis [Application interface functions.]

Description [External procedures included in this module:

Static procedures included in this module:

]

SeeAlso []

Author [Fabio Somenzi]

Copyright [Copyright (c) 1995-2004, 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.]

Definition at line 218 of file cuddAPI.c.