1 /**CHeaderFile***************************************************************
7 Synopsis [Class definitions for C++ object-oriented encapsulation of
10 Description [Class definitions for C++ object-oriented encapsulation of
15 Author [Fabio Somenzi]
17 Copyright [Copyright (c) 1995-2004, Regents of the University of Colorado
21 Redistribution and use in source and binary forms, with or without
22 modification, are permitted provided that the following conditions
25 Redistributions of source code must retain the above copyright
26 notice, this list of conditions and the following disclaimer.
28 Redistributions in binary form must reproduce the above copyright
29 notice, this list of conditions and the following disclaimer in the
30 documentation and/or other materials provided with the distribution.
32 Neither the name of the University of Colorado nor the names of its
33 contributors may be used to endorse or promote products derived from
34 this software without specific prior written permission.
36 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
39 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
40 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
41 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
42 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
45 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
46 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
47 POSSIBILITY OF SUCH DAMAGE.]
49 Revision [$Id: cuddObj.hh,v 1.11 2009/02/21 19:41:38 fabio Exp fabio $]
51 ******************************************************************************/
56 /*---------------------------------------------------------------------------*/
58 /*---------------------------------------------------------------------------*/
71 /*---------------------------------------------------------------------------*/
72 /* Type definitions */
73 /*---------------------------------------------------------------------------*/
83 typedef void (*PFC
)(string
); // error function type
85 /*---------------------------------------------------------------------------*/
86 /* Class definitions */
87 /*---------------------------------------------------------------------------*/
90 /**Class***********************************************************************
92 Synopsis [Base class for all decision diagrams in CUDD.]
96 SeeAlso [Cudd ABDD ADD BDD ZDD]
98 ******************************************************************************/
106 inline DdManager
* checkSameManager(const DD
&other
) const;
107 inline void checkReturnValue(const DdNode
*result
) const;
108 inline void checkReturnValue(const int result
, const int expected
= 1)
111 DD(Cudd
*ddManager
, DdNode
*ddNode
);
115 Cudd
*manager() const;
116 inline DdNode
* getNode() const;
117 int nodeCount() const;
118 unsigned int NodeReadIndex() const;
123 /**Class***********************************************************************
125 Synopsis [Class for ADDs and BDDs.]
129 SeeAlso [Cudd ADD BDD]
131 ******************************************************************************/
132 class ABDD
: public DD
{
137 ABDD(Cudd
*bddManager
, DdNode
*bddNode
);
139 ABDD(const ABDD
&from
);
141 int operator==(const ABDD
&other
) const;
142 int operator!=(const ABDD
&other
) const;
143 void print(int nvars
, int verbosity
= 1) const;
144 DdApaNumber
ApaCountMinterm(int nvars
, int * digits
) const;
145 void ApaPrintMinterm(int nvars
, FILE * fp
= stdout
) const;
146 void EpdPrintMinterm(int nvars
, FILE * fp
= stdout
) const;
147 BDD
FindEssential() const;
148 void PrintTwoLiteralClauses(char ** names
, FILE * fp
= stdout
) const;
149 BDD
ShortestPath(int * weight
, int * support
, int * length
) const;
150 BDD
LargestCube(int * length
) const;
151 int ShortestLength(int * weight
) const;
152 int EquivDC(const ABDD
& G
, const ABDD
& D
) const;
153 double * CofMinterm() const;
154 void PrintMinterm() const;
155 double CountMinterm(int nvars
) const;
156 double CountPath() const;
158 int SupportSize() const;
159 void ClassifySupport(const ABDD
& g
, BDD
* common
, BDD
* onlyF
, BDD
* onlyG
)
161 int CountLeaves() const;
162 DdGen
* FirstCube(int ** cube
, CUDD_VALUE_TYPE
* value
) const;
163 double Density(int nvars
) const;
168 /**Class***********************************************************************
170 Synopsis [Class for BDDs.]
176 ******************************************************************************/
177 class BDD
: public ABDD
{
180 BDD(Cudd
*bddManager
, DdNode
*bddNode
);
182 BDD(const BDD
&from
);
183 int operator==(const BDD
& other
) const;
184 int operator!=(const BDD
& other
) const;
185 BDD
operator=(const BDD
& right
);
186 int operator<=(const BDD
& other
) const;
187 int operator>=(const BDD
& other
) const;
188 int operator<(const BDD
& other
) const;
189 int operator>(const BDD
& other
) const;
190 BDD
operator!() const;
191 BDD
operator~() const;
192 BDD
operator*(const BDD
& other
) const;
193 BDD
operator*=(const BDD
& other
);
194 BDD
operator&(const BDD
& other
) const;
195 BDD
operator&=(const BDD
& other
);
196 BDD
operator+(const BDD
& other
) const;
197 BDD
operator+=(const BDD
& other
);
198 BDD
operator|(const BDD
& other
) const;
199 BDD
operator|=(const BDD
& other
);
200 BDD
operator^(const BDD
& other
) const;
201 BDD
operator^=(const BDD
& other
);
202 BDD
operator-(const BDD
& other
) const;
203 BDD
operator-=(const BDD
& other
);
204 BDD
AndAbstract(const BDD
& g
, const BDD
& cube
) const;
205 BDD
AndAbstractLimit(const BDD
& g
, const BDD
& cube
, unsigned int limit
)
211 double quality
= 1.0) const;
216 double quality
= 1.0) const;
217 BDD
RemapUnderApprox(int numVars
, int threshold
= 0, double quality
= 1.0)
219 BDD
RemapOverApprox(int numVars
, int threshold
= 0, double quality
= 1.0)
221 BDD
ExistAbstract(const BDD
& cube
) const;
222 BDD
XorExistAbstract(const BDD
& g
, const BDD
& cube
) const;
223 BDD
UnivAbstract(const BDD
& cube
) const;
224 BDD
BooleanDiff(int x
) const;
225 int VarIsDependent(const BDD
& var
) const;
226 double Correlation(const BDD
& g
) const;
227 double CorrelationWeights(const BDD
& g
, double * prob
) const;
228 BDD
Ite(const BDD
& g
, const BDD
& h
) const;
229 BDD
IteConstant(const BDD
& g
, const BDD
& h
) const;
230 BDD
Intersect(const BDD
& g
) const;
231 BDD
And(const BDD
& g
) const;
232 BDD
AndLimit(const BDD
& g
, unsigned int limit
) const;
233 BDD
Or(const BDD
& g
) const;
234 BDD
Nand(const BDD
& g
) const;
235 BDD
Nor(const BDD
& g
) const;
236 BDD
Xor(const BDD
& g
) const;
237 BDD
Xnor(const BDD
& g
) const;
238 int Leq(const BDD
& g
) const;
240 BDD
Transfer(Cudd
& destination
) const;
241 BDD
ClippingAnd(const BDD
& g
, int maxDepth
, int direction
) const;
242 BDD
ClippingAndAbstract(const BDD
& g
, const BDD
& cube
, int maxDepth
,
243 int direction
) const;
244 BDD
Cofactor(const BDD
& g
) const;
245 BDD
Compose(const BDD
& g
, int v
) const;
246 BDD
Permute(int * permut
) const;
247 BDD
SwapVariables(BDDvector x
, BDDvector y
) const;
248 BDD
AdjPermuteX(BDDvector x
) const;
249 BDD
VectorCompose(BDDvector vector
) const;
250 void ApproxConjDecomp(BDD
* g
, BDD
* h
) const;
251 void ApproxDisjDecomp(BDD
* g
, BDD
* h
) const;
252 void IterConjDecomp(BDD
* g
, BDD
* h
) const;
253 void IterDisjDecomp(BDD
* g
, BDD
* h
) const;
254 void GenConjDecomp(BDD
* g
, BDD
* h
) const;
255 void GenDisjDecomp(BDD
* g
, BDD
* h
) const;
256 void VarConjDecomp(BDD
* g
, BDD
* h
) const;
257 void VarDisjDecomp(BDD
* g
, BDD
* h
) const;
258 int IsVarEssential(int id
, int phase
) const;
259 BDD
Constrain(const BDD
& c
) const;
260 BDD
Restrict(const BDD
& c
) const;
261 BDD
NPAnd(const BDD
& g
) const;
262 BDDvector
ConstrainDecomp() const;
263 BDDvector
CharToVect() const;
264 BDD
LICompaction(const BDD
& c
) const;
265 BDD
Squeeze(const BDD
& u
) const;
266 BDD
Minimize(const BDD
& c
) const;
267 BDD
SubsetCompress(int nvars
, int threshold
) const;
268 BDD
SupersetCompress(int nvars
, int threshold
) const;
269 BDD
LiteralSetIntersection(const BDD
& g
) const;
270 BDD
PrioritySelect(BDDvector x
, BDDvector y
, BDDvector z
, const BDD
& Pi
,
271 DD_PRFP Pifunc
) const;
272 BDD
CProjection(const BDD
& Y
) const;
273 int MinHammingDist(int *minterm
, int upperBound
) const;
274 BDD
Eval(int * inputs
) const;
275 BDD
Decreasing(int i
) const;
276 BDD
Increasing(int i
) const;
277 BDD
SolveEqn(const BDD
& Y
, BDD
* G
, int ** yIndex
, int n
) const;
278 BDD
VerifySol(BDD
* G
, int * yIndex
, int n
) const;
279 BDD
SplitSet(BDDvector xVars
, double m
) const;
280 BDD
SubsetHeavyBranch(int numVars
, int threshold
) const;
281 BDD
SupersetHeavyBranch(int numVars
, int threshold
) const;
282 BDD
SubsetShortPaths(int numVars
, int threshold
, int hardlimit
) const;
283 BDD
SupersetShortPaths(int numVars
, int threshold
, int hardlimit
) const;
284 void PrintCover() const;
285 void PrintCover(const BDD
& u
) const;
286 int EstimateCofactor(int i
, int phase
) const;
287 int EstimateCofactorSimple(int i
) const;
288 void PickOneCube(char * string
) const;
289 BDD
PickOneMinterm(BDDvector vars
) const;
290 DdGen
* FirstNode(BDD
* fnode
) const;
291 BDD
zddIsop(const BDD
& U
, ZDD
* zdd_I
) const;
292 BDD
Isop(const BDD
& U
) const;
293 ZDD
PortToZdd() const;
298 /**Class***********************************************************************
300 Synopsis [Class for ADDs.]
306 ******************************************************************************/
307 class ADD
: public ABDD
{
310 ADD(Cudd
*bddManager
, DdNode
*bddNode
);
312 ADD(const ADD
&from
);
313 int operator==(const ADD
& other
) const;
314 int operator!=(const ADD
& other
) const;
315 ADD
operator=(const ADD
& right
);
316 // Relational operators
317 int operator<=(const ADD
& other
) const;
318 int operator>=(const ADD
& other
) const;
319 int operator<(const ADD
& other
) const;
320 int operator>(const ADD
& other
) const;
321 // Arithmetic operators
322 ADD
operator-() const;
323 ADD
operator*(const ADD
& other
) const;
324 ADD
operator*=(const ADD
& other
);
325 ADD
operator+(const ADD
& other
) const;
326 ADD
operator+=(const ADD
& other
);
327 ADD
operator-(const ADD
& other
) const;
328 ADD
operator-=(const ADD
& other
);
330 ADD
operator~() const;
331 ADD
operator&(const ADD
& other
) const;
332 ADD
operator&=(const ADD
& other
);
333 ADD
operator|(const ADD
& other
) const;
334 ADD
operator|=(const ADD
& other
);
335 ADD
ExistAbstract(const ADD
& cube
) const;
336 ADD
UnivAbstract(const ADD
& cube
) const;
337 ADD
OrAbstract(const ADD
& cube
) const;
338 ADD
Plus(const ADD
& g
) const;
339 ADD
Times(const ADD
& g
) const;
340 ADD
Threshold(const ADD
& g
) const;
341 ADD
SetNZ(const ADD
& g
) const;
342 ADD
Divide(const ADD
& g
) const;
343 ADD
Minus(const ADD
& g
) const;
344 ADD
Minimum(const ADD
& g
) const;
345 ADD
Maximum(const ADD
& g
) const;
346 ADD
OneZeroMaximum(const ADD
& g
) const;
347 ADD
Diff(const ADD
& g
) const;
348 ADD
Agreement(const ADD
& g
) const;
349 ADD
Or(const ADD
& g
) const;
350 ADD
Nand(const ADD
& g
) const;
351 ADD
Nor(const ADD
& g
) const;
352 ADD
Xor(const ADD
& g
) const;
353 ADD
Xnor(const ADD
& g
) const;
357 ADD
IthBit(int bit
) const;
358 ADD
ScalarInverse(const ADD
& epsilon
) const;
359 ADD
Ite(const ADD
& g
, const ADD
& h
) const;
360 ADD
IteConstant(const ADD
& g
, const ADD
& h
) const;
361 ADD
EvalConst(const ADD
& g
) const;
362 int Leq(const ADD
& g
) const;
365 ADD
RoundOff(int N
) const;
366 BDD
BddThreshold(CUDD_VALUE_TYPE value
) const;
367 BDD
BddStrictThreshold(CUDD_VALUE_TYPE value
) const;
368 BDD
BddInterval(CUDD_VALUE_TYPE lower
, CUDD_VALUE_TYPE upper
) const;
369 BDD
BddIthBit(int bit
) const;
370 BDD
BddPattern() const;
371 ADD
Cofactor(const ADD
& g
) const;
372 ADD
Compose(const ADD
& g
, int v
) const;
373 ADD
Permute(int * permut
) const;
374 ADD
SwapVariables(ADDvector x
, ADDvector y
) const;
375 ADD
VectorCompose(ADDvector vector
) const;
376 ADD
NonSimCompose(ADDvector vector
) const;
377 ADD
Constrain(const ADD
& c
) const;
378 ADD
Restrict(const ADD
& c
) const;
379 ADD
MatrixMultiply(const ADD
& B
, ADDvector z
) const;
380 ADD
TimesPlus(const ADD
& B
, ADDvector z
) const;
381 ADD
Triangle(const ADD
& g
, ADDvector z
) const;
382 ADD
Eval(int * inputs
) const;
383 int EqualSupNorm(const ADD
& g
, CUDD_VALUE_TYPE tolerance
, int pr
) const;
388 /**Class***********************************************************************
390 Synopsis [Class for ZDDs.]
396 ******************************************************************************/
397 class ZDD
: public DD
{
400 ZDD(Cudd
*bddManager
, DdNode
*bddNode
);
402 ZDD(const ZDD
&from
);
404 ZDD
operator=(const ZDD
& right
);
405 int operator==(const ZDD
& other
) const;
406 int operator!=(const ZDD
& other
) const;
407 int operator<=(const ZDD
& other
) const;
408 int operator>=(const ZDD
& other
) const;
409 int operator<(const ZDD
& other
) const;
410 int operator>(const ZDD
& other
) const;
411 void print(int nvars
, int verbosity
= 1) const;
412 ZDD
operator*(const ZDD
& other
) const;
413 ZDD
operator*=(const ZDD
& other
);
414 ZDD
operator&(const ZDD
& other
) const;
415 ZDD
operator&=(const ZDD
& other
);
416 ZDD
operator+(const ZDD
& other
) const;
417 ZDD
operator+=(const ZDD
& other
);
418 ZDD
operator|(const ZDD
& other
) const;
419 ZDD
operator|=(const ZDD
& other
);
420 ZDD
operator-(const ZDD
& other
) const;
421 ZDD
operator-=(const ZDD
& other
);
423 double CountDouble() const;
424 ZDD
Product(const ZDD
& g
) const;
425 ZDD
UnateProduct(const ZDD
& g
) const;
426 ZDD
WeakDiv(const ZDD
& g
) const;
427 ZDD
Divide(const ZDD
& g
) const;
428 ZDD
WeakDivF(const ZDD
& g
) const;
429 ZDD
DivideF(const ZDD
& g
) const;
430 double CountMinterm(int path
) const;
431 BDD
PortToBdd() const;
432 ZDD
Ite(const ZDD
& g
, const ZDD
& h
) const;
433 ZDD
Union(const ZDD
& Q
) const;
434 ZDD
Intersect(const ZDD
& Q
) const;
435 ZDD
Diff(const ZDD
& Q
) const;
436 ZDD
DiffConst(const ZDD
& Q
) const;
437 ZDD
Subset1(int var
) const;
438 ZDD
Subset0(int var
) const;
439 ZDD
Change(int var
) const;
440 void PrintMinterm() const;
441 void PrintCover() const;
446 /**Class***********************************************************************
448 Synopsis [Class for CUDD managers.]
454 ******************************************************************************/
470 unsigned int numVars
= 0,
471 unsigned int numVarsZ
= 0,
472 unsigned int numSlots
= CUDD_UNIQUE_SLOTS
,
473 unsigned int cacheSize
= CUDD_CACHE_SLOTS
,
474 unsigned long maxMemory
= 0);
477 PFC
setHandler(PFC newHandler
);
478 PFC
getHandler() const;
479 DdManager
*getManager() const {return p
->manager
;}
480 inline void makeVerbose() {p
->verbose
= 1;}
481 inline void makeTerse() {p
->verbose
= 0;}
482 inline int isVerbose() const {return p
->verbose
;}
483 inline void checkReturnValue(const DdNode
*result
) const;
484 inline void checkReturnValue(const int result
) const;
485 Cudd
& operator=(const Cudd
& right
);
488 BDD
bddVar(int index
);
492 ADD
addVar(int index
);
495 ADD
constant(CUDD_VALUE_TYPE c
);
498 ZDD
zddVar(int index
);
501 ADD
addNewVarAtLevel(int level
);
502 BDD
bddNewVarAtLevel(int level
);
503 void zddVarsFromBddVars(int multiplicity
);
504 void AutodynEnable(Cudd_ReorderingType method
);
505 void AutodynDisable();
506 int ReorderingStatus(Cudd_ReorderingType
* method
) const;
507 void AutodynEnableZdd(Cudd_ReorderingType method
);
508 void AutodynDisableZdd();
509 int ReorderingStatusZdd(Cudd_ReorderingType
* method
) const;
510 int zddRealignmentEnabled() const;
511 void zddRealignEnable();
512 void zddRealignDisable();
513 int bddRealignmentEnabled() const;
514 void bddRealignEnable();
515 void bddRealignDisable();
517 void SetBackground(ADD bg
);
518 unsigned int ReadCacheSlots() const;
519 double ReadCacheUsedSlots() const;
520 double ReadCacheLookUps() const;
521 double ReadCacheHits() const;
522 unsigned int ReadMinHit() const;
523 void SetMinHit(unsigned int hr
);
524 unsigned int ReadLooseUpTo() const;
525 void SetLooseUpTo(unsigned int lut
);
526 unsigned int ReadMaxCache() const;
527 unsigned int ReadMaxCacheHard() const;
528 void SetMaxCacheHard(unsigned int mc
);
529 int ReadSize() const;
530 int ReadZddSize() const;
531 unsigned int ReadSlots() const;
532 unsigned int ReadKeys() const;
533 unsigned int ReadDead() const;
534 unsigned int ReadMinDead() const;
535 int ReadReorderings() const;
536 long ReadReorderingTime() const;
537 int ReadGarbageCollections() const;
538 long ReadGarbageCollectionTime() const;
539 int ReadSiftMaxVar() const;
540 void SetSiftMaxVar(int smv
);
541 int ReadSiftMaxSwap() const;
542 void SetSiftMaxSwap(int sms
);
543 double ReadMaxGrowth() const;
544 void SetMaxGrowth(double mg
);
545 MtrNode
* ReadTree() const;
546 void SetTree(MtrNode
* tree
);
548 MtrNode
* ReadZddTree() const;
549 void SetZddTree(MtrNode
* tree
);
551 int ReadPerm(int i
) const;
552 int ReadPermZdd(int i
) const;
553 int ReadInvPerm(int i
) const;
554 int ReadInvPermZdd(int i
) const;
556 CUDD_VALUE_TYPE
ReadEpsilon() const;
557 void SetEpsilon(CUDD_VALUE_TYPE ep
);
558 Cudd_AggregationType
ReadGroupcheck() const;
559 void SetGroupcheck(Cudd_AggregationType gc
);
560 int GarbageCollectionEnabled() const;
561 void EnableGarbageCollection();
562 void DisableGarbageCollection();
563 int DeadAreCounted() const;
564 void TurnOnCountDead();
565 void TurnOffCountDead();
566 int ReadRecomb() const;
567 void SetRecomb(int recomb
);
568 int ReadSymmviolation() const;
569 void SetSymmviolation(int symmviolation
);
570 int ReadArcviolation() const;
571 void SetArcviolation(int arcviolation
);
572 int ReadPopulationSize() const;
573 void SetPopulationSize(int populationSize
);
574 int ReadNumberXovers() const;
575 void SetNumberXovers(int numberXovers
);
576 unsigned long ReadMemoryInUse() const;
577 long ReadPeakNodeCount() const;
578 long ReadNodeCount() const;
579 long zddReadNodeCount() const;
580 void AddHook(DD_HFP f
, Cudd_HookType where
);
581 void RemoveHook(DD_HFP f
, Cudd_HookType where
);
582 int IsInHook(DD_HFP f
, Cudd_HookType where
) const;
583 void EnableReorderingReporting();
584 void DisableReorderingReporting();
585 int ReorderingReporting();
586 int ReadErrorCode() const;
587 void ClearErrorCode();
588 FILE *ReadStdout() const;
589 void SetStdout(FILE *);
590 FILE *ReadStderr() const;
591 void SetStderr(FILE *);
592 unsigned int ReadNextReordering() const;
593 double ReadSwapSteps() const;
594 unsigned int ReadMaxLive() const;
595 void SetMaxLive(unsigned int);
596 unsigned long ReadMaxMemory() const;
597 void SetMaxMemory(unsigned long);
599 int bddUnbindVar(int);
600 int bddVarIsBound(int) const;
601 ADD
Walsh(ADDvector x
, ADDvector y
);
602 ADD
addResidue(int n
, int m
, int options
, int top
);
603 int ApaNumberOfDigits(int binaryDigits
) const;
604 DdApaNumber
NewApaNumber(int digits
) const;
605 void ApaCopy(int digits
, DdApaNumber source
, DdApaNumber dest
) const;
606 DdApaDigit
ApaAdd(int digits
, DdApaNumber a
, DdApaNumber b
, DdApaNumber
608 DdApaDigit
ApaSubtract(int digits
, DdApaNumber a
, DdApaNumber b
,
609 DdApaNumber diff
) const;
610 DdApaDigit
ApaShortDivision(int digits
, DdApaNumber dividend
, DdApaDigit
611 divisor
, DdApaNumber quotient
) const;
612 void ApaShiftRight(int digits
, DdApaDigit in
, DdApaNumber a
, DdApaNumber
614 void ApaSetToLiteral(int digits
, DdApaNumber number
, DdApaDigit literal
)
616 void ApaPowerOfTwo(int digits
, DdApaNumber number
, int power
) const;
617 void ApaPrintHex(FILE * fp
, int digits
, DdApaNumber number
) const;
618 void ApaPrintDecimal(FILE * fp
, int digits
, DdApaNumber number
) const;
621 MtrNode
* MakeTreeNode(unsigned int low
, unsigned int size
, unsigned int type
);
622 // void Harwell(FILE * fp, ADD* E, ADD** x, ADD** y, ADD** xn, ADD** yn_, int * nx, int * ny, int * m, int * n, int bx, int sx, int by, int sy, int pr);
624 int ReadLinear(int x
, int y
);
625 BDD
Xgty(BDDvector z
, BDDvector x
, BDDvector y
);
626 BDD
Xeqy(BDDvector x
, BDDvector y
);
627 ADD
Xeqy(ADDvector x
, ADDvector y
);
628 BDD
Dxygtdxz(BDDvector x
, BDDvector y
, BDDvector z
);
629 BDD
Dxygtdyz(BDDvector x
, BDDvector y
, BDDvector z
);
630 BDD
Inequality(int c
, BDDvector x
, BDDvector y
);
631 BDD
Disequality(int c
, BDDvector x
, BDDvector y
);
632 BDD
Interval(BDDvector x
, unsigned int lowerB
, unsigned int upperB
);
633 ADD
Hamming(ADDvector xVars
, ADDvector yVars
);
634 // void Read(FILE * fp, ADD* E, ADD** x, ADD** y, ADD** xn, ADD** yn_, int * nx, int * ny, int * m, int * n, int bx, int sx, int by, int sy);
635 // void Read(FILE * fp, BDD* E, BDD** x, BDD** y, int * nx, int * ny, int * m, int * n, int bx, int sx, int by, int sy);
636 void ReduceHeap(Cudd_ReorderingType heuristic
, int minsize
);
637 void ShuffleHeap(int * permutation
);
638 void SymmProfile(int lower
, int upper
) const;
639 unsigned int Prime(unsigned int pr
) const;
640 int SharingSize(DD
* nodes
, int n
) const;
641 BDD
bddComputeCube(BDD
* vars
, int * phase
, int n
);
642 ADD
addComputeCube(ADD
* vars
, int * phase
, int n
);
643 int NextNode(DdGen
* gen
, BDD
* nnode
);
644 BDD
IndicesToCube(int * array
, int n
);
645 void PrintVersion(FILE * fp
) const;
646 double AverageDistance() const;
648 void Srandom(long seed
);
649 MtrNode
* MakeZddTreeNode(unsigned int low
, unsigned int size
, unsigned int type
);
650 void zddPrintSubtable() const;
651 void zddReduceHeap(Cudd_ReorderingType heuristic
, int minsize
);
652 void zddShuffleHeap(int * permutation
);
653 void zddSymmProfile(int lower
, int upper
) const;
654 //void DumpDot(int n, ZDD* f, char ** inames, char ** onames, FILE * fp);
659 /**Class***********************************************************************
661 Synopsis [Class for BDD vectors.]
667 ******************************************************************************/
677 BDDvector(int size
, Cudd
*manager
= 0, DdNode
**nodes
= 0);
678 BDDvector(const BDDvector
&from
);
680 BDDvector
& operator=(const BDDvector
& right
);
681 BDD
& operator[](int i
) const;
682 int count() const {return p
->size
;}
683 Cudd
*manager() const {return p
->manager
;}
684 void DumpDot(char ** inames
= 0, char ** onames
= 0, FILE * fp
= stdout
)
689 FILE * fp
= stdout
) const;
696 void DumpDDcal(char ** inames
= 0, char ** onames
= 0, FILE * fp
= stdout
)
698 void DumpFactoredForm(
701 FILE * fp
= stdout
) const;
702 BDD
VectorSupport() const;
703 int nodeCount() const;
704 int VectorSupportSize() const;
709 /**Class***********************************************************************
711 Synopsis [Class for ADD vectors.]
717 ******************************************************************************/
727 ADDvector(int size
, Cudd
*manager
= 0, DdNode
**nodes
= 0);
728 ADDvector(const ADDvector
&from
);
730 ADDvector
& operator=(const ADDvector
& right
);
731 ADD
& operator[](int i
) const;
732 int count() const {return p
->size
;}
733 Cudd
*manager() const {return p
->manager
;}
734 void DumpDot(char ** inames
= 0, char ** onames
= 0, FILE * fp
= stdout
)
739 FILE * fp
= stdout
) const;
740 BDD
VectorSupport() const;
741 int VectorSupportSize() const;
746 /**Class***********************************************************************
748 Synopsis [Class for ZDD vectors.]
754 ******************************************************************************/
764 ZDDvector(int size
, Cudd
*manager
= 0, DdNode
**nodes
= 0);
765 ZDDvector(const ZDDvector
&from
);
767 ZDDvector
& operator=(const ZDDvector
& right
);
768 ZDD
& operator[](int i
) const;
769 int count() const {return p
->size
;}
770 Cudd
*manager() const {return p
->manager
;}
771 void DumpDot(char ** inames
= 0, char ** onames
= 0, FILE * fp
= stdout
)
777 extern void defaultError(string message
);
778 extern int NextCube(DdGen
* gen
, int ** cube
, CUDD_VALUE_TYPE
* value
);
779 extern int GenFree(DdGen
* gen
);
780 extern int IsGenEmpty(DdGen
* gen
);