SVF
Functions | Variables
cuddAPI.c File Reference
#include "CUDD/util.h"
#include "CUDD/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)
 
unsigned long Cudd_ReadStartTime (DdManager *unique)
 
unsigned long Cudd_ReadElapsedTime (DdManager *unique)
 
void Cudd_SetStartTime (DdManager *unique, unsigned long st)
 
void Cudd_ResetStartTime (DdManager *unique)
 
unsigned long Cudd_ReadTimeLimit (DdManager *unique)
 
void Cudd_SetTimeLimit (DdManager *unique, unsigned long tl)
 
void Cudd_UpdateTimeLimit (DdManager *unique)
 
void Cudd_IncreaseTimeLimit (DdManager *unique, unsigned long increase)
 
void Cudd_UnsetTimeLimit (DdManager *unique)
 
int Cudd_TimeLimited (DdManager *unique)
 
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)
 
unsigned int Cudd_ReadReorderings (DdManager *dd)
 
unsigned int Cudd_ReadMaxReorderings (DdManager *dd)
 
void Cudd_SetMaxReorderings (DdManager *dd, unsigned int mr)
 
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 int Cudd_ReadOrderRandomization (DdManager *dd)
 
void Cudd_SetOrderRandomization (DdManager *dd, unsigned int factor)
 
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)
 
int Cudd_PrintGroupedOrder (DdManager *dd, const char *str, void *data)
 
int Cudd_EnableOrderingMonitoring (DdManager *dd)
 
int Cudd_DisableOrderingMonitoring (DdManager *dd)
 
int Cudd_OrderingMonitoring (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 char rcsid [] DD_UNUSED = "$Id: cuddAPI.c,v 1.64 2012/02/05 01:07:18 fabio Exp $"
 

Function Documentation

◆ addMultiplicityGroups()

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 4855 of file cuddAPI.c.

4861 {
4862  int startV, stopV, startL;
4863  int i, j;
4864  MtrNode *auxnode = treenode;
4865 
4866  while (auxnode != NULL) {
4867  if (auxnode->child != NULL) {
4868  addMultiplicityGroups(dd,auxnode->child,multiplicity,vmask,lmask);
4869  }
4870  /* Build remaining groups. */
4871  startV = dd->permZ[auxnode->index] / multiplicity;
4872  startL = auxnode->low / multiplicity;
4873  stopV = startV + auxnode->size / multiplicity;
4874  /* Walk down vmask starting at startV and build missing groups. */
4875  for (i = startV, j = startL; i < stopV; i++) {
4876  if (vmask[i] == 0) {
4877  MtrNode *node;
4878  while (lmask[j] == 1) j++;
4879  node = Mtr_MakeGroup(auxnode, j * multiplicity, multiplicity,
4880  MTR_FIXED);
4881  if (node == NULL) {
4882  return(0);
4883  }
4884  node->index = dd->invpermZ[i * multiplicity];
4885  vmask[i] = 1;
4886  lmask[j] = 1;
4887  }
4888  }
4889  auxnode = auxnode->younger;
4890  }
4891  return(1);
4892 
4893 } /* end of addMultiplicityGroups */
MtrHalfWord size
Definition: mtr.h:129
int * invpermZ
Definition: cuddInt.h:372
#define MTR_FIXED
Definition: mtr.h:97
int * permZ
Definition: cuddInt.h:370
struct MtrNode * younger
Definition: mtr.h:134
MtrHalfWord index
Definition: mtr.h:130
static int addMultiplicityGroups(DdManager *dd, MtrNode *treenode, int multiplicity, char *vmask, char *lmask)
Definition: cuddAPI.c:4855
MtrHalfWord low
Definition: mtr.h:128
Definition: mtr.h:126
MtrNode * Mtr_MakeGroup(MtrNode *root, unsigned int low, unsigned int high, unsigned int flags)
Definition: mtrGroup.c:156
struct MtrNode * child
Definition: mtr.h:132

◆ Cudd_addConst()

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 634 of file cuddAPI.c.

637 {
638  return(cuddUniqueConst(dd,c));
639 
640 } /* end of Cudd_addConst */
DdNode * cuddUniqueConst(DdManager *unique, CUDD_VALUE_TYPE value)
Definition: cuddTable.c:1479

◆ Cudd_AddHook()

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 3569 of file cuddAPI.c.

3573 {
3574  DdHook **hook, *nextHook, *newHook;
3575 
3576  switch (where) {
3577  case CUDD_PRE_GC_HOOK:
3578  hook = &(dd->preGCHook);
3579  break;
3580  case CUDD_POST_GC_HOOK:
3581  hook = &(dd->postGCHook);
3582  break;
3584  hook = &(dd->preReorderingHook);
3585  break;
3587  hook = &(dd->postReorderingHook);
3588  break;
3589  default:
3590  return(0);
3591  }
3592  /* Scan the list and find whether the function is already there.
3593  ** If so, just return. */
3594  nextHook = *hook;
3595  while (nextHook != NULL) {
3596  if (nextHook->f == f) {
3597  return(2);
3598  }
3599  hook = &(nextHook->next);
3600  nextHook = nextHook->next;
3601  }
3602  /* The function was not in the list. Create a new item and append it
3603  ** to the end of the list. */
3604  newHook = ALLOC(DdHook,1);
3605  if (newHook == NULL) {
3606  dd->errorCode = CUDD_MEMORY_OUT;
3607  return(0);
3608  }
3609  newHook->next = NULL;
3610  newHook->f = f;
3611  *hook = newHook;
3612  return(1);
3613 
3614 } /* end of Cudd_AddHook */
DdHook * preReorderingHook
Definition: cuddInt.h:421
DD_HFP f
Definition: cuddInt.h:241
DdHook * postReorderingHook
Definition: cuddInt.h:422
#define ALLOC(type, num)
Definition: util.h:76
struct DdHook * next
Definition: cuddInt.h:242
DdHook * postGCHook
Definition: cuddInt.h:420
DdHook * preGCHook
Definition: cuddInt.h:419
Cudd_ErrorType errorCode
Definition: cuddInt.h:425

◆ Cudd_addIthVar()

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 398 of file cuddAPI.c.

401 {
402  DdNode *res;
403 
404  if ((unsigned int) i >= CUDD_MAXINDEX - 1) return(NULL);
405  do {
406  dd->reordered = 0;
407  res = cuddUniqueInter(dd,i,DD_ONE(dd),DD_ZERO(dd));
408  } while (dd->reordered == 1);
409 
410  return(res);
411 
412 } /* end of Cudd_addIthVar */
Definition: cudd.h:270
int reordered
Definition: cuddInt.h:392
#define CUDD_MAXINDEX
Definition: cudd.h:108
#define DD_ONE(dd)
Definition: cuddInt.h:864
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1137
#define DD_ZERO(dd)
Definition: cuddInt.h:880

◆ Cudd_addNewVar()

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 273 of file cuddAPI.c.

275 {
276  DdNode *res;
277 
278  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
279  do {
280  dd->reordered = 0;
281  res = cuddUniqueInter(dd,dd->size,DD_ONE(dd),DD_ZERO(dd));
282  } while (dd->reordered == 1);
283 
284  return(res);
285 
286 } /* end of Cudd_addNewVar */
Definition: cudd.h:270
int size
Definition: cuddInt.h:345
int reordered
Definition: cuddInt.h:392
#define CUDD_MAXINDEX
Definition: cudd.h:108
#define DD_ONE(dd)
Definition: cuddInt.h:864
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1137
#define DD_ZERO(dd)
Definition: cuddInt.h:880

◆ Cudd_addNewVarAtLevel()

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 304 of file cuddAPI.c.

307 {
308  DdNode *res;
309 
310  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
311  if (level >= dd->size) return(Cudd_addIthVar(dd,level));
312  if (!cuddInsertSubtables(dd,1,level)) return(NULL);
313  do {
314  dd->reordered = 0;
315  res = cuddUniqueInter(dd,dd->size - 1,DD_ONE(dd),DD_ZERO(dd));
316  } while (dd->reordered == 1);
317 
318  return(res);
319 
320 } /* end of Cudd_addNewVarAtLevel */
Definition: cudd.h:270
int size
Definition: cuddInt.h:345
int reordered
Definition: cuddInt.h:392
int cuddInsertSubtables(DdManager *unique, int n, int level)
Definition: cuddTable.c:1824
DdNode * Cudd_addIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:398
#define CUDD_MAXINDEX
Definition: cudd.h:108
#define DD_ONE(dd)
Definition: cuddInt.h:864
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1137
#define DD_ZERO(dd)
Definition: cuddInt.h:880

◆ Cudd_AutodynDisable()

void Cudd_AutodynDisable ( DdManager unique)

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

Synopsis [Disables automatic dynamic reordering.]

Description []

SideEffects [None]

SeeAlso [Cudd_AutodynEnable Cudd_ReorderingStatus Cudd_AutodynDisableZdd]

Definition at line 948 of file cuddAPI.c.

950 {
951  unique->autoDyn = 0;
952  return;
953 
954 } /* end of Cudd_AutodynDisable */
int autoDyn
Definition: cuddInt.h:400

◆ Cudd_AutodynDisableZdd()

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 1026 of file cuddAPI.c.

1028 {
1029  unique->autoDynZ = 0;
1030  return;
1031 
1032 } /* end of Cudd_AutodynDisableZdd */
int autoDynZ
Definition: cuddInt.h:401

◆ Cudd_AutodynEnable()

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 909 of file cuddAPI.c.

912 {
913  unique->autoDyn = 1;
914  if (method != CUDD_REORDER_SAME) {
915  unique->autoMethod = method;
916  }
917 #ifndef DD_NO_DEATH_ROW
918  /* If reordering is enabled, using the death row causes too many
919  ** invocations. Hence, we shrink the death row to just one entry.
920  */
921  cuddClearDeathRow(unique);
922  unique->deathRowDepth = 1;
923  unique->deadMask = unique->deathRowDepth - 1;
924  if ((unsigned) unique->nextDead > unique->deadMask) {
925  unique->nextDead = 0;
926  }
927  unique->deathRow = REALLOC(DdNodePtr, unique->deathRow,
928  unique->deathRowDepth);
929 #endif
930  return;
931 
932 } /* end of Cudd_AutodynEnable */
Cudd_ReorderingType autoMethod
Definition: cuddInt.h:402
Definition: cudd.h:270
unsigned deadMask
Definition: cuddInt.h:387
DdNode ** deathRow
Definition: cuddInt.h:384
int nextDead
Definition: cuddInt.h:386
int deathRowDepth
Definition: cuddInt.h:385
#define REALLOC(type, obj, num)
Definition: util.h:78
void cuddClearDeathRow(DdManager *table)
Definition: cuddRef.c:722
int autoDyn
Definition: cuddInt.h:400

◆ Cudd_AutodynEnableZdd()

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 1000 of file cuddAPI.c.

1003 {
1004  unique->autoDynZ = 1;
1005  if (method != CUDD_REORDER_SAME) {
1006  unique->autoMethodZ = method;
1007  }
1008  return;
1009 
1010 } /* end of Cudd_AutodynEnableZdd */
Cudd_ReorderingType autoMethodZ
Definition: cuddInt.h:403
int autoDynZ
Definition: cuddInt.h:401

◆ Cudd_bddBindVar()

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 4352 of file cuddAPI.c.

4355 {
4356  if (index >= dd->size || index < 0) return(0);
4357  dd->subtables[dd->perm[index]].bindVar = 1;
4358  return(1);
4359 
4360 } /* end of Cudd_bddBindVar */
int size
Definition: cuddInt.h:345
int bindVar
Definition: cuddInt.h:318
DdSubtable * subtables
Definition: cuddInt.h:349
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIsNsVar()

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 4551 of file cuddAPI.c.

4554 {
4555  if (index >= dd->size || index < 0) return -1;
4556  return (dd->subtables[dd->perm[index]].varType == CUDD_VAR_NEXT_STATE);
4557 
4558 } /* end of Cudd_bddIsNsVar */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_VariableType varType
Definition: cuddInt.h:320
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIsPiVar()

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 4503 of file cuddAPI.c.

4506 {
4507  if (index >= dd->size || index < 0) return -1;
4508  return (dd->subtables[dd->perm[index]].varType == CUDD_VAR_PRIMARY_INPUT);
4509 
4510 } /* end of Cudd_bddIsPiVar */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_VariableType varType
Definition: cuddInt.h:320
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIsPsVar()

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 4527 of file cuddAPI.c.

4530 {
4531  if (index >= dd->size || index < 0) return -1;
4532  return (dd->subtables[dd->perm[index]].varType == CUDD_VAR_PRESENT_STATE);
4533 
4534 } /* end of Cudd_bddIsPsVar */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_VariableType varType
Definition: cuddInt.h:320
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIsVarHardGroup()

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 4779 of file cuddAPI.c.

4782 {
4783  if (index >= dd->size || index < 0) return(-1);
4784  if (dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_HARD_GROUP)
4785  return(1);
4786  return(0);
4787 
4788 } /* end of Cudd_bddIsVarToBeGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIsVarToBeGrouped()

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 4702 of file cuddAPI.c.

4705 {
4706  if (index >= dd->size || index < 0) return(-1);
4707  if (dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_UNGROUP)
4708  return(0);
4709  else
4710  return(dd->subtables[dd->perm[index]].varToBeGrouped);
4711 
4712 } /* end of Cudd_bddIsVarToBeGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIsVarToBeUngrouped()

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 4754 of file cuddAPI.c.

4757 {
4758  if (index >= dd->size || index < 0) return(-1);
4759  return dd->subtables[dd->perm[index]].varToBeGrouped == CUDD_LAZY_UNGROUP;
4760 
4761 } /* end of Cudd_bddIsVarToBeGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddIthVar()

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 430 of file cuddAPI.c.

433 {
434  DdNode *res;
435 
436  if ((unsigned int) i >= CUDD_MAXINDEX - 1) return(NULL);
437  if (i < dd->size) {
438  res = dd->vars[i];
439  } else {
440  res = cuddUniqueInter(dd,i,dd->one,Cudd_Not(dd->one));
441  }
442 
443  return(res);
444 
445 } /* end of Cudd_bddIthVar */
Definition: cudd.h:270
#define Cudd_Not(node)
Definition: cudd.h:354
DdNode ** vars
Definition: cuddInt.h:373
DdNode * one
Definition: cuddInt.h:329
#define CUDD_MAXINDEX
Definition: cudd.h:108
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1137

◆ Cudd_bddNewVar()

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 337 of file cuddAPI.c.

339 {
340  DdNode *res;
341 
342  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
343  res = cuddUniqueInter(dd,dd->size,dd->one,Cudd_Not(dd->one));
344 
345  return(res);
346 
347 } /* end of Cudd_bddNewVar */
Definition: cudd.h:270
#define Cudd_Not(node)
Definition: cudd.h:354
int size
Definition: cuddInt.h:345
DdNode * one
Definition: cuddInt.h:329
#define CUDD_MAXINDEX
Definition: cudd.h:108
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1137

◆ Cudd_bddNewVarAtLevel()

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 365 of file cuddAPI.c.

368 {
369  DdNode *res;
370 
371  if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
372  if (level >= dd->size) return(Cudd_bddIthVar(dd,level));
373  if (!cuddInsertSubtables(dd,1,level)) return(NULL);
374  res = dd->vars[dd->size - 1];
375 
376  return(res);
377 
378 } /* end of Cudd_bddNewVarAtLevel */
Definition: cudd.h:270
int size
Definition: cuddInt.h:345
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
Definition: cuddAPI.c:430
int cuddInsertSubtables(DdManager *unique, int n, int level)
Definition: cuddTable.c:1824
DdNode ** vars
Definition: cuddInt.h:373
#define CUDD_MAXINDEX
Definition: cudd.h:108

◆ Cudd_bddReadPairIndex()

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 4601 of file cuddAPI.c.

4604 {
4605  if (index >= dd->size || index < 0) return -1;
4606  return dd->subtables[dd->perm[index]].pairIndex;
4607 
4608 } /* end of Cudd_bddReadPairIndex */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
int pairIndex
Definition: cuddInt.h:321
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddRealignDisable()

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 1205 of file cuddAPI.c.

1207 {
1208  unique->realignZ = 0;
1209  return;
1210 
1211 } /* end of Cudd_bddRealignDisable */
int realignZ
Definition: cuddInt.h:405

◆ Cudd_bddRealignEnable()

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 1183 of file cuddAPI.c.

1185 {
1186  unique->realignZ = 1;
1187  return;
1188 
1189 } /* end of Cudd_bddRealignEnable */
int realignZ
Definition: cuddInt.h:405

◆ Cudd_bddRealignmentEnabled()

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 1153 of file cuddAPI.c.

1155 {
1156  return(unique->realignZ);
1157 
1158 } /* end of Cudd_bddRealignmentEnabled */
int realignZ
Definition: cuddInt.h:405

◆ Cudd_bddResetVarToBeGrouped()

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 4675 of file cuddAPI.c.

4678 {
4679  if (index >= dd->size || index < 0) return(0);
4680  if (dd->subtables[dd->perm[index]].varToBeGrouped <=
4682  dd->subtables[dd->perm[index]].varToBeGrouped = CUDD_LAZY_NONE;
4683  }
4684  return(1);
4685 
4686 } /* end of Cudd_bddResetVarToBeGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetNsVar()

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 4478 of file cuddAPI.c.

4481 {
4482  if (index >= dd->size || index < 0) return (0);
4483  dd->subtables[dd->perm[index]].varType = CUDD_VAR_NEXT_STATE;
4484  return(1);
4485 
4486 } /* end of Cudd_bddSetNsVar */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_VariableType varType
Definition: cuddInt.h:320
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetPairIndex()

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 4575 of file cuddAPI.c.

4579 {
4580  if (index >= dd->size || index < 0) return(0);
4581  dd->subtables[dd->perm[index]].pairIndex = pairIndex;
4582  return(1);
4583 
4584 } /* end of Cudd_bddSetPairIndex */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
int pairIndex
Definition: cuddInt.h:321
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetPiVar()

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 4430 of file cuddAPI.c.

4433 {
4434  if (index >= dd->size || index < 0) return (0);
4435  dd->subtables[dd->perm[index]].varType = CUDD_VAR_PRIMARY_INPUT;
4436  return(1);
4437 
4438 } /* end of Cudd_bddSetPiVar */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_VariableType varType
Definition: cuddInt.h:320
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetPsVar()

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 4454 of file cuddAPI.c.

4457 {
4458  if (index >= dd->size || index < 0) return (0);
4459  dd->subtables[dd->perm[index]].varType = CUDD_VAR_PRESENT_STATE;
4460  return(1);
4461 
4462 } /* end of Cudd_bddSetPsVar */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_VariableType varType
Definition: cuddInt.h:320
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetVarHardGroup()

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 4651 of file cuddAPI.c.

4654 {
4655  if (index >= dd->size || index < 0) return(0);
4657  return(1);
4658 
4659 } /* end of Cudd_bddSetVarHardGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetVarToBeGrouped()

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 4624 of file cuddAPI.c.

4627 {
4628  if (index >= dd->size || index < 0) return(0);
4629  if (dd->subtables[dd->perm[index]].varToBeGrouped <= CUDD_LAZY_SOFT_GROUP) {
4631  }
4632  return(1);
4633 
4634 } /* end of Cudd_bddSetVarToBeGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddSetVarToBeUngrouped()

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 4728 of file cuddAPI.c.

4731 {
4732  if (index >= dd->size || index < 0) return(0);
4733  dd->subtables[dd->perm[index]].varToBeGrouped = CUDD_LAZY_UNGROUP;
4734  return(1);
4735 
4736 } /* end of Cudd_bddSetVarToBeGrouped */
int size
Definition: cuddInt.h:345
DdSubtable * subtables
Definition: cuddInt.h:349
Cudd_LazyGroupType varToBeGrouped
Definition: cuddInt.h:323
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddUnbindVar()

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 4380 of file cuddAPI.c.

4383 {
4384  if (index >= dd->size || index < 0) return(0);
4385  dd->subtables[dd->perm[index]].bindVar = 0;
4386  return(1);
4387 
4388 } /* end of Cudd_bddUnbindVar */
int size
Definition: cuddInt.h:345
int bindVar
Definition: cuddInt.h:318
DdSubtable * subtables
Definition: cuddInt.h:349
int * perm
Definition: cuddInt.h:369

◆ Cudd_bddVarIsBound()

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 4407 of file cuddAPI.c.

4410 {
4411  if (index >= dd->size || index < 0) return(0);
4412  return(dd->subtables[dd->perm[index]].bindVar);
4413 
4414 } /* end of Cudd_bddVarIsBound */
int size
Definition: cuddInt.h:345
int bindVar
Definition: cuddInt.h:318
DdSubtable * subtables
Definition: cuddInt.h:349
int * perm
Definition: cuddInt.h:369

◆ Cudd_ClearErrorCode()

void Cudd_ClearErrorCode ( DdManager dd)

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

Synopsis [Clear the error code of a manager.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadErrorCode]

Definition at line 4085 of file cuddAPI.c.

4087 {
4088  dd->errorCode = CUDD_NO_ERROR;
4089 
4090 } /* end of Cudd_ClearErrorCode */
Cudd_ErrorType errorCode
Definition: cuddInt.h:425

◆ Cudd_DeadAreCounted()

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 2867 of file cuddAPI.c.

2869 {
2870  return(dd->countDead == 0 ? 1 : 0);
2871 
2872 } /* end of Cudd_DeadAreCounted */
unsigned int countDead
Definition: cuddInt.h:407

◆ Cudd_DisableGarbageCollection()

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 2845 of file cuddAPI.c.

2847 {
2848  dd->gcEnabled = 0;
2849 
2850 } /* end of Cudd_DisableGarbageCollection */
int gcEnabled
Definition: cuddInt.h:360

◆ Cudd_DisableOrderingMonitoring()

int Cudd_DisableOrderingMonitoring ( DdManager dd)

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

Synopsis [Disables monitoring of ordering.]

Description [Disables monitoring of ordering. Returns 1 if successful; 0 otherwise.]

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

SeeAlso [Cudd_EnableOrderingMonitoring]

Definition at line 4011 of file cuddAPI.c.

4013 {
4015  return(0);
4016  }
4018  return(0);
4019  }
4021  return(0);
4022  }
4024  return(0);
4025  }
4026  return(1);
4027 
4028 } /* end of Cudd_DisableOrderingMonitoring */
int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3826
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3733
int Cudd_PrintGroupedOrder(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3939
int Cudd_RemoveHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3631

◆ Cudd_DisableReorderingReporting()

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 3889 of file cuddAPI.c.

3891 {
3893  return(0);
3894  }
3896  return(0);
3897  }
3898  return(1);
3899 
3900 } /* end of Cudd_DisableReorderingReporting */
int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3826
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3733
int Cudd_RemoveHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3631

