The cudd package The University of Colorado decision diagram package. Fabio Somenzi ********************************************************************** Cudd_AddHook() Adds a function to a hook. Cudd_ApaAdd() Adds two arbitrary precision integers. Cudd_ApaCompareRatios() Compares the ratios of two arbitrary precision integers to two unsigned ints. Cudd_ApaCompare() Compares two arbitrary precision integers. Cudd_ApaCopy() Makes a copy of an arbitrary precision integer. Cudd_ApaCountMinterm() Counts the number of minterms of a DD. Cudd_ApaIntDivision() Divides an arbitrary precision integer by an integer. Cudd_ApaNumberOfDigits() Finds the number of digits for an arbitrary precision integer. Cudd_ApaPowerOfTwo() Sets an arbitrary precision integer to a power of two. Cudd_ApaPrintDecimal() Prints an arbitrary precision integer in decimal format. Cudd_ApaPrintDensity() Prints the density of a BDD or ADD using arbitrary precision arithmetic. Cudd_ApaPrintExponential() Prints an arbitrary precision integer in exponential format. Cudd_ApaPrintHex() Prints an arbitrary precision integer in hexadecimal format. Cudd_ApaPrintMintermExp() Prints the number of minterms of a BDD or ADD in exponential format using arbitrary precision arithmetic. Cudd_ApaPrintMinterm() Prints the number of minterms of a BDD or ADD using arbitrary precision arithmetic. Cudd_ApaSetToLiteral() Sets an arbitrary precision integer to a one- digit literal. Cudd_ApaShiftRight() Shifts right an arbitrary precision integer by one binary place. Cudd_ApaShortDivision() Divides an arbitrary precision integer by a digit. Cudd_ApaSubtract() Subtracts two arbitrary precision integers. Cudd_AutodynDisableZdd() Disables automatic dynamic reordering of ZDDs. Cudd_AutodynDisable() Disables automatic dynamic reordering. Cudd_AutodynEnableZdd() Enables automatic dynamic reordering of ZDDs. Cudd_AutodynEnable() Enables automatic dynamic reordering of BDDs and ADDs. Cudd_AverageDistance() Computes the average distance between adjacent nodes. Cudd_BddToAdd() Converts a BDD to a 0-1 ADD. Cudd_BddToCubeArray() Builds a positional array from the BDD of a cube. Cudd_BiasedOverApprox() Extracts a dense superset from a BDD with the biased underapproximation method. Cudd_BiasedUnderApprox() Extracts a dense subset from a BDD with the biased underapproximation method. Cudd_CProjection() Computes the compatible projection of R w.r.t. cube Y. Cudd_CheckCube() Checks whether g is the BDD of a cube. Cudd_CheckKeys() Checks for several conditions that should not occur. Cudd_CheckZeroRef() Checks the unique table for nodes with non-zero reference counts. Cudd_ClassifySupport() Classifies the variables in the support of two DDs. Cudd_ClearErrorCode() Clear the error code of a manager. Cudd_CofMinterm() Computes the fraction of minterms in the on-set of all the positive cofactors of a BDD or ADD. Cudd_Cofactor() Computes the cofactor of f with respect to g. Cudd_CountLeaves() Counts the number of leaves in a DD. Cudd_CountMinterm() Counts the number of minterms of a DD. Cudd_CountPathsToNonZero() Counts the number of paths to a non-zero terminal of a DD. Cudd_CountPath() Counts the number of paths of a DD. Cudd_CubeArrayToBdd() Builds the BDD of a cube from a positional array. Cudd_DagSize() Counts the number of nodes in a DD. Cudd_DeadAreCounted() Tells whether dead nodes are counted towards triggering reordering. Cudd_DebugCheck() Checks for inconsistencies in the DD heap. Cudd_Decreasing() Determines whether a BDD is negative unate in a variable. Cudd_DelayedDerefBdd() Decreases the reference count of BDD node n. Cudd_Density() Computes the density of a BDD or ADD. Cudd_Deref() Decreases the reference count of node. Cudd_DisableGarbageCollection() Disables garbage collection. Cudd_DisableOrderingMonitoring() Disables monitoring of ordering. Cudd_DisableReorderingReporting() Disables reporting of reordering stats. Cudd_Disequality() Generates a BDD for the function x - y != c. Cudd_DumpBlifBody() Writes a blif body representing the argument BDDs. Cudd_DumpBlif() Writes a blif file representing the argument BDDs. Cudd_DumpDDcal() Writes a DDcal file representing the argument BDDs. Cudd_DumpDaVinci() Writes a daVinci file representing the argument BDDs. Cudd_DumpDot() Writes a dot file representing the argument DDs. Cudd_DumpFactoredForm() Writes factored forms representing the argument BDDs. Cudd_Dxygtdxz() Generates a BDD for the function d(x,y) > d(x,z). Cudd_Dxygtdyz() Generates a BDD for the function d(x,y) > d(y,z). Cudd_EnableGarbageCollection() Enables garbage collection. Cudd_EnableOrderingMonitoring() Enables monitoring of ordering. Cudd_EnableReorderingReporting() Enables reporting of reordering stats. Cudd_EpdCountMinterm() Counts the number of minterms of a DD with extended precision. Cudd_EqualSupNorm() Compares two ADDs for equality within tolerance. Cudd_EquivDC() Tells whether F and G are identical wherever D is 0. Cudd_EstimateCofactorSimple() Estimates the number of nodes in a cofactor of a DD. Cudd_EstimateCofactor() Estimates the number of nodes in a cofactor of a DD. Cudd_Eval() Returns the value of a DD for a given variable assignment. Cudd_ExpectedUsedSlots() Computes the expected fraction of used slots in the unique table. Cudd_FindEssential() Finds the essential variables of a DD. Cudd_FindTwoLiteralClauses() Finds the two literal clauses of a DD. Cudd_FirstCube() Finds the first cube of a decision diagram. Cudd_FirstNode() Finds the first node of a decision diagram. Cudd_FirstPrime() Finds the first prime of a Boolean function. Cudd_FreeTree() Frees the variable group tree of the manager. Cudd_FreeZddTree() Frees the variable group tree of the manager. Cudd_GarbageCollectionEnabled() Tells whether garbage collection is enabled. Cudd_GenFree() Frees a CUDD generator. Cudd_IncreaseTimeLimit() Increases the time limit for the manager. Cudd_Increasing() Determines whether a BDD is positive unate in a variable. Cudd_IndicesToCube() Builds a cube of BDD variables from an array of indices. Cudd_Inequality() Generates a BDD for the function x - y ≥ c. Cudd_Init() Creates a new DD manager. Cudd_IsGenEmpty() Queries the status of a generator. Cudd_IsInHook() Checks whether a function is in a hook. Cudd_IsNonConstant() Returns 1 if a DD node is not constant. Cudd_IterDerefBdd() Decreases the reference count of BDD node n. Cudd_LargestCube() Finds a largest cube in a DD. Cudd_MakeBddFromZddCover() Converts a ZDD cover to a BDD. Cudd_MakeTreeNode() Creates a new variable group. Cudd_MakeZddTreeNode() Creates a new ZDD variable group. Cudd_MinHammingDist() Returns the minimum Hamming distance between f and minterm. Cudd_NewApaNumber() Allocates memory for an arbitrary precision integer. Cudd_NextCube() Generates the next cube of a decision diagram onset. Cudd_NextNode() Finds the next node of a decision diagram. Cudd_NextPrime() Generates the next prime of a Boolean function. Cudd_NodeReadIndex() Returns the index of the node. Cudd_OrderingMonitoring() Returns 1 if monitoring of ordering is enabled. Cudd_OutOfMem() Warns that a memory allocation failed. Cudd_OverApprox() Extracts a dense superset from a BDD with Shiple's underapproximation method. Cudd_Prime() Returns the next prime >= p. Cudd_PrintDebug() Prints to the standard output a DD and its statistics. Cudd_PrintGroupedOrder() Hook function to print the current variable order. Cudd_PrintInfo() Prints out statistics and settings for a CUDD manager. Cudd_PrintLinear() Prints the linear transform matrix. Cudd_PrintMinterm() Prints a disjoint sum of products. Cudd_PrintTwoLiteralClauses() Prints the two literal clauses of a DD. Cudd_PrintVersion() Prints the package version number. Cudd_PrioritySelect() Selects pairs from R using a priority function. Cudd_Quit() Deletes resources associated with a DD manager. Cudd_Random() Portable random number generator. Cudd_ReadArcviolation() Returns the current value of the arcviolation parameter used in group sifting. Cudd_ReadBackground() Reads the background constant of the manager. Cudd_ReadCacheHits() Returns the number of cache hits. Cudd_ReadCacheLookUps() Returns the number of cache look-ups. Cudd_ReadCacheSlots() Reads the number of slots in the cache. Cudd_ReadCacheUsedSlots() Reads the fraction of used slots in the cache. Cudd_ReadDead() Returns the number of dead nodes in the unique table. Cudd_ReadElapsedTime() Returns the time elapsed since the start time of the manager. Cudd_ReadEpsilon() Reads the epsilon parameter of the manager. Cudd_ReadErrorCode() Returns the code of the last error. Cudd_ReadGarbageCollectionTime() Returns the time spent in garbage collection. Cudd_ReadGarbageCollections() Returns the number of times garbage collection has occurred. Cudd_ReadGroupcheck() Reads the groupcheck parameter of the manager. Cudd_ReadInvPermZdd() Returns the index of the ZDD variable currently in the i-th position of the order. Cudd_ReadInvPerm() Returns the index of the variable currently in the i-th position of the order. Cudd_ReadIthClause() Accesses the i-th clause of a DD. Cudd_ReadKeys() Returns the number of nodes in the unique table. Cudd_ReadLinear() Reads an entry of the linear transform matrix. Cudd_ReadLogicZero() Returns the logic zero constant of the manager. Cudd_ReadLooseUpTo() Reads the looseUpTo parameter of the manager. Cudd_ReadMaxCacheHard() Reads the maxCacheHard parameter of the manager. Cudd_ReadMaxCache() Returns the soft limit for the cache size. Cudd_ReadMaxGrowthAlternate() Reads the maxGrowthAlt parameter of the manager. Cudd_ReadMaxGrowth() Reads the maxGrowth parameter of the manager. Cudd_ReadMaxLive() Reads the maximum allowed number of live nodes. Cudd_ReadMaxMemory() Reads the maximum allowed memory. Cudd_ReadMaxReorderings() Returns the maximum number of times reordering may be invoked. Cudd_ReadMemoryInUse() Returns the memory in use by the manager measured in bytes. Cudd_ReadMinDead() Reads the minDead parameter of the manager. Cudd_ReadMinHit() Reads the hit rate that causes resizinig of the computed table. Cudd_ReadMinusInfinity() Reads the minus-infinity constant from the manager. Cudd_ReadNextReordering() Returns the threshold for the next dynamic reordering. Cudd_ReadNodeCount() Reports the number of nodes in BDDs and ADDs. Cudd_ReadNodesDropped() Returns the number of nodes dropped. Cudd_ReadNodesFreed() Returns the number of nodes freed. Cudd_ReadNumberXovers() Reads the current number of crossovers used by the genetic algorithm for reordering. Cudd_ReadOne() Returns the one constant of the manager. Cudd_ReadOrderRandomization() Returns the order randomization factor. Cudd_ReadPeakLiveNodeCount() Reports the peak number of live nodes. Cudd_ReadPeakNodeCount() Reports the peak number of nodes. Cudd_ReadPermZdd() Returns the current position of the i-th ZDD variable in the order. Cudd_ReadPerm() Returns the current position of the i-th variable in the order. Cudd_ReadPlusInfinity() Reads the plus-infinity constant from the manager. Cudd_ReadPopulationSize() Reads the current size of the population used by the genetic algorithm for reordering. Cudd_ReadRecomb() Returns the current value of the recombination parameter used in group sifting. Cudd_ReadRecursiveCalls() Returns the number of recursive calls. Cudd_ReadReorderingCycle() Reads the reordCycle parameter of the manager. Cudd_ReadReorderingTime() Returns the time spent in reordering. Cudd_ReadReorderings() Returns the number of times reordering has occurred. Cudd_ReadSiftMaxSwap() Reads the siftMaxSwap parameter of the manager. Cudd_ReadSiftMaxVar() Reads the siftMaxVar parameter of the manager. Cudd_ReadSize() Returns the number of BDD variables in existance. Cudd_ReadSlots() Returns the total number of slots of the unique table. Cudd_ReadStartTime() Returns the start time of the manager. Cudd_ReadStderr() Reads the stderr of a manager. Cudd_ReadStdout() Reads the stdout of a manager. Cudd_ReadSwapSteps() Reads the number of elementary reordering steps. Cudd_ReadSymmviolation() Returns the current value of the symmviolation parameter used in group sifting. Cudd_ReadTimeLimit() Returns the time limit for the manager. Cudd_ReadTree() Returns the variable group tree of the manager. Cudd_ReadUniqueLinks() Returns the number of links followed in the unique table. Cudd_ReadUniqueLookUps() Returns the number of look-ups in the unique table. Cudd_ReadUsedSlots() Reads the fraction of used slots in the unique table. Cudd_ReadVars() Returns the i-th element of the vars array. Cudd_ReadZddOne() Returns the ZDD for the constant 1 function. Cudd_ReadZddSize() Returns the number of ZDD variables in existance. Cudd_ReadZddTree() Returns the variable group tree of the manager. Cudd_ReadZero() Returns the zero constant of the manager. Cudd_RecursiveDerefZdd() Decreases the reference count of ZDD node n. Cudd_RecursiveDeref() Decreases the reference count of node n. Cudd_ReduceHeap() Main dynamic reordering routine. Cudd_Ref() Increases the reference count of a node, if it is not saturated. Cudd_RemapOverApprox() Extracts a dense superset from a BDD with the remapping underapproximation method. Cudd_RemapUnderApprox() Extracts a dense subset from a BDD with the remapping underapproximation method. Cudd_RemoveHook() Removes a function from a hook. Cudd_ReorderingReporting() Returns 1 if reporting of reordering stats is enabled. Cudd_ReorderingStatusZdd() Reports the status of automatic dynamic reordering of ZDDs. Cudd_ReorderingStatus() Reports the status of automatic dynamic reordering of BDDs and ADDs. Cudd_Reserve() Expand manager without creating variables. Cudd_ResetStartTime() Resets the start time of the manager. Cudd_SetArcviolation() Sets the value of the arcviolation parameter used in group sifting. Cudd_SetBackground() Sets the background constant of the manager. Cudd_SetEpsilon() Sets the epsilon parameter of the manager to ep. Cudd_SetGroupcheck() Sets the parameter groupcheck of the manager to gc. Cudd_SetLooseUpTo() Sets the looseUpTo parameter of the manager. Cudd_SetMaxCacheHard() Sets the maxCacheHard parameter of the manager. Cudd_SetMaxGrowthAlternate() Sets the maxGrowthAlt parameter of the manager. Cudd_SetMaxGrowth() Sets the maxGrowth parameter of the manager. Cudd_SetMaxLive() Sets the maximum allowed number of live nodes. Cudd_SetMaxMemory() Sets the maximum allowed memory. Cudd_SetMaxReorderings() Sets the maximum number of times reordering may be invoked. Cudd_SetMinHit() Sets the hit rate that causes resizinig of the computed table. Cudd_SetNextReordering() Sets the threshold for the next dynamic reordering. Cudd_SetNumberXovers() Sets the number of crossovers used by the genetic algorithm for reordering. Cudd_SetOrderRandomization() Sets the order randomization factor. Cudd_SetPopulationSize() Sets the size of the population used by the genetic algorithm for reordering. Cudd_SetRecomb() Sets the value of the recombination parameter used in group sifting. Cudd_SetReorderingCycle() Sets the reordCycle parameter of the manager. Cudd_SetSiftMaxSwap() Sets the siftMaxSwap parameter of the manager. Cudd_SetSiftMaxVar() Sets the siftMaxVar parameter of the manager. Cudd_SetStartTime() Sets the start time of the manager. Cudd_SetStderr() Sets the stderr of a manager. Cudd_SetStdout() Sets the stdout of a manager. Cudd_SetSymmviolation() Sets the value of the symmviolation parameter used in group sifting. Cudd_SetTimeLimit() Sets the time limit for the manager. Cudd_SetTree() Sets the variable group tree of the manager. Cudd_SetVarMap() Registers a variable mapping with the manager. Cudd_SetZddTree() Sets the ZDD variable group tree of the manager. Cudd_SharingSize() Counts the number of nodes in an array of DDs. Cudd_ShortestLength() Find the length of the shortest path(s) in a DD. Cudd_ShortestPath() Finds a shortest path in a DD. Cudd_ShuffleHeap() Reorders variables according to given permutation. Cudd_SolveEqn() Implements the solution of F(x,y) = 0. Cudd_SplitSet() Returns m minterms from a BDD. Cudd_Srandom() Initializer for the portable random number generator. Cudd_StdPostReordHook() Sample hook function to call after reordering. Cudd_StdPreReordHook() Sample hook function to call before reordering. Cudd_SubsetCompress() Find a dense subset of BDD f. Cudd_SubsetHeavyBranch() Extracts a dense subset from a BDD with the heavy branch heuristic. Cudd_SubsetShortPaths() Extracts a dense subset from a BDD with the shortest paths heuristic. Cudd_SubsetWithMaskVars() Extracts a subset from a BDD. Cudd_SupersetCompress() Find a dense superset of BDD f. Cudd_SupersetHeavyBranch() Extracts a dense superset from a BDD with the heavy branch heuristic. Cudd_SupersetShortPaths() Extracts a dense superset from a BDD with the shortest paths heuristic. Cudd_SupportIndex() Finds the variables on which a DD depends. Cudd_SupportIndices() Finds the variables on which a DD depends. Cudd_SupportSize() Counts the variables on which a DD depends. Cudd_Support() Finds the variables on which a DD depends. Cudd_SymmProfile() Prints statistics on symmetric variables. Cudd_TimeLimited() Returns true if the time limit for the manager is set. Cudd_TurnOffCountDead() Causes the dead nodes not to be counted towards triggering reordering. Cudd_TurnOnCountDead() Causes the dead nodes to be counted towards triggering reordering. Cudd_UnderApprox() Extracts a dense subset from a BDD with Shiple's underapproximation method. Cudd_UnsetTimeLimit() Unsets the time limit for the manager. Cudd_UpdateTimeLimit() Updates the time limit for the manager. Cudd_VectorSupportIndex() Finds the variables on which a set of DDs depends. Cudd_VectorSupportIndices() Finds the variables on which a set of DDs depends. Cudd_VectorSupportSize() Counts the variables on which a set of DDs depends. Cudd_VectorSupport() Finds the variables on which a set of DDs depends. Cudd_VerifySol() Checks the solution of F(x,y) = 0. Cudd_Xeqy() Generates a BDD for the function x==y. Cudd_Xgty() Generates a BDD for the function x > y. Cudd_addAgreement() f if f==g; background if f!=g. Cudd_addApply() Applies op to the corresponding discriminants of f and g. Cudd_addBddInterval() Converts an ADD to a BDD. Cudd_addBddIthBit() Converts an ADD to a BDD by extracting the i-th bit from the leaves. Cudd_addBddPattern() Converts an ADD to a BDD. Cudd_addBddStrictThreshold() Converts an ADD to a BDD. Cudd_addBddThreshold() Converts an ADD to a BDD. Cudd_addCmpl() Computes the complement of an ADD a la C language. Cudd_addCompose() Substitutes g for x_v in the ADD for f. Cudd_addComputeCube() Computes the cube of an array of ADD variables. Cudd_addConstrain() Computes f constrain c for ADDs. Cudd_addConst() Returns the ADD for constant c. Cudd_addDiff() Returns plusinfinity if f=g; returns min(f,g) if f!=g. Cudd_addDivide() Integer and floating point division. Cudd_addEvalConst() Checks whether ADD g is constant whenever ADD f is 1. Cudd_addExistAbstract() Existentially Abstracts all the variables in cube from f. Cudd_addFindMax() Finds the maximum discriminant of f. Cudd_addFindMin() Finds the minimum discriminant of f. Cudd_addGeneralVectorCompose() Composes an ADD with a vector of ADDs. Cudd_addHamming() Computes the Hamming distance ADD. Cudd_addHarwell() Reads in a matrix in the format of the Harwell- Boeing benchmark suite. Cudd_addIteConstant() Implements ITEconstant for ADDs. Cudd_addIte() Implements ITE(f,g,h). Cudd_addIthBit() Extracts the i-th bit from an ADD. Cudd_addIthVar() Returns the ADD variable with index i. Cudd_addLeq() Determines whether f is less than or equal to g. Cudd_addLog() Natural logarithm of an ADD. Cudd_addMatrixMultiply() Calculates the product of two matrices represented as ADDs. Cudd_addMaximum() Integer and floating point max. Cudd_addMinimum() Integer and floating point min. Cudd_addMinus() Integer and floating point subtraction. Cudd_addMonadicApply() Applies op to the discriminants of f. Cudd_addNand() NAND of two 0-1 ADDs. Cudd_addNegate() Computes the additive inverse of an ADD. Cudd_addNewVarAtLevel() Returns a new ADD variable at a specified level. Cudd_addNewVar() Returns a new ADD variable. Cudd_addNonSimCompose() Composes an ADD with a vector of 0-1 ADDs. Cudd_addNor() NOR of two 0-1 ADDs. Cudd_addOneZeroMaximum() Returns 1 if f > g and 0 otherwise. Cudd_addOrAbstract() Disjunctively abstracts all the variables in cube from the 0-1 ADD f. Cudd_addOr() Disjunction of two 0-1 ADDs. Cudd_addOuterSum() Takes the minimum of a matrix and the outer sum of two vectors. Cudd_addPermute() Permutes the variables of an ADD. Cudd_addPlus() Integer and floating point addition. Cudd_addRead() Reads in a sparse matrix. Cudd_addResidue() Builds an ADD for the residue modulo m of an n- bit number. Cudd_addRestrict() ADD restrict according to Coudert and Madre's algorithm (ICCAD90). Cudd_addRoundOff() Rounds off the discriminants of an ADD. Cudd_addScalarInverse() Computes the scalar inverse of an ADD. Cudd_addSetNZ() This operator sets f to the value of g wherever g != 0. Cudd_addSwapVariables() Swaps two sets of variables of the same size (x and y) in the ADD f. Cudd_addThreshold() f if f>=g; 0 if f d(x,z); x, y, and z are N-bit numbers, x[0] x[1] ... x[N-1], y[0] y[1] ... y[N-1], and z[0] z[1] ... z[N-1], with 0 the most significant bit. The distance d(x,y) is defined as: sum_{i=0}^{N-1}(|x_i - y_i| cdot 2^{N-i-1}). The BDD is built bottom-up. It has 7*N-3 internal nodes, if the variables are ordered as follows: x[0] y[0] z[0] x[1] y[1] z[1] ... x[N-1] y[N-1] z[N-1]. Side Effects: None DdNode * Cudd_Dxygtdyz( DdManager * dd, DD manager int N, number of x, y, and z variables DdNode ** x, array of x variables DdNode ** y, array of y variables DdNode ** z array of z variables ) This function generates a BDD for the function d(x,y) > d(y,z); x, y, and z are N-bit numbers, x[0] x[1] ... x[N-1], y[0] y[1] ... y[N-1], and z[0] z[1] ... z[N-1], with 0 the most significant bit. The distance d(x,y) is defined as: sum_{i=0}^{N-1}(|x_i - y_i| cdot 2^{N-i-1}). The BDD is built bottom-up. It has 7*N-3 internal nodes, if the variables are ordered as follows: x[0] y[0] z[0] x[1] y[1] z[1] ... x[N-1] y[N-1] z[N-1]. Side Effects: None void Cudd_EnableGarbageCollection( DdManager * dd ) Enables garbage collection. Garbage collection is initially enabled. Therefore it is necessary to call this function only if garbage collection has been explicitly disabled. Side Effects: None int Cudd_EnableOrderingMonitoring( DdManager * dd ) Enables monitoring of ordering. Returns 1 if successful; 0 otherwise. Side Effects: Installs functions in the pre-reordering and post-reordering hooks. int Cudd_EnableReorderingReporting( DdManager * dd ) Enables reporting of reordering stats. Returns 1 if successful; 0 otherwise. Side Effects: Installs functions in the pre-reordering and post-reordering hooks. int Cudd_EpdCountMinterm( DdManager * manager, DdNode * node, int nvars, EpDouble * epd ) Counts the number of minterms of a DD with extended precision. The function is assumed to depend on nvars variables. The minterm count is represented as an EpDouble, to allow any number of variables. Returns 0 if successful; CUDD_OUT_OF_MEM otherwise. Side Effects: None int Cudd_EqualSupNorm( DdManager * dd, manager DdNode * f, first ADD DdNode * g, second ADD CUDD_VALUE_TYPE tolerance, maximum allowed difference int pr verbosity level ) Compares two ADDs for equality within tolerance. Two ADDs are reported to be equal if the maximum difference between them (the sup norm of their difference) is less than or equal to the tolerance parameter. Returns 1 if the two ADDs are equal (within tolerance); 0 otherwise. If parameter pr is positive the first failure is reported to the standard output. Side Effects: None int Cudd_EquivDC( DdManager * dd, DdNode * F, DdNode * G, DdNode * D ) Tells whether F and G are identical wherever D is 0. F and G are either two ADDs or two BDDs. D is either a 0-1 ADD or a BDD. The function returns 1 if F and G are equivalent, and 0 otherwise. No new nodes are created. Side Effects: None int Cudd_EstimateCofactorSimple( DdNode * node, int i ) Estimates the number of nodes in a cofactor of a DD. Returns an estimate of the number of nodes in the positive cofactor of the graph rooted at node with respect to the variable whose index is i. This procedure implements with minor changes the algorithm of Cabodi et al. (ICCAD96). It does not allocate any memory, it does not change the state of the manager, and it is fast. However, it has been observed to overestimate the size of the cofactor by as much as a factor of 2. Side Effects: None int Cudd_EstimateCofactor( DdManager * dd, manager DdNode * f, function int i, index of variable int phase 1: positive; 0: negative ) Estimates the number of nodes in a cofactor of a DD. Returns an estimate of the number of nodes in a cofactor of the graph rooted at node with respect to the variable whose index is i. In case of failure, returns CUDD_OUT_OF_MEM. This function uses a refinement of the algorithm of Cabodi et al. (ICCAD96). The refinement allows the procedure to account for part of the recombination that may occur in the part of the cofactor above the cofactoring variable. This procedure does not create any new node. It does keep a small table of results; therefore it may run out of memory. If this is a concern, one should use Cudd_EstimateCofactorSimple, which is faster, does not allocate any memory, but is less accurate. Side Effects: None DdNode * Cudd_Eval( DdManager * dd, DdNode * f, int * inputs ) Finds the value of a DD for a given variable assignment. The variable assignment is passed in an array of int's, that should specify a zero or a one for each variable in the support of the function. Returns a pointer to a constant node. No new nodes are produced. Side Effects: None double Cudd_ExpectedUsedSlots( DdManager * dd ) 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. Side Effects: None DdNode * Cudd_FindEssential( DdManager * dd, DdNode * f ) Returns the cube of the essential variables. A positive literal means that the variable must be set to 1 for the function to be 1. A negative literal means that the variable must be set to 0 for the function to be 1. Returns a pointer to the cube BDD if successful; NULL otherwise. Side Effects: None DdTlcInfo * Cudd_FindTwoLiteralClauses( DdManager * dd, DdNode * f ) Returns the one- and two-literal clauses of a DD. Returns a pointer to the structure holding the clauses if successful; NULL otherwise. For a constant DD, the empty set of clauses is returned. This is obviously correct for a non-zero constant. For the constant zero, it is based on the assumption that only those clauses containing variables in the support of the function are considered. Since the support of a constant function is empty, no clauses are returned. Side Effects: None DdGen * Cudd_FirstCube( DdManager * dd, DdNode * f, int ** cube, CUDD_VALUE_TYPE * value ) Defines an iterator on the onset of a decision diagram and finds its first cube. Returns a generator that contains the information necessary to continue the enumeration if successful; NULL otherwise. A cube is represented as an array of literals, which are integers in {0, 1, 2}; 0 represents a complemented literal, 1 represents an uncomplemented literal, and 2 stands for don't care. The enumeration produces a disjoint cover of the function associated with the diagram. The size of the array equals the number of variables in the manager at the time Cudd_FirstCube is called. For each cube, a value is also returned. This value is always 1 for a BDD, while it may be different from 1 for an ADD. For BDDs, the offset is the set of cubes whose value is the logical zero. For ADDs, the offset is the set of cubes whose value is the background value. The cubes of the offset are not enumerated. Side Effects: The first cube and its value are returned as side effects. DdGen * Cudd_FirstNode( DdManager * dd, DdNode * f, DdNode ** node ) Defines an iterator on the nodes of a decision diagram and finds its first node. Returns a generator that contains the information necessary to continue the enumeration if successful; NULL otherwise. The nodes are enumerated in a reverse topological order, so that a node is always preceded in the enumeration by its descendants. Side Effects: The first node is returned as a side effect. DdGen * Cudd_FirstPrime( DdManager * dd, DdNode * l, DdNode * u, int ** cube ) Defines an iterator on a pair of BDDs describing a (possibly incompletely specified) Boolean functions and finds the first cube of a cover of the function. Returns a generator that contains the information necessary to continue the enumeration if successful; NULL otherwise. The two argument BDDs are the lower and upper bounds of an interval. It is a mistake to call this function with a lower bound that is not less than or equal to the upper bound. A cube is represented as an array of literals, which are integers in {0, 1, 2}; 0 represents a complemented literal, 1 represents an uncomplemented literal, and 2 stands for don't care. The enumeration produces a prime and irredundant cover of the function associated with the two BDDs. The size of the array equals the number of variables in the manager at the time Cudd_FirstCube is called. This iterator can only be used on BDDs. Side Effects: The first cube is returned as side effect. void Cudd_FreeTree( DdManager * dd ) Frees the variable group tree of the manager. Side Effects: None void Cudd_FreeZddTree( DdManager * dd ) Frees the variable group tree of the manager. Side Effects: None int Cudd_GarbageCollectionEnabled( DdManager * dd ) Returns 1 if garbage collection is enabled; 0 otherwise. Side Effects: None int Cudd_GenFree( DdGen * gen ) Frees a CUDD generator. Always returns 0, so that it can be used in mis-like foreach constructs. Side Effects: None void Cudd_IncreaseTimeLimit( DdManager * unique, unsigned long increase ) Increases the time limit for the manager. Side Effects: None DdNode * Cudd_Increasing( DdManager * dd, DdNode * f, int i ) Determines whether the function represented by BDD f is positive unate (monotonic increasing) in variable i. It is based on Cudd_Decreasing and the fact that f is monotonic increasing in i if and only if its complement is monotonic decreasing in i. Side Effects: None DdNode * Cudd_IndicesToCube( DdManager * dd, int * array, int n ) Builds a cube of BDD variables from an array of indices. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_Inequality( DdManager * dd, DD manager int N, number of x and y variables int c, right-hand side constant DdNode ** x, array of x variables DdNode ** y array of y variables ) This function generates a BDD for the function x -y ≥ c. Both x and y are N-bit numbers, x[0] x[1] ... x[N-1] and y[0] y[1] ... y[N-1], with 0 the most significant bit. The BDD is built bottom-up. It has a linear number of nodes if the variables are ordered as follows: x[0] y[0] x[1] y[1] ... x[N- 1] y[N-1]. Side Effects: None DdManager * Cudd_Init( unsigned int numVars, initial number of BDD variables (i.e., subtables) unsigned int numVarsZ, initial number of ZDD variables (i.e., subtables) unsigned int numSlots, initial size of the unique tables unsigned int cacheSize, initial size of the cache unsigned long maxMemory target maximum memory occupation ) Creates a new DD manager, initializes the table, the basic constants and the projection functions. If maxMemory is 0, Cudd_Init decides suitable values for the maximum size of the cache and for the limit for fast unique table growth based on the available memory. Returns a pointer to the manager if successful; NULL otherwise. Side Effects: None int Cudd_IsGenEmpty( DdGen * gen ) Queries the status of a generator. Returns 1 if the generator is empty or NULL; 0 otherswise. Side Effects: None int Cudd_IsInHook( DdManager * dd, DD_HFP f, Cudd_HookType where ) 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. Side Effects: None int Cudd_IsNonConstant( DdNode * f ) 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. Side Effects: None void Cudd_IterDerefBdd( DdManager * table, DdNode * n ) Decreases the reference count of node n. If n dies, recursively decreases the reference counts of its children. It is used to dispose of a BDD that is no longer needed. It is more efficient than Cudd_RecursiveDeref, but it cannot be used on ADDs. The greater efficiency comes from being able to assume that no constant node will ever die as a result of a call to this procedure. Side Effects: None DdNode * Cudd_LargestCube( DdManager * manager, DdNode * f, int * length ) Finds a largest cube in a DD. f is the DD we want to get the largest cube for. The problem is translated into the one of finding a shortest path in f, when both THEN and ELSE arcs are assumed to have unit length. This yields a largest cube in the disjoint cover corresponding to the DD. Therefore, it is not necessarily the largest implicant of f. Returns the largest cube as a BDD. Side Effects: The number of literals of the cube is returned in the location pointed by length if it is non-null. DdNode * Cudd_MakeBddFromZddCover( DdManager * dd, DdNode * node ) Converts a ZDD cover to a BDD for the function represented by the cover. If successful, it returns a BDD node, otherwise it returns NULL. MtrNode * Cudd_MakeTreeNode( DdManager * dd, manager unsigned int low, index of the first group variable unsigned int size, number of variables in the group unsigned int type MTR_DEFAULT or MTR_FIXED ) Creates a new variable group. The group starts at variable low and contains size variables. The parameter low is the index of the first variable. If the variable already exists, its current position in the order is known to the manager. If the variable does not exist yet, the position is assumed to be the same as the index. The group tree is created if it does not exist yet. Returns a pointer to the group if successful; NULL otherwise. Side Effects: The variable tree is changed. MtrNode * Cudd_MakeZddTreeNode( DdManager * dd, manager unsigned int low, index of the first group variable unsigned int size, number of variables in the group unsigned int type MTR_DEFAULT or MTR_FIXED ) Creates a new ZDD variable group. The group starts at variable and contains size variables. The parameter low is the index of the first variable. If the variable already exists, its current position in the order is known to the manager. If the variable does not exist yet, the position is assumed to be the same as the index. The group tree is created if it does not exist yet. Returns a pointer to the group if successful; NULL otherwise. Side Effects: The ZDD variable tree is changed. int Cudd_MinHammingDist( DdManager * dd, DD manager DdNode * f, function to examine int * minterm, reference minterm int upperBound distance above which an approximate answer is OK ) Returns the minimum Hamming distance between the minterms of a function f and a reference minterm. The function is given as a BDD; the minterm is given as an array of integers, one for each variable in the manager. Returns the minimum distance if it is less than the upper bound; the upper bound if the minimum distance is at least as large; CUDD_OUT_OF_MEM in case of failure. Side Effects: None DdApaNumber Cudd_NewApaNumber( int digits ) Allocates memory for an arbitrary precision integer. Returns a pointer to the allocated memory if successful; NULL otherwise. Side Effects: None int Cudd_NextCube( DdGen * gen, int ** cube, CUDD_VALUE_TYPE * value ) Generates the next cube of a decision diagram onset, using generator gen. Returns 0 if the enumeration is completed; 1 otherwise. Side Effects: The cube and its value are returned as side effects. The generator is modified. int Cudd_NextNode( DdGen * gen, DdNode ** node ) Finds the node of a decision diagram, using generator gen. Returns 0 if the enumeration is completed; 1 otherwise. Side Effects: The next node is returned as a side effect. int Cudd_NextPrime( DdGen * gen, int ** cube ) Generates the next cube of a Boolean function, using generator gen. Returns 0 if the enumeration is completed; 1 otherwise. Side Effects: The cube and is returned as side effects. The generator is modified. unsigned int Cudd_NodeReadIndex( DdNode * node ) Returns the index of the node. The node pointer can be either regular or complemented. Side Effects: None int Cudd_OrderingMonitoring( DdManager * dd ) Returns 1 if monitoring of ordering is enabled; 0 otherwise. Side Effects: none void Cudd_OutOfMem( long size size of the allocation that failed ) Warns that a memory allocation failed. This function can be used as replacement of MMout_of_memory to prevent the safe_mem functions of the util package from exiting when malloc returns NULL. One possible use is in case of discretionary allocations; for instance, the allocation of memory to enlarge the computed table. Side Effects: None DdNode * Cudd_OverApprox( DdManager * dd, manager DdNode * f, function to be superset int numVars, number of variables in the support of f int threshold, when to stop approximation int safe, enforce safe approximation double quality minimum improvement for accepted changes ) Extracts a dense superset from a BDD. The procedure is identical to the underapproximation procedure except for the fact that it works on the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. Returns a pointer to the BDD of the superset if successful. NULL if intermediate result causes the procedure to run out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more. Side Effects: None unsigned int Cudd_Prime( unsigned int p ) Returns the next prime >= p. Side Effects: None int Cudd_PrintDebug( DdManager * dd, DdNode * f, int n, int pr ) Prints to the standard output a DD and its statistics. The statistics include the number of nodes, the number of leaves, and the number of minterms. (The number of minterms is the number of assignments to the variables that cause the function to be different from the logical zero (for BDDs) and from the background value (for ADDs.) The statistics are printed if pr > 0. Specifically: pr = 0 : prints nothing pr = 1 : prints counts of nodes and minterms pr = 2 : prints counts + disjoint sum of product pr = 3 : prints counts + list of nodes pr > 3 : prints counts + disjoint sum of product + list of nodes For the purpose of counting the number of minterms, the function is supposed to depend on n variables. Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_PrintGroupedOrder( DdManager * dd, const char * str, void * data ) 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. Side Effects: None int Cudd_PrintInfo( DdManager * dd, FILE * fp ) Prints out statistics and settings for a CUDD manager. Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_PrintLinear( DdManager * table ) Prints the linear transform matrix. Returns 1 in case of success; 0 otherwise. Side Effects: none int Cudd_PrintMinterm( DdManager * manager, DdNode * node ) Prints a disjoint sum of product cover for the function rooted at node. Each product corresponds to a path from node to a leaf node different from the logical zero, and different from the background value. Uses the package default output file. Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_PrintTwoLiteralClauses( DdManager * dd, DdNode * f, char ** names, FILE * fp ) Prints the one- and two-literal clauses. Returns 1 if successful; 0 otherwise. The argument "names" can be NULL, in which case the variable indices are printed. Side Effects: None void Cudd_PrintVersion( FILE * fp ) Prints the package version number. Side Effects: None DdNode * Cudd_PrioritySelect( DdManager * dd, manager DdNode * R, BDD of the relation DdNode ** x, array of x variables DdNode ** y, array of y variables DdNode ** z, array of z variables (optional: may be NULL) DdNode * Pi, BDD of the priority function (optional: may be NULL) int n, size of x, y, and z DD_PRFP Pifunc function used to build Pi if it is NULL ) Selects pairs from a relation R(x,y) (given as a BDD) in such a way that a given x appears in one pair only. Uses a priority function to determine which y should be paired to a given x. Cudd_PrioritySelect returns a pointer to the selected function if successful; NULL otherwise. Three of the arguments--x, y, and z--are vectors of BDD variables. The first two are the variables on which R depends. The third vector is a vector of auxiliary variables, used during the computation. This vector is optional. If a NULL value is passed instead, Cudd_PrioritySelect will create the working variables on the fly. The sizes of x and y (and z if it is not NULL) should equal n. The priority function Pi can be passed as a BDD, or can be built by Cudd_PrioritySelect. If NULL is passed instead of a DdNode *, parameter Pifunc is used by Cudd_PrioritySelect to build a BDD for the priority function. (Pifunc is a pointer to a C function.) If Pi is not NULL, then Pifunc is ignored. Pifunc should have the same interface as the standard priority functions (e.g., Cudd_Dxygtdxz). Cudd_PrioritySelect and Cudd_CProjection can sometimes be used interchangeably. Specifically, calling Cudd_PrioritySelect with Cudd_Xgty as Pifunc produces the same result as calling Cudd_CProjection with the all-zero minterm as reference minterm. However, depending on the application, one or the other may be preferable: When extracting representatives from an equivalence relation, Cudd_CProjection has the advantage of nor requiring the auxiliary variables. When computing matchings in general bipartite graphs, Cudd_PrioritySelect normally obtains better results because it can use more powerful matching schemes (e.g., Cudd_Dxygtdxz). Side Effects: If called with z == NULL, will create new variables in the manager. void Cudd_Quit( DdManager * unique ) Deletes resources associated with a DD manager and resets the global statistical counters. (Otherwise, another manaqger subsequently created would inherit the stats of this one.) Side Effects: None long Cudd_Random( ) Portable number generator based on ran2 from "Numerical Recipes in C." It is a long period (> 2 * 10^18) random number generator of L'Ecuyer with Bays- Durham shuffle. Returns a long integer uniformly distributed between 0 and 2147483561 (inclusive of the endpoint values). The random generator can be explicitly initialized by calling Cudd_Srandom. If no explicit initialization is performed, then the seed 1 is assumed. Side Effects: None int Cudd_ReadArcviolation( DdManager * dd ) 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. Side Effects: None DdNode * Cudd_ReadBackground( DdManager * dd ) Reads the background constant of the manager. Side Effects: None double Cudd_ReadCacheHits( DdManager * dd ) Returns the number of cache hits. Side Effects: None double Cudd_ReadCacheLookUps( DdManager * dd ) Returns the number of cache look-ups. Side Effects: None unsigned int Cudd_ReadCacheSlots( DdManager * dd ) Reads the number of slots in the cache. Side Effects: None double Cudd_ReadCacheUsedSlots( DdManager * dd ) 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. Side Effects: None unsigned int Cudd_ReadDead( DdManager * dd ) Returns the number of dead nodes in the unique table. Side Effects: None unsigned long Cudd_ReadElapsedTime( DdManager * unique ) Returns the time elapsed since the start time of the manager. Side Effects: None CUDD_VALUE_TYPE Cudd_ReadEpsilon( DdManager * dd ) Reads the epsilon parameter of the manager. The epsilon parameter control the comparison between floating point numbers. Side Effects: None Cudd_ErrorType Cudd_ReadErrorCode( DdManager * dd ) Returns the code of the last error. The error codes are defined in cudd.h. Side Effects: None long Cudd_ReadGarbageCollectionTime( DdManager * dd ) Returns the number of milliseconds spent doing garbage collection since the manager was initialized. Side Effects: None int Cudd_ReadGarbageCollections( DdManager * dd ) 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. Side Effects: None Cudd_AggregationType Cudd_ReadGroupcheck( DdManager * dd ) Reads the groupcheck parameter of the manager. The groupcheck parameter determines the aggregation criterion in group sifting. Side Effects: None int Cudd_ReadInvPermZdd( DdManager * dd, int i ) 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. Side Effects: None int Cudd_ReadInvPerm( DdManager * dd, int i ) 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. Side Effects: None int Cudd_ReadIthClause( DdTlcInfo * tlc, int i, DdHalfWord * var1, DdHalfWord * var2, int * phase1, int * phase2 ) Accesses the i-th clause of a DD given the clause set which must be already computed. Returns 1 if successful; 0 if i is out of range, or in case of error. Side Effects: the four components of a clause are returned as side effects. unsigned int Cudd_ReadKeys( DdManager * dd ) Returns the total number of nodes currently in the unique table, including the dead nodes. Side Effects: None int Cudd_ReadLinear( DdManager * table, CUDD manager int x, row index int y column index ) Reads an entry of the linear transform matrix. Side Effects: none DdNode * Cudd_ReadLogicZero( DdManager * dd ) 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. Side Effects: None unsigned int Cudd_ReadLooseUpTo( DdManager * dd ) Reads the looseUpTo parameter of the manager. Side Effects: None unsigned int Cudd_ReadMaxCacheHard( DdManager * dd ) Reads the maxCacheHard parameter of the manager. Side Effects: None unsigned int Cudd_ReadMaxCache( DdManager * dd ) Returns the soft limit for the cache size. Side Effects: None double Cudd_ReadMaxGrowthAlternate( DdManager * dd ) 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. Side Effects: None double Cudd_ReadMaxGrowth( DdManager * dd ) 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. Side Effects: None unsigned int Cudd_ReadMaxLive( DdManager * dd ) Reads the maximum allowed number of live nodes. When this number is exceeded, the package returns NULL. Side Effects: none unsigned long Cudd_ReadMaxMemory( DdManager * dd ) Reads the maximum allowed memory. When this number is exceeded, the package returns NULL. Side Effects: none unsigned int Cudd_ReadMaxReorderings( DdManager * dd ) Returns the maximum number of times reordering may be invoked in this manager. Side Effects: None unsigned long Cudd_ReadMemoryInUse( DdManager * dd ) Returns the memory in use by the manager measured in bytes. Side Effects: None unsigned int Cudd_ReadMinDead( DdManager * dd ) 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. Side Effects: None unsigned int Cudd_ReadMinHit( DdManager * dd ) Reads the hit rate that causes resizinig of the computed table. Side Effects: None DdNode * Cudd_ReadMinusInfinity( DdManager * dd ) Reads the minus-infinity constant from the manager. Side Effects: None unsigned int Cudd_ReadNextReordering( DdManager * dd ) 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. Side Effects: None long Cudd_ReadNodeCount( DdManager * dd ) 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. Side Effects: None double Cudd_ReadNodesDropped( DdManager * dd ) 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. Side Effects: None double Cudd_ReadNodesFreed( DdManager * dd ) 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. Side Effects: None int Cudd_ReadNumberXovers( DdManager * dd ) 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. Side Effects: None DdNode * Cudd_ReadOne( DdManager * dd ) Returns the one constant of the manager. The one constant is common to ADDs and BDDs. Side Effects: None unsigned int Cudd_ReadOrderRandomization( DdManager * dd ) 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. Side Effects: None int Cudd_ReadPeakLiveNodeCount( DdManager * dd ) Reports the peak number of live nodes. Side Effects: None long Cudd_ReadPeakNodeCount( DdManager * dd ) 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. Side Effects: None int Cudd_ReadPermZdd( DdManager * dd, int i ) 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. Side Effects: None int Cudd_ReadPerm( DdManager * dd, int i ) 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. Side Effects: None DdNode * Cudd_ReadPlusInfinity( DdManager * dd ) Reads the plus-infinity constant from the manager. Side Effects: None int Cudd_ReadPopulationSize( DdManager * dd ) 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. Side Effects: None int Cudd_ReadRecomb( DdManager * dd ) 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. Side Effects: None double Cudd_ReadRecursiveCalls( DdManager * dd ) Returns the number of recursive calls if the package is compiled with DD_COUNT defined. Side Effects: None int Cudd_ReadReorderingCycle( DdManager * dd ) Reads the reordCycle parameter of the manager. This parameter determines how often the alternate threshold on maximum growth is used in reordering. Side Effects: None long Cudd_ReadReorderingTime( DdManager * dd ) Returns the number of milliseconds spent reordering variables since the manager was initialized. The time spent in collecting garbage before reordering is included. Side Effects: None unsigned int Cudd_ReadReorderings( DdManager * dd ) 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. Side Effects: None int Cudd_ReadSiftMaxSwap( DdManager * dd ) 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. Side Effects: None int Cudd_ReadSiftMaxVar( DdManager * dd ) Reads the siftMaxVar parameter of the manager. This parameter gives the maximum number of variables that will be sifted for each invocation of sifting. Side Effects: None int Cudd_ReadSize( DdManager * dd ) Returns the number of BDD variables in existance. Side Effects: None unsigned int Cudd_ReadSlots( DdManager * dd ) Returns the total number of slots of the unique table. This number ismainly for diagnostic purposes. Side Effects: None unsigned long Cudd_ReadStartTime( DdManager * unique ) 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. Side Effects: None FILE * Cudd_ReadStderr( DdManager * dd ) 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. Side Effects: None FILE * Cudd_ReadStdout( DdManager * dd ) 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. Side Effects: None double Cudd_ReadSwapSteps( DdManager * dd ) Reads the number of elementary reordering steps. Side Effects: none int Cudd_ReadSymmviolation( DdManager * dd ) 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. Side Effects: None unsigned long Cudd_ReadTimeLimit( DdManager * unique ) Returns the time limit for the manager. This is initially set to a very large number, but may be reset by the application. Side Effects: None MtrNode * Cudd_ReadTree( DdManager * dd ) Returns the variable group tree of the manager. Side Effects: None double Cudd_ReadUniqueLinks( DdManager * dd ) 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. Side Effects: None double Cudd_ReadUniqueLookUps( DdManager * dd ) 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. Side Effects: None double Cudd_ReadUsedSlots( DdManager * dd ) 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. Side Effects: None DdNode * Cudd_ReadVars( DdManager * dd, int i ) 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. Side Effects: None DdNode * Cudd_ReadZddOne( DdManager * dd, int i ) 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. Side Effects: None int Cudd_ReadZddSize( DdManager * dd ) Returns the number of ZDD variables in existance. Side Effects: None MtrNode * Cudd_ReadZddTree( DdManager * dd ) Returns the variable group tree of the manager. Side Effects: None DdNode * Cudd_ReadZero( DdManager * dd ) 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. Side Effects: None void Cudd_RecursiveDerefZdd( DdManager * table, DdNode * n ) Decreases the reference count of ZDD node n. If n dies, recursively decreases the reference counts of its children. It is used to dispose of a ZDD that is no longer needed. Side Effects: None void Cudd_RecursiveDeref( DdManager * table, DdNode * n ) Decreases the reference count of node n. If n dies, recursively decreases the reference counts of its children. It is used to dispose of a DD that is no longer needed. Side Effects: None int Cudd_ReduceHeap( DdManager * table, DD manager Cudd_ReorderingTy heuristic, method used for reordering int minsize bound below which no reordering occurs ) Main dynamic reordering routine. Calls one of the possible reordering procedures: Swapping Sifting Symmetric Sifting Group Sifting Window Permutation Simulated Annealing Genetic Algorithm Dynamic Programming (exact) For sifting, symmetric sifting, group sifting, and window permutation it is possible to request reordering to convergence. The core of all methods is the reordering procedure cuddSwapInPlace() which swaps two adjacent variables and is based on Rudell's paper. Returns 1 in case of success; 0 otherwise. In the case of symmetric sifting (with and without convergence) returns 1 plus the number of symmetric variables, in case of success. Side Effects: Changes the variable order for all diagrams and clears the cache. void Cudd_Ref( DdNode * n ) Increases the reference count of a node, if it is not saturated. Side Effects: None DdNode * Cudd_RemapOverApprox( DdManager * dd, manager DdNode * f, function to be superset int numVars, number of variables in the support of f int threshold, when to stop approximation double quality minimum improvement for accepted changes ) Extracts a dense superset from a BDD. The procedure is identical to the underapproximation procedure except for the fact that it works on the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. Returns a pointer to the BDD of the superset if successful. NULL if intermediate result causes the procedure to run out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more. Side Effects: None DdNode * Cudd_RemapUnderApprox( DdManager * dd, manager DdNode * f, function to be subset int numVars, number of variables in the support of f int threshold, when to stop approximation double quality minimum improvement for accepted changes ) Extracts a dense subset from a BDD. This procedure uses a remapping technique and density as the cost function. Returns a pointer to the BDD of the subset if successful. NULL if the procedure runs out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will cause overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more. Side Effects: None int Cudd_RemoveHook( DdManager * dd, DD_HFP f, Cudd_HookType where ) 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. Side Effects: None int Cudd_ReorderingReporting( DdManager * dd ) Returns 1 if reporting of reordering stats is enabled; 0 otherwise. Side Effects: none int Cudd_ReorderingStatusZdd( DdManager * unique, Cudd_ReorderingTy method ) 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. Side Effects: Parameter method is set to the ZDD reordering method currently selected. int Cudd_ReorderingStatus( DdManager * unique, Cudd_ReorderingTy method ) 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. Side Effects: Parameter method is set to the reordering method currently selected. int Cudd_Reserve( DdManager * manager, int amount ) Expand a manager by a specified number of subtables without actually creating new variables. This function can be used to reduce the frequency of resizing when an estimate of the number of variables is available. One would call this function instead of passing the number of variables to Cudd_Init if variables should not be created right away of if the estimate on their number became available only after the manager has been created. Returns 1 if successful; 0 otherwise. Side Effects: None void Cudd_ResetStartTime( DdManager * unique ) Resets the start time of the manager. Side Effects: None void Cudd_SetArcviolation( DdManager * dd, int arcviolation ) 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. Side Effects: None void Cudd_SetBackground( DdManager * dd, DdNode * bck ) Sets the background constant of the manager. It assumes that the DdNode pointer bck is already referenced. Side Effects: None void Cudd_SetEpsilon( DdManager * dd, CUDD_VALUE_TYPE ep ) Sets the epsilon parameter of the manager to ep. The epsilon parameter control the comparison between floating point numbers. Side Effects: None void Cudd_SetGroupcheck( DdManager * dd, Cudd_AggregationT gc ) Sets the parameter groupcheck of the manager to gc. The groupcheck parameter determines the aggregation criterion in group sifting. Side Effects: None void Cudd_SetLooseUpTo( DdManager * dd, unsigned int lut ) 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. Side Effects: None void Cudd_SetMaxCacheHard( DdManager * dd, unsigned int mc ) 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. Side Effects: None void Cudd_SetMaxGrowthAlternate( DdManager * dd, double mg ) 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. Side Effects: None void Cudd_SetMaxGrowth( DdManager * dd, double mg ) 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. Side Effects: None void Cudd_SetMaxLive( DdManager * dd, unsigned int maxLive ) Sets the maximum allowed number of live nodes. When this number is exceeded, the package returns NULL. Side Effects: none void Cudd_SetMaxMemory( DdManager * dd, unsigned long maxMemory ) Sets the maximum allowed memory. When this number is exceeded, the package returns NULL. Side Effects: none void Cudd_SetMaxReorderings( DdManager * dd, unsigned int mr ) Sets the maximum number of times reordering may be invoked in this manager. The default value is (practically) infinite. Side Effects: None void Cudd_SetMinHit( DdManager * dd, unsigned int hr ) 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. Side Effects: None void Cudd_SetNextReordering( DdManager * dd, unsigned int next ) 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. Side Effects: None void Cudd_SetNumberXovers( DdManager * dd, int numberXovers ) 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. Side Effects: None void Cudd_SetOrderRandomization( DdManager * dd, unsigned int factor ) Sets the order randomization factor. Side Effects: None void Cudd_SetPopulationSize( DdManager * dd, int populationSize ) 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. Side Effects: Changes the manager. void Cudd_SetRecomb( DdManager * dd, int recomb ) 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. Side Effects: Changes the manager. void Cudd_SetReorderingCycle( DdManager * dd, int cycle ) Sets the reordCycle parameter of the manager. This parameter determines how often the alternate threshold on maximum growth is used in reordering. Side Effects: None void Cudd_SetSiftMaxSwap( DdManager * dd, int sms ) 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. Side Effects: None void Cudd_SetSiftMaxVar( DdManager * dd, int smv ) Sets the siftMaxVar parameter of the manager. This parameter gives the maximum number of variables that will be sifted for each invocation of sifting. Side Effects: None void Cudd_SetStartTime( DdManager * unique, unsigned long st ) Sets the start time of the manager. Side Effects: None void Cudd_SetStderr( DdManager * dd, FILE * fp ) Sets the stderr of a manager. Side Effects: None void Cudd_SetStdout( DdManager * dd, FILE * fp ) Sets the stdout of a manager. Side Effects: None void Cudd_SetSymmviolation( DdManager * dd, int symmviolation ) 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. Side Effects: Changes the manager. void Cudd_SetTimeLimit( DdManager * unique, unsigned long tl ) Sets the time limit for the manager. Side Effects: None void Cudd_SetTree( DdManager * dd, MtrNode * tree ) Sets the variable group tree of the manager. Side Effects: None int Cudd_SetVarMap( DdManager * manager, DD manager DdNode ** x, first array of variables DdNode ** y, second array of variables int n length of both arrays ) Registers with the manager a variable mapping described by two sets of variables. This variable mapping is then used by functions like Cudd_bddVarMap. This function is convenient for those applications that perform the same mapping several times. However, if several different permutations are used, it may be more efficient not to rely on the registered mapping, because changing mapping causes the cache to be cleared. (The initial setting, however, does not clear the cache.) The two sets of variables (x and y) must have the same size (x and y). The size is given by n. The two sets of variables are normally disjoint, but this restriction is not imposeded by the function. When new variables are created, the map is automatically extended (each new variable maps to itself). The typical use, however, is to wait until all variables are created, and then create the map. Returns 1 if the mapping is successfully registered with the manager; 0 otherwise. Side Effects: Modifies the manager. May clear the cache. void Cudd_SetZddTree( DdManager * dd, MtrNode * tree ) Sets the ZDD variable group tree of the manager. Side Effects: None int Cudd_SharingSize( DdNode ** nodeArray, int n ) Counts the number of nodes in an array of DDs. Shared nodes are counted only once. Returns the total number of nodes. Side Effects: None int Cudd_ShortestLength( DdManager * manager, DdNode * f, int * weight ) Find the length of the shortest path(s) in a DD. f is the DD we want to get the shortest path for; weight[i] is the weight of the THEN edge coming from the node whose index is i. All ELSE edges have 0 weight. Returns the length of the shortest path(s) if such a path is found; a large number if the function is identically 0, and CUDD_OUT_OF_MEM in case of failure. Side Effects: None DdNode * Cudd_ShortestPath( DdManager * manager, DdNode * f, int * weight, int * support, int * length ) Finds a shortest path in a DD. f is the DD we want to get the shortest path for; weight[i] is the weight of the THEN arc coming from the node whose index is i. If weight is NULL, then unit weights are assumed for all THEN arcs. All ELSE arcs have 0 weight. If non-NULL, both weight and support should point to arrays with at least as many entries as there are variables in the manager. Returns the shortest path as the BDD of a cube. Side Effects: support contains on return the true support of f. If support is NULL on entry, then Cudd_ShortestPath does not compute the true support info. length contains the length of the path. int Cudd_ShuffleHeap( DdManager * table, DD manager int * permutation required variable permutation ) Reorders variables according to given permutation. The i-th entry of the permutation array contains the index of the variable that should be brought to the i-th level. The size of the array should be equal or greater to the number of variables currently in use. Returns 1 in case of success; 0 otherwise. Side Effects: Changes the variable order for all diagrams and clears the cache. DdNode * Cudd_SolveEqn( DdManager * bdd, DdNode * F, the left-hand side of the equation DdNode * Y, the cube of the y variables DdNode ** G, the array of solutions (return parameter) int ** yIndex, index of y variables int n numbers of unknowns ) Implements the solution for F(x,y) = 0. The return value is the consistency condition. The y variables are the unknowns and the remaining variables are the parameters. Returns the consistency condition if successful; NULL otherwise. Cudd_SolveEqn allocates an array and fills it with the indices of the unknowns. This array is used by Cudd_VerifySol. Side Effects: The solution is returned in G; the indices of the y variables are returned in yIndex. DdNode * Cudd_SplitSet( DdManager * manager, DdNode * S, DdNode ** xVars, int n, double m ) Returns m minterms from a BDD whose support has n variables at most. The procedure tries to create as few extra nodes as possible. The function represented by S depends on at most n of the variables in xVars. Returns a BDD with m minterms of the on-set of S if successful; NULL otherwise. Side Effects: None void Cudd_Srandom( long seed ) Initializer for the portable number generator based on ran2 in "Numerical Recipes in C." The input is the seed for the generator. If it is negative, its absolute value is taken as seed. If it is 0, then 1 is taken as seed. The initialized sets up the two recurrences used to generate a long-period stream, and sets up the shuffle table. Side Effects: None int Cudd_StdPostReordHook( DdManager * dd, const char * str, void * data ) Sample hook function to call after reordering. Prints on the manager's stdout final size and reordering time. Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_StdPreReordHook( DdManager * dd, const char * str, void * data ) Sample hook function to call before reordering. Prints on the manager's stdout reordering method and initial size. Returns 1 if successful; 0 otherwise. Side Effects: None DdNode * Cudd_SubsetCompress( DdManager * dd, manager DdNode * f, BDD whose subset is sought int nvars, number of variables in the support of f int threshold maximum number of nodes in the subset ) Finds a dense subset of BDD f. Density is the ratio of number of minterms to number of nodes. Uses several techniques in series. It is more expensive than other subsetting procedures, but often produces better results. See Cudd_SubsetShortPaths for a description of the threshold and nvars parameters. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_SubsetHeavyBranch( DdManager * dd, manager DdNode * f, function to be subset int numVars, number of variables in the support of f int threshold maximum number of nodes in the subset ) Extracts a dense subset from a BDD. This procedure builds a subset by throwing away one of the children of each node, starting from the root, until the result is small enough. The child that is eliminated from the result is the one that contributes the fewer minterms. Returns a pointer to the BDD of the subset if successful. NULL if the procedure runs out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation and node count calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more. Side Effects: None DdNode * Cudd_SubsetShortPaths( DdManager * dd, manager DdNode * f, function to be subset int numVars, number of variables in the support of f int threshold, maximum number of nodes in the subset int hardlimit flag: 1 if threshold is a hard limit ) Extracts a dense subset from a BDD. This procedure tries to preserve the shortest paths of the input BDD, because they give many minterms and contribute few nodes. This procedure may increase the number of nodes in trying to create the subset or reduce the number of nodes due to recombination as compared to the original BDD. Hence the threshold may not be strictly adhered to. In practice, recombination overshadows the increase in the number of nodes and results in small BDDs as compared to the threshold. The hardlimit specifies whether threshold needs to be strictly adhered to. If it is set to 1, the procedure ensures that result is never larger than the specified limit but may be considerably less than the threshold. Returns a pointer to the BDD for the subset if successful; NULL otherwise. The value for numVars should be as close as possible to the size of the support of f for better efficiency. However, it is safe to pass the value returned by Cudd_ReadSize for numVars. If 0 is passed, then the value returned by Cudd_ReadSize is used. Side Effects: None DdNode * Cudd_SubsetWithMaskVars( DdManager * dd, manager DdNode * f, function from which to pick a cube DdNode ** vars, array of variables int nvars, size of vars DdNode ** maskVars, array of variables int mvars size of maskVars ) Extracts a subset from a BDD in the following procedure. 1. Compute the weight for each mask variable by counting the number of minterms for both positive and negative cofactors of the BDD with respect to each mask variable. (weight = #positive - #negative) 2. Find a representative cube of the BDD by using the weight. From the top variable of the BDD, for each variable, if the weight is greater than 0.0, choose THEN branch, othereise ELSE branch, until meeting the constant 1. 3. Quantify out the variables not in maskVars from the representative cube and if a variable in maskVars is don't care, replace the variable with a constant(1 or 0) depending on the weight. 4. Make a subset of the BDD by multiplying with the modified cube. Side Effects: None DdNode * Cudd_SupersetCompress( DdManager * dd, manager DdNode * f, BDD whose superset is sought int nvars, number of variables in the support of f int threshold maximum number of nodes in the superset ) Finds a dense superset of BDD f. Density is the ratio of number of minterms to number of nodes. Uses several techniques in series. It is more expensive than other supersetting procedures, but often produces better results. See Cudd_SupersetShortPaths for a description of the threshold and nvars parameters. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_SupersetHeavyBranch( DdManager * dd, manager DdNode * f, function to be superset int numVars, number of variables in the support of f int threshold maximum number of nodes in the superset ) Extracts a dense superset from a BDD. The procedure is identical to the subset procedure except for the fact that it receives the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. This procedure builds a superset by throwing away one of the children of each node starting from the root of the complement function, until the result is small enough. The child that is eliminated from the result is the one that contributes the fewer minterms. Returns a pointer to the BDD of the superset if successful. NULL if intermediate result causes the procedure to run out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation and node count calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more. Side Effects: None DdNode * Cudd_SupersetShortPaths( DdManager * dd, manager DdNode * f, function to be superset int numVars, number of variables in the support of f int threshold, maximum number of nodes in the subset int hardlimit flag: 1 if threshold is a hard limit ) Extracts a dense superset from a BDD. The procedure is identical to the subset procedure except for the fact that it receives the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. This procedure tries to preserve the shortest paths of the complement BDD, because they give many minterms and contribute few nodes. This procedure may increase the number of nodes in trying to create the superset or reduce the number of nodes due to recombination as compared to the original BDD. Hence the threshold may not be strictly adhered to. In practice, recombination overshadows the increase in the number of nodes and results in small BDDs as compared to the threshold. The hardlimit specifies whether threshold needs to be strictly adhered to. If it is set to 1, the procedure ensures that result is never larger than the specified limit but may be considerably less than the threshold. Returns a pointer to the BDD for the superset if successful; NULL otherwise. The value for numVars should be as close as possible to the size of the support of f for better efficiency. However, it is safe to pass the value returned by Cudd_ReadSize for numVar. If 0 is passed, then the value returned by Cudd_ReadSize is used. Side Effects: None int * Cudd_SupportIndex( DdManager * dd, manager DdNode * f DD whose support is sought ) Finds the variables on which a DD depends. Returns an index array of the variables if successful; NULL otherwise. The size of the array equals the number of variables in the manager. Each entry of the array is 1 if the corresponding variable is in the support of the DD and 0 otherwise. Side Effects: None int Cudd_SupportIndices( DdManager * dd, manager DdNode * f, DD whose support is sought int ** indices array containing (on return) the indices ) Finds the variables on which a DD depends. Returns the number of variables if successful; CUDD_OUT_OF_MEM otherwise. Side Effects: The indices of the support variables are returned as side effects. If the function is constant, no array is allocated. int Cudd_SupportSize( DdManager * dd, manager DdNode * f DD whose support size is sought ) Returns the variables on which a DD depends. Side Effects: None DdNode * Cudd_Support( DdManager * dd, manager DdNode * f DD whose support is sought ) Finds the variables on which a DD depends. Returns a BDD consisting of the product of the variables if successful; NULL otherwise. Side Effects: None void Cudd_SymmProfile( DdManager * table, int lower, int upper ) Prints statistics on symmetric variables. Side Effects: None int Cudd_TimeLimited( DdManager * unique ) Returns true if the time limit for the manager is set. Side Effects: None void Cudd_TurnOffCountDead( DdManager * dd ) 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. Side Effects: Changes the manager. void Cudd_TurnOnCountDead( DdManager * dd ) Causes the dead nodes to be counted towards triggering reordering. This causes more frequent reorderings. By default dead nodes are not counted. Side Effects: Changes the manager. DdNode * Cudd_UnderApprox( DdManager * dd, manager DdNode * f, function to be subset int numVars, number of variables in the support of f int threshold, when to stop approximation int safe, enforce safe approximation double quality minimum improvement for accepted changes ) Extracts a dense subset from a BDD. This procedure uses a variant of Tom Shiple's underapproximation method. The main difference from the original method is that density is used as cost function. Returns a pointer to the BDD of the subset if successful. NULL if the procedure runs out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will cause overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more. Side Effects: None void Cudd_UnsetTimeLimit( DdManager * unique ) Unsets the time limit for the manager. Actually, sets it to a very large value. Side Effects: None void Cudd_UpdateTimeLimit( DdManager * unique ) Updates the time limit for the manager by subtracting the elapsed time from it. Side Effects: None int * Cudd_VectorSupportIndex( DdManager * dd, manager DdNode ** F, array of DDs whose support is sought int n size of the array ) Finds the variables on which a set of DDs depends. The set must contain either BDDs and ADDs, or ZDDs. Returns an index array of the variables if successful; NULL otherwise. Side Effects: None int Cudd_VectorSupportIndices( DdManager * dd, manager DdNode ** F, DD whose support is sought int n, size of the array int ** indices array containing (on return) the indices ) Finds the variables on which a set of DDs depends. The set must contain either BDDs and ADDs, or ZDDs. Returns the number of variables if successful; CUDD_OUT_OF_MEM otherwise. Side Effects: The indices of the support variables are returned as side effects. If the function is constant, no array is allocated. int Cudd_VectorSupportSize( DdManager * dd, manager DdNode ** F, array of DDs whose support is sought int n size of the array ) Returns the variables on which a set of DDs depends. The set must contain either BDDs and ADDs, or ZDDs. Side Effects: None DdNode * Cudd_VectorSupport( DdManager * dd, manager DdNode ** F, array of DDs whose support is sought int n size of the array ) Finds the variables on which a set of DDs depends. The set must contain either BDDs and ADDs, or ZDDs. Returns a BDD consisting of the product of the variables if successful; NULL otherwise. Side Effects: None DdNode * Cudd_VerifySol( DdManager * bdd, DdNode * F, the left-hand side of the equation DdNode ** G, the array of solutions int * yIndex, index of y variables int n numbers of unknowns ) Checks the solution of F(x,y) = 0. This procedure substitutes the solution components for the unknowns of F and returns the resulting BDD for F. Side Effects: Frees the memory pointed by yIndex. DdNode * Cudd_Xeqy( DdManager * dd, DD manager int N, number of x and y variables DdNode ** x, array of x variables DdNode ** y array of y variables ) This function generates a BDD for the function x==y. Both x and y are N-bit numbers, x[0] x[1] ... x[N-1] and y[0] y[1] ... y[N-1], with 0 the most significant bit. The BDD is built bottom-up. It has 3*N-1 internal nodes, if the variables are ordered as follows: x[0] y[0] x[1] y[1] ... x[N-1] y[N-1]. Side Effects: None DdNode * Cudd_Xgty( DdManager * dd, DD manager int N, number of x and y variables DdNode ** z, array of z variables: unused DdNode ** x, array of x variables DdNode ** y array of y variables ) This function generates a BDD for the function x > y. Both x and y are N- bit numbers, x[0] x[1] ... x[N-1] and y[0] y[1] ... y[N-1], with 0 the most significant bit. The BDD is built bottom-up. It has 3*N-1 internal nodes, if the variables are ordered as follows: x[0] y[0] x[1] y[1] ... x[N-1] y[N-1]. Argument z is not used by Cudd_Xgty: it is included to make it call- compatible to Cudd_Dxygtdxz and Cudd_Dxygtdyz. Side Effects: None DdNode * Cudd_addAgreement( DdManager * dd, DdNode ** f, DdNode ** g ) Returns NULL if not a terminal case; f op g otherwise, where f op g is f if f==g; background if f!=g. Side Effects: None DdNode * Cudd_addApply( DdManager * dd, DD_AOP op, DdNode * f, DdNode * g ) Applies op to the corresponding discriminants of f and g. Returns a pointer to the result if succssful; NULL otherwise. Side Effects: None DdNode * Cudd_addBddInterval( DdManager * dd, DdNode * f, CUDD_VALUE_TYPE lower, CUDD_VALUE_TYPE upper ) Converts an ADD to a BDD by replacing all discriminants greater than or equal to lower and less than or equal to upper with 1, and all other discriminants with 0. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addBddIthBit( DdManager * dd, DdNode * f, int bit ) Converts an ADD to a BDD by replacing all discriminants whose i-th bit is equal to 1 with 1, and all other discriminants with 0. The i-th bit refers to the integer representation of the leaf value. If the value is has a fractional part, it is ignored. Repeated calls to this procedure allow one to transform an integer-valued ADD into an array of BDDs, one for each bit of the leaf values. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addBddPattern( DdManager * dd, DdNode * f ) Converts an ADD to a BDD by replacing all discriminants different from 0 with 1. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addBddStrictThreshold( DdManager * dd, DdNode * f, CUDD_VALUE_TYPE value ) Converts an ADD to a BDD by replacing all discriminants STRICTLY greater than value with 1, and all other discriminants with 0. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addBddThreshold( DdManager * dd, DdNode * f, CUDD_VALUE_TYPE value ) Converts an ADD to a BDD by replacing all discriminants greater than or equal to value with 1, and all other discriminants with 0. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addCmpl( DdManager * dd, DdNode * f ) Computes the complement of an ADD a la C language: The complement of 0 is 1 and the complement of everything else is 0. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addCompose( DdManager * dd, DdNode * f, DdNode * g, int v ) Substitutes g for x_v in the ADD for f. v is the index of the variable to be substituted. g must be a 0-1 ADD. Cudd_bddCompose passes the corresponding projection function to the recursive procedure, so that the cache may be used. Returns the composed ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addComputeCube( DdManager * dd, DdNode ** vars, int * phase, int n ) Computes the cube of an array of ADD variables. If non-null, the phase argument indicates which literal of each variable should appear in the cube. If phase[i] is nonzero, then the positive literal is used. If phase is NULL, the cube is positive unate. Returns a pointer to the result if successful; NULL otherwise. Side Effects: none DdNode * Cudd_addConstrain( DdManager * dd, DdNode * f, DdNode * c ) Computes f constrain c (f @ c), for f an ADD and c a 0-1 ADD. List of special cases: F @ 0 = 0 F @ 1 = F 0 @ c = 0 1 @ c = 1 F @ F = 1 Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addConst( DdManager * dd, CUDD_VALUE_TYPE c ) 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. Side Effects: None DdNode * Cudd_addDiff( DdManager * dd, DdNode ** f, DdNode ** g ) Returns NULL if not a terminal case; f op g otherwise, where f op g is plusinfinity if f=g; min(f,g) if f!=g. Side Effects: None DdNode * Cudd_addDivide( DdManager * dd, DdNode ** f, DdNode ** g ) Integer and floating point division. Returns NULL if not a terminal case; f / g otherwise. Side Effects: None DdNode * Cudd_addEvalConst( DdManager * dd, DdNode * f, DdNode * g ) Checks whether ADD g is constant whenever ADD f is 1. f must be a 0-1 ADD. Returns a pointer to the resulting ADD (which may or may not be constant) or DD_NON_CONSTANT. If f is identically 0, the check is assumed to be successful, and the background value is returned. No new nodes are created. Side Effects: None DdNode * Cudd_addExistAbstract( DdManager * manager, DdNode * f, DdNode * cube ) Abstracts all the variables in cube from f by summing over all possible values taken by the variables. Returns the abstracted ADD. Side Effects: None DdNode * Cudd_addFindMax( DdManager * dd, DdNode * f ) Returns a pointer to a constant ADD. Side Effects: None DdNode * Cudd_addFindMin( DdManager * dd, DdNode * f ) Returns a pointer to a constant ADD. Side Effects: None DdNode * Cudd_addGeneralVectorCompose( DdManager * dd, DdNode * f, DdNode ** vectorOn, DdNode ** vectorOff ) Given a vector of ADDs, creates a new ADD by substituting the ADDs for the variables of the ADD f. vectorOn contains ADDs to be substituted for the x_v and vectorOff the ADDs to be substituted for x_v'. There should be an entry in vector for each variable in the manager. If no substitution is sought for a given variable, the corresponding projection function should be specified in the vector. This function implements simultaneous composition. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addHamming( DdManager * dd, DdNode ** xVars, DdNode ** yVars, int nVars ) Computes the Hamming distance ADD. Returns an ADD that gives the Hamming distance between its two arguments if successful; NULL otherwise. The two vectors xVars and yVars identify the variables that form the two arguments. Side Effects: None int Cudd_addHarwell( FILE * fp, pointer to the input file DdManager * dd, DD manager DdNode ** E, characteristic function of the graph DdNode *** x, array of row variables DdNode *** y, array of column variables DdNode *** xn, array of complemented row variables DdNode *** yn_, array of complemented column variables int * nx, number or row variables int * ny, number or column variables int * m, number of rows int * n, number of columns int bx, first index of row variables int sx, step of row variables int by, first index of column variables int sy, step of column variables int pr verbosity level ) Reads in a matrix in the format of the Harwell-Boeing benchmark suite. The variables are ordered as follows: x[0] y[0] x[1] y[1] ... 0 is the most significant bit. On input, nx and ny hold the numbers of row and column variables already in existence. On output, they hold the numbers of row and column variables actually used by the matrix. m and n are set to the numbers of rows and columns of the matrix. Their values on input are immaterial. Returns 1 on success; 0 otherwise. The ADD for the sparse matrix is returned in E, and its reference count is > 0. Side Effects: None DdNode * Cudd_addIteConstant( DdManager * dd, DdNode * f, DdNode * g, DdNode * h ) Implements ITEconstant for ADDs. f must be a 0-1 ADD. Returns a pointer to the resulting ADD (which may or may not be constant) or DD_NON_CONSTANT. No new nodes are created. This function can be used, for instance, to check that g has a constant value (specified by h) whenever f is 1. If the constant value is unknown, then one should use Cudd_addEvalConst. Side Effects: None DdNode * Cudd_addIte( DdManager * dd, DdNode * f, DdNode * g, DdNode * h ) Implements ITE(f,g,h). This procedure assumes that f is a 0-1 ADD. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addIthBit( DdManager * dd, DdNode * f, int bit ) Produces an ADD from another ADD by replacing all discriminants whose i-th bit is equal to 1 with 1, and all other discriminants with 0. The i-th bit refers to the integer representation of the leaf value. If the value is has a fractional part, it is ignored. Repeated calls to this procedure allow one to transform an integer-valued ADD into an array of ADDs, one for each bit of the leaf values. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addIthVar( DdManager * dd, int i ) 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. Side Effects: None int Cudd_addLeq( DdManager * dd, DdNode * f, DdNode * g ) Returns 1 if f is less than or equal to g; 0 otherwise. No new nodes are created. This procedure works for arbitrary ADDs. For 0-1 ADDs Cudd_addEvalConst is more efficient. Side Effects: None DdNode * Cudd_addLog( DdManager * dd, DdNode * f ) Natural logarithm of an ADDs. Returns NULL if not a terminal case; log(f) otherwise. The discriminants of f must be positive double's. Side Effects: None DdNode * Cudd_addMatrixMultiply( DdManager * dd, DdNode * A, DdNode * B, DdNode ** z, int nz ) Calculates the product of two matrices, A and B, represented as ADDs. This procedure implements the quasiring multiplication algorithm. A is assumed to depend on variables x (rows) and z (columns). B is assumed to depend on variables z (rows) and y (columns). The product of A and B then depends on x (rows) and y (columns). Only the z variables have to be explicitly identified; they are the "summation" variables. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addMaximum( DdManager * dd, DdNode ** f, DdNode ** g ) Integer and floating point max for Cudd_addApply. Returns NULL if not a terminal case; max(f,g) otherwise. Side Effects: None DdNode * Cudd_addMinimum( DdManager * dd, DdNode ** f, DdNode ** g ) Integer and floating point min for Cudd_addApply. Returns NULL if not a terminal case; min(f,g) otherwise. Side Effects: None DdNode * Cudd_addMinus( DdManager * dd, DdNode ** f, DdNode ** g ) Integer and floating point subtraction. Returns NULL if not a terminal case; f - g otherwise. Side Effects: None DdNode * Cudd_addMonadicApply( DdManager * dd, DD_MAOP op, DdNode * f ) Applies op to the discriminants of f. Returns a pointer to the result if succssful; NULL otherwise. Side Effects: None DdNode * Cudd_addNand( DdManager * dd, DdNode ** f, DdNode ** g ) NAND of two 0-1 ADDs. Returns NULL if not a terminal case; f NAND g otherwise. Side Effects: None DdNode * Cudd_addNegate( DdManager * dd, DdNode * f ) Computes the additive inverse of an ADD. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addNewVarAtLevel( DdManager * dd, int level ) 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. Side Effects: None DdNode * Cudd_addNewVar( DdManager * dd ) 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. Side Effects: None DdNode * Cudd_addNonSimCompose( DdManager * dd, DdNode * f, DdNode ** vector ) Given a vector of 0-1 ADDs, creates a new ADD by substituting the 0-1 ADDs for the variables of the ADD f. There should be an entry in vector for each variable in the manager. This function implements non-simultaneous composition. If any of the functions being composed depends on any of the variables being substituted, then the result depends on the order of composition, which in turn depends on the variable order: The variables farther from the roots in the order are substituted first. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addNor( DdManager * dd, DdNode ** f, DdNode ** g ) NOR of two 0-1 ADDs. Returns NULL if not a terminal case; f NOR g otherwise. Side Effects: None DdNode * Cudd_addOneZeroMaximum( DdManager * dd, DdNode ** f, DdNode ** g ) Returns 1 if f > g and 0 otherwise. Used in conjunction with Cudd_addApply. Returns NULL if not a terminal case. Side Effects: None DdNode * Cudd_addOrAbstract( DdManager * manager, DdNode * f, DdNode * cube ) Abstracts all the variables in cube from the 0-1 ADD f by taking the disjunction over all possible values taken by the variables. Returns the abstracted ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addOr( DdManager * dd, DdNode ** f, DdNode ** g ) Disjunction of two 0-1 ADDs. Returns NULL if not a terminal case; f OR g otherwise. Side Effects: None DdNode * Cudd_addOuterSum( DdManager * dd, DdNode * M, DdNode * r, DdNode * c ) Takes the pointwise minimum of a matrix and the outer sum of two vectors. This procedure is used in the Floyd-Warshall all-pair shortest path algorithm. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addPermute( DdManager * manager, DdNode * node, int * permut ) Given a permutation in array permut, creates a new ADD with permuted variables. There should be an entry in array permut for each variable in the manager. The i-th entry of permut holds the index of the variable that is to substitute the i-th variable. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addPlus( DdManager * dd, DdNode ** f, DdNode ** g ) Integer and floating point addition. Returns NULL if not a terminal case; f+g otherwise. Side Effects: None int Cudd_addRead( FILE * fp, input file pointer DdManager * dd, DD manager DdNode ** E, characteristic function of the graph DdNode *** x, array of row variables DdNode *** y, array of column variables DdNode *** xn, array of complemented row variables DdNode *** yn_, array of complemented column variables int * nx, number or row variables int * ny, number or column variables int * m, number of rows int * n, number of columns int bx, first index of row variables int sx, step of row variables int by, first index of column variables int sy step of column variables ) Reads in a sparse matrix specified in a simple format. The first line of the input contains the numbers of rows and columns. The remaining lines contain the elements of the matrix, one per line. Given a background value (specified by the background field of the manager), only the values different from it are explicitly listed. Each foreground element is described by two integers, i.e., the row and column number, and a real number, i.e., the value. Cudd_addRead produces an ADD that depends on two sets of variables: x and y. The x variables (x[0] ... x[nx-1]) encode the row index and the y variables (y[0] ... y[ny-1]) encode the column index. x[0] and y[0] are the most significant bits in the indices. The variables may already exist or may be created by the function. The index of x[i] is bx+i*sx, and the index of y[i] is by+i*sy. On input, nx and ny hold the numbers of row and column variables already in existence. On output, they hold the numbers of row and column variables actually used by the matrix. When Cudd_addRead creates the variable arrays, the index of x[i] is bx+i*sx, and the index of y[i] is by+i*sy. When some variables already exist Cudd_addRead expects the indices of the existing x variables to be bx+i*sx, and the indices of the existing y variables to be by+i*sy. m and n are set to the numbers of rows and columns of the matrix. Their values on input are immaterial. The ADD for the sparse matrix is returned in E, and its reference count is > 0. Cudd_addRead returns 1 in case of success; 0 otherwise. Side Effects: nx and ny are set to the numbers of row and column variables. m and n are set to the numbers of rows and columns. x and y are possibly extended to represent the array of row and column variables. Similarly for xn and yn_, which hold on return from Cudd_addRead the complements of the row and column variables. DdNode * Cudd_addResidue( DdManager * dd, manager int n, number of bits int m, modulus int options, options int top index of top variable ) Builds an ADD for the residue modulo m of an n-bit number. The modulus must be at least 2, and the number of bits at least 1. Parameter options specifies whether the MSB should be on top or the LSB; and whther the number whose residue is computed is in two's complement notation or not. The macro CUDD_RESIDUE_DEFAULT specifies LSB on top and unsigned number. The macro CUDD_RESIDUE_MSB specifies MSB on top, and the macro CUDD_RESIDUE_TC specifies two's complement residue. To request MSB on top and two's complement residue simultaneously, one can OR the two macros: CUDD_RESIDUE_MSB | CUDD_RESIDUE_TC. Cudd_addResidue returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addRestrict( DdManager * dd, DdNode * f, DdNode * c ) ADD restrict according to Coudert and Madre's algorithm (ICCAD90). Returns the restricted ADD if successful; otherwise NULL. If application of restrict results in an ADD larger than the input ADD, the input ADD is returned. Side Effects: None DdNode * Cudd_addRoundOff( DdManager * dd, DdNode * f, int N ) Rounds off the discriminants of an ADD. The discriminants are rounded off to N digits after the decimal. Returns a pointer to the result ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addScalarInverse( DdManager * dd, DdNode * f, DdNode * epsilon ) Computes an n ADD where the discriminants are the multiplicative inverses of the corresponding discriminants of the argument ADD. Returns a pointer to the resulting ADD in case of success. Returns NULL if any discriminants smaller than epsilon is encountered. Side Effects: None DdNode * Cudd_addSetNZ( DdManager * dd, DdNode ** f, DdNode ** g ) This operator sets f to the value of g wherever g != 0. Returns NULL if not a terminal case; f op g otherwise. Side Effects: None DdNode * Cudd_addSwapVariables( DdManager * dd, DdNode * f, DdNode ** x, DdNode ** y, int n ) Swaps two sets of variables of the same size (x and y) in the ADD f. The size is given by n. The two sets of variables are assumed to be disjoint. Returns a pointer to the resulting ADD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_addThreshold( DdManager * dd, DdNode ** f, DdNode ** g ) Threshold operator for Apply (f if f >=g; 0 if fx_id, or if phase == 0 and f-->x_id'. Side Effects: None int Cudd_bddIsVarHardGroup( DdManager * dd, int index ) 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. Side Effects: none int Cudd_bddIsVarToBeGrouped( DdManager * dd, int index ) Checks whether a variable is set to be grouped. This function is used for lazy sifting. Side Effects: none int Cudd_bddIsVarToBeUngrouped( DdManager * dd, int index ) 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. Side Effects: none DdNode * Cudd_bddIsop( DdManager * dd, DdNode * L, DdNode * U ) Computes a BDD in the interval between L and U with a simple sum-of-product cover. This procedure is similar to Cudd_zddIsop, but it does not return the ZDD for the cover. Returns a pointer to the BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddIteConstant( DdManager * dd, DdNode * f, DdNode * g, DdNode * h ) Implements ITEconstant(f,g,h). Returns a pointer to the resulting BDD (which may or may not be constant) or DD_NON_CONSTANT. No new nodes are created. Side Effects: None DdNode * Cudd_bddIteLimit( DdManager * dd, DdNode * f, DdNode * g, DdNode * h, unsigned int limit ) Implements ITE(f,g,h). Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required. Side Effects: None int Cudd_bddIterConjDecomp( DdManager * dd, manager DdNode * f, function to be decomposed DdNode *** conjuncts address of the array of conjuncts ) Performs two-way conjunctive decomposition of a BDD. This procedure owes its name to the iterated use of supersetting to obtain a factor of the given function. Returns the number of conjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The conjuncts produced by this procedure tend to be imbalanced. Side Effects: The factors are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the conjuncts are already referenced. If the function returns 0, the array for the conjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed. int Cudd_bddIterDisjDecomp( DdManager * dd, manager DdNode * f, function to be decomposed DdNode *** disjuncts address of the array of the disjuncts ) Performs two-way disjunctive decomposition of a BDD. Returns the number of disjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The disjuncts produced by this procedure tend to be imbalanced. Side Effects: The two disjuncts are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the disjuncts are already referenced. If the function returns 0, the array for the disjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed. DdNode * Cudd_bddIte( DdManager * dd, DdNode * f, DdNode * g, DdNode * h ) Implements ITE(f,g,h). Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up. Side Effects: None DdNode * Cudd_bddIthVar( DdManager * dd, int i ) 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. Side Effects: None DdNode * Cudd_bddLICompaction( DdManager * dd, manager DdNode * f, function to be minimized DdNode * c constraint (care set) ) Performs safe minimization of a BDD. Given the BDD f of a function to be minimized and a BDD c representing the care set, Cudd_bddLICompaction produces the BDD of a function that agrees with f wherever c is 1. Safe minimization means that the size of the result is guaranteed not to exceed the size of f. This function is based on the DAC97 paper by Hong et al.. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddLargestPrimeUnate( DdManager * dd, manager DdNode * f, unate function DdNode * phaseBdd cube of the phases ) Find a largest prime implicant of a unate function. Returns the BDD for the prime if succesful; NULL otherwise. The behavior is undefined if f is not unate. The third argument is used to determine whether f is unate positive (increasing) or negative (decreasing) in each of the variables in its support. Side Effects: None int Cudd_bddLeqUnless( DdManager * dd, DdNode * f, DdNode * g, DdNode * D ) Tells whether f is less than of equal to G unless D is 1. f, g, and D are BDDs. The function returns 1 if f is less than of equal to G, and 0 otherwise. No new nodes are created. Side Effects: None int Cudd_bddLeq( DdManager * dd, DdNode * f, DdNode * g ) Returns 1 if f is less than or equal to g; 0 otherwise. No new nodes are created. Side Effects: None DdNode * Cudd_bddLiteralSetIntersection( DdManager * dd, DdNode * f, DdNode * g ) Computes the intesection of two sets of literals represented as BDDs. Each set is represented as a cube of the literals in the set. The empty set is represented by the constant 1. No variable can be simultaneously present in both phases in a set. Returns a pointer to the BDD representing the intersected sets, if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddMakePrime( DdManager * dd, manager DdNode * cube, cube to be expanded DdNode * f function of which the cube is to be made a prime ) Expands cube to a prime implicant of f. Returns the prime if successful; NULL otherwise. In particular, NULL is returned if cube is not a real cube or is not an implicant of f. Side Effects: None DdNode * Cudd_bddMaximallyExpand( DdManager * dd, manager DdNode * lb, cube to be expanded DdNode * ub, upper bound cube DdNode * f function against which to expand ) Expands lb to all prime implicants of (f and ub) that contain lb. Assumes that lb is contained in ub. Returns the disjunction of the primes if lb is contained in f; returns the zero BDD if lb is not contained in f; returns NULL in case of failure. In particular, NULL is returned if cube is not a real cube or is not an implicant of f. Returning the disjunction of all prime implicants works because the resulting function is unate. Side Effects: None DdNode * Cudd_bddMinimize( DdManager * dd, DdNode * f, DdNode * c ) Finds a small BDD that agrees with f over c. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddNPAnd( DdManager * dd, DdNode * f, DdNode * g ) Computes f non-polluting-and g. The non-polluting AND of f and g is a hybrid of AND and Restrict. From Restrict, this operation takes the idea of existentially quantifying the top variable of the second operand if it does not appear in the first. Therefore, the variables that appear in the result also appear in f. For the rest, the function behaves like AND. Since the two operands play different roles, non-polluting AND is not commutative. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddNand( DdManager * dd, DdNode * f, DdNode * g ) Computes the NAND of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up. Side Effects: None DdNode * Cudd_bddNewVarAtLevel( DdManager * dd, int level ) 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. Side Effects: None DdNode * Cudd_bddNewVar( DdManager * dd ) 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. Side Effects: None DdNode * Cudd_bddNor( DdManager * dd, DdNode * f, DdNode * g ) Computes the NOR of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up. Side Effects: None DdNode * Cudd_bddOrLimit( DdManager * dd, DdNode * f, DdNode * g, unsigned int limit ) Computes the disjunction of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required. Side Effects: None DdNode * Cudd_bddOr( DdManager * dd, DdNode * f, DdNode * g ) Computes the disjunction of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up. Side Effects: None DdNode * Cudd_bddPermute( DdManager * manager, DdNode * node, int * permut ) Given a permutation in array permut, creates a new BDD with permuted variables. There should be an entry in array permut for each variable in the manager. The i-th entry of permut holds the index of the variable that is to substitute the i-th variable. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode ** Cudd_bddPickArbitraryMinterms( DdManager * dd, manager DdNode * f, function from which to pick k minterms DdNode ** vars, array of variables int n, size of vars int k number of minterms to find ) Picks k on-set minterms evenly distributed from given DD. The minterms are in terms of vars. The array vars should contain at least all variables in the support of f; if this condition is not met the minterms built by this procedure may not be contained in f. Builds an array of BDDs for the minterms and returns a pointer to it if successful; NULL otherwise. There are three reasons why the procedure may fail: It may run out of memory; the function f may be the constant 0; the minterms may not be contained in f. Side Effects: None int Cudd_bddPickOneCube( DdManager * ddm, DdNode * node, char * string ) Picks one on-set cube randomly from the given DD. The cube is written into an array of characters. The array must have at least as many entries as there are variables. Returns 1 if successful; 0 otherwise. Side Effects: None DdNode * Cudd_bddPickOneMinterm( DdManager * dd, manager DdNode * f, function from which to pick one minterm DdNode ** vars, array of variables int n size of vars ) Picks one on-set minterm randomly from the given DD. The minterm is in terms of vars. The array vars should contain at least all variables in the support of f; if this condition is not met the minterm built by this procedure may not be contained in f. Builds a BDD for the minterm and returns a pointer to it if successful; NULL otherwise. There are three reasons why the procedure may fail: It may run out of memory; the function f may be the constant 0; the minterm may not be contained in f. Side Effects: None int Cudd_bddPrintCover( DdManager * dd, DdNode * l, DdNode * u ) Prints a sum of product cover for an incompletely specified function given by a lower bound and an upper bound. Each product is a prime implicant obtained by expanding the product corresponding to a path from node to the constant one. Uses the package default output file. Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_bddReadPairIndex( DdManager * dd, int index ) 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. Side Effects: modifies the manager int Cudd_bddRead( FILE * fp, input file pointer DdManager * dd, DD manager DdNode ** E, characteristic function of the graph DdNode *** x, array of row variables DdNode *** y, array of column variables int * nx, number or row variables int * ny, number or column variables int * m, number of rows int * n, number of columns int bx, first index of row variables int sx, step of row variables int by, first index of column variables int sy step of column variables ) Reads in a graph (without labels) given as an adjacency matrix. The first line of the input contains the numbers of rows and columns of the adjacency matrix. The remaining lines contain the arcs of the graph, one per line. Each arc is described by two integers, i.e., the row and column number, or the indices of the two endpoints. Cudd_bddRead produces a BDD that depends on two sets of variables: x and y. The x variables (x[0] ... x[nx-1]) encode the row index and the y variables (y[0] ... y[ny-1]) encode the column index. x[0] and y[0] are the most significant bits in the indices. The variables may already exist or may be created by the function. The index of x[i] is bx+i*sx, and the index of y[i] is by+i*sy. On input, nx and ny hold the numbers of row and column variables already in existence. On output, they hold the numbers of row and column variables actually used by the matrix. When Cudd_bddRead creates the variable arrays, the index of x[i] is bx+i*sx, and the index of y[i] is by+i*sy. When some variables already exist, Cudd_bddRead expects the indices of the existing x variables to be bx+i*sx, and the indices of the existing y variables to be by+i*sy. m and n are set to the numbers of rows and columns of the matrix. Their values on input are immaterial. The BDD for the graph is returned in E, and its reference count is > 0. Cudd_bddRead returns 1 in case of success; 0 otherwise. Side Effects: nx and ny are set to the numbers of row and column variables. m and n are set to the numbers of rows and columns. x and y are possibly extended to represent the array of row and column variables. void Cudd_bddRealignDisable( DdManager * unique ) Disables realignment of ZDD order to BDD order. Side Effects: None void Cudd_bddRealignEnable( DdManager * unique ) 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. Side Effects: None int Cudd_bddRealignmentEnabled( DdManager * unique ) Returns 1 if the realignment of BDD order to ZDD order is enabled; 0 otherwise. Side Effects: None int Cudd_bddResetVarToBeGrouped( DdManager * dd, int index ) Resets a variable not to be grouped. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager DdNode * Cudd_bddRestrict( DdManager * dd, DdNode * f, DdNode * c ) BDD restrict according to Coudert and Madre's algorithm (ICCAD90). Returns the restricted BDD if successful; otherwise NULL. If application of restrict results in a BDD larger than the input BDD, the input BDD is returned. Side Effects: None int Cudd_bddSetNsVar( DdManager * dd, manager int index variable index ) Sets a variable type to next state. The variable type is used by lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager int Cudd_bddSetPairIndex( DdManager * dd, manager int index, variable index int pairIndex corresponding variable index ) Sets a corresponding pair index for a given index. These pair indices are present and next state variable. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager int Cudd_bddSetPiVar( DdManager * dd, manager int index variable index ) Sets a variable type to primary input. The variable type is used by lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager int Cudd_bddSetPsVar( DdManager * dd, manager int index variable index ) Sets a variable type to present state. The variable type is used by lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager int Cudd_bddSetVarHardGroup( DdManager * dd, int index ) Sets a variable to be a hard group. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager int Cudd_bddSetVarToBeGrouped( DdManager * dd, int index ) Sets a variable to be grouped. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager int Cudd_bddSetVarToBeUngrouped( DdManager * dd, int index ) Sets a variable to be ungrouped. This function is used for lazy sifting. Returns 1 if successful; 0 otherwise. Side Effects: modifies the manager DdNode * Cudd_bddSqueeze( DdManager * dd, manager DdNode * l, lower bound DdNode * u upper bound ) Finds a small BDD in a function interval. Given BDDs l and u, representing the lower bound and upper bound of a function interval, Cudd_bddSqueeze produces the BDD of a function within the interval with a small BDD. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddSwapVariables( DdManager * dd, DdNode * f, DdNode ** x, DdNode ** y, int n ) Swaps two sets of variables of the same size (x and y) in the BDD f. The size is given by n. The two sets of variables are assumed to be disjoint. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddTransfer( DdManager * ddSource, DdManager * ddDestination, DdNode * f ) Convert a BDD from a manager to another one. The orders of the variables in the two managers may be different. Returns a pointer to the BDD in the destination manager if successful; NULL otherwise. Side Effects: None int Cudd_bddUnbindVar( DdManager * dd, manager int index variable index ) 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). Side Effects: Changes the "bindVar" flag in DdSubtable. DdNode * Cudd_bddUnivAbstract( DdManager * manager, DdNode * f, DdNode * cube ) Universally abstracts all the variables in cube from f. Returns the abstracted BDD if successful; NULL otherwise. Side Effects: None int Cudd_bddVarConjDecomp( DdManager * dd, manager DdNode * f, function to be decomposed DdNode *** conjuncts address of the array of conjuncts ) Conjunctively decomposes one BDD according to a variable. If f is the function of the BDD and x is the variable, the decomposition is (f+x)(f+x'). The variable is chosen so as to balance the sizes of the two conjuncts and to keep them small. Returns the number of conjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. Side Effects: The two factors are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the conjuncts are already referenced. If the function returns 0, the array for the conjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed. int Cudd_bddVarDisjDecomp( DdManager * dd, manager DdNode * f, function to be decomposed DdNode *** disjuncts address of the array of the disjuncts ) Performs two-way disjunctive decomposition of a BDD according to a variable. If f is the function of the BDD and x is the variable, the decomposition is f*x + f*x'. The variable is chosen so as to balance the sizes of the two disjuncts and to keep them small. Returns the number of disjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. Side Effects: The two disjuncts are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the disjuncts are already referenced. If the function returns 0, the array for the disjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed. int Cudd_bddVarIsBound( DdManager * dd, manager int index variable index ) 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. Side Effects: none int Cudd_bddVarIsDependent( DdManager * dd, DdNode * f, DdNode * var variable ) Checks whether a variable is dependent on others in a function. Returns 1 if the variable is dependent; 0 otherwise. No new nodes are created. Side Effects: None DdNode * Cudd_bddVarMap( DdManager * manager, DD manager DdNode * f function in which to remap variables ) Remaps the variables of a BDD using the default variable map. A typical use of this function is to swap two sets of variables. The variable map must be registered with Cudd_SetVarMap. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddVectorCompose( DdManager * dd, DdNode * f, DdNode ** vector ) Given a vector of BDDs, creates a new BDD by substituting the BDDs for the variables of the BDD f. There should be an entry in vector for each variable in the manager. If no substitution is sought for a given variable, the corresponding projection function should be specified in the vector. This function implements simultaneous composition. Returns a pointer to the resulting BDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddXnorLimit( DdManager * dd, DdNode * f, DdNode * g, unsigned int limit ) Computes the exclusive NOR of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required. Side Effects: None DdNode * Cudd_bddXnor( DdManager * dd, DdNode * f, DdNode * g ) Computes the exclusive NOR of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up. Side Effects: None DdNode * Cudd_bddXorExistAbstract( DdManager * manager, DdNode * f, DdNode * g, DdNode * cube ) Takes the exclusive OR of two BDDs and simultaneously abstracts the variables in cube. The variables are existentially abstracted. Returns a pointer to the result is successful; NULL otherwise. Side Effects: None DdNode * Cudd_bddXor( DdManager * dd, DdNode * f, DdNode * g ) Computes the exclusive OR of two BDDs f and g. Returns a pointer to the resulting BDD if successful; NULL if the intermediate result blows up. Side Effects: None void Cudd_tlcInfoFree( DdTlcInfo * t ) Frees a DdTlcInfo Structure as well as the memory pointed by it. Side Effects: None DdNode * Cudd_zddChange( DdManager * dd, DdNode * P, int var ) Substitutes a variable with its complement in a ZDD. returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddComplement( DdManager * dd, DdNode * node ) Computes a complement cover for a ZDD node. For lack of a better method, we first extract the function BDD from the ZDD cover, then make the complement of the ZDD cover from the complement of the BDD node by using ISOP. Returns a pointer to the resulting cover if successful; NULL otherwise. The result depends on current variable order. Side Effects: The result depends on current variable order. double Cudd_zddCountDouble( DdManager * zdd, DdNode * P ) Counts the number of minterms of a ZDD. The result is returned as a double. If the procedure runs out of memory, it returns (double) CUDD_OUT_OF_MEM. This procedure is used in Cudd_zddCountMinterm. Side Effects: None double Cudd_zddCountMinterm( DdManager * zdd, DdNode * node, int path ) Counts the number of minterms of the ZDD rooted at node. This procedure takes a parameter path that specifies how many variables are in the support of the function. If the procedure runs out of memory, it returns (double) CUDD_OUT_OF_MEM. Side Effects: None int Cudd_zddCount( DdManager * zdd, DdNode * P ) Returns an integer representing the number of minterms in a ZDD. Side Effects: None char * Cudd_zddCoverPathToString( DdManager * zdd, DD manager int * path, path of ZDD representing a cover char * str pointer to string to use if != NULL ) Converts a path of a ZDD representing a cover to a string. The string represents an implicant of the cover. The path is typically produced by Cudd_zddForeachPath. Returns a pointer to the string if successful; NULL otherwise. If the str input is NULL, it allocates a new string. The string passed to this function must have enough room for all variables and for the terminator. Side Effects: None int Cudd_zddDagSize( DdNode * p_node ) Counts the number of nodes in a ZDD. This function duplicates Cudd_DagSize and is only retained for compatibility. Side Effects: None DdNode * Cudd_zddDiffConst( DdManager * zdd, DdNode * P, DdNode * Q ) Inclusion test for ZDDs (P implies Q). No new nodes are generated by this procedure. Returns empty if true; a valid pointer different from empty or DD_NON_CONSTANT otherwise. Side Effects: None DdNode * Cudd_zddDiff( DdManager * dd, DdNode * P, DdNode * Q ) Computes the difference of two ZDDs. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddDivideF( DdManager * dd, DdNode * f, DdNode * g ) Modified version of Cudd_zddDivide. This function may disappear in future releases. Side Effects: None DdNode * Cudd_zddDivide( DdManager * dd, DdNode * f, DdNode * g ) Computes the quotient of two unate covers represented by ZDDs. Unate covers use one ZDD variable for each BDD variable. Returns a pointer to the resulting ZDD if successful; NULL otherwise. Side Effects: None int Cudd_zddDumpDot( DdManager * dd, manager int n, number of output nodes to be dumped DdNode ** f, array of output nodes to be dumped char ** inames, array of input names (or NULL) char ** onames, array of output names (or NULL) FILE * fp pointer to the dump file ) Writes a file representing the argument ZDDs in a format suitable for the graph drawing program dot. It returns 1 in case of success; 0 otherwise (e.g., out-of-memory, file system full). Cudd_zddDumpDot does not close the file: This is the caller responsibility. Cudd_zddDumpDot uses a minimal unique subset of the hexadecimal address of a node as name for it. If the argument inames is non-null, it is assumed to hold the pointers to the names of the inputs. Similarly for onames. Cudd_zddDumpDot uses the following convention to draw arcs: solid line: THEN arcs; dashed line: ELSE arcs. The dot options are chosen so that the drawing fits on a letter-size sheet. Side Effects: None DdGen * Cudd_zddFirstPath( DdManager * zdd, DdNode * f, int ** path ) Defines an iterator on the paths of a ZDD and finds its first path. Returns a generator that contains the information necessary to continue the enumeration if successful; NULL otherwise. A path is represented as an array of literals, which are integers in {0, 1, 2}; 0 represents an else arc out of a node, 1 represents a then arc out of a node, and 2 stands for the absence of a node. The size of the array equals the number of variables in the manager at the time Cudd_zddFirstCube is called. The paths that end in the empty terminal are not enumerated. Side Effects: The first path is returned as a side effect. DdNode * Cudd_zddIntersect( DdManager * dd, DdNode * P, DdNode * Q ) Computes the intersection of two ZDDs. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddIsop( DdManager * dd, DdNode * L, DdNode * U, DdNode ** zdd_I ) Computes an irredundant sum of products (ISOP) in ZDD form from BDDs. The two BDDs L and U represent the lower bound and the upper bound, respectively, of the function. The ISOP uses two ZDD variables for each BDD variable: One for the positive literal, and one for the negative literal. These two variables should be adjacent in the ZDD order. The two ZDD variables corresponding to BDD variable i should have indices 2i and 2i+1. The result of this procedure depends on the variable order. If successful, Cudd_zddIsop returns the BDD for the function chosen from the interval. The ZDD representing the irredundant cover is returned as a side effect in zdd_I. In case of failure, NULL is returned. Side Effects: zdd_I holds the pointer to the ZDD for the ISOP on successful return. DdNode * Cudd_zddIte( DdManager * dd, DdNode * f, DdNode * g, DdNode * h ) Computes the ITE of three ZDDs. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddIthVar( DdManager * dd, int i ) 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. Side Effects: None int Cudd_zddNextPath( DdGen * gen, int ** path ) Generates the next path of a ZDD onset, using generator gen. Returns 0 if the enumeration is completed; 1 otherwise. Side Effects: The path is returned as a side effect. The generator is modified. DdNode * Cudd_zddPortFromBdd( DdManager * dd, DdNode * B ) Converts a BDD into a ZDD. This function assumes that there is a one-to-one correspondence between the BDD variables and the ZDD variables, and that the variable order is the same for both types of variables. These conditions are established if the ZDD variables are created by one call to Cudd_zddVarsFromBddVars with multiplicity = 1. Returns a pointer to the resulting ZDD if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddPortToBdd( DdManager * dd, DdNode * f ) Converts a ZDD into a BDD. Returns a pointer to the resulting ZDD if successful; NULL otherwise. Side Effects: None int Cudd_zddPrintCover( DdManager * zdd, DdNode * node ) Prints a sum of products from a ZDD representing a cover. Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_zddPrintDebug( DdManager * zdd, DdNode * f, int n, int pr ) Prints to the standard output a DD and its statistics. The statistics include the number of nodes and the number of minterms. (The number of minterms is also the number of combinations in the set.) The statistics are printed if pr > 0. Specifically: pr = 0 : prints nothing pr = 1 : prints counts of nodes and minterms pr = 2 : prints counts + disjoint sum of products pr = 3 : prints counts + list of nodes pr > 3 : prints counts + disjoint sum of products + list of nodes Returns 1 if successful; 0 otherwise. Side Effects: None int Cudd_zddPrintMinterm( DdManager * zdd, DdNode * node ) Prints a disjoint sum of product form for a ZDD. Returns 1 if successful; 0 otherwise. Side Effects: None void Cudd_zddPrintSubtable( DdManager * table ) Prints the ZDD table for debugging purposes. Side Effects: None DdNode * Cudd_zddProduct( DdManager * dd, DdNode * f, DdNode * g ) Computes the product of two covers represented by ZDDs. The result is also a ZDD. Returns a pointer to the result if successful; NULL otherwise. The covers on which Cudd_zddProduct operates use two ZDD variables for each function variable (one ZDD variable for each literal of the variable). Those two ZDD variables should be adjacent in the order. Side Effects: None long Cudd_zddReadNodeCount( DdManager * dd ) Reports the number of nodes in ZDDs. This number always includes the two constants 1 and 0. Side Effects: None void Cudd_zddRealignDisable( DdManager * unique ) Disables realignment of ZDD order to BDD order. Side Effects: None void Cudd_zddRealignEnable( DdManager * unique ) 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. Side Effects: None int Cudd_zddRealignmentEnabled( DdManager * unique ) Returns 1 if the realignment of ZDD order to BDD order is enabled; 0 otherwise. Side Effects: None int Cudd_zddReduceHeap( DdManager * table, DD manager Cudd_ReorderingTy heuristic, method used for reordering int minsize bound below which no reordering occurs ) Main dynamic reordering routine for ZDDs. Calls one of the possible reordering procedures: Swapping Sifting Symmetric Sifting For sifting and symmetric sifting it is possible to request reordering to convergence. The core of all methods is the reordering procedure cuddZddSwapInPlace() which swaps two adjacent variables. Returns 1 in case of success; 0 otherwise. In the case of symmetric sifting (with and without convergence) returns 1 plus the number of symmetric variables, in case of success. Side Effects: Changes the variable order for all ZDDs and clears the cache. int Cudd_zddShuffleHeap( DdManager * table, DD manager int * permutation required variable permutation ) Reorders ZDD variables according to given permutation. The i-th entry of the permutation array contains the index of the variable that should be brought to the i-th level. The size of the array should be equal or greater to the number of variables currently in use. Returns 1 in case of success; 0 otherwise. Side Effects: Changes the ZDD variable order for all diagrams and clears the cache. DdNode * Cudd_zddSubset0( DdManager * dd, DdNode * P, int var ) Computes the negative cofactor of a ZDD w.r.t. a variable. In terms of combinations, the result is the set of all combinations in which the variable is negated. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddSubset1( DdManager * dd, DdNode * P, int var ) Computes the positive cofactor of a ZDD w.r.t. a variable. In terms of combinations, the result is the set of all combinations in which the variable is asserted. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddSupport( DdManager * dd, manager DdNode * f ZDD whose support is sought ) Finds the variables on which a ZDD depends. Returns a BDD consisting of the product of the variables if successful; NULL otherwise. Side Effects: None void Cudd_zddSymmProfile( DdManager * table, int lower, int upper ) Prints statistics on symmetric ZDD variables. Side Effects: None DdNode * Cudd_zddUnateProduct( DdManager * dd, DdNode * f, DdNode * g ) Computes the product of two unate covers represented as ZDDs. Unate covers use one ZDD variable for each BDD variable. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None DdNode * Cudd_zddUnion( DdManager * dd, DdNode * P, DdNode * Q ) Computes the union of two ZDDs. Returns a pointer to the result if successful; NULL otherwise. Side Effects: None int Cudd_zddVarsFromBddVars( DdManager * dd, DD manager int multiplicity how many ZDD variables are created for each BDD variable ) 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. Side Effects: None DdNode * Cudd_zddWeakDivF( DdManager * dd, DdNode * f, DdNode * g ) Modified version of Cudd_zddWeakDiv. This function may disappear in future releases. Side Effects: None DdNode * Cudd_zddWeakDiv( DdManager * dd, DdNode * f, DdNode * g ) Applies weak division to two ZDDs representing two covers. Returns a pointer to the ZDD representing the result if successful; NULL otherwise. The result of weak division depends on the variable order. The covers on which Cudd_zddWeakDiv operates use two ZDD variables for each function variable (one ZDD variable for each literal of the variable). Those two ZDD variables should be adjacent in the order. Side Effects: None writing ./cuddTitle.html