You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

999 lines
48 KiB

  1. /**
  2. @file
  3. @ingroup cudd
  4. @brief The University of Colorado decision diagram package.
  5. @details External functions and data strucures of the CUDD package.
  6. <ul>
  7. <li> To turn on the gathering of statistics, define DD_STATS.
  8. <li> To turn on additional debugging code, define DD_DEBUG.
  9. </ul>
  10. @author Fabio Somenzi
  11. @author Modified by Abelardo Pardo to interface it to VIS
  12. @copyright@parblock
  13. Copyright (c) 1995-2015, Regents of the University of Colorado
  14. All rights reserved.
  15. Redistribution and use in source and binary forms, with or without
  16. modification, are permitted provided that the following conditions
  17. are met:
  18. Redistributions of source code must retain the above copyright
  19. notice, this list of conditions and the following disclaimer.
  20. Redistributions in binary form must reproduce the above copyright
  21. notice, this list of conditions and the following disclaimer in the
  22. documentation and/or other materials provided with the distribution.
  23. Neither the name of the University of Colorado nor the names of its
  24. contributors may be used to endorse or promote products derived from
  25. this software without specific prior written permission.
  26. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  27. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  28. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  29. FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  30. COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  31. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  32. BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  33. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  34. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  35. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  36. ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  37. POSSIBILITY OF SUCH DAMAGE.
  38. @endparblock
  39. */
  40. #ifndef CUDD_H_
  41. #define CUDD_H_
  42. /*---------------------------------------------------------------------------*/
  43. /* Nested includes */
  44. /*---------------------------------------------------------------------------*/
  45. #include <inttypes.h>
  46. /*---------------------------------------------------------------------------*/
  47. /* Constant declarations */
  48. /*---------------------------------------------------------------------------*/
  49. #define CUDD_TRUE 1 /**< readable true */
  50. #define CUDD_FALSE 0 /**< readable false */
  51. /**
  52. * @brief Value returned my many functions when memory is exhausted.
  53. */
  54. #define CUDD_OUT_OF_MEM -1
  55. /* The sizes of the subtables and the cache must be powers of two. */
  56. #define CUDD_UNIQUE_SLOTS 256 /**< Initial size of subtables */
  57. #define CUDD_CACHE_SLOTS 262144 /**< Default size of the cache */
  58. /* Constants for residue functions. */
  59. #define CUDD_RESIDUE_DEFAULT 0
  60. #define CUDD_RESIDUE_MSB 1
  61. #define CUDD_RESIDUE_TC 2
  62. /*---------------------------------------------------------------------------*/
  63. /* Stucture declarations */
  64. /*---------------------------------------------------------------------------*/
  65. /*---------------------------------------------------------------------------*/
  66. /* Type declarations */
  67. /*---------------------------------------------------------------------------*/
  68. /**
  69. @brief Type of reordering algorithm.
  70. */
  71. typedef enum {
  72. CUDD_REORDER_SAME,
  73. CUDD_REORDER_NONE,
  74. CUDD_REORDER_RANDOM,
  75. CUDD_REORDER_RANDOM_PIVOT,
  76. CUDD_REORDER_SIFT,
  77. CUDD_REORDER_SIFT_CONVERGE,
  78. CUDD_REORDER_SYMM_SIFT,
  79. CUDD_REORDER_SYMM_SIFT_CONV,
  80. CUDD_REORDER_WINDOW2,
  81. CUDD_REORDER_WINDOW3,
  82. CUDD_REORDER_WINDOW4,
  83. CUDD_REORDER_WINDOW2_CONV,
  84. CUDD_REORDER_WINDOW3_CONV,
  85. CUDD_REORDER_WINDOW4_CONV,
  86. CUDD_REORDER_GROUP_SIFT,
  87. CUDD_REORDER_GROUP_SIFT_CONV,
  88. CUDD_REORDER_ANNEALING,
  89. CUDD_REORDER_GENETIC,
  90. CUDD_REORDER_LINEAR,
  91. CUDD_REORDER_LINEAR_CONVERGE,
  92. CUDD_REORDER_LAZY_SIFT,
  93. CUDD_REORDER_EXACT
  94. } Cudd_ReorderingType;
  95. /**
  96. @brief Type of aggregation methods.
  97. */
  98. typedef enum {
  99. CUDD_NO_CHECK,
  100. CUDD_GROUP_CHECK,
  101. CUDD_GROUP_CHECK2,
  102. CUDD_GROUP_CHECK3,
  103. CUDD_GROUP_CHECK4,
  104. CUDD_GROUP_CHECK5,
  105. CUDD_GROUP_CHECK6,
  106. CUDD_GROUP_CHECK7,
  107. CUDD_GROUP_CHECK8,
  108. CUDD_GROUP_CHECK9
  109. } Cudd_AggregationType;
  110. /**
  111. @brief Type of hooks.
  112. */
  113. typedef enum {
  114. CUDD_PRE_GC_HOOK,
  115. CUDD_POST_GC_HOOK,
  116. CUDD_PRE_REORDERING_HOOK,
  117. CUDD_POST_REORDERING_HOOK
  118. } Cudd_HookType;
  119. /**
  120. @brief Type of error codes.
  121. */
  122. typedef enum {
  123. CUDD_NO_ERROR,
  124. CUDD_MEMORY_OUT,
  125. CUDD_TOO_MANY_NODES,
  126. CUDD_MAX_MEM_EXCEEDED,
  127. CUDD_TIMEOUT_EXPIRED,
  128. CUDD_TERMINATION,
  129. CUDD_INVALID_ARG,
  130. CUDD_INTERNAL_ERROR
  131. } Cudd_ErrorType;
  132. /**
  133. @brief Group type for lazy sifting.
  134. */
  135. typedef enum {
  136. CUDD_LAZY_NONE,
  137. CUDD_LAZY_SOFT_GROUP,
  138. CUDD_LAZY_HARD_GROUP,
  139. CUDD_LAZY_UNGROUP
  140. } Cudd_LazyGroupType;
  141. /**
  142. @brief Variable type.
  143. @details Used only in lazy sifting.
  144. */
  145. typedef enum {
  146. CUDD_VAR_PRIMARY_INPUT,
  147. CUDD_VAR_PRESENT_STATE,
  148. CUDD_VAR_NEXT_STATE
  149. } Cudd_VariableType;
  150. /**
  151. @brief Type of the value of a terminal node.
  152. */
  153. typedef double CUDD_VALUE_TYPE;
  154. /**
  155. @brief Type of the decision diagram node.
  156. */
  157. typedef struct DdNode DdNode;
  158. /**
  159. @brief Type of a pointer to a decision diagram node.
  160. */
  161. typedef DdNode *DdNodePtr;
  162. /**
  163. @brief CUDD manager.
  164. */
  165. typedef struct DdManager DdManager;
  166. /**
  167. @brief CUDD generator.
  168. */
  169. typedef struct DdGen DdGen;
  170. /**
  171. @brief Type of an arbitrary precision integer "digit."
  172. */
  173. typedef uint32_t DdApaDigit;
  174. /**
  175. @brief Type of an arbitrary precision intger, which is an array of digits.
  176. */
  177. typedef DdApaDigit * DdApaNumber;
  178. /**
  179. @brief Type of a const-qualified arbitrary precision integer.
  180. */
  181. typedef DdApaDigit const * DdConstApaNumber;
  182. /**
  183. @brief Return type for function computing two-literal clauses.
  184. */
  185. typedef struct DdTlcInfo DdTlcInfo;
  186. /**
  187. @brief Type of hook function.
  188. */
  189. typedef int (*DD_HFP)(DdManager *, const char *, void *);
  190. /**
  191. @brief Type of priority function
  192. */
  193. typedef DdNode * (*DD_PRFP)(DdManager * , int, DdNode **, DdNode **, DdNode **);
  194. /**
  195. @brief Type of apply operator.
  196. */
  197. typedef DdNode * (*DD_AOP)(DdManager *, DdNode **, DdNode **);
  198. /**
  199. @brief Type of monadic apply operator.
  200. */
  201. typedef DdNode * (*DD_MAOP)(DdManager *, DdNode *);
  202. /**
  203. @brief Type of two-operand cache tag functions.
  204. */
  205. typedef DdNode * (*DD_CTFP)(DdManager *, DdNode *, DdNode *);
  206. /**
  207. @brief Type of one-operand cache tag functions.
  208. */
  209. typedef DdNode * (*DD_CTFP1)(DdManager *, DdNode *);
  210. /**
  211. @brief Type of memory-out function.
  212. */
  213. typedef void (*DD_OOMFP)(size_t);
  214. /**
  215. @brief Type of comparison function for qsort.
  216. */
  217. typedef int (*DD_QSFP)(const void *, const void *);
  218. /**
  219. @brief Type of termination handler.
  220. */
  221. typedef int (*DD_THFP)(const void *);
  222. /**
  223. @brief Type of timeout handler.
  224. */
  225. typedef void (*DD_TOHFP)(DdManager *, void *);
  226. /*---------------------------------------------------------------------------*/
  227. /* Variable declarations */
  228. /*---------------------------------------------------------------------------*/
  229. /*---------------------------------------------------------------------------*/
  230. /* Macro declarations */
  231. /*---------------------------------------------------------------------------*/
  232. /**
  233. @brief Complements a %DD.
  234. @details Complements a %DD by flipping the complement attribute of
  235. the pointer (the least significant bit).
  236. @sideeffect none
  237. @see Cudd_NotCond
  238. */
  239. #define Cudd_Not(node) ((DdNode *)((uintptr_t)(node) ^ (uintptr_t) 01))
  240. /**
  241. @brief Complements a %DD if a condition is true.
  242. @details Complements a %DD if condition c is true; c should be
  243. either 0 or 1, because it is used directly (for efficiency). If in
  244. doubt on the values c may take, use "(c) ? Cudd_Not(node) : node".
  245. @sideeffect none
  246. @see Cudd_Not
  247. */
  248. #define Cudd_NotCond(node,c) ((DdNode *)((uintptr_t)(node) ^ (uintptr_t) (c)))
  249. /**
  250. @brief Returns the regular version of a pointer.
  251. @details
  252. @sideeffect none
  253. @see Cudd_Complement Cudd_IsComplement
  254. */
  255. #define Cudd_Regular(node) ((DdNode *)((uintptr_t)(node) & ~(uintptr_t) 01))
  256. /**
  257. @brief Returns the complemented version of a pointer.
  258. @details
  259. @sideeffect none
  260. @see Cudd_Regular Cudd_IsComplement
  261. */
  262. #define Cudd_Complement(node) ((DdNode *)((uintptr_t)(node) | (uintptr_t) 01))
  263. /**
  264. @brief Returns 1 if a pointer is complemented.
  265. @details
  266. @sideeffect none
  267. @see Cudd_Regular Cudd_Complement
  268. */
  269. #define Cudd_IsComplement(node) ((int) ((uintptr_t) (node) & (uintptr_t) 01))
  270. /**
  271. @brief Returns the current position in the order of variable
  272. index.
  273. @details Returns the current position in the order of variable
  274. index. This macro is obsolete and is kept for compatibility. New
  275. applications should use Cudd_ReadPerm instead.
  276. @sideeffect none
  277. @see Cudd_ReadPerm
  278. */
  279. #define Cudd_ReadIndex(dd,index) (Cudd_ReadPerm(dd,index))
  280. /**
  281. @brief Iterates over the cubes of a decision diagram.
  282. @details Iterates over the cubes of a decision diagram f.
  283. <ul>
  284. <li> DdManager *manager;
  285. <li> DdNode *f;
  286. <li> DdGen *gen;
  287. <li> int *cube;
  288. <li> CUDD_VALUE_TYPE value;
  289. </ul>
  290. Cudd_ForeachCube allocates and frees the generator. Therefore the
  291. application should not try to do that. Also, the cube is freed at the
  292. end of Cudd_ForeachCube and hence is not available outside of the loop.<p>
  293. CAUTION: It is assumed that dynamic reordering will not occur while
  294. there are open generators. It is the user's responsibility to make sure
  295. that dynamic reordering does not occur. As long as new nodes are not created
  296. during generation, and dynamic reordering is not called explicitly,
  297. dynamic reordering will not occur. Alternatively, it is sufficient to
  298. disable dynamic reordering. It is a mistake to dispose of a diagram
  299. on which generation is ongoing.
  300. @sideeffect none
  301. @see Cudd_ForeachNode Cudd_FirstCube Cudd_NextCube Cudd_GenFree
  302. Cudd_IsGenEmpty Cudd_AutodynDisable
  303. */
  304. #define Cudd_ForeachCube(manager, f, gen, cube, value)\
  305. for((gen) = Cudd_FirstCube(manager, f, &cube, &value);\
  306. Cudd_IsGenEmpty(gen) ? Cudd_GenFree(gen) : CUDD_TRUE;\
  307. (void) Cudd_NextCube(gen, &cube, &value))
  308. /**
  309. @brief Iterates over the primes of a Boolean function.
  310. @details Iterates over the primes of a Boolean function producing
  311. a prime, but not necessarily irredundant, cover.
  312. <ul>
  313. <li> DdManager *manager;
  314. <li> DdNode *l;
  315. <li> DdNode *u;
  316. <li> DdGen *gen;
  317. <li> int *cube;
  318. </ul>
  319. The Boolean function is described by an upper bound and a lower bound. If
  320. the function is completely specified, the two bounds coincide.
  321. Cudd_ForeachPrime allocates and frees the generator. Therefore the
  322. application should not try to do that. Also, the cube is freed at the
  323. end of Cudd_ForeachPrime and hence is not available outside of the loop.<p>
  324. CAUTION: It is a mistake to change a diagram on which generation is ongoing.
  325. @sideeffect none
  326. @see Cudd_ForeachCube Cudd_FirstPrime Cudd_NextPrime Cudd_GenFree
  327. Cudd_IsGenEmpty
  328. */
  329. #define Cudd_ForeachPrime(manager, l, u, gen, cube)\
  330. for((gen) = Cudd_FirstPrime(manager, l, u, &cube);\
  331. Cudd_IsGenEmpty(gen) ? Cudd_GenFree(gen) : CUDD_TRUE;\
  332. (void) Cudd_NextPrime(gen, &cube))
  333. /**
  334. @brief Iterates over the nodes of a decision diagram.
  335. @details Iterates over the nodes of a decision diagram f.
  336. <ul>
  337. <li> DdManager *manager;
  338. <li> DdNode *f;
  339. <li> DdGen *gen;
  340. <li> DdNode *node;
  341. </ul>
  342. The nodes are returned in a seemingly random order.
  343. Cudd_ForeachNode allocates and frees the generator. Therefore the
  344. application should not try to do that.<p>
  345. CAUTION: It is assumed that dynamic reordering will not occur while
  346. there are open generators. It is the user's responsibility to make sure
  347. that dynamic reordering does not occur. As long as new nodes are not created
  348. during generation, and dynamic reordering is not called explicitly,
  349. dynamic reordering will not occur. Alternatively, it is sufficient to
  350. disable dynamic reordering. It is a mistake to dispose of a diagram
  351. on which generation is ongoing.
  352. @sideeffect none
  353. @see Cudd_ForeachCube Cudd_FirstNode Cudd_NextNode Cudd_GenFree
  354. Cudd_IsGenEmpty Cudd_AutodynDisable
  355. */
  356. #define Cudd_ForeachNode(manager, f, gen, node)\
  357. for((gen) = Cudd_FirstNode(manager, f, &node);\
  358. Cudd_IsGenEmpty(gen) ? Cudd_GenFree(gen) : CUDD_TRUE;\
  359. (void) Cudd_NextNode(gen, &node))
  360. /**
  361. @brief Iterates over the paths of a %ZDD.
  362. @details Iterates over the paths of a %ZDD f.
  363. <ul>
  364. <li> DdManager *manager;
  365. <li> DdNode *f;
  366. <li> DdGen *gen;
  367. <li> int *path;
  368. </ul>
  369. Cudd_zddForeachPath allocates and frees the generator. Therefore the
  370. application should not try to do that. Also, the path is freed at the
  371. end of Cudd_zddForeachPath and hence is not available outside of the loop.<p>
  372. CAUTION: It is assumed that dynamic reordering will not occur while
  373. there are open generators. It is the user's responsibility to make sure
  374. that dynamic reordering does not occur. As long as new nodes are not created
  375. during generation, and dynamic reordering is not called explicitly,
  376. dynamic reordering will not occur. Alternatively, it is sufficient to
  377. disable dynamic reordering. It is a mistake to dispose of a diagram
  378. on which generation is ongoing.
  379. @sideeffect none
  380. @see Cudd_zddFirstPath Cudd_zddNextPath Cudd_GenFree
  381. Cudd_IsGenEmpty Cudd_AutodynDisable
  382. */
  383. #define Cudd_zddForeachPath(manager, f, gen, path)\
  384. for((gen) = Cudd_zddFirstPath(manager, f, &path);\
  385. Cudd_IsGenEmpty(gen) ? Cudd_GenFree(gen) : CUDD_TRUE;\
  386. (void) Cudd_zddNextPath(gen, &path))
  387. /*---------------------------------------------------------------------------*/
  388. /* Function prototypes */
  389. /*---------------------------------------------------------------------------*/
  390. #ifdef __cplusplus
  391. extern "C" {
  392. #endif
  393. extern DdNode * Cudd_addNewVar(DdManager *dd);
  394. extern DdNode * Cudd_addNewVarAtLevel(DdManager *dd, int level);
  395. extern DdNode * Cudd_bddNewVar(DdManager *dd);
  396. extern DdNode * Cudd_bddNewVarAtLevel(DdManager *dd, int level);
  397. extern int Cudd_bddIsVar(DdManager * dd, DdNode * f);
  398. extern DdNode * Cudd_addIthVar(DdManager *dd, int i);
  399. extern DdNode * Cudd_bddIthVar(DdManager *dd, int i);
  400. extern DdNode * Cudd_zddIthVar(DdManager *dd, int i);
  401. extern int Cudd_zddVarsFromBddVars(DdManager *dd, int multiplicity);
  402. extern unsigned int Cudd_ReadMaxIndex(void);
  403. extern DdNode * Cudd_addConst(DdManager *dd, CUDD_VALUE_TYPE c);
  404. extern int Cudd_IsConstant(DdNode *node);
  405. extern int Cudd_IsNonConstant(DdNode *f);
  406. extern DdNode * Cudd_T(DdNode *node);
  407. extern DdNode * Cudd_E(DdNode *node);
  408. extern DdNode const * Cudd_T_const(DdNode const * node);
  409. extern DdNode const * Cudd_E_const(DdNode const * node);
  410. extern CUDD_VALUE_TYPE Cudd_V(DdNode const * node);
  411. extern unsigned long Cudd_ReadStartTime(DdManager *unique);
  412. extern unsigned long Cudd_ReadElapsedTime(DdManager *unique);
  413. extern void Cudd_SetStartTime(DdManager *unique, unsigned long st);
  414. extern void Cudd_ResetStartTime(DdManager *unique);
  415. extern unsigned long Cudd_ReadTimeLimit(DdManager *unique);
  416. extern unsigned long Cudd_SetTimeLimit(DdManager *unique, unsigned long tl);
  417. extern void Cudd_UpdateTimeLimit(DdManager * unique);
  418. extern void Cudd_IncreaseTimeLimit(DdManager * unique, unsigned long increase);
  419. extern void Cudd_UnsetTimeLimit(DdManager *unique);
  420. extern int Cudd_TimeLimited(DdManager *unique);
  421. extern void Cudd_RegisterTerminationCallback(DdManager *unique, DD_THFP callback, void * callback_arg);
  422. extern void Cudd_UnregisterTerminationCallback(DdManager *unique);
  423. extern DD_OOMFP Cudd_RegisterOutOfMemoryCallback(DdManager *unique, DD_OOMFP callback);
  424. extern void Cudd_UnregisterOutOfMemoryCallback(DdManager *unique);
  425. extern void Cudd_RegisterTimeoutHandler(DdManager *unique, DD_TOHFP handler, void *arg);
  426. extern DD_TOHFP Cudd_ReadTimeoutHandler(DdManager *unique, void **argp);
  427. extern void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method);
  428. extern void Cudd_AutodynDisable(DdManager *unique);
  429. extern int Cudd_ReorderingStatus(DdManager *unique, Cudd_ReorderingType *method);
  430. extern void Cudd_AutodynEnableZdd(DdManager *unique, Cudd_ReorderingType method);
  431. extern void Cudd_AutodynDisableZdd(DdManager *unique);
  432. extern int Cudd_ReorderingStatusZdd(DdManager *unique, Cudd_ReorderingType *method);
  433. extern int Cudd_zddRealignmentEnabled(DdManager *unique);
  434. extern void Cudd_zddRealignEnable(DdManager *unique);
  435. extern void Cudd_zddRealignDisable(DdManager *unique);
  436. extern int Cudd_bddRealignmentEnabled(DdManager *unique);
  437. extern void Cudd_bddRealignEnable(DdManager *unique);
  438. extern void Cudd_bddRealignDisable(DdManager *unique);
  439. extern DdNode * Cudd_ReadOne(DdManager *dd);
  440. extern DdNode * Cudd_ReadZddOne(DdManager *dd, int i);
  441. extern DdNode * Cudd_ReadZero(DdManager *dd);
  442. extern DdNode * Cudd_ReadLogicZero(DdManager *dd);
  443. extern DdNode * Cudd_ReadPlusInfinity(DdManager *dd);
  444. extern DdNode * Cudd_ReadMinusInfinity(DdManager *dd);
  445. extern DdNode * Cudd_ReadBackground(DdManager *dd);
  446. extern void Cudd_SetBackground(DdManager *dd, DdNode *bck);
  447. extern unsigned int Cudd_ReadCacheSlots(DdManager *dd);
  448. extern double Cudd_ReadCacheUsedSlots(DdManager * dd);
  449. extern double Cudd_ReadCacheLookUps(DdManager *dd);
  450. extern double Cudd_ReadCacheHits(DdManager *dd);
  451. extern double Cudd_ReadRecursiveCalls(DdManager * dd);
  452. extern unsigned int Cudd_ReadMinHit(DdManager *dd);
  453. extern void Cudd_SetMinHit(DdManager *dd, unsigned int hr);
  454. extern unsigned int Cudd_ReadLooseUpTo(DdManager *dd);
  455. extern void Cudd_SetLooseUpTo(DdManager *dd, unsigned int lut);
  456. extern unsigned int Cudd_ReadMaxCache(DdManager *dd);
  457. extern unsigned int Cudd_ReadMaxCacheHard(DdManager *dd);
  458. extern void Cudd_SetMaxCacheHard(DdManager *dd, unsigned int mc);
  459. extern int Cudd_ReadSize(DdManager *dd);
  460. extern int Cudd_ReadZddSize(DdManager *dd);
  461. extern unsigned int Cudd_ReadSlots(DdManager *dd);
  462. extern double Cudd_ReadUsedSlots(DdManager * dd);
  463. extern double Cudd_ExpectedUsedSlots(DdManager * dd);
  464. extern unsigned int Cudd_ReadKeys(DdManager *dd);
  465. extern unsigned int Cudd_ReadDead(DdManager *dd);
  466. extern unsigned int Cudd_ReadMinDead(DdManager *dd);
  467. extern unsigned int Cudd_ReadReorderings(DdManager *dd);
  468. extern unsigned int Cudd_ReadMaxReorderings(DdManager *dd);
  469. extern void Cudd_SetMaxReorderings(DdManager *dd, unsigned int mr);
  470. extern long Cudd_ReadReorderingTime(DdManager * dd);
  471. extern int Cudd_ReadGarbageCollections(DdManager * dd);
  472. extern long Cudd_ReadGarbageCollectionTime(DdManager * dd);
  473. extern double Cudd_ReadNodesFreed(DdManager * dd);
  474. extern double Cudd_ReadNodesDropped(DdManager * dd);
  475. extern double Cudd_ReadUniqueLookUps(DdManager * dd);
  476. extern double Cudd_ReadUniqueLinks(DdManager * dd);
  477. extern int Cudd_ReadSiftMaxVar(DdManager *dd);
  478. extern void Cudd_SetSiftMaxVar(DdManager *dd, int smv);
  479. extern int Cudd_ReadSiftMaxSwap(DdManager *dd);
  480. extern void Cudd_SetSiftMaxSwap(DdManager *dd, int sms);
  481. extern double Cudd_ReadMaxGrowth(DdManager *dd);
  482. extern void Cudd_SetMaxGrowth(DdManager *dd, double mg);
  483. extern double Cudd_ReadMaxGrowthAlternate(DdManager * dd);
  484. extern void Cudd_SetMaxGrowthAlternate(DdManager * dd, double mg);
  485. extern int Cudd_ReadReorderingCycle(DdManager * dd);
  486. extern void Cudd_SetReorderingCycle(DdManager * dd, int cycle);
  487. extern unsigned int Cudd_NodeReadIndex(DdNode const * node);
  488. extern int Cudd_ReadPerm(DdManager *dd, int i);
  489. extern int Cudd_ReadPermZdd(DdManager *dd, int i);
  490. extern int Cudd_ReadInvPerm(DdManager *dd, int i);
  491. extern int Cudd_ReadInvPermZdd(DdManager *dd, int i);
  492. extern DdNode * Cudd_ReadVars(DdManager *dd, int i);
  493. extern CUDD_VALUE_TYPE Cudd_ReadEpsilon(DdManager *dd);
  494. extern void Cudd_SetEpsilon(DdManager *dd, CUDD_VALUE_TYPE ep);
  495. extern Cudd_AggregationType Cudd_ReadGroupcheck(DdManager *dd);
  496. extern void Cudd_SetGroupcheck(DdManager *dd, Cudd_AggregationType gc);
  497. extern int Cudd_GarbageCollectionEnabled(DdManager *dd);
  498. extern void Cudd_EnableGarbageCollection(DdManager *dd);
  499. extern void Cudd_DisableGarbageCollection(DdManager *dd);
  500. extern int Cudd_DeadAreCounted(DdManager *dd);
  501. extern void Cudd_TurnOnCountDead(DdManager *dd);
  502. extern void Cudd_TurnOffCountDead(DdManager *dd);
  503. extern int Cudd_ReadRecomb(DdManager *dd);
  504. extern void Cudd_SetRecomb(DdManager *dd, int recomb);
  505. extern int Cudd_ReadSymmviolation(DdManager *dd);
  506. extern void Cudd_SetSymmviolation(DdManager *dd, int symmviolation);
  507. extern int Cudd_ReadArcviolation(DdManager *dd);
  508. extern void Cudd_SetArcviolation(DdManager *dd, int arcviolation);
  509. extern int Cudd_ReadPopulationSize(DdManager *dd);
  510. extern void Cudd_SetPopulationSize(DdManager *dd, int populationSize);
  511. extern int Cudd_ReadNumberXovers(DdManager *dd);
  512. extern void Cudd_SetNumberXovers(DdManager *dd, int numberXovers);
  513. extern unsigned int Cudd_ReadOrderRandomization(DdManager * dd);
  514. extern void Cudd_SetOrderRandomization(DdManager * dd, unsigned int factor);
  515. extern size_t Cudd_ReadMemoryInUse(DdManager *dd);
  516. extern int Cudd_PrintInfo(DdManager *dd, FILE *fp);
  517. extern long Cudd_ReadPeakNodeCount(DdManager *dd);
  518. extern int Cudd_ReadPeakLiveNodeCount(DdManager * dd);
  519. extern long Cudd_ReadNodeCount(DdManager *dd);
  520. extern long Cudd_zddReadNodeCount(DdManager *dd);
  521. extern int Cudd_AddHook(DdManager *dd, DD_HFP f, Cudd_HookType where);
  522. extern int Cudd_RemoveHook(DdManager *dd, DD_HFP f, Cudd_HookType where);
  523. extern int Cudd_IsInHook(DdManager * dd, DD_HFP f, Cudd_HookType where);
  524. extern int Cudd_StdPreReordHook(DdManager *dd, const char *str, void *data);
  525. extern int Cudd_StdPostReordHook(DdManager *dd, const char *str, void *data);
  526. extern int Cudd_EnableReorderingReporting(DdManager *dd);
  527. extern int Cudd_DisableReorderingReporting(DdManager *dd);
  528. extern int Cudd_ReorderingReporting(DdManager *dd);
  529. extern int Cudd_PrintGroupedOrder(DdManager * dd, const char *str, void *data);
  530. extern int Cudd_EnableOrderingMonitoring(DdManager *dd);
  531. extern int Cudd_DisableOrderingMonitoring(DdManager *dd);
  532. extern int Cudd_OrderingMonitoring(DdManager *dd);
  533. extern void Cudd_SetApplicationHook(DdManager *dd, void * value);
  534. extern void * Cudd_ReadApplicationHook(DdManager *dd);
  535. extern Cudd_ErrorType Cudd_ReadErrorCode(DdManager *dd);
  536. extern void Cudd_ClearErrorCode(DdManager *dd);
  537. extern DD_OOMFP Cudd_InstallOutOfMemoryHandler(DD_OOMFP newHandler);
  538. extern FILE * Cudd_ReadStdout(DdManager *dd);
  539. extern void Cudd_SetStdout(DdManager *dd, FILE *fp);
  540. extern FILE * Cudd_ReadStderr(DdManager *dd);
  541. extern void Cudd_SetStderr(DdManager *dd, FILE *fp);
  542. extern unsigned int Cudd_ReadNextReordering(DdManager *dd);
  543. extern void Cudd_SetNextReordering(DdManager *dd, unsigned int next);
  544. extern double Cudd_ReadSwapSteps(DdManager *dd);
  545. extern unsigned int Cudd_ReadMaxLive(DdManager *dd);
  546. extern void Cudd_SetMaxLive(DdManager *dd, unsigned int maxLive);
  547. extern size_t Cudd_ReadMaxMemory(DdManager *dd);
  548. extern size_t Cudd_SetMaxMemory(DdManager *dd, size_t maxMemory);
  549. extern int Cudd_bddBindVar(DdManager *dd, int index);
  550. extern int Cudd_bddUnbindVar(DdManager *dd, int index);
  551. extern int Cudd_bddVarIsBound(DdManager *dd, int index);
  552. extern DdNode * Cudd_addExistAbstract(DdManager *manager, DdNode *f, DdNode *cube);
  553. extern DdNode * Cudd_addUnivAbstract(DdManager *manager, DdNode *f, DdNode *cube);
  554. extern DdNode * Cudd_addOrAbstract(DdManager *manager, DdNode *f, DdNode *cube);
  555. extern DdNode * Cudd_addMinAbstract(DdManager * manager, DdNode * f, DdNode * cube);
  556. extern DdNode * Cudd_addMaxAbstract(DdManager * manager, DdNode * f, DdNode * cube);
  557. extern DdNode * Cudd_addApply(DdManager *dd, DD_AOP op, DdNode *f, DdNode *g);
  558. extern DdNode * Cudd_addPlus(DdManager *dd, DdNode **f, DdNode **g);
  559. extern DdNode * Cudd_addTimes(DdManager *dd, DdNode **f, DdNode **g);
  560. extern DdNode * Cudd_addThreshold(DdManager *dd, DdNode **f, DdNode **g);
  561. extern DdNode * Cudd_addSetNZ(DdManager *dd, DdNode **f, DdNode **g);
  562. extern DdNode * Cudd_addDivide(DdManager *dd, DdNode **f, DdNode **g);
  563. extern DdNode * Cudd_addMinus(DdManager *dd, DdNode **f, DdNode **g);
  564. extern DdNode * Cudd_addMinimum(DdManager *dd, DdNode **f, DdNode **g);
  565. extern DdNode * Cudd_addMaximum(DdManager *dd, DdNode **f, DdNode **g);
  566. extern DdNode * Cudd_addOneZeroMaximum(DdManager *dd, DdNode **f, DdNode **g);
  567. extern DdNode * Cudd_addDiff(DdManager *dd, DdNode **f, DdNode **g);
  568. extern DdNode * Cudd_addAgreement(DdManager *dd, DdNode **f, DdNode **g);
  569. extern DdNode * Cudd_addOr(DdManager *dd, DdNode **f, DdNode **g);
  570. extern DdNode * Cudd_addNand(DdManager *dd, DdNode **f, DdNode **g);
  571. extern DdNode * Cudd_addNor(DdManager *dd, DdNode **f, DdNode **g);
  572. extern DdNode * Cudd_addXor(DdManager *dd, DdNode **f, DdNode **g);
  573. extern DdNode * Cudd_addXnor(DdManager *dd, DdNode **f, DdNode **g);
  574. extern DdNode * Cudd_addEquals (DdManager *dd, DdNode **f, DdNode **g);
  575. extern DdNode * Cudd_addNotEquals (DdManager *dd, DdNode **f, DdNode **g);
  576. extern DdNode * Cudd_addGreaterThan (DdManager *dd, DdNode **f, DdNode **g);
  577. extern DdNode * Cudd_addGreaterThanEquals (DdManager *dd, DdNode **f, DdNode **g);
  578. extern DdNode * Cudd_addLessThan (DdManager *dd, DdNode **f, DdNode **g);
  579. extern DdNode * Cudd_addLessThanEquals (DdManager *dd, DdNode **f, DdNode **g);
  580. extern DdNode * Cudd_addPow (DdManager *dd, DdNode **f, DdNode **g);
  581. extern DdNode * Cudd_addMod (DdManager *dd, DdNode **f, DdNode **g);
  582. extern DdNode * Cudd_addLogXY (DdManager *dd, DdNode **f, DdNode **g);
  583. extern DdNode * Cudd_addFloor (DdManager * dd, DdNode * f);
  584. extern DdNode * Cudd_addCeil (DdManager * dd, DdNode * f);
  585. extern DdNode * Cudd_addMonadicApply(DdManager * dd, DD_MAOP op, DdNode * f);
  586. extern DdNode * Cudd_addLog(DdManager * dd, DdNode * f);
  587. extern DdNode * Cudd_addFindMax(DdManager *dd, DdNode *f);
  588. extern DdNode * Cudd_addFindMin(DdManager *dd, DdNode *f);
  589. extern DdNode * Cudd_addIthBit(DdManager *dd, DdNode *f, int bit);
  590. extern DdNode * Cudd_addScalarInverse(DdManager *dd, DdNode *f, DdNode *epsilon);
  591. extern DdNode * Cudd_addIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h);
  592. extern DdNode * Cudd_addIteConstant(DdManager *dd, DdNode *f, DdNode *g, DdNode *h);
  593. extern DdNode * Cudd_addEvalConst(DdManager *dd, DdNode *f, DdNode *g);
  594. extern int Cudd_addLeq(DdManager * dd, DdNode * f, DdNode * g);
  595. extern DdNode * Cudd_addCmpl(DdManager *dd, DdNode *f);
  596. extern DdNode * Cudd_addNegate(DdManager *dd, DdNode *f);
  597. extern DdNode * Cudd_addRoundOff(DdManager *dd, DdNode *f, int N);
  598. extern DdNode * Cudd_addWalsh(DdManager *dd, DdNode **x, DdNode **y, int n);
  599. extern DdNode * Cudd_addResidue(DdManager *dd, int n, int m, int options, int top);
  600. extern DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube);
  601. extern DdNode * Cudd_bddAndAbstractLimit(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube, unsigned int limit);
  602. extern int Cudd_ApaNumberOfDigits(int binaryDigits);
  603. extern DdApaNumber Cudd_NewApaNumber(int digits);
  604. extern void Cudd_FreeApaNumber(DdApaNumber number);
  605. extern void Cudd_ApaCopy(int digits, DdConstApaNumber source, DdApaNumber dest);
  606. extern DdApaDigit Cudd_ApaAdd(int digits, DdConstApaNumber a, DdConstApaNumber b, DdApaNumber sum);
  607. extern DdApaDigit Cudd_ApaSubtract(int digits, DdConstApaNumber a, DdConstApaNumber b, DdApaNumber diff);
  608. extern DdApaDigit Cudd_ApaShortDivision(int digits, DdConstApaNumber dividend, DdApaDigit divisor, DdApaNumber quotient);
  609. extern unsigned int Cudd_ApaIntDivision(int digits, DdConstApaNumber dividend, unsigned int divisor, DdApaNumber quotient);
  610. extern void Cudd_ApaShiftRight(int digits, DdApaDigit in, DdConstApaNumber a, DdApaNumber b);
  611. extern void Cudd_ApaSetToLiteral(int digits, DdApaNumber number, DdApaDigit literal);
  612. extern void Cudd_ApaPowerOfTwo(int digits, DdApaNumber number, int power);
  613. extern int Cudd_ApaCompare(int digitsFirst, DdConstApaNumber first, int digitsSecond, DdConstApaNumber second);
  614. extern int Cudd_ApaCompareRatios(int digitsFirst, DdConstApaNumber firstNum, unsigned int firstDen, int digitsSecond, DdConstApaNumber secondNum, unsigned int secondDen);
  615. extern int Cudd_ApaPrintHex(FILE *fp, int digits, DdConstApaNumber number);
  616. extern int Cudd_ApaPrintDecimal(FILE *fp, int digits, DdConstApaNumber number);
  617. extern char * Cudd_ApaStringDecimal(int digits, DdConstApaNumber number);
  618. extern int Cudd_ApaPrintExponential(FILE * fp, int digits, DdConstApaNumber number, int precision);
  619. extern DdApaNumber Cudd_ApaCountMinterm(DdManager const *manager, DdNode *node, int nvars, int *digits);
  620. extern int Cudd_ApaPrintMinterm(FILE *fp, DdManager const *dd, DdNode *node, int nvars);
  621. extern int Cudd_ApaPrintMintermExp(FILE * fp, DdManager const * dd, DdNode *node, int nvars, int precision);
  622. extern int Cudd_ApaPrintDensity(FILE * fp, DdManager * dd, DdNode * node, int nvars);
  623. extern DdNode * Cudd_UnderApprox(DdManager *dd, DdNode *f, int numVars, int threshold, int safe, double quality);
  624. extern DdNode * Cudd_OverApprox(DdManager *dd, DdNode *f, int numVars, int threshold, int safe, double quality);
  625. extern DdNode * Cudd_RemapUnderApprox(DdManager *dd, DdNode *f, int numVars, int threshold, double quality);
  626. extern DdNode * Cudd_RemapOverApprox(DdManager *dd, DdNode *f, int numVars, int threshold, double quality);
  627. extern DdNode * Cudd_BiasedUnderApprox(DdManager *dd, DdNode *f, DdNode *b, int numVars, int threshold, double quality1, double quality0);
  628. extern DdNode * Cudd_BiasedOverApprox(DdManager *dd, DdNode *f, DdNode *b, int numVars, int threshold, double quality1, double quality0);
  629. extern DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube);
  630. extern DdNode * Cudd_bddExistAbstractLimit(DdManager * manager, DdNode * f, DdNode * cube, unsigned int limit);
  631. extern DdNode * Cudd_bddXorExistAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube);
  632. extern DdNode * Cudd_bddUnivAbstract(DdManager *manager, DdNode *f, DdNode *cube);
  633. extern DdNode * Cudd_bddBooleanDiff(DdManager *manager, DdNode *f, int x);
  634. extern int Cudd_bddVarIsDependent(DdManager *dd, DdNode *f, DdNode *var);
  635. extern double Cudd_bddCorrelation(DdManager *manager, DdNode *f, DdNode *g);
  636. extern double Cudd_bddCorrelationWeights(DdManager *manager, DdNode *f, DdNode *g, double *prob);
  637. extern DdNode * Cudd_bddIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h);
  638. extern DdNode * Cudd_bddIteLimit(DdManager *dd, DdNode *f, DdNode *g, DdNode *h, unsigned int limit);
  639. extern DdNode * Cudd_bddIteConstant(DdManager *dd, DdNode *f, DdNode *g, DdNode *h);
  640. extern DdNode * Cudd_bddIntersect(DdManager *dd, DdNode *f, DdNode *g);
  641. extern DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g);
  642. extern DdNode * Cudd_bddAndLimit(DdManager *dd, DdNode *f, DdNode *g, unsigned int limit);
  643. extern DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g);
  644. extern DdNode * Cudd_bddOrLimit(DdManager *dd, DdNode *f, DdNode *g, unsigned int limit);
  645. extern DdNode * Cudd_bddNand(DdManager *dd, DdNode *f, DdNode *g);
  646. extern DdNode * Cudd_bddNor(DdManager *dd, DdNode *f, DdNode *g);
  647. extern DdNode * Cudd_bddXor(DdManager *dd, DdNode *f, DdNode *g);
  648. extern DdNode * Cudd_bddXnor(DdManager *dd, DdNode *f, DdNode *g);
  649. extern DdNode * Cudd_bddXnorLimit(DdManager *dd, DdNode *f, DdNode *g, unsigned int limit);
  650. extern int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g);
  651. extern DdNode * Cudd_addBddThreshold(DdManager *dd, DdNode *f, CUDD_VALUE_TYPE value);
  652. extern DdNode * Cudd_addBddStrictThreshold(DdManager *dd, DdNode *f, CUDD_VALUE_TYPE value);
  653. extern DdNode * Cudd_addBddInterval(DdManager *dd, DdNode *f, CUDD_VALUE_TYPE lower, CUDD_VALUE_TYPE upper);
  654. extern DdNode * Cudd_addBddIthBit(DdManager *dd, DdNode *f, int bit);
  655. extern DdNode * Cudd_BddToAdd(DdManager *dd, DdNode *B);
  656. extern DdNode * Cudd_addBddPattern(DdManager *dd, DdNode *f);
  657. extern DdNode * Cudd_bddTransfer(DdManager *ddSource, DdManager *ddDestination, DdNode *f);
  658. extern int Cudd_DebugCheck(DdManager *table);
  659. extern int Cudd_CheckKeys(DdManager *table);
  660. extern DdNode * Cudd_bddClippingAnd(DdManager *dd, DdNode *f, DdNode *g, int maxDepth, int direction);
  661. extern DdNode * Cudd_bddClippingAndAbstract(DdManager *dd, DdNode *f, DdNode *g, DdNode *cube, int maxDepth, int direction);
  662. extern DdNode * Cudd_Cofactor(DdManager *dd, DdNode *f, DdNode *g);
  663. extern int Cudd_CheckCube(DdManager *dd, DdNode *g);
  664. extern int Cudd_VarsAreSymmetric(DdManager * dd, DdNode * f, int index1, int index2);
  665. extern DdNode * Cudd_bddCompose(DdManager *dd, DdNode *f, DdNode *g, int v);
  666. extern DdNode * Cudd_addCompose(DdManager *dd, DdNode *f, DdNode *g, int v);
  667. extern DdNode * Cudd_addPermute(DdManager *manager, DdNode *node, int *permut);
  668. extern DdNode * Cudd_addSwapVariables(DdManager *dd, DdNode *f, DdNode **x, DdNode **y, int n);
  669. extern DdNode * Cudd_bddPermute(DdManager *manager, DdNode *node, int *permut);
  670. extern DdNode * Cudd_bddVarMap(DdManager *manager, DdNode *f);
  671. extern int Cudd_SetVarMap(DdManager *manager, DdNode **x, DdNode **y, int n);
  672. extern DdNode * Cudd_bddSwapVariables(DdManager *dd, DdNode *f, DdNode **x, DdNode **y, int n);
  673. extern DdNode * Cudd_bddAdjPermuteX(DdManager *dd, DdNode *B, DdNode **x, int n);
  674. extern DdNode * Cudd_addVectorCompose(DdManager *dd, DdNode *f, DdNode **vector);
  675. extern DdNode * Cudd_addGeneralVectorCompose(DdManager *dd, DdNode *f, DdNode **vectorOn, DdNode **vectorOff);
  676. extern DdNode * Cudd_addNonSimCompose(DdManager *dd, DdNode *f, DdNode **vector);
  677. extern DdNode * Cudd_bddVectorCompose(DdManager *dd, DdNode *f, DdNode **vector);
  678. extern int Cudd_bddApproxConjDecomp(DdManager *dd, DdNode *f, DdNode ***conjuncts);
  679. extern int Cudd_bddApproxDisjDecomp(DdManager *dd, DdNode *f, DdNode ***disjuncts);
  680. extern int Cudd_bddIterConjDecomp(DdManager *dd, DdNode *f, DdNode ***conjuncts);
  681. extern int Cudd_bddIterDisjDecomp(DdManager *dd, DdNode *f, DdNode ***disjuncts);
  682. extern int Cudd_bddGenConjDecomp(DdManager *dd, DdNode *f, DdNode ***conjuncts);
  683. extern int Cudd_bddGenDisjDecomp(DdManager *dd, DdNode *f, DdNode ***disjuncts);
  684. extern int Cudd_bddVarConjDecomp(DdManager *dd, DdNode * f, DdNode ***conjuncts);
  685. extern int Cudd_bddVarDisjDecomp(DdManager *dd, DdNode * f, DdNode ***disjuncts);
  686. extern DdNode * Cudd_FindEssential(DdManager *dd, DdNode *f);
  687. extern int Cudd_bddIsVarEssential(DdManager *manager, DdNode *f, int id, int phase);
  688. extern DdTlcInfo * Cudd_FindTwoLiteralClauses(DdManager * dd, DdNode * f);
  689. extern int Cudd_PrintTwoLiteralClauses(DdManager * dd, DdNode * f, char **names, FILE *fp);
  690. extern int Cudd_ReadIthClause(DdTlcInfo * tlc, int i, unsigned *var1, unsigned *var2, int *phase1, int *phase2);
  691. extern void Cudd_tlcInfoFree(DdTlcInfo * t);
  692. extern int Cudd_DumpBlif(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, char *mname, FILE *fp, int mv);
  693. extern int Cudd_DumpBlifBody(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, FILE *fp, int mv);
  694. extern int Cudd_DumpDot(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, FILE *fp);
  695. extern int Cudd_DumpDaVinci(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, FILE *fp);
  696. extern int Cudd_DumpDDcal(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, FILE *fp);
  697. extern int Cudd_DumpFactoredForm(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, FILE *fp);
  698. extern char * Cudd_FactoredFormString(DdManager *dd, DdNode *f, char const * const * inames);
  699. extern DdNode * Cudd_bddConstrain(DdManager *dd, DdNode *f, DdNode *c);
  700. extern DdNode * Cudd_bddRestrict(DdManager *dd, DdNode *f, DdNode *c);
  701. extern DdNode * Cudd_bddNPAnd(DdManager *dd, DdNode *f, DdNode *c);
  702. extern DdNode * Cudd_addConstrain(DdManager *dd, DdNode *f, DdNode *c);
  703. extern DdNode ** Cudd_bddConstrainDecomp(DdManager *dd, DdNode *f);
  704. extern DdNode * Cudd_addRestrict(DdManager *dd, DdNode *f, DdNode *c);
  705. extern DdNode ** Cudd_bddCharToVect(DdManager *dd, DdNode *f);
  706. extern DdNode * Cudd_bddLICompaction(DdManager *dd, DdNode *f, DdNode *c);
  707. extern DdNode * Cudd_bddSqueeze(DdManager *dd, DdNode *l, DdNode *u);
  708. extern DdNode * Cudd_bddInterpolate(DdManager * dd, DdNode * l, DdNode * u);
  709. extern DdNode * Cudd_bddMinimize(DdManager *dd, DdNode *f, DdNode *c);
  710. extern DdNode * Cudd_SubsetCompress(DdManager *dd, DdNode *f, int nvars, int threshold);
  711. extern DdNode * Cudd_SupersetCompress(DdManager *dd, DdNode *f, int nvars, int threshold);
  712. extern int Cudd_addHarwell(FILE *fp, DdManager *dd, DdNode **E, DdNode ***x, DdNode ***y, DdNode ***xn, DdNode ***yn_, int *nx, int *ny, int *m, int *n, int bx, int sx, int by, int sy, int pr);
  713. extern DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, size_t maxMemory);
  714. extern void Cudd_Quit(DdManager *unique);
  715. extern int Cudd_PrintLinear(DdManager *table);
  716. extern int Cudd_ReadLinear(DdManager *table, int x, int y);
  717. extern DdNode * Cudd_bddLiteralSetIntersection(DdManager *dd, DdNode *f, DdNode *g);
  718. extern DdNode * Cudd_addMatrixMultiply(DdManager *dd, DdNode *A, DdNode *B, DdNode **z, int nz);
  719. extern DdNode * Cudd_addTimesPlus(DdManager *dd, DdNode *A, DdNode *B, DdNode **z, int nz);
  720. extern DdNode * Cudd_addTriangle(DdManager *dd, DdNode *f, DdNode *g, DdNode **z, int nz);
  721. extern DdNode * Cudd_addOuterSum(DdManager *dd, DdNode *M, DdNode *r, DdNode *c);
  722. extern DdNode * Cudd_PrioritySelect(DdManager *dd, DdNode *R, DdNode **x, DdNode **y, DdNode **z, DdNode *Pi, int n, DD_PRFP PiFunc);
  723. extern DdNode * Cudd_Xgty(DdManager *dd, int N, DdNode **z, DdNode **x, DdNode **y);
  724. extern DdNode * Cudd_Xeqy(DdManager *dd, int N, DdNode **x, DdNode **y);
  725. extern DdNode * Cudd_addXeqy(DdManager *dd, int N, DdNode **x, DdNode **y);
  726. extern DdNode * Cudd_Dxygtdxz(DdManager *dd, int N, DdNode **x, DdNode **y, DdNode **z);
  727. extern DdNode * Cudd_Dxygtdyz(DdManager *dd, int N, DdNode **x, DdNode **y, DdNode **z);
  728. extern DdNode * Cudd_Inequality(DdManager * dd, int N, int c, DdNode ** x, DdNode ** y);
  729. extern DdNode * Cudd_Disequality(DdManager * dd, int N, int c, DdNode ** x, DdNode ** y);
  730. extern DdNode * Cudd_bddInterval(DdManager * dd, int N, DdNode ** x, unsigned int lowerB, unsigned int upperB);
  731. extern DdNode * Cudd_CProjection(DdManager *dd, DdNode *R, DdNode *Y);
  732. extern DdNode * Cudd_addHamming(DdManager *dd, DdNode **xVars, DdNode **yVars, int nVars);
  733. extern int Cudd_MinHammingDist(DdManager *dd, DdNode *f, int *minterm, int upperBound);
  734. extern DdNode * Cudd_bddClosestCube(DdManager *dd, DdNode * f, DdNode *g, int *distance);
  735. extern int Cudd_addRead(FILE *fp, DdManager *dd, DdNode **E, DdNode ***x, DdNode ***y, DdNode ***xn, DdNode ***yn_, int *nx, int *ny, int *m, int *n, int bx, int sx, int by, int sy);
  736. extern int Cudd_bddRead(FILE *fp, DdManager *dd, DdNode **E, DdNode ***x, DdNode ***y, int *nx, int *ny, int *m, int *n, int bx, int sx, int by, int sy);
  737. extern void Cudd_Ref(DdNode *n);
  738. extern void Cudd_RecursiveDeref(DdManager *table, DdNode *n);
  739. extern void Cudd_IterDerefBdd(DdManager *table, DdNode *n);
  740. extern void Cudd_DelayedDerefBdd(DdManager * table, DdNode * n);
  741. extern void Cudd_RecursiveDerefZdd(DdManager *table, DdNode *n);
  742. extern void Cudd_Deref(DdNode *node);
  743. extern int Cudd_CheckZeroRef(DdManager *manager);
  744. extern int Cudd_ReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize);
  745. extern int Cudd_ShuffleHeap(DdManager *table, int *permutation);
  746. extern DdNode * Cudd_Eval(DdManager *dd, DdNode *f, int *inputs);
  747. extern DdNode * Cudd_ShortestPath(DdManager *manager, DdNode *f, int *weight, int *support, int *length);
  748. extern DdNode * Cudd_LargestCube(DdManager *manager, DdNode *f, int *length);
  749. extern int Cudd_ShortestLength(DdManager *manager, DdNode *f, int *weight);
  750. extern DdNode * Cudd_Decreasing(DdManager *dd, DdNode *f, int i);
  751. extern DdNode * Cudd_Increasing(DdManager *dd, DdNode *f, int i);
  752. extern int Cudd_EquivDC(DdManager *dd, DdNode *F, DdNode *G, DdNode *D);
  753. extern int Cudd_bddLeqUnless(DdManager *dd, DdNode *f, DdNode *g, DdNode *D);
  754. extern int Cudd_EqualSupNorm(DdManager *dd, DdNode *f, DdNode *g, CUDD_VALUE_TYPE tolerance, int pr);
  755. extern int Cudd_EqualSupNormRel (DdManager *dd, DdNode *f, DdNode *g, CUDD_VALUE_TYPE tolerance, int pr);
  756. extern DdNode * Cudd_bddMakePrime(DdManager *dd, DdNode *cube, DdNode *f);
  757. extern DdNode * Cudd_bddMaximallyExpand(DdManager *dd, DdNode *lb, DdNode *ub, DdNode *f);
  758. extern DdNode * Cudd_bddLargestPrimeUnate(DdManager *dd , DdNode *f, DdNode *phaseBdd);
  759. extern double * Cudd_CofMinterm(DdManager *dd, DdNode *node);
  760. extern DdNode * Cudd_SolveEqn(DdManager * bdd, DdNode *F, DdNode *Y, DdNode **G, int **yIndex, int n);
  761. extern DdNode * Cudd_VerifySol(DdManager * bdd, DdNode *F, DdNode **G, int *yIndex, int n);
  762. extern DdNode * Cudd_SplitSet(DdManager *manager, DdNode *S, DdNode **xVars, int n, double m);
  763. extern DdNode * Cudd_SubsetHeavyBranch(DdManager *dd, DdNode *f, int numVars, int threshold);
  764. extern DdNode * Cudd_SupersetHeavyBranch(DdManager *dd, DdNode *f, int numVars, int threshold);
  765. extern DdNode * Cudd_SubsetShortPaths(DdManager *dd, DdNode *f, int numVars, int threshold, int hardlimit);
  766. extern DdNode * Cudd_SupersetShortPaths(DdManager *dd, DdNode *f, int numVars, int threshold, int hardlimit);
  767. extern void Cudd_SymmProfile(DdManager *table, int lower, int upper);
  768. extern unsigned int Cudd_Prime(unsigned int p);
  769. extern int Cudd_Reserve(DdManager *manager, int amount);
  770. extern int Cudd_PrintMinterm(DdManager *manager, DdNode *node);
  771. extern int Cudd_bddPrintCover(DdManager *dd, DdNode *l, DdNode *u);
  772. extern int Cudd_PrintDebug(DdManager *dd, DdNode *f, int n, int pr);
  773. extern int Cudd_PrintSummary(DdManager * dd, DdNode * f, int n, int mode);
  774. extern int Cudd_DagSize(DdNode *node);
  775. extern int Cudd_EstimateCofactor(DdManager *dd, DdNode * node, int i, int phase);
  776. extern int Cudd_EstimateCofactorSimple(DdNode * node, int i);
  777. extern int Cudd_SharingSize(DdNode **nodeArray, int n);
  778. extern double Cudd_CountMinterm(DdManager *manager, DdNode *node, int nvars);
  779. #ifdef EPD_H_
  780. extern int Cudd_EpdCountMinterm(DdManager const *manager, DdNode *node, int nvars, EpDouble *epd);
  781. #endif
  782. extern long double Cudd_LdblCountMinterm(DdManager const *manager, DdNode *node, int nvars);
  783. extern int Cudd_EpdPrintMinterm(DdManager const * dd, DdNode * node, int nvars);
  784. extern double Cudd_CountPath(DdNode *node);
  785. extern double Cudd_CountPathsToNonZero(DdNode *node);
  786. extern int Cudd_SupportIndices(DdManager * dd, DdNode * f, int **indices);
  787. extern DdNode * Cudd_Support(DdManager *dd, DdNode *f);
  788. extern int * Cudd_SupportIndex(DdManager *dd, DdNode *f);
  789. extern int Cudd_SupportSize(DdManager *dd, DdNode *f);
  790. extern int Cudd_VectorSupportIndices(DdManager * dd, DdNode ** F, int n, int **indices);
  791. extern DdNode * Cudd_VectorSupport(DdManager *dd, DdNode **F, int n);
  792. extern int * Cudd_VectorSupportIndex(DdManager *dd, DdNode **F, int n);
  793. extern int Cudd_VectorSupportSize(DdManager *dd, DdNode **F, int n);
  794. extern int Cudd_ClassifySupport(DdManager *dd, DdNode *f, DdNode *g, DdNode **common, DdNode **onlyF, DdNode **onlyG);
  795. extern int Cudd_CountLeaves(DdNode *node);
  796. extern int Cudd_bddPickOneCube(DdManager *ddm, DdNode *node, char *string);
  797. extern DdNode * Cudd_bddPickOneMinterm(DdManager *dd, DdNode *f, DdNode **vars, int n);
  798. extern DdNode ** Cudd_bddPickArbitraryMinterms(DdManager *dd, DdNode *f, DdNode **vars, int n, int k);
  799. extern DdNode * Cudd_SubsetWithMaskVars(DdManager *dd, DdNode *f, DdNode **vars, int nvars, DdNode **maskVars, int mvars);
  800. extern DdGen * Cudd_FirstCube(DdManager *dd, DdNode *f, int **cube, CUDD_VALUE_TYPE *value);
  801. extern int Cudd_NextCube(DdGen *gen, int **cube, CUDD_VALUE_TYPE *value);
  802. extern DdGen * Cudd_FirstPrime(DdManager *dd, DdNode *l, DdNode *u, int **cube);
  803. extern int Cudd_NextPrime(DdGen *gen, int **cube);
  804. extern DdNode * Cudd_bddComputeCube(DdManager *dd, DdNode **vars, int *phase, int n);
  805. extern DdNode * Cudd_addComputeCube(DdManager *dd, DdNode **vars, int *phase, int n);
  806. extern DdNode * Cudd_CubeArrayToBdd(DdManager *dd, int *array);
  807. extern int Cudd_BddToCubeArray(DdManager *dd, DdNode *cube, int *array);
  808. extern DdGen * Cudd_FirstNode(DdManager *dd, DdNode *f, DdNode **node);
  809. extern int Cudd_NextNode(DdGen *gen, DdNode **node);
  810. extern int Cudd_GenFree(DdGen *gen);
  811. extern int Cudd_IsGenEmpty(DdGen *gen);
  812. extern DdNode * Cudd_IndicesToCube(DdManager *dd, int *array, int n);
  813. extern void Cudd_PrintVersion(FILE *fp);
  814. extern double Cudd_AverageDistance(DdManager *dd);
  815. extern int32_t Cudd_Random(DdManager * dd);
  816. extern void Cudd_Srandom(DdManager * dd, int32_t seed);
  817. extern double Cudd_Density(DdManager *dd, DdNode *f, int nvars);
  818. extern void Cudd_OutOfMem(size_t size);
  819. extern void Cudd_OutOfMemSilent(size_t size);
  820. extern int Cudd_zddCount(DdManager *zdd, DdNode *P);
  821. extern double Cudd_zddCountDouble(DdManager *zdd, DdNode *P);
  822. extern DdNode * Cudd_zddProduct(DdManager *dd, DdNode *f, DdNode *g);
  823. extern DdNode * Cudd_zddUnateProduct(DdManager *dd, DdNode *f, DdNode *g);
  824. extern DdNode * Cudd_zddWeakDiv(DdManager *dd, DdNode *f, DdNode *g);
  825. extern DdNode * Cudd_zddDivide(DdManager *dd, DdNode *f, DdNode *g);
  826. extern DdNode * Cudd_zddWeakDivF(DdManager *dd, DdNode *f, DdNode *g);
  827. extern DdNode * Cudd_zddDivideF(DdManager *dd, DdNode *f, DdNode *g);
  828. extern DdNode * Cudd_zddComplement(DdManager *dd, DdNode *node);
  829. extern DdNode * Cudd_zddIsop(DdManager *dd, DdNode *L, DdNode *U, DdNode **zdd_I);
  830. extern DdNode * Cudd_bddIsop(DdManager *dd, DdNode *L, DdNode *U);
  831. extern DdNode * Cudd_MakeBddFromZddCover(DdManager *dd, DdNode *node);
  832. extern int Cudd_zddDagSize(DdNode *p_node);
  833. extern double Cudd_zddCountMinterm(DdManager *zdd, DdNode *node, int path);
  834. extern void Cudd_zddPrintSubtable(DdManager *table);
  835. extern DdNode * Cudd_zddPortFromBdd(DdManager *dd, DdNode *B);
  836. extern DdNode * Cudd_zddPortToBdd(DdManager *dd, DdNode *f);
  837. extern int Cudd_zddReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize);
  838. extern int Cudd_zddShuffleHeap(DdManager *table, int *permutation);
  839. extern DdNode * Cudd_zddIte(DdManager *dd, DdNode *f, DdNode *g, DdNode *h);
  840. extern DdNode * Cudd_zddUnion(DdManager *dd, DdNode *P, DdNode *Q);
  841. extern DdNode * Cudd_zddIntersect(DdManager *dd, DdNode *P, DdNode *Q);
  842. extern DdNode * Cudd_zddDiff(DdManager *dd, DdNode *P, DdNode *Q);
  843. extern DdNode * Cudd_zddDiffConst(DdManager *zdd, DdNode *P, DdNode *Q);
  844. extern DdNode * Cudd_zddSubset1(DdManager *dd, DdNode *P, int var);
  845. extern DdNode * Cudd_zddSubset0(DdManager *dd, DdNode *P, int var);
  846. extern DdNode * Cudd_zddChange(DdManager *dd, DdNode *P, int var);
  847. extern void Cudd_zddSymmProfile(DdManager *table, int lower, int upper);
  848. extern int Cudd_zddPrintMinterm(DdManager *zdd, DdNode *node);
  849. extern int Cudd_zddPrintCover(DdManager *zdd, DdNode *node);
  850. extern int Cudd_zddPrintDebug(DdManager *zdd, DdNode *f, int n, int pr);
  851. extern DdGen * Cudd_zddFirstPath(DdManager *zdd, DdNode *f, int **path);
  852. extern int Cudd_zddNextPath(DdGen *gen, int **path);
  853. extern char * Cudd_zddCoverPathToString(DdManager *zdd, int *path, char *str);
  854. extern DdNode * Cudd_zddSupport(DdManager * dd, DdNode * f);
  855. extern int Cudd_zddDumpDot(DdManager *dd, int n, DdNode **f, char const * const *inames, char const * const *onames, FILE *fp);
  856. extern int Cudd_bddSetPiVar(DdManager *dd, int index);
  857. extern int Cudd_bddSetPsVar(DdManager *dd, int index);
  858. extern int Cudd_bddSetNsVar(DdManager *dd, int index);
  859. extern int Cudd_bddIsPiVar(DdManager *dd, int index);
  860. extern int Cudd_bddIsPsVar(DdManager *dd, int index);
  861. extern int Cudd_bddIsNsVar(DdManager *dd, int index);
  862. extern int Cudd_bddSetPairIndex(DdManager *dd, int index, int pairIndex);
  863. extern int Cudd_bddReadPairIndex(DdManager *dd, int index);
  864. extern int Cudd_bddSetVarToBeGrouped(DdManager *dd, int index);
  865. extern int Cudd_bddSetVarHardGroup(DdManager *dd, int index);
  866. extern int Cudd_bddResetVarToBeGrouped(DdManager *dd, int index);
  867. extern int Cudd_bddIsVarToBeGrouped(DdManager *dd, int index);
  868. extern int Cudd_bddSetVarToBeUngrouped(DdManager *dd, int index);
  869. extern int Cudd_bddIsVarToBeUngrouped(DdManager *dd, int index);
  870. extern int Cudd_bddIsVarHardGroup(DdManager *dd, int index);
  871. #ifdef MTR_H_
  872. extern MtrNode * Cudd_ReadTree(DdManager *dd);
  873. extern void Cudd_SetTree(DdManager *dd, MtrNode *tree);
  874. extern void Cudd_FreeTree(DdManager *dd);
  875. extern MtrNode * Cudd_ReadZddTree(DdManager *dd);
  876. extern void Cudd_SetZddTree(DdManager *dd, MtrNode *tree);
  877. extern void Cudd_FreeZddTree(DdManager *dd);
  878. extern MtrNode * Cudd_MakeTreeNode(DdManager *dd, unsigned int low, unsigned int size, unsigned int type);
  879. extern MtrNode * Cudd_MakeZddTreeNode(DdManager *dd, unsigned int low, unsigned int size, unsigned int type);
  880. #endif
  881. #ifdef __cplusplus
  882. } /* end of extern "C" */
  883. #endif
  884. #endif /* CUDD_H_ */