◆ Cudd_EnableGarbageCollection()

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 2821 of file cuddAPI.c.

2823 {
2824  dd->gcEnabled = 1;
2825 
2826 } /* end of Cudd_EnableGarbageCollection */
int gcEnabled
Definition: cuddInt.h:360

◆ Cudd_EnableOrderingMonitoring()

int Cudd_EnableOrderingMonitoring ( DdManager dd)

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

Synopsis [Enables monitoring of ordering.]

Description [Enables monitoring of ordering. Returns 1 if successful; 0 otherwise.]

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

SeeAlso [Cudd_EnableReorderingReporting]

Definition at line 3977 of file cuddAPI.c.

3979 {
3981  return(0);
3982  }
3984  return(0);
3985  }
3987  return(0);
3988  }
3990  return(0);
3991  }
3992  return(1);
3993 
3994 } /* end of Cudd_EnableOrderingMonitoring */
int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3826
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3733
int Cudd_AddHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3569
int Cudd_PrintGroupedOrder(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3939

◆ Cudd_EnableReorderingReporting()

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 3861 of file cuddAPI.c.

3863 {
3865  return(0);
3866  }
3868  return(0);
3869  }
3870  return(1);
3871 
3872 } /* end of Cudd_EnableReorderingReporting */
int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3826
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3733
int Cudd_AddHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3569

◆ Cudd_ExpectedUsedSlots()

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 1812 of file cuddAPI.c.

1814 {
1815  int i;
1816  int size = dd->size;
1817  DdSubtable *subtable;
1818  double empty = 0.0;
1819 
1820  /* To each subtable we apply the corollary to Theorem 8.5 (occupancy
1821  ** distribution) from Sedgewick and Flajolet's Analysis of Algorithms.
1822  ** The corollary says that for a table with M buckets and a load ratio
1823  ** of r, the expected number of empty buckets is asymptotically given
1824  ** by M * exp(-r).
1825  */
1826 
1827  /* Scan each BDD/ADD subtable. */
1828  for (i = 0; i < size; i++) {
1829  subtable = &(dd->subtables[i]);
1830  empty += (double) subtable->slots *
1831  exp(-(double) subtable->keys / (double) subtable->slots);
1832  }
1833 
1834  /* Scan the ZDD subtables. */
1835  size = dd->sizeZ;
1836 
1837  for (i = 0; i < size; i++) {
1838  subtable = &(dd->subtableZ[i]);
1839  empty += (double) subtable->slots *
1840  exp(-(double) subtable->keys / (double) subtable->slots);
1841  }
1842 
1843  /* Constant table. */
1844  subtable = &(dd->constants);
1845  empty += (double) subtable->slots *
1846  exp(-(double) subtable->keys / (double) subtable->slots);
1847 
1848  return(1.0 - empty / (double) dd->slots);
1849 
1850 } /* end of Cudd_ExpectedUsedSlots */
unsigned int keys
Definition: cuddInt.h:314
int size
Definition: cuddInt.h:345
unsigned int slots
Definition: cuddInt.h:352
DdSubtable * subtables
Definition: cuddInt.h:349
int sizeZ
Definition: cuddInt.h:346
unsigned int slots
Definition: cuddInt.h:313
DdSubtable constants
Definition: cuddInt.h:351
static DdNode * empty
Definition: cuddZddLin.c:94
DdSubtable * subtableZ
Definition: cuddInt.h:350

◆ Cudd_FreeTree()

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 2462 of file cuddAPI.c.

2464 {
2465  if (dd->tree != NULL) {
2466  Mtr_FreeTree(dd->tree);
2467  dd->tree = NULL;
2468  }
2469  return;
2470 
2471 } /* end of Cudd_FreeTree */
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:187
MtrNode * tree
Definition: cuddInt.h:408

◆ Cudd_FreeZddTree()

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 2534 of file cuddAPI.c.

2536 {
2537  if (dd->treeZ != NULL) {
2538  Mtr_FreeTree(dd->treeZ);
2539  dd->treeZ = NULL;
2540  }
2541  return;
2542 
2543 } /* end of Cudd_FreeZddTree */
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:187
MtrNode * treeZ
Definition: cuddInt.h:409

◆ Cudd_GarbageCollectionEnabled()

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 2799 of file cuddAPI.c.

2801 {
2802  return(dd->gcEnabled);
2803 
2804 } /* end of Cudd_GarbageCollectionEnabled */
int gcEnabled
Definition: cuddInt.h:360

◆ Cudd_IncreaseTimeLimit()

void Cudd_IncreaseTimeLimit ( DdManager unique,
unsigned long  increase 
)

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

Synopsis [Increases the time limit for the manager.]

Description [Increases the time limit for the manager.]

SideEffects [None]

SeeAlso [Cudd_ReadTimeLimit Cudd_SetTimeLimit Cudd_UnsetTimeLimit Cudd_UpdateTimeLimit Cudd_TimeLimited Cudd_SetStartTime]

Definition at line 838 of file cuddAPI.c.

841 {
842  if (unique->timeLimit == ~0UL)
843  unique->timeLimit = increase;
844  else
845  unique->timeLimit += increase;
846 
847 } /* end of Cudd_IncreaseTimeLimit */
unsigned long timeLimit
Definition: cuddInt.h:427

◆ Cudd_IsInHook()

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 3684 of file cuddAPI.c.

3688 {
3689  DdHook *hook;
3690 
3691  switch (where) {
3692  case CUDD_PRE_GC_HOOK:
3693  hook = dd->preGCHook;
3694  break;
3695  case CUDD_POST_GC_HOOK:
3696  hook = dd->postGCHook;
3697  break;
3699  hook = dd->preReorderingHook;
3700  break;
3702  hook = dd->postReorderingHook;
3703  break;
3704  default:
3705  return(0);
3706  }
3707  /* Scan the list and find whether the function is already there. */
3708  while (hook != NULL) {
3709  if (hook->f == f) {
3710  return(1);
3711  }
3712  hook = hook->next;
3713  }
3714  return(0);
3715 
3716 } /* end of Cudd_IsInHook */
DdHook * preReorderingHook
Definition: cuddInt.h:421
DD_HFP f
Definition: cuddInt.h:241
DdHook * postReorderingHook
Definition: cuddInt.h:422
struct DdHook * next
Definition: cuddInt.h:242
DdHook * postGCHook
Definition: cuddInt.h:420
DdHook * preGCHook
Definition: cuddInt.h:419

◆ Cudd_IsNonConstant()

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 659 of file cuddAPI.c.

661 {
662  return(f == DD_NON_CONSTANT || !Cudd_IsConstant(f));
663 
664 } /* end of Cudd_IsNonConstant */
#define Cudd_IsConstant(node)
Definition: cudd.h:339
#define DD_NON_CONSTANT
Definition: cuddInt.h:124

◆ Cudd_NodeReadIndex()

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 2559 of file cuddAPI.c.

2561 {
2562  return((unsigned int) Cudd_Regular(node)->index);
2563 
2564 } /* end of Cudd_NodeReadIndex */
#define Cudd_Regular(node)
Definition: cudd.h:384

◆ Cudd_OrderingMonitoring()

int Cudd_OrderingMonitoring ( DdManager dd)

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

Synopsis [Returns 1 if monitoring of ordering is enabled.]

Description [Returns 1 if monitoring of ordering is enabled; 0 otherwise.]

SideEffects [none]

SeeAlso [Cudd_EnableOrderingMonitoring Cudd_DisableOrderingMonitoring]

Definition at line 4044 of file cuddAPI.c.

4046 {
4048 
4049 } /* end of Cudd_OrderingMonitoring */
int Cudd_IsInHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3684
int Cudd_PrintGroupedOrder(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3939

◆ Cudd_PrintGroupedOrder()

int Cudd_PrintGroupedOrder ( DdManager dd,
const char *  str,
void *  data 
)

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

Synopsis [Hook function to print the current variable order.]

Description [Hook function to print the current variable order. It may be called before or after reordering. Prints on the manager's stdout a parenthesized list that describes the variable groups. Returns 1 if successful; 0 otherwise.]

SideEffects [None]

SeeAlso [Cudd_StdPreReordHook]

Definition at line 3939 of file cuddAPI.c.

3943 {
3944  int isBdd = strcmp(str, "ZDD");
3945  MtrNode *tree = isBdd ? dd->tree : dd->treeZ;
3946  int *invperm = isBdd ? dd->invperm : dd->invpermZ;
3947  int size = isBdd ? dd->size : dd->sizeZ;
3948  if (tree == NULL) {
3949  int i, retval;
3950  for (i=0; i < size; i++) {
3951  retval = fprintf(dd->out, "%c%d", i==0 ? '(' : ',', invperm[i]);
3952  if (retval == EOF) return(0);
3953  }
3954  retval = fprintf(dd->out,")\n");
3955  return (retval != EOF);
3956  } else {
3957  return Mtr_PrintGroupedOrder(tree,invperm,dd->out);
3958  }
3959 
3960 } /* end of Cudd_PrintGroupedOrder */
int strcmp()
int * invpermZ
Definition: cuddInt.h:372
int size
Definition: cuddInt.h:345
MtrNode * tree
Definition: cuddInt.h:408
FILE * out
Definition: cuddInt.h:423
Definition: mtr.h:126
int Mtr_PrintGroupedOrder(MtrNode *root, int *invperm, FILE *fp)
Definition: mtrGroup.c:662
int sizeZ
Definition: cuddInt.h:346
MtrNode * treeZ
Definition: cuddInt.h:409
int * invperm
Definition: cuddInt.h:371

◆ Cudd_PrintInfo()

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 3263 of file cuddAPI.c.

3266 {
3267  int retval;
3268  Cudd_ReorderingType autoMethod, autoMethodZ;
3269 
3270  /* Modifiable parameters. */
3271  retval = fprintf(fp,"**** CUDD modifiable parameters ****\n");
3272  if (retval == EOF) return(0);
3273  retval = fprintf(fp,"Hard limit for cache size: %u\n",
3274  Cudd_ReadMaxCacheHard(dd));
3275  if (retval == EOF) return(0);
3276  retval = fprintf(fp,"Cache hit threshold for resizing: %u%%\n",
3277  Cudd_ReadMinHit(dd));
3278  if (retval == EOF) return(0);
3279  retval = fprintf(fp,"Garbage collection enabled: %s\n",
3280  Cudd_GarbageCollectionEnabled(dd) ? "yes" : "no");
3281  if (retval == EOF) return(0);
3282  retval = fprintf(fp,"Limit for fast unique table growth: %u\n",
3283  Cudd_ReadLooseUpTo(dd));
3284  if (retval == EOF) return(0);
3285  retval = fprintf(fp,
3286  "Maximum number of variables sifted per reordering: %d\n",
3287  Cudd_ReadSiftMaxVar(dd));
3288  if (retval == EOF) return(0);
3289  retval = fprintf(fp,
3290  "Maximum number of variable swaps per reordering: %d\n",
3291  Cudd_ReadSiftMaxSwap(dd));
3292  if (retval == EOF) return(0);
3293  retval = fprintf(fp,"Maximum growth while sifting a variable: %g\n",
3294  Cudd_ReadMaxGrowth(dd));
3295  if (retval == EOF) return(0);
3296  retval = fprintf(fp,"Dynamic reordering of BDDs enabled: %s\n",
3297  Cudd_ReorderingStatus(dd,&autoMethod) ? "yes" : "no");
3298  if (retval == EOF) return(0);
3299  retval = fprintf(fp,"Default BDD reordering method: %d\n",
3300  (int) autoMethod);
3301  if (retval == EOF) return(0);
3302  retval = fprintf(fp,"Dynamic reordering of ZDDs enabled: %s\n",
3303  Cudd_ReorderingStatusZdd(dd,&autoMethodZ) ? "yes" : "no");
3304  if (retval == EOF) return(0);
3305  retval = fprintf(fp,"Default ZDD reordering method: %d\n",
3306  (int) autoMethodZ);
3307  if (retval == EOF) return(0);
3308  retval = fprintf(fp,"Realignment of ZDDs to BDDs enabled: %s\n",
3309  Cudd_zddRealignmentEnabled(dd) ? "yes" : "no");
3310  if (retval == EOF) return(0);
3311  retval = fprintf(fp,"Realignment of BDDs to ZDDs enabled: %s\n",
3312  Cudd_bddRealignmentEnabled(dd) ? "yes" : "no");
3313  if (retval == EOF) return(0);
3314  retval = fprintf(fp,"Dead nodes counted in triggering reordering: %s\n",
3315  Cudd_DeadAreCounted(dd) ? "yes" : "no");
3316  if (retval == EOF) return(0);
3317  retval = fprintf(fp,"Group checking criterion: %d\n",
3318  (int) Cudd_ReadGroupcheck(dd));
3319  if (retval == EOF) return(0);
3320  retval = fprintf(fp,"Recombination threshold: %d\n", Cudd_ReadRecomb(dd));
3321  if (retval == EOF) return(0);
3322  retval = fprintf(fp,"Symmetry violation threshold: %d\n",
3324  if (retval == EOF) return(0);
3325  retval = fprintf(fp,"Arc violation threshold: %d\n",
3326  Cudd_ReadArcviolation(dd));
3327  if (retval == EOF) return(0);
3328  retval = fprintf(fp,"GA population size: %d\n",
3330  if (retval == EOF) return(0);
3331  retval = fprintf(fp,"Number of crossovers for GA: %d\n",
3332  Cudd_ReadNumberXovers(dd));
3333  if (retval == EOF) return(0);
3334  retval = fprintf(fp,"Next reordering threshold: %u\n",
3336  if (retval == EOF) return(0);
3337 
3338  /* Non-modifiable parameters. */
3339  retval = fprintf(fp,"**** CUDD non-modifiable parameters ****\n");
3340  if (retval == EOF) return(0);
3341  retval = fprintf(fp,"Memory in use: %lu\n", Cudd_ReadMemoryInUse(dd));
3342  if (retval == EOF) return(0);
3343  retval = fprintf(fp,"Peak number of nodes: %ld\n",
3345  if (retval == EOF) return(0);
3346  retval = fprintf(fp,"Peak number of live nodes: %d\n",
3348  if (retval == EOF) return(0);
3349  retval = fprintf(fp,"Number of BDD variables: %d\n", dd->size);
3350  if (retval == EOF) return(0);
3351  retval = fprintf(fp,"Number of ZDD variables: %d\n", dd->sizeZ);
3352  if (retval == EOF) return(0);
3353  retval = fprintf(fp,"Number of cache entries: %u\n", dd->cacheSlots);
3354  if (retval == EOF) return(0);
3355  retval = fprintf(fp,"Number of cache look-ups: %.0f\n",
3356  Cudd_ReadCacheLookUps(dd));
3357  if (retval == EOF) return(0);
3358  retval = fprintf(fp,"Number of cache hits: %.0f\n",
3359  Cudd_ReadCacheHits(dd));
3360  if (retval == EOF) return(0);
3361  retval = fprintf(fp,"Number of cache insertions: %.0f\n",
3362  dd->cacheinserts);
3363  if (retval == EOF) return(0);
3364  retval = fprintf(fp,"Number of cache collisions: %.0f\n",
3365  dd->cachecollisions);
3366  if (retval == EOF) return(0);
3367  retval = fprintf(fp,"Number of cache deletions: %.0f\n",
3368  dd->cachedeletions);
3369  if (retval == EOF) return(0);
3370  retval = cuddCacheProfile(dd,fp);
3371  if (retval == 0) return(0);
3372  retval = fprintf(fp,"Soft limit for cache size: %u\n",
3373  Cudd_ReadMaxCache(dd));
3374  if (retval == EOF) return(0);
3375  retval = fprintf(fp,"Number of buckets in unique table: %u\n", dd->slots);
3376  if (retval == EOF) return(0);
3377  retval = fprintf(fp,"Used buckets in unique table: %.2f%% (expected %.2f%%)\n",
3378  100.0 * Cudd_ReadUsedSlots(dd),
3379  100.0 * Cudd_ExpectedUsedSlots(dd));
3380  if (retval == EOF) return(0);
3381 #ifdef DD_UNIQUE_PROFILE
3382  retval = fprintf(fp,"Unique lookups: %.0f\n", dd->uniqueLookUps);
3383  if (retval == EOF) return(0);
3384  retval = fprintf(fp,"Unique links: %.0f (%g per lookup)\n",
3385  dd->uniqueLinks, dd->uniqueLinks / dd->uniqueLookUps);
3386  if (retval == EOF) return(0);
3387 #endif
3388  retval = fprintf(fp,"Number of BDD and ADD nodes: %u\n", dd->keys);
3389  if (retval == EOF) return(0);
3390  retval = fprintf(fp,"Number of ZDD nodes: %u\n", dd->keysZ);
3391  if (retval == EOF) return(0);
3392  retval = fprintf(fp,"Number of dead BDD and ADD nodes: %u\n", dd->dead);
3393  if (retval == EOF) return(0);
3394  retval = fprintf(fp,"Number of dead ZDD nodes: %u\n", dd->deadZ);
3395  if (retval == EOF) return(0);
3396  retval = fprintf(fp,"Total number of nodes allocated: %.0f\n",
3397  dd->allocated);
3398  if (retval == EOF) return(0);
3399  retval = fprintf(fp,"Total number of nodes reclaimed: %.0f\n",
3400  dd->reclaimed);
3401  if (retval == EOF) return(0);
3402 #ifdef DD_STATS
3403  retval = fprintf(fp,"Nodes freed: %.0f\n", dd->nodesFreed);
3404  if (retval == EOF) return(0);
3405  retval = fprintf(fp,"Nodes dropped: %.0f\n", dd->nodesDropped);
3406  if (retval == EOF) return(0);
3407 #endif
3408 #ifdef DD_COUNT
3409  retval = fprintf(fp,"Number of recursive calls: %.0f\n",
3411  if (retval == EOF) return(0);
3412 #endif
3413  retval = fprintf(fp,"Garbage collections so far: %d\n",
3415  if (retval == EOF) return(0);
3416  retval = fprintf(fp,"Time for garbage collection: %.2f sec\n",
3417  ((double)Cudd_ReadGarbageCollectionTime(dd)/1000.0));
3418  if (retval == EOF) return(0);
3419  retval = fprintf(fp,"Reorderings so far: %d\n", dd->reorderings);
3420  if (retval == EOF) return(0);
3421  retval = fprintf(fp,"Time for reordering: %.2f sec\n",
3422  ((double)Cudd_ReadReorderingTime(dd)/1000.0));
3423  if (retval == EOF) return(0);
3424 #ifdef DD_COUNT
3425  retval = fprintf(fp,"Node swaps in reordering: %.0f\n",
3426  Cudd_ReadSwapSteps(dd));
3427  if (retval == EOF) return(0);
3428 #endif
3429 
3430  return(1);
3431 
3432 } /* end of Cudd_PrintInfo */
double allocated
Definition: cuddInt.h:365
int Cudd_ReadSiftMaxSwap(DdManager *dd)
Definition: cuddAPI.c:2220
unsigned int deadZ
Definition: cuddInt.h:356
double Cudd_ExpectedUsedSlots(DdManager *dd)
Definition: cuddAPI.c:1812
unsigned int Cudd_ReadMaxCache(DdManager *dd)
Definition: cuddAPI.c:1611
long Cudd_ReadPeakNodeCount(DdManager *dd)
Definition: cuddAPI.c:3449
int Cudd_ReorderingStatusZdd(DdManager *unique, Cudd_ReorderingType *method)
Definition: cuddAPI.c:1052
int size
Definition: cuddInt.h:345
int Cudd_ReadRecomb(DdManager *dd)
Definition: cuddAPI.c:2939
double Cudd_ReadSwapSteps(DdManager *dd)
Definition: cuddAPI.c:4240
unsigned int slots
Definition: cuddInt.h:352
Cudd_AggregationType Cudd_ReadGroupcheck(DdManager *dd)
Definition: cuddAPI.c:2756
unsigned int Cudd_ReadMaxCacheHard(DdManager *dd)
Definition: cuddAPI.c:1631
int Cudd_GarbageCollectionEnabled(DdManager *dd)
Definition: cuddAPI.c:2799
unsigned int Cudd_ReadMinHit(DdManager *dd)
Definition: cuddAPI.c:1512
int Cudd_DeadAreCounted(DdManager *dd)
Definition: cuddAPI.c:2867
int cuddCacheProfile(DdManager *table, FILE *fp)
Definition: cuddCache.c:749
unsigned long Cudd_ReadMemoryInUse(DdManager *dd)
Definition: cuddAPI.c:3242
double cachecollisions
Definition: cuddInt.h:437
int Cudd_ReadArcviolation(DdManager *dd)
Definition: cuddAPI.c:3046
double cacheinserts
Definition: cuddInt.h:438
unsigned int dead
Definition: cuddInt.h:355
unsigned int cacheSlots
Definition: cuddInt.h:337
unsigned int keys
Definition: cuddInt.h:353
int Cudd_ReadSymmviolation(DdManager *dd)
Definition: cuddAPI.c:2992
unsigned int Cudd_ReadNextReordering(DdManager *dd)
Definition: cuddAPI.c:4195
double Cudd_ReadCacheLookUps(DdManager *dd)
Definition: cuddAPI.c:1444
int Cudd_ReadPopulationSize(DdManager *dd)
Definition: cuddAPI.c:3099
int Cudd_bddRealignmentEnabled(DdManager *unique)
Definition: cuddAPI.c:1153
int Cudd_ReadPeakLiveNodeCount(DdManager *dd)
Definition: cuddAPI.c:3476
double Cudd_ReadUsedSlots(DdManager *dd)
Definition: cuddAPI.c:1743
double Cudd_ReadCacheHits(DdManager *dd)
Definition: cuddAPI.c:1465
int Cudd_zddRealignmentEnabled(DdManager *unique)
Definition: cuddAPI.c:1077
unsigned int Cudd_ReadLooseUpTo(DdManager *dd)
Definition: cuddAPI.c:1561
int Cudd_ReadSiftMaxVar(DdManager *dd)
Definition: cuddAPI.c:2173
long Cudd_ReadReorderingTime(DdManager *dd)
Definition: cuddAPI.c:2000
double Cudd_ReadMaxGrowth(DdManager *dd)
Definition: cuddAPI.c:2270
int Cudd_ReadGarbageCollections(DdManager *dd)
Definition: cuddAPI.c:2023
int Cudd_ReadNumberXovers(DdManager *dd)
Definition: cuddAPI.c:3152
int sizeZ
Definition: cuddInt.h:346
unsigned int reorderings
Definition: cuddInt.h:393
int Cudd_ReorderingStatus(DdManager *unique, Cudd_ReorderingType *method)
Definition: cuddAPI.c:975
double cachedeletions
Definition: cuddInt.h:440
unsigned int keysZ
Definition: cuddInt.h:354
double Cudd_ReadRecursiveCalls(DdManager *dd)
Definition: cuddAPI.c:1486
Cudd_ReorderingType
Definition: cudd.h:147
long Cudd_ReadGarbageCollectionTime(DdManager *dd)
Definition: cuddAPI.c:2044
double reclaimed
Definition: cuddInt.h:367

◆ Cudd_ReadArcviolation()

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 3046 of file cuddAPI.c.

3048 {
3049  return(dd->arcviolation);
3050 
3051 } /* end of Cudd_ReadArcviolation */
int arcviolation
Definition: cuddInt.h:413

◆ Cudd_ReadBackground()

DdNode* Cudd_ReadBackground ( DdManager dd)

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

Synopsis [Reads the background constant of the manager.]

Description []

SideEffects [None]

Definition at line 1352 of file cuddAPI.c.

1354 {
1355  return(dd->background);
1356 
1357 } /* end of Cudd_ReadBackground */
DdNode * background
Definition: cuddInt.h:333

◆ Cudd_ReadCacheHits()

double Cudd_ReadCacheHits ( DdManager dd)

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

Synopsis [Returns the number of cache hits.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadCacheLookUps]

Definition at line 1465 of file cuddAPI.c.

1467 {
1468  return(dd->cacheHits + dd->totCachehits);
1469 
1470 } /* end of Cudd_ReadCacheHits */
double cacheHits
Definition: cuddInt.h:340
double totCachehits
Definition: cuddInt.h:435

◆ Cudd_ReadCacheLookUps()

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 1444 of file cuddAPI.c.

1446 {
1447  return(dd->cacheHits + dd->cacheMisses +
1448  dd->totCachehits + dd->totCacheMisses);
1449 
1450 } /* end of Cudd_ReadCacheLookUps */
double totCacheMisses
Definition: cuddInt.h:436
double cacheHits
Definition: cuddInt.h:340
double cacheMisses
Definition: cuddInt.h:339
double totCachehits
Definition: cuddInt.h:435

◆ Cudd_ReadCacheSlots()

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 1392 of file cuddAPI.c.

1394 {
1395  return(dd->cacheSlots);
1396 
1397 } /* end of Cudd_ReadCacheSlots */
unsigned int cacheSlots
Definition: cuddInt.h:337

◆ Cudd_ReadCacheUsedSlots()

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 1415 of file cuddAPI.c.

1417 {
1418  unsigned long used = 0;
1419  int slots = dd->cacheSlots;
1420  DdCache *cache = dd->cache;
1421  int i;
1422 
1423  for (i = 0; i < slots; i++) {
1424  used += cache[i].h != 0;
1425  }
1426 
1427  return((double)used / (double) dd->cacheSlots);
1428 
1429 } /* end of Cudd_ReadCacheUsedSlots */
ptruint h
Definition: cuddInt.h:303
unsigned int cacheSlots
Definition: cuddInt.h:337
DdCache * cache
Definition: cuddInt.h:336

◆ Cudd_ReadDead()

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 1886 of file cuddAPI.c.

1888 {
1889  return(dd->dead);
1890 
1891 } /* end of Cudd_ReadDead */
unsigned int dead
Definition: cuddInt.h:355

◆ Cudd_ReadElapsedTime()

unsigned long Cudd_ReadElapsedTime ( DdManager unique)

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

Synopsis [Returns the time elapsed since the start time of the manager.]

Description [Returns the time elapsed since the start time of the manager.]

SideEffects [None]

SeeAlso [Cudd_ReadStartTime Cudd_SetStartTime]

Definition at line 701 of file cuddAPI.c.

703 {
704  return util_cpu_time() - unique->startTime;
705 
706 } /* end of Cudd_ReadElapsedTime */
unsigned long startTime
Definition: cuddInt.h:426
long util_cpu_time(void)
Definition: cpu_time.c:34

◆ Cudd_ReadEpsilon()

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 2712 of file cuddAPI.c.

2714 {
2715  return(dd->epsilon);
2716 
2717 } /* end of Cudd_ReadEpsilon */
CUDD_VALUE_TYPE epsilon
Definition: cuddInt.h:390

◆ Cudd_ReadErrorCode()

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 4065 of file cuddAPI.c.

4067 {
4068  return(dd->errorCode);
4069 
4070 } /* end of Cudd_ReadErrorCode */
Cudd_ErrorType errorCode
Definition: cuddInt.h:425

◆ Cudd_ReadGarbageCollections()

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 2023 of file cuddAPI.c.

2025 {
2026  return(dd->garbageCollections);
2027 
2028 } /* end of Cudd_ReadGarbageCollections */
int garbageCollections
Definition: cuddInt.h:432

◆ Cudd_ReadGarbageCollectionTime()

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 2044 of file cuddAPI.c.

2046 {
2047  return(dd->GCTime);
2048 
2049 } /* end of Cudd_ReadGarbageCollectionTime */
unsigned long GCTime
Definition: cuddInt.h:433

◆ Cudd_ReadGroupcheck()

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 2756 of file cuddAPI.c.

2758 {
2759  return(dd->groupcheck);
2760 
2761 } /* end of Cudd_ReadGroupCheck */
Cudd_AggregationType groupcheck
Definition: cuddInt.h:410

◆ Cudd_ReadInvPerm()

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 2636 of file cuddAPI.c.

2639 {
2640  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2641  if (i < 0 || i >= dd->size) return(-1);
2642  return(dd->invperm[i]);
2643 
2644 } /* end of Cudd_ReadInvPerm */
int size
Definition: cuddInt.h:345
#define CUDD_CONST_INDEX
Definition: cudd.h:113
int * invperm
Definition: cuddInt.h:371

◆ Cudd_ReadInvPermZdd()

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 2662 of file cuddAPI.c.

2665 {
2666  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2667  if (i < 0 || i >= dd->sizeZ) return(-1);
2668  return(dd->invpermZ[i]);
2669 
2670 } /* end of Cudd_ReadInvPermZdd */
int * invpermZ
Definition: cuddInt.h:372
#define CUDD_CONST_INDEX
Definition: cudd.h:113
int sizeZ
Definition: cuddInt.h:346

◆ Cudd_ReadKeys()

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 1866 of file cuddAPI.c.

1868 {
1869  return(dd->keys);
1870 
1871 } /* end of Cudd_ReadKeys */
unsigned int keys
Definition: cuddInt.h:353

◆ Cudd_ReadLogicZero()

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 1298 of file cuddAPI.c.

1300 {
1301  return(Cudd_Not(DD_ONE(dd)));
1302 
1303 } /* end of Cudd_ReadLogicZero */
#define Cudd_Not(node)
Definition: cudd.h:354
#define DD_ONE(dd)
Definition: cuddInt.h:864

◆ Cudd_ReadLooseUpTo()

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 1561 of file cuddAPI.c.

1563 {
1564  return(dd->looseUpTo);
1565 
1566 } /* end of Cudd_ReadLooseUpTo */
unsigned int looseUpTo
Definition: cuddInt.h:361

◆ Cudd_ReadMaxCache()

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.]

SideEffects [None]

SeeAlso [Cudd_ReadMaxCacheHard]

Definition at line 1611 of file cuddAPI.c.

1613 {
1614  return(2 * dd->cacheSlots + dd->cacheSlack);
1615 
1616 } /* end of Cudd_ReadMaxCache */
unsigned int cacheSlots
Definition: cuddInt.h:337
int cacheSlack
Definition: cuddInt.h:342

◆ Cudd_ReadMaxCacheHard()

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 1631 of file cuddAPI.c.

1633 {
1634  return(dd->maxCacheHard);
1635 
1636 } /* end of Cudd_ReadMaxCache */
unsigned int maxCacheHard
Definition: cuddInt.h:343

◆ Cudd_ReadMaxGrowth()

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 2270 of file cuddAPI.c.

2272 {
2273  return(dd->maxGrowth);
2274 
2275 } /* end of Cudd_ReadMaxGrowth */
double maxGrowth
Definition: cuddInt.h:397

◆ Cudd_ReadMaxGrowthAlternate()

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 2321 of file cuddAPI.c.

2323 {
2324  return(dd->maxGrowthAlt);
2325 
2326 } /* end of Cudd_ReadMaxGrowthAlternate */
double maxGrowthAlt
Definition: cuddInt.h:398

◆ Cudd_ReadMaxLive()

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 4265 of file cuddAPI.c.

4267 {
4268  return(dd->maxLive);
4269 
4270 } /* end of Cudd_ReadMaxLive */
unsigned int maxLive
Definition: cuddInt.h:357

◆ Cudd_ReadMaxMemory()

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 4308 of file cuddAPI.c.

4310 {
4311  return(dd->maxmemhard);
4312 
4313 } /* end of Cudd_ReadMaxMemory */
unsigned long maxmemhard
Definition: cuddInt.h:431

◆ Cudd_ReadMaxReorderings()

unsigned int Cudd_ReadMaxReorderings ( DdManager dd)

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

Synopsis [Returns the maximum number of times reordering may be invoked.]

Description [Returns the maximum number of times reordering may be invoked in this manager.]

SideEffects [None]

SeeAlso [Cudd_ReadReorderings Cudd_SetMaxReorderings Cudd_ReduceHeap]

Definition at line 1957 of file cuddAPI.c.

1959 {
1960  return(dd->maxReorderings);
1961 
1962 } /* end of Cudd_ReadMaxReorderings */
unsigned int maxReorderings
Definition: cuddInt.h:394

◆ Cudd_ReadMemoryInUse()

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 3242 of file cuddAPI.c.

3244 {
3245  return(dd->memused);
3246 
3247 } /* end of Cudd_ReadMemoryInUse */
unsigned long memused
Definition: cuddInt.h:429

◆ Cudd_ReadMinDead()

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 1910 of file cuddAPI.c.

1912 {
1913  return(dd->minDead);
1914 
1915 } /* end of Cudd_ReadMinDead */
unsigned int minDead
Definition: cuddInt.h:358

◆ Cudd_ReadMinHit()

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 1512 of file cuddAPI.c.

1514 {
1515  /* Internally, the package manipulates the ratio of hits to
1516  ** misses instead of the ratio of hits to accesses. */
1517  return((unsigned int) (0.5 + 100 * dd->minHit / (1 + dd->minHit)));
1518 
1519 } /* end of Cudd_ReadMinHit */
double minHit
Definition: cuddInt.h:341

◆ Cudd_ReadMinusInfinity()

DdNode* Cudd_ReadMinusInfinity ( DdManager dd)

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

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

Description []

SideEffects [None]

Definition at line 1334 of file cuddAPI.c.

1336 {
1337  return(dd->minusinfinity);
1338 
1339 } /* end of Cudd_ReadMinusInfinity */
DdNode * minusinfinity
Definition: cuddInt.h:332

◆ Cudd_ReadNextReordering()

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 4195 of file cuddAPI.c.

4197 {
4198  return(dd->nextDyn);
4199 
4200 } /* end of Cudd_ReadNextReordering */
unsigned int nextDyn
Definition: cuddInt.h:406

◆ Cudd_ReadNodeCount()

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 3504 of file cuddAPI.c.

3506 {
3507  long count;
3508  int i;
3509 
3510 #ifndef DD_NO_DEATH_ROW
3511  cuddClearDeathRow(dd);
3512 #endif
3513 
3514  count = (long) (dd->keys - dd->dead);
3515 
3516  /* Count isolated projection functions. Their number is subtracted
3517  ** from the node count because they are not part of the BDDs.
3518  */
3519  for (i=0; i < dd->size; i++) {
3520  if (dd->vars[i]->ref == 1) count--;
3521  }
3522  /* Subtract from the count the unused constants. */
3523  if (DD_ZERO(dd)->ref == 1) count--;
3524  if (DD_PLUS_INFINITY(dd)->ref == 1) count--;
3525  if (DD_MINUS_INFINITY(dd)->ref == 1) count--;
3526 
3527  return(count);
3528 
3529 } /* end of Cudd_ReadNodeCount */
DdHalfWord ref
Definition: cudd.h:272
int size
Definition: cuddInt.h:345
#define DD_MINUS_INFINITY(dd)
Definition: cuddInt.h:908
unsigned int dead
Definition: cuddInt.h:355
unsigned int keys
Definition: cuddInt.h:353
void cuddClearDeathRow(DdManager *table)
Definition: cuddRef.c:722
DdNode ** vars
Definition: cuddInt.h:373
#define DD_PLUS_INFINITY(dd)
Definition: cuddInt.h:894
#define DD_ZERO(dd)
Definition: cuddInt.h:880

◆ Cudd_ReadNodesDropped()

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 2092 of file cuddAPI.c.

2094 {
2095 #ifdef DD_STATS
2096  return(dd->nodesDropped);
2097 #else
2098  return(-1.0);
2099 #endif
2100 
2101 } /* end of Cudd_ReadNodesDropped */

◆ Cudd_ReadNodesFreed()

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 2066 of file cuddAPI.c.

2068 {
2069 #ifdef DD_STATS
2070  return(dd->nodesFreed);
2071 #else
2072  return(-1.0);
2073 #endif
2074 
2075 } /* end of Cudd_ReadNodesFreed */

◆ Cudd_ReadNumberXovers()

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 3152 of file cuddAPI.c.

3154 {
3155  return(dd->numberXovers);
3156 
3157 } /* end of Cudd_ReadNumberXovers */
int numberXovers
Definition: cuddInt.h:415

◆ Cudd_ReadOne()

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 1227 of file cuddAPI.c.

1229 {
1230  return(dd->one);
1231 
1232 } /* end of Cudd_ReadOne */
DdNode * one
Definition: cuddInt.h:329

◆ Cudd_ReadOrderRandomization()

unsigned int Cudd_ReadOrderRandomization ( DdManager dd)

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

Synopsis [Returns the order randomization factor.]

Description [Returns the order randomization factor. If non-zero this factor is used to determine a perturbation of the next reordering threshold. Larger factors cause larger perturbations.]

SideEffects [None]

SeeAlso [Cudd_SetOrderRandomization]

Definition at line 3201 of file cuddAPI.c.

3203 {
3204  return(dd->randomizeOrder);
3205 
3206 } /* end of Cudd_ReadOrderRandomization */
unsigned int randomizeOrder
Definition: cuddInt.h:416

◆ Cudd_ReadPeakLiveNodeCount()

int Cudd_ReadPeakLiveNodeCount ( DdManager dd)

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

Synopsis [Reports the peak number of live nodes.]

Description [Reports the peak number of live nodes.]

SideEffects [None]

SeeAlso [Cudd_ReadNodeCount Cudd_PrintInfo Cudd_ReadPeakNodeCount]

Definition at line 3476 of file cuddAPI.c.

3478 {
3479  unsigned int live = dd->keys - dd->dead;
3480 
3481  if (live > dd->peakLiveNodes) {
3482  dd->peakLiveNodes = live;
3483  }
3484  return((int)dd->peakLiveNodes);
3485 
3486 } /* end of Cudd_ReadPeakLiveNodeCount */
unsigned int peakLiveNodes
Definition: cuddInt.h:445
unsigned int dead
Definition: cuddInt.h:355
unsigned int keys
Definition: cuddInt.h:353

◆ Cudd_ReadPeakNodeCount()

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 3449 of file cuddAPI.c.

3451 {
3452  long count = 0;
3453  DdNodePtr *scan = dd->memoryList;
3454 
3455  while (scan != NULL) {
3456  count += DD_MEM_CHUNK;
3457  scan = (DdNodePtr *) *scan;
3458  }
3459  return(count);
3460 
3461 } /* end of Cudd_ReadPeakNodeCount */
Definition: cudd.h:270
DdNode ** memoryList
Definition: cuddInt.h:380
#define DD_MEM_CHUNK
Definition: cuddInt.h:105

◆ Cudd_ReadPerm()

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 2583 of file cuddAPI.c.

2586 {
2587  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2588  if (i < 0 || i >= dd->size) return(-1);
2589  return(dd->perm[i]);
2590 
2591 } /* end of Cudd_ReadPerm */
int size
Definition: cuddInt.h:345
#define CUDD_CONST_INDEX
Definition: cudd.h:113
int * perm
Definition: cuddInt.h:369

◆ Cudd_ReadPermZdd()

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 2610 of file cuddAPI.c.

2613 {
2614  if (i == CUDD_CONST_INDEX) return(CUDD_CONST_INDEX);
2615  if (i < 0 || i >= dd->sizeZ) return(-1);
2616  return(dd->permZ[i]);
2617 
2618 } /* end of Cudd_ReadPermZdd */
int * permZ
Definition: cuddInt.h:370
#define CUDD_CONST_INDEX
Definition: cudd.h:113
int sizeZ
Definition: cuddInt.h:346

◆ Cudd_ReadPlusInfinity()

DdNode* Cudd_ReadPlusInfinity ( DdManager dd)

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

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

Description []

SideEffects [None]

Definition at line 1316 of file cuddAPI.c.

1318 {
1319  return(dd->plusinfinity);
1320 
1321 } /* end of Cudd_ReadPlusInfinity */
DdNode * plusinfinity
Definition: cuddInt.h:331

◆ Cudd_ReadPopulationSize()

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 3099 of file cuddAPI.c.

3101 {
3102  return(dd->populationSize);
3103 
3104 } /* end of Cudd_ReadPopulationSize */
int populationSize
Definition: cuddInt.h:414

◆ Cudd_ReadRecomb()

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 2939 of file cuddAPI.c.

2941 {
2942  return(dd->recomb);
2943 
2944 } /* end of Cudd_ReadRecomb */
int recomb
Definition: cuddInt.h:411

◆ Cudd_ReadRecursiveCalls()

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 1486 of file cuddAPI.c.

1488 {
1489 #ifdef DD_COUNT
1490  return(dd->recursiveCalls);
1491 #else
1492  return(-1.0);
1493 #endif
1494 
1495 } /* end of Cudd_ReadRecursiveCalls */

◆ Cudd_ReadReorderingCycle()

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 2370 of file cuddAPI.c.

2372 {
2373  return(dd->reordCycle);
2374 
2375 } /* end of Cudd_ReadReorderingCycle */
int reordCycle
Definition: cuddInt.h:399

◆ Cudd_ReadReorderings()

unsigned 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 1936 of file cuddAPI.c.

1938 {
1939  return(dd->reorderings);
1940 
1941 } /* end of Cudd_ReadReorderings */
unsigned int reorderings
Definition: cuddInt.h:393

◆ Cudd_ReadReorderingTime()

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 2000 of file cuddAPI.c.

2002 {
2003  return(dd->reordTime);
2004 
2005 } /* end of Cudd_ReadReorderingTime */
unsigned long reordTime
Definition: cuddInt.h:434

◆ Cudd_ReadSiftMaxSwap()

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 2220 of file cuddAPI.c.

2222 {
2223  return(dd->siftMaxSwap);
2224 
2225 } /* end of Cudd_ReadSiftMaxSwap */
int siftMaxSwap
Definition: cuddInt.h:396

◆ Cudd_ReadSiftMaxVar()

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 2173 of file cuddAPI.c.

2175 {
2176  return(dd->siftMaxVar);
2177 
2178 } /* end of Cudd_ReadSiftMaxVar */
int siftMaxVar
Definition: cuddInt.h:395

◆ Cudd_ReadSize()

int Cudd_ReadSize ( DdManager dd)

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

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

Description []

SideEffects [None]

SeeAlso [Cudd_ReadZddSize]

Definition at line 1681 of file cuddAPI.c.

1683 {
1684  return(dd->size);
1685 
1686 } /* end of Cudd_ReadSize */
int size
Definition: cuddInt.h:345

◆ Cudd_ReadSlots()

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 1720 of file cuddAPI.c.

1722 {
1723  return(dd->slots);
1724 
1725 } /* end of Cudd_ReadSlots */
unsigned int slots
Definition: cuddInt.h:352

◆ Cudd_ReadStartTime()

unsigned long Cudd_ReadStartTime ( DdManager unique)

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

Synopsis [Returns the start time of the manager.]

Description [Returns the start time of the manager. This is initially set to the number of milliseconds since the program started, but may be reset by the application.]

SideEffects [None]

SeeAlso [Cudd_SetStartTime Cudd_ResetStartTime Cudd_ReadTimeLimit]

Definition at line 681 of file cuddAPI.c.

683 {
684  return unique->startTime;
685 
686 } /* end of Cudd_ReadStartTime */
unsigned long startTime
Definition: cuddInt.h:426

◆ Cudd_ReadStderr()

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 4150 of file cuddAPI.c.

4152 {
4153  return(dd->err);
4154 
4155 } /* end of Cudd_ReadStderr */
FILE * err
Definition: cuddInt.h:424

◆ Cudd_ReadStdout()

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 4107 of file cuddAPI.c.

4109 {
4110  return(dd->out);
4111 
4112 } /* end of Cudd_ReadStdout */
FILE * out
Definition: cuddInt.h:423

◆ Cudd_ReadSwapSteps()

double Cudd_ReadSwapSteps ( DdManager dd)

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

Synopsis [Reads the number of elementary reordering steps.]

Description []

SideEffects [none]

SeeAlso []

Definition at line 4240 of file cuddAPI.c.

4242 {
4243 #ifdef DD_COUNT
4244  return(dd->swapSteps);
4245 #else
4246  return(-1);
4247 #endif
4248 
4249 } /* end of Cudd_ReadSwapSteps */

◆ Cudd_ReadSymmviolation()

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 2992 of file cuddAPI.c.

2994 {
2995  return(dd->symmviolation);
2996 
2997 } /* end of Cudd_ReadSymmviolation */
int symmviolation
Definition: cuddInt.h:412

◆ Cudd_ReadTimeLimit()

unsigned long Cudd_ReadTimeLimit ( DdManager unique)

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

Synopsis [Returns the time limit for the manager.]

Description [Returns the time limit for the manager. This is initially set to a very large number, but may be reset by the application.]

SideEffects [None]

SeeAlso [Cudd_SetTimeLimit Cudd_UpdateTimeLimit Cudd_UnsetTimeLimit Cudd_IncreaseTimeLimit Cudd_TimeLimited Cudd_ReadStartTime]

Definition at line 765 of file cuddAPI.c.

767 {
768  return unique->timeLimit;
769 
770 } /* end of Cudd_ReadTimeLimit */
unsigned long timeLimit
Definition: cuddInt.h:427

◆ Cudd_ReadTree()

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 2414 of file cuddAPI.c.

2416 {
2417  return(dd->tree);
2418 
2419 } /* end of Cudd_ReadTree */
MtrNode * tree
Definition: cuddInt.h:408

◆ Cudd_ReadUniqueLinks()

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 2147 of file cuddAPI.c.

2149 {
2150 #ifdef DD_UNIQUE_PROFILE
2151  return(dd->uniqueLinks);
2152 #else
2153  return(-1.0);
2154 #endif
2155 
2156 } /* end of Cudd_ReadUniqueLinks */

◆ Cudd_ReadUniqueLookUps()

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 2118 of file cuddAPI.c.

2120 {
2121 #ifdef DD_UNIQUE_PROFILE
2122  return(dd->uniqueLookUps);
2123 #else
2124  return(-1.0);
2125 #endif
2126 
2127 } /* end of Cudd_ReadUniqueLookUps */

◆ Cudd_ReadUsedSlots()

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 1743 of file cuddAPI.c.

1745 {
1746  unsigned long used = 0;
1747  int i, j;
1748  int size = dd->size;
1749  DdNodePtr *nodelist;
1750  DdSubtable *subtable;
1751  DdNode *node;
1752  DdNode *sentinel = &(dd->sentinel);
1753 
1754  /* Scan each BDD/ADD subtable. */
1755  for (i = 0; i < size; i++) {
1756  subtable = &(dd->subtables[i]);
1757  nodelist = subtable->nodelist;
1758  for (j = 0; (unsigned) j < subtable->slots; j++) {
1759  node = nodelist[j];
1760  if (node != sentinel) {
1761  used++;
1762  }
1763  }
1764  }
1765 
1766  /* Scan the ZDD subtables. */
1767  size = dd->sizeZ;
1768 
1769  for (i = 0; i < size; i++) {
1770  subtable = &(dd->subtableZ[i]);
1771  nodelist = subtable->nodelist;
1772  for (j = 0; (unsigned) j < subtable->slots; j++) {
1773  node = nodelist[j];
1774  if (node != NULL) {
1775  used++;
1776  }
1777  }
1778  }
1779 
1780  /* Constant table. */
1781  subtable = &(dd->constants);
1782  nodelist = subtable->nodelist;
1783  for (j = 0; (unsigned) j < subtable->slots; j++) {
1784  node = nodelist[j];
1785  if (node != NULL) {
1786  used++;
1787  }
1788  }
1789 
1790  return((double)used / (double) dd->slots);
1791 
1792 } /* end of Cudd_ReadUsedSlots */
Definition: cudd.h:270
int size
Definition: cuddInt.h:345
unsigned int slots
Definition: cuddInt.h:352
DdSubtable * subtables
Definition: cuddInt.h:349
DdNode sentinel
Definition: cuddInt.h:328
DdNode ** nodelist
Definition: cuddInt.h:311
int sizeZ
Definition: cuddInt.h:346
DdSubtable constants
Definition: cuddInt.h:351
DdSubtable * subtableZ
Definition: cuddInt.h:350

◆ Cudd_ReadVars()

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 2689 of file cuddAPI.c.

2692 {
2693  if (i < 0 || i > dd->size) return(NULL);
2694  return(dd->vars[i]);
2695 
2696 } /* end of Cudd_ReadVars */
int size
Definition: cuddInt.h:345
DdNode ** vars
Definition: cuddInt.h:373

◆ Cudd_ReadZddOne()

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 1250 of file cuddAPI.c.

1253 {
1254  if (i < 0)
1255  return(NULL);
1256  return(i < dd->sizeZ ? dd->univ[i] : DD_ONE(dd));
1257 
1258 } /* end of Cudd_ReadZddOne */
#define DD_ONE(dd)
Definition: cuddInt.h:864
DdNode ** univ
Definition: cuddInt.h:375

◆ Cudd_ReadZddSize()

int Cudd_ReadZddSize ( DdManager dd)

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

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

Description []

SideEffects [None]

SeeAlso [Cudd_ReadSize]

Definition at line 1701 of file cuddAPI.c.

1703 {
1704  return(dd->sizeZ);
1705 
1706 } /* end of Cudd_ReadZddSize */
int sizeZ
Definition: cuddInt.h:346

◆ Cudd_ReadZddTree()

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 2486 of file cuddAPI.c.

2488 {
2489  return(dd->treeZ);
2490 
2491 } /* end of Cudd_ReadZddTree */
MtrNode * treeZ
Definition: cuddInt.h:409

◆ Cudd_ReadZero()

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 1276 of file cuddAPI.c.

1278 {
1279  return(DD_ZERO(dd));
1280 
1281 } /* end of Cudd_ReadZero */
#define DD_ZERO(dd)
Definition: cuddInt.h:880

◆ Cudd_RemoveHook()

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 3631 of file cuddAPI.c.

3635 {
3636  DdHook **hook, *nextHook;
3637 
3638  switch (where) {
3639  case CUDD_PRE_GC_HOOK:
3640  hook = &(dd->preGCHook);
3641  break;
3642  case CUDD_POST_GC_HOOK:
3643  hook = &(dd->postGCHook);
3644  break;
3646  hook = &(dd->preReorderingHook);
3647  break;
3649  hook = &(dd->postReorderingHook);
3650  break;
3651  default:
3652  return(0);
3653  }
3654  nextHook = *hook;
3655  while (nextHook != NULL) {
3656  if (nextHook->f == f) {
3657  *hook = nextHook->next;
3658  FREE(nextHook);
3659  return(1);
3660  }
3661  hook = &(nextHook->next);
3662  nextHook = nextHook->next;
3663  }
3664 
3665  return(0);
3666 
3667 } /* end of Cudd_RemoveHook */
#define FREE(obj)
Definition: util.h:80
DdHook * preReorderingHook
Definition: cuddInt.h:421
DD_HFP f
Definition: cuddInt.h:241
DdHook * postReorderingHook
Definition: cuddInt.h:422
struct DdHook * next
Definition: cuddInt.h:242
DdHook * postGCHook
Definition: cuddInt.h:420
DdHook * preGCHook
Definition: cuddInt.h:419

◆ Cudd_ReorderingReporting()

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 3916 of file cuddAPI.c.

3918 {
3920 
3921 } /* end of Cudd_ReorderingReporting */
int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data)
Definition: cuddAPI.c:3733
int Cudd_IsInHook(DdManager *dd, DD_HFP f, Cudd_HookType where)
Definition: cuddAPI.c:3684

◆ Cudd_ReorderingStatus()

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 975 of file cuddAPI.c.

978 {
979  *method = unique->autoMethod;
980  return(unique->autoDyn);
981 
982 } /* end of Cudd_ReorderingStatus */
Cudd_ReorderingType autoMethod
Definition: cuddInt.h:402
int autoDyn
Definition: cuddInt.h:400

◆ Cudd_ReorderingStatusZdd()

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 1052 of file cuddAPI.c.

1055 {
1056  *method = unique->autoMethodZ;
1057  return(unique->autoDynZ);
1058 
1059 } /* end of Cudd_ReorderingStatusZdd */
Cudd_ReorderingType autoMethodZ
Definition: cuddInt.h:403
int autoDynZ
Definition: cuddInt.h:401

◆ Cudd_ResetStartTime()

void Cudd_ResetStartTime ( DdManager unique)

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

Synopsis [Resets the start time of the manager.]

Description [Resets the start time of the manager.]

SideEffects [None]

SeeAlso [Cudd_ReadStartTime Cudd_SetStartTime Cudd_SetTimeLimit]

Definition at line 743 of file cuddAPI.c.

745 {
746  unique->startTime = util_cpu_time();
747 
748 } /* end of Cudd_ResetStartTime */
unsigned long startTime
Definition: cuddInt.h:426
long util_cpu_time(void)
Definition: cpu_time.c:34

◆ Cudd_SetArcviolation()

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 3072 of file cuddAPI.c.

3075 {
3076  dd->arcviolation = arcviolation;
3077 
3078 } /* end of Cudd_SetArcviolation */
int arcviolation
Definition: cuddInt.h:413

◆ Cudd_SetBackground()

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 1371 of file cuddAPI.c.

1374 {
1375  dd->background = bck;
1376 
1377 } /* end of Cudd_SetBackground */
DdNode * background
Definition: cuddInt.h:333

◆ Cudd_SetEpsilon()

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 2733 of file cuddAPI.c.

2736 {
2737  dd->epsilon = ep;
2738 
2739 } /* end of Cudd_SetEpsilon */
CUDD_VALUE_TYPE epsilon
Definition: cuddInt.h:390

◆ Cudd_SetGroupcheck()

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 2778 of file cuddAPI.c.

2781 {
2782  dd->groupcheck = gc;
2783 
2784 } /* end of Cudd_SetGroupcheck */
Cudd_AggregationType groupcheck
Definition: cuddInt.h:410

◆ Cudd_SetLooseUpTo()

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 1585 of file cuddAPI.c.

1588 {
1589  if (lut == 0) {
1590  unsigned long datalimit = getSoftDataLimit();
1591  lut = (unsigned int) (datalimit / (sizeof(DdNode) *
1593  }
1594  dd->looseUpTo = lut;
1595 
1596 } /* end of Cudd_SetLooseUpTo */
Definition: cudd.h:270
#define DD_MAX_LOOSE_FRACTION
Definition: cuddInt.h:139
unsigned long getSoftDataLimit(void)
Definition: datalimit.c:35
unsigned int looseUpTo
Definition: cuddInt.h:361

◆ Cudd_SetMaxCacheHard()

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 1655 of file cuddAPI.c.

1658 {
1659  if (mc == 0) {
1660  unsigned long datalimit = getSoftDataLimit();
1661  mc = (unsigned int) (datalimit / (sizeof(DdCache) *
1663  }
1664  dd->maxCacheHard = mc;
1665 
1666 } /* end of Cudd_SetMaxCacheHard */
#define DD_MAX_CACHE_FRACTION
Definition: cuddInt.h:141
unsigned int maxCacheHard
Definition: cuddInt.h:343
unsigned long getSoftDataLimit(void)
Definition: datalimit.c:35

◆ Cudd_SetMaxGrowth()

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 2295 of file cuddAPI.c.

2298 {
2299  dd->maxGrowth = mg;
2300 
2301 } /* end of Cudd_SetMaxGrowth */
double maxGrowth
Definition: cuddInt.h:397

◆ Cudd_SetMaxGrowthAlternate()

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 2346 of file cuddAPI.c.

2349 {
2350  dd->maxGrowthAlt = mg;
2351 
2352 } /* end of Cudd_SetMaxGrowthAlternate */
double maxGrowthAlt
Definition: cuddInt.h:398

◆ Cudd_SetMaxLive()

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 4286 of file cuddAPI.c.

4289 {
4290  dd->maxLive = maxLive;
4291 
4292 } /* end of Cudd_SetMaxLive */
unsigned int maxLive
Definition: cuddInt.h:357

◆ Cudd_SetMaxMemory()

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 4329 of file cuddAPI.c.

4332 {
4333  dd->maxmemhard = maxMemory;
4334 
4335 } /* end of Cudd_SetMaxMemory */
unsigned long maxmemhard
Definition: cuddInt.h:431

◆ Cudd_SetMaxReorderings()

void Cudd_SetMaxReorderings ( DdManager dd,
unsigned int  mr 
)

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

Synopsis [Sets the maximum number of times reordering may be invoked.]

Description [Sets the maximum number of times reordering may be invoked in this manager. The default value is (practically) infinite.]

SideEffects [None]

SeeAlso [Cudd_ReadReorderings Cudd_ReadMaxReorderings Cudd_ReduceHeap]

Definition at line 1978 of file cuddAPI.c.

1980 {
1981  dd->maxReorderings = mr;
1982 
1983 } /* end of Cudd_SetMaxReorderings */
unsigned int maxReorderings
Definition: cuddInt.h:394

◆ Cudd_SetMinHit()

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 1538 of file cuddAPI.c.

1541 {
1542  /* Internally, the package manipulates the ratio of hits to
1543  ** misses instead of the ratio of hits to accesses. */
1544  dd->minHit = (double) hr / (100.0 - (double) hr);
1545 
1546 } /* end of Cudd_SetMinHit */
double minHit
Definition: cuddInt.h:341

◆ Cudd_SetNextReordering()

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 4219 of file cuddAPI.c.

4222 {
4223  dd->nextDyn = next;
4224 
4225 } /* end of Cudd_SetNextReordering */
unsigned int nextDyn
Definition: cuddInt.h:406

◆ Cudd_SetNumberXovers()

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 3178 of file cuddAPI.c.

3181 {
3182  dd->numberXovers = numberXovers;
3183 
3184 } /* end of Cudd_SetNumberXovers */
int numberXovers
Definition: cuddInt.h:415

◆ Cudd_SetOrderRandomization()

void Cudd_SetOrderRandomization ( DdManager dd,
unsigned int  factor 
)

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

Synopsis [Sets the order randomization factor.]

Description []

SideEffects [None]

SeeAlso [Cudd_ReadOrderRandomization]

Definition at line 3221 of file cuddAPI.c.

3224 {
3225  dd->randomizeOrder = factor;
3226 
3227 } /* end of Cudd_SetOrderRandomization */
unsigned int randomizeOrder
Definition: cuddInt.h:416

◆ Cudd_SetPopulationSize()

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 3125 of file cuddAPI.c.

3128 {
3129  dd->populationSize = populationSize;
3130 
3131 } /* end of Cudd_SetPopulationSize */
int populationSize
Definition: cuddInt.h:414

◆ Cudd_SetRecomb()

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 2964 of file cuddAPI.c.

2967 {
2968  dd->recomb = recomb;
2969 
2970 } /* end of Cudd_SetRecomb */
int recomb
Definition: cuddInt.h:411

◆ Cudd_SetReorderingCycle()

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 2393 of file cuddAPI.c.

2396 {
2397  dd->reordCycle = cycle;
2398 
2399 } /* end of Cudd_SetReorderingCycle */
int reordCycle
Definition: cuddInt.h:399

◆ Cudd_SetSiftMaxSwap()

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 2244 of file cuddAPI.c.

2247 {
2248  dd->siftMaxSwap = sms;
2249 
2250 } /* end of Cudd_SetSiftMaxSwap */
int siftMaxSwap
Definition: cuddInt.h:396

◆ Cudd_SetSiftMaxVar()

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 2195 of file cuddAPI.c.

2198 {
2199  dd->siftMaxVar = smv;
2200 
2201 } /* end of Cudd_SetSiftMaxVar */
int siftMaxVar
Definition: cuddInt.h:395

◆ Cudd_SetStartTime()

void Cudd_SetStartTime ( DdManager unique,
unsigned long  st 
)

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

Synopsis [Sets the start time of the manager.]

Description [Sets the start time of the manager.]

SideEffects [None]

SeeAlso [Cudd_ReadStartTime Cudd_ResetStartTime Cudd_ReadElapsedTime Cudd_SetTimeLimit]

Definition at line 722 of file cuddAPI.c.

725 {
726  unique->startTime = st;
727 
728 } /* end of Cudd_SetStartTime */
unsigned long startTime
Definition: cuddInt.h:426

◆ Cudd_SetStderr()

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 4170 of file cuddAPI.c.

4173 {
4174  dd->err = fp;
4175 
4176 } /* end of Cudd_SetStderr */
FILE * err
Definition: cuddInt.h:424

◆ Cudd_SetStdout()

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 4127 of file cuddAPI.c.

4130 {
4131  dd->out = fp;
4132 
4133 } /* end of Cudd_SetStdout */
FILE * out
Definition: cuddInt.h:423

◆ Cudd_SetSymmviolation()

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 3019 of file cuddAPI.c.

3022 {
3023  dd->symmviolation = symmviolation;
3024 
3025 } /* end of Cudd_SetSymmviolation */
int symmviolation
Definition: cuddInt.h:412

◆ Cudd_SetTimeLimit()

void Cudd_SetTimeLimit ( DdManager unique,
unsigned long  tl 
)

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

Synopsis [Sets the time limit for the manager.]

Description [Sets the time limit for the manager.]

SideEffects [None]

SeeAlso [Cudd_ReadTimeLimit Cudd_UnsetTimeLimit Cudd_UpdateTimeLimit Cudd_IncreaseTimeLimit Cudd_TimeLimited Cudd_SetStartTime]

Definition at line 786 of file cuddAPI.c.

789 {
790  unique->timeLimit = tl;
791 
792 } /* end of Cudd_SetTimeLimit */
unsigned long timeLimit
Definition: cuddInt.h:427

◆ Cudd_SetTree()

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 2434 of file cuddAPI.c.

2437 {
2438  if (dd->tree != NULL) {
2439  Mtr_FreeTree(dd->tree);
2440  }
2441  dd->tree = tree;
2442  if (tree == NULL) return;
2443 
2444  fixVarTree(tree, dd->perm, dd->size);
2445  return;
2446 
2447 } /* end of Cudd_SetTree */
int size
Definition: cuddInt.h:345
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:187
MtrNode * tree
Definition: cuddInt.h:408
static void fixVarTree(MtrNode *treenode, int *perm, int size)
Definition: cuddAPI.c:4812
int * perm
Definition: cuddInt.h:369

◆ Cudd_SetZddTree()

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 2506 of file cuddAPI.c.

2509 {
2510  if (dd->treeZ != NULL) {
2511  Mtr_FreeTree(dd->treeZ);
2512  }
2513  dd->treeZ = tree;
2514  if (tree == NULL) return;
2515 
2516  fixVarTree(tree, dd->permZ, dd->sizeZ);
2517  return;
2518 
2519 } /* end of Cudd_SetZddTree */
void Mtr_FreeTree(MtrNode *node)
Definition: mtrBasic.c:187
int * permZ
Definition: cuddInt.h:370
int sizeZ
Definition: cuddInt.h:346
MtrNode * treeZ
Definition: cuddInt.h:409
static void fixVarTree(MtrNode *treenode, int *perm, int size)
Definition: cuddAPI.c:4812

◆ Cudd_StdPostReordHook()

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 3826 of file cuddAPI.c.

3830 {
3831  unsigned long initialTime = (long) data;
3832  int retval;
3833  unsigned long finalTime = util_cpu_time();
3834  double totalTimeSec = (double)(finalTime - initialTime) / 1000.0;
3835 
3836  retval = fprintf(dd->out,"%ld nodes in %g sec\n", strcmp(str, "BDD") == 0 ?
3838  totalTimeSec);
3839  if (retval == EOF) return(0);
3840  retval = fflush(dd->out);
3841  if (retval == EOF) return(0);
3842  return(1);
3843 
3844 } /* end of Cudd_StdPostReordHook */
long Cudd_ReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3504
int strcmp()
FILE * out
Definition: cuddInt.h:423
long Cudd_zddReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3546
long util_cpu_time(void)
Definition: cpu_time.c:34

◆ Cudd_StdPreReordHook()

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 3733 of file cuddAPI.c.

3737 {
3739  int retval;
3740 
3741  retval = fprintf(dd->out,"%s reordering with ", str);
3742  if (retval == EOF) return(0);
3743  switch (method) {
3751  retval = fprintf(dd->out,"converging ");
3752  if (retval == EOF) return(0);
3753  break;
3754  default:
3755  break;
3756  }
3757  switch (method) {
3758  case CUDD_REORDER_RANDOM:
3760  retval = fprintf(dd->out,"random");
3761  break;
3762  case CUDD_REORDER_SIFT:
3764  retval = fprintf(dd->out,"sifting");
3765  break;
3768  retval = fprintf(dd->out,"symmetric sifting");
3769  break;
3771  retval = fprintf(dd->out,"lazy sifting");
3772  break;
3775  retval = fprintf(dd->out,"group sifting");
3776  break;
3777  case CUDD_REORDER_WINDOW2:
3778  case CUDD_REORDER_WINDOW3:
3779  case CUDD_REORDER_WINDOW4:
3783  retval = fprintf(dd->out,"window");
3784  break;
3786  retval = fprintf(dd->out,"annealing");
3787  break;
3788  case CUDD_REORDER_GENETIC:
3789  retval = fprintf(dd->out,"genetic");
3790  break;
3791  case CUDD_REORDER_LINEAR:
3793  retval = fprintf(dd->out,"linear sifting");
3794  break;
3795  case CUDD_REORDER_EXACT:
3796  retval = fprintf(dd->out,"exact");
3797  break;
3798  default:
3799  return(0);
3800  }
3801  if (retval == EOF) return(0);
3802 
3803  retval = fprintf(dd->out,": from %ld to ... ", strcmp(str, "BDD") == 0 ?
3805  if (retval == EOF) return(0);
3806  fflush(dd->out);
3807  return(1);
3808 
3809 } /* end of Cudd_StdPreReordHook */
long Cudd_ReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3504
int strcmp()
FILE * out
Definition: cuddInt.h:423
long Cudd_zddReadNodeCount(DdManager *dd)
Definition: cuddAPI.c:3546
unsigned int ptruint
Definition: cuddInt.h:250
Cudd_ReorderingType
Definition: cudd.h:147

◆ Cudd_TimeLimited()

int Cudd_TimeLimited ( DdManager unique)

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

Synopsis [Returns true if the time limit for the manager is set.]

Description [Returns true if the time limit for the manager is set.]

SideEffects [None]

SeeAlso [Cudd_ReadTimeLimit Cudd_SetTimeLimit Cudd_UpdateTimeLimit Cudd_UnsetTimeLimit Cudd_IncreaseTimeLimit]

Definition at line 885 of file cuddAPI.c.

887 {
888  return unique->timeLimit != ~0UL;
889 
890 } /* end of Cudd_TimeLimited */
unsigned long timeLimit
Definition: cuddInt.h:427

◆ Cudd_TurnOffCountDead()

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 2915 of file cuddAPI.c.

2917 {
2918  dd->countDead = ~0;
2919 
2920 } /* end of Cudd_TurnOffCountDead */
unsigned int countDead
Definition: cuddInt.h:407

◆ Cudd_TurnOnCountDead()

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 2890 of file cuddAPI.c.

2892 {
2893  dd->countDead = 0;
2894 
2895 } /* end of Cudd_TurnOnCountDead */
unsigned int countDead
Definition: cuddInt.h:407

◆ Cudd_UnsetTimeLimit()

void Cudd_UnsetTimeLimit ( DdManager unique)

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

Synopsis [Unsets the time limit for the manager.]

Description [Unsets the time limit for the manager. Actually, sets it to a very large value.]

SideEffects [None]

SeeAlso [Cudd_ReadTimeLimit Cudd_SetTimeLimit Cudd_UpdateTimeLimit Cudd_IncreaseTimeLimit Cudd_TimeLimited Cudd_SetStartTime]

Definition at line 864 of file cuddAPI.c.

866 {
867  unique->timeLimit = ~0UL;
868 
869 } /* end of Cudd_UnsetTimeLimit */
unsigned long timeLimit
Definition: cuddInt.h:427

◆ Cudd_UpdateTimeLimit()

void Cudd_UpdateTimeLimit ( DdManager unique)

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

Synopsis [Updates the time limit for the manager.]

Description [Updates the time limit for the manager by subtracting the elapsed time from it.]

SideEffects [None]

SeeAlso [Cudd_ReadTimeLimit Cudd_SetTimeLimit Cudd_UnsetTimeLimit Cudd_IncreaseTimeLimit Cudd_TimeLimited Cudd_SetStartTime]

Definition at line 809 of file cuddAPI.c.

811 {
812  unsigned long elapsed;
813  if (unique->timeLimit == ~0UL)
814  return;
815  elapsed = util_cpu_time() - unique->startTime;
816  if (unique->timeLimit >= elapsed) {
817  unique->timeLimit -= elapsed;
818  } else {
819  unique->timeLimit = 0;
820  }
821 
822 } /* end of Cudd_UpdateTimeLimit */
unsigned long startTime
Definition: cuddInt.h:426
long util_cpu_time(void)
Definition: cpu_time.c:34
unsigned long timeLimit
Definition: cuddInt.h:427

◆ Cudd_zddIthVar()

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 462 of file cuddAPI.c.

465 {
466  DdNode *res;
467  DdNode *zvar;
468  DdNode *lower;
469  int j;
470 
471  if ((unsigned int) i >= CUDD_MAXINDEX - 1) return(NULL);
472 
473  /* The i-th variable function has the following structure:
474  ** at the level corresponding to index i there is a node whose "then"
475  ** child points to the universe, and whose "else" child points to zero.
476  ** Above that level there are nodes with identical children.
477  */
478 
479  /* First we build the node at the level of index i. */
480  lower = (i < dd->sizeZ - 1) ? dd->univ[dd->permZ[i]+1] : DD_ONE(dd);
481  do {
482  dd->reordered = 0;
483  zvar = cuddUniqueInterZdd(dd, i, lower, DD_ZERO(dd));
484  } while (dd->reordered == 1);
485 
486  if (zvar == NULL)
487  return(NULL);
488  cuddRef(zvar);
489 
490  /* Now we add the "filler" nodes above the level of index i. */
491  for (j = dd->permZ[i] - 1; j >= 0; j--) {
492  do {
493  dd->reordered = 0;
494  res = cuddUniqueInterZdd(dd, dd->invpermZ[j], zvar, zvar);
495  } while (dd->reordered == 1);
496  if (res == NULL) {
497  Cudd_RecursiveDerefZdd(dd,zvar);
498  return(NULL);
499  }
500  cuddRef(res);
501  Cudd_RecursiveDerefZdd(dd,zvar);
502  zvar = res;
503  }
504  cuddDeref(zvar);
505  return(zvar);
506 
507 } /* end of Cudd_zddIthVar */
#define cuddRef(n)
Definition: cuddInt.h:557
void Cudd_RecursiveDerefZdd(DdManager *table, DdNode *n)
Definition: cuddRef.c:381
#define cuddDeref(n)
Definition: cuddInt.h:577
Definition: cudd.h:270
int * invpermZ
Definition: cuddInt.h:372
int * permZ
Definition: cuddInt.h:370
int reordered
Definition: cuddInt.h:392
DdNode * cuddUniqueInterZdd(DdManager *unique, int index, DdNode *T, DdNode *E)
Definition: cuddTable.c:1372
int sizeZ
Definition: cuddInt.h:346
#define CUDD_MAXINDEX
Definition: cudd.h:108
#define DD_ONE(dd)
Definition: cuddInt.h:864
DdNode ** univ
Definition: cuddInt.h:375
#define DD_ZERO(dd)
Definition: cuddInt.h:880

◆ Cudd_zddReadNodeCount()

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 3546 of file cuddAPI.c.

3548 {
3549  return((long)(dd->keysZ - dd->deadZ + 2));
3550 
3551 } /* end of Cudd_zddReadNodeCount */
unsigned int deadZ
Definition: cuddInt.h:356
unsigned int keysZ
Definition: cuddInt.h:354

◆ Cudd_zddRealignDisable()

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 1129 of file cuddAPI.c.

1131 {
1132  unique->realign = 0;
1133  return;
1134 
1135 } /* end of Cudd_zddRealignDisable */
int realign
Definition: cuddInt.h:404

◆ Cudd_zddRealignEnable()

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 1107 of file cuddAPI.c.

1109 {
1110  unique->realign = 1;
1111  return;
1112 
1113 } /* end of Cudd_zddRealignEnable */
int realign
Definition: cuddInt.h:404

◆ Cudd_zddRealignmentEnabled()

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 1077 of file cuddAPI.c.

1079 {
1080  return(unique->realign);
1081 
1082 } /* end of Cudd_zddRealignmentEnabled */
int realign
Definition: cuddInt.h:404

◆ Cudd_zddVarsFromBddVars()

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 533 of file cuddAPI.c.

536 {
537  int res;
538  int i, j;
539  int allnew;
540  int *permutation;
541 
542  if (multiplicity < 1) return(0);
543  allnew = dd->sizeZ == 0;
544  if (dd->size * multiplicity > dd->sizeZ) {
545  res = cuddResizeTableZdd(dd,dd->size * multiplicity - 1);
546  if (res == 0) return(0);
547  }
548  /* Impose the order of the BDD variables to the ZDD variables. */
549  if (allnew) {
550  for (i = 0; i < dd->size; i++) {
551  for (j = 0; j < multiplicity; j++) {
552  dd->permZ[i * multiplicity + j] =
553  dd->perm[i] * multiplicity + j;
554  dd->invpermZ[dd->permZ[i * multiplicity + j]] =
555  i * multiplicity + j;
556  }
557  }
558  for (i = 0; i < dd->sizeZ; i++) {
559  dd->univ[i]->index = dd->invpermZ[i];
560  }
561  } else {
562  permutation = ALLOC(int,dd->sizeZ);
563  if (permutation == NULL) {
565  return(0);
566  }
567  for (i = 0; i < dd->size; i++) {
568  for (j = 0; j < multiplicity; j++) {
569  permutation[i * multiplicity + j] =
570  dd->invperm[i] * multiplicity + j;
571  }
572  }
573  for (i = dd->size * multiplicity; i < dd->sizeZ; i++) {
574  permutation[i] = i;
575  }
576  res = Cudd_zddShuffleHeap(dd, permutation);
577  FREE(permutation);
578  if (res == 0) return(0);
579  }
580  /* Copy and expand the variable group tree if it exists. */
581  if (dd->treeZ != NULL) {
582  Cudd_FreeZddTree(dd);
583  }
584  if (dd->tree != NULL) {
585  dd->treeZ = Mtr_CopyTree(dd->tree, multiplicity);
586  if (dd->treeZ == NULL) return(0);
587  } else if (multiplicity > 1) {
588  dd->treeZ = Mtr_InitGroupTree(0, dd->sizeZ);
589  if (dd->treeZ == NULL) return(0);
590  dd->treeZ->index = dd->invpermZ[0];
591  }
592  /* Create groups for the ZDD variables derived from the same BDD variable.
593  */
594  if (multiplicity > 1) {
595  char *vmask, *lmask;
596 
597  vmask = ALLOC(char, dd->size);
598  if (vmask == NULL) {
600  return(0);
601  }
602  lmask = ALLOC(char, dd->size);
603  if (lmask == NULL) {
605  return(0);
606  }
607  for (i = 0; i < dd->size; i++) {
608  vmask[i] = lmask[i] = 0;
609  }
610  res = addMultiplicityGroups(dd,dd->treeZ,multiplicity,vmask,lmask);
611  FREE(vmask);
612  FREE(lmask);
613  if (res == 0) return(0);
614  }
615  return(1);
616 
617 } /* end of Cudd_zddVarsFromBddVars */
#define FREE(obj)
Definition: util.h:80
int * invpermZ
Definition: cuddInt.h:372
int size
Definition: cuddInt.h:345
void Cudd_FreeZddTree(DdManager *dd)
Definition: cuddAPI.c:2534
int * permZ
Definition: cuddInt.h:370
MtrNode * tree
Definition: cuddInt.h:408
MtrHalfWord index
Definition: mtr.h:130
int Cudd_zddShuffleHeap(DdManager *table, int *permutation)
Definition: cuddZddReord.c:300
#define ALLOC(type, num)
Definition: util.h:76
int cuddResizeTableZdd(DdManager *unique, int index)
Definition: cuddTable.c:2270
static int addMultiplicityGroups(DdManager *dd, MtrNode *treenode, int multiplicity, char *vmask, char *lmask)
Definition: cuddAPI.c:4855
MtrNode * Mtr_InitGroupTree(int lower, int size)
Definition: mtrGroup.c:120
int sizeZ
Definition: cuddInt.h:346
DdHalfWord index
Definition: cudd.h:271
MtrNode * treeZ
Definition: cuddInt.h:409
int * invperm
Definition: cuddInt.h:371
MtrNode * Mtr_CopyTree(MtrNode *node, int expansion)
Definition: mtrBasic.c:214
int * perm
Definition: cuddInt.h:369
Cudd_ErrorType errorCode
Definition: cuddInt.h:425
DdNode ** univ
Definition: cuddInt.h:375

◆ fixVarTree()

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 4812 of file cuddAPI.c.

4816 {
4817  treenode->index = treenode->low;
4818  treenode->low = ((int) treenode->index < size) ?
4819  perm[treenode->index] : treenode->index;
4820  if (treenode->child != NULL)
4821  fixVarTree(treenode->child, perm, size);
4822  if (treenode->younger != NULL)
4823  fixVarTree(treenode->younger, perm, size);
4824  return;
4825 
4826 } /* end of fixVarTree */
struct MtrNode * younger
Definition: mtr.h:134
MtrHalfWord index
Definition: mtr.h:130
MtrHalfWord low
Definition: mtr.h:128
static void fixVarTree(MtrNode *treenode, int *perm, int size)
Definition: cuddAPI.c:4812
struct MtrNode * child
Definition: mtr.h:132

Variable Documentation

◆ DD_UNUSED

char rcsid [] DD_UNUSED = "$Id: cuddAPI.c,v 1.64 2012/02/05 01:07:18 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-2012, 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 232 of file cuddAPI.c.