abc-master
|
Go to the source code of this file.
Functions | |
static DdApaNumber | cuddApaCountMintermAux (DdNode *node, int digits, DdApaNumber max, DdApaNumber min, st__table *table) |
static enum st__retval | cuddApaStCountfree (char *key, char *value, char *arg) |
int | Cudd_ApaNumberOfDigits (int binaryDigits) |
DdApaNumber | Cudd_NewApaNumber (int digits) |
void | Cudd_ApaCopy (int digits, DdApaNumber source, DdApaNumber dest) |
DdApaDigit | Cudd_ApaAdd (int digits, DdApaNumber a, DdApaNumber b, DdApaNumber sum) |
DdApaDigit | Cudd_ApaSubtract (int digits, DdApaNumber a, DdApaNumber b, DdApaNumber diff) |
DdApaDigit | Cudd_ApaShortDivision (int digits, DdApaNumber dividend, DdApaDigit divisor, DdApaNumber quotient) |
unsigned int | Cudd_ApaIntDivision (int digits, DdApaNumber dividend, unsigned int divisor, DdApaNumber quotient) |
void | Cudd_ApaShiftRight (int digits, DdApaDigit in, DdApaNumber a, DdApaNumber b) |
void | Cudd_ApaSetToLiteral (int digits, DdApaNumber number, DdApaDigit literal) |
void | Cudd_ApaPowerOfTwo (int digits, DdApaNumber number, int power) |
int | Cudd_ApaCompare (int digitsFirst, DdApaNumber first, int digitsSecond, DdApaNumber second) |
int | Cudd_ApaCompareRatios (int digitsFirst, DdApaNumber firstNum, unsigned int firstDen, int digitsSecond, DdApaNumber secondNum, unsigned int secondDen) |
int | Cudd_ApaPrintHex (FILE *fp, int digits, DdApaNumber number) |
int | Cudd_ApaPrintDecimal (FILE *fp, int digits, DdApaNumber number) |
int | Cudd_ApaPrintExponential (FILE *fp, int digits, DdApaNumber number, int precision) |
DdApaNumber | Cudd_ApaCountMinterm (DdManager *manager, DdNode *node, int nvars, int *digits) |
int | Cudd_ApaPrintMinterm (FILE *fp, DdManager *dd, DdNode *node, int nvars) |
int | Cudd_ApaPrintMintermExp (FILE *fp, DdManager *dd, DdNode *node, int nvars, int precision) |
int | Cudd_ApaPrintDensity (FILE *fp, DdManager *dd, DdNode *node, int nvars) |
Variables | |
static ABC_NAMESPACE_IMPL_START char rcsid[] | DD_UNUSED = "$Id: cuddApa.c,v 1.19 2009/03/08 01:27:50 fabio Exp $" |
static DdNode * | background |
static DdNode * | zero |
DdApaDigit Cudd_ApaAdd | ( | int | digits, |
DdApaNumber | a, | ||
DdApaNumber | b, | ||
DdApaNumber | sum | ||
) |
Function********************************************************************
Synopsis [Adds two arbitrary precision integers.]
Description [Adds two arbitrary precision integers. Returns the carry out of the most significant digit.]
SideEffects [The result of the sum is stored in parameter sum
.]
SeeAlso []
Definition at line 221 of file cuddApa.c.
int Cudd_ApaCompare | ( | int | digitsFirst, |
DdApaNumber | first, | ||
int | digitsSecond, | ||
DdApaNumber | second | ||
) |
Function********************************************************************
Synopsis [Compares two arbitrary precision integers.]
Description [Compares two arbitrary precision integers. Returns 1 if the first number is larger; 0 if they are equal; -1 if the second number is larger.]
SideEffects [None]
SeeAlso []
Definition at line 449 of file cuddApa.c.
int Cudd_ApaCompareRatios | ( | int | digitsFirst, |
DdApaNumber | firstNum, | ||
unsigned int | firstDen, | ||
int | digitsSecond, | ||
DdApaNumber | secondNum, | ||
unsigned int | secondDen | ||
) |
Function********************************************************************
Synopsis [Compares the ratios of two arbitrary precision integers to two unsigned ints.]
Description [Compares the ratios of two arbitrary precision integers to two unsigned ints. Returns 1 if the first number is larger; 0 if they are equal; -1 if the second number is larger.]
SideEffects [None]
SeeAlso []
Definition at line 489 of file cuddApa.c.
void Cudd_ApaCopy | ( | int | digits, |
DdApaNumber | source, | ||
DdApaNumber | dest | ||
) |
Function********************************************************************
Synopsis [Makes a copy of an arbitrary precision integer.]
Description [Makes a copy of an arbitrary precision integer.]
SideEffects [Changes parameter dest
.]
SeeAlso []
DdApaNumber Cudd_ApaCountMinterm | ( | DdManager * | manager, |
DdNode * | node, | ||
int | nvars, | ||
int * | digits | ||
) |
Function********************************************************************
Synopsis [Counts the number of minterms of a DD.]
Description [Counts the number of minterms of a DD. The function is assumed to depend on nvars variables. The minterm count is represented as an arbitrary precision unsigned integer, to allow for any number of variables CUDD supports. Returns a pointer to the array representing the number of minterms of the function rooted at node if successful; NULL otherwise.]
SideEffects [The number of digits of the result is returned in parameter digits
.]
SeeAlso [Cudd_CountMinterm]
Definition at line 684 of file cuddApa.c.
unsigned int Cudd_ApaIntDivision | ( | int | digits, |
DdApaNumber | dividend, | ||
unsigned int | divisor, | ||
DdApaNumber | quotient | ||
) |
Function********************************************************************
Synopsis [Divides an arbitrary precision integer by an integer.]
Description [Divides an arbitrary precision integer by a 32-bit unsigned integer. Returns the remainder of the division. This procedure relies on the assumption that the number of bits of a DdApaDigit plus the number of bits of an unsigned int is less the number of bits of the mantissa of a double. This guarantees that the product of a DdApaDigit and an unsigned int can be represented without loss of precision by a double. On machines where this assumption is not satisfied, this procedure will malfunction.]
SideEffects [The quotient is returned in parameter quotient
.]
SeeAlso [Cudd_ApaShortDivision]
Definition at line 324 of file cuddApa.c.
int Cudd_ApaNumberOfDigits | ( | int | binaryDigits | ) |
AutomaticEnd Function********************************************************************
Synopsis [Finds the number of digits for an arbitrary precision integer.]
Description [Finds the number of digits for an arbitrary precision integer given the maximum number of binary digits. The number of binary digits should be positive. Returns the number of digits if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 147 of file cuddApa.c.
void Cudd_ApaPowerOfTwo | ( | int | digits, |
DdApaNumber | number, | ||
int | power | ||
) |
Function********************************************************************
Synopsis [Sets an arbitrary precision integer to a power of two.]
Description [Sets an arbitrary precision integer to a power of two. If the power of two is too large to be represented, the number is set to 0.]
SideEffects [The result is returned in parameter number
.]
SeeAlso []
Definition at line 417 of file cuddApa.c.
int Cudd_ApaPrintDecimal | ( | FILE * | fp, |
int | digits, | ||
DdApaNumber | number | ||
) |
Function********************************************************************
Synopsis [Prints an arbitrary precision integer in decimal format.]
Description [Prints an arbitrary precision integer in decimal format. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [Cudd_ApaPrintHex Cudd_ApaPrintExponential]
Definition at line 562 of file cuddApa.c.
Function********************************************************************
Synopsis [Prints the density of a BDD or ADD using arbitrary precision arithmetic.]
Description [Prints the density of a BDD or ADD using arbitrary precision arithmetic. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 838 of file cuddApa.c.
int Cudd_ApaPrintExponential | ( | FILE * | fp, |
int | digits, | ||
DdApaNumber | number, | ||
int | precision | ||
) |
Function********************************************************************
Synopsis [Prints an arbitrary precision integer in exponential format.]
Description [Prints an arbitrary precision integer in exponential format. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [Cudd_ApaPrintHex Cudd_ApaPrintDecimal]
Definition at line 619 of file cuddApa.c.
int Cudd_ApaPrintHex | ( | FILE * | fp, |
int | digits, | ||
DdApaNumber | number | ||
) |
Function********************************************************************
Synopsis [Prints an arbitrary precision integer in hexadecimal format.]
Description [Prints an arbitrary precision integer in hexadecimal format. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [Cudd_ApaPrintDecimal Cudd_ApaPrintExponential]
Definition at line 532 of file cuddApa.c.
Function********************************************************************
Synopsis [Prints the number of minterms of a BDD or ADD using arbitrary precision arithmetic.]
Description [Prints the number of minterms of a BDD or ADD using arbitrary precision arithmetic. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [Cudd_ApaPrintMintermExp]
Definition at line 761 of file cuddApa.c.
Function********************************************************************
Synopsis [Prints the number of minterms of a BDD or ADD in exponential format using arbitrary precision arithmetic.]
Description [Prints the number of minterms of a BDD or ADD in exponential format using arbitrary precision arithmetic. Parameter precision controls the number of signficant digits printed. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [Cudd_ApaPrintMinterm]
Definition at line 800 of file cuddApa.c.
void Cudd_ApaSetToLiteral | ( | int | digits, |
DdApaNumber | number, | ||
DdApaDigit | literal | ||
) |
Function********************************************************************
Synopsis [Sets an arbitrary precision integer to a one-digit literal.]
Description [Sets an arbitrary precision integer to a one-digit literal.]
SideEffects [The result is returned in parameter number
.]
SeeAlso []
void Cudd_ApaShiftRight | ( | int | digits, |
DdApaDigit | in, | ||
DdApaNumber | a, | ||
DdApaNumber | b | ||
) |
Function********************************************************************
Synopsis [Shifts right an arbitrary precision integer by one binary place.]
Description [Shifts right an arbitrary precision integer by one binary place. The most significant binary digit of the result is taken from parameter in
.]
SideEffects [The result is returned in parameter b
.]
SeeAlso []
Definition at line 361 of file cuddApa.c.
DdApaDigit Cudd_ApaShortDivision | ( | int | digits, |
DdApaNumber | dividend, | ||
DdApaDigit | divisor, | ||
DdApaNumber | quotient | ||
) |
Function********************************************************************
Synopsis [Divides an arbitrary precision integer by a digit.]
Description [Divides an arbitrary precision integer by a digit.]
SideEffects [The quotient is returned in parameter quotient
.]
SeeAlso []
Definition at line 283 of file cuddApa.c.
DdApaDigit Cudd_ApaSubtract | ( | int | digits, |
DdApaNumber | a, | ||
DdApaNumber | b, | ||
DdApaNumber | diff | ||
) |
Function********************************************************************
Synopsis [Subtracts two arbitrary precision integers.]
Description [Subtracts two arbitrary precision integers. Returns the borrow out of the most significant digit.]
SideEffects [The result of the subtraction is stored in parameter diff
.]
SeeAlso []
Definition at line 253 of file cuddApa.c.
DdApaNumber Cudd_NewApaNumber | ( | int | digits | ) |
Function********************************************************************
Synopsis [Allocates memory for an arbitrary precision integer.]
Description [Allocates memory for an arbitrary precision integer. Returns a pointer to the allocated memory if successful; NULL otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 174 of file cuddApa.c.
|
static |
AutomaticStart
Function********************************************************************
Synopsis [Performs the recursive step of Cudd_ApaCountMinterm.]
Description [Performs the recursive step of Cudd_ApaCountMinterm. It is based on the following identity. Let |f| be the number of minterms of f. Then: <xmp> |f| = (|f0|+|f1|)/2 </xmp> where f0 and f1 are the two cofactors of f. Uses the identity |f'| = max - |f|
. The procedure expects the argument "node" to be a regular pointer, and guarantees this condition is met in the recursive calls. For efficiency, the result of a call is cached only if the node has a reference count greater than 1. Returns the number of minterms of the function rooted at node.]
SideEffects [None]
Definition at line 899 of file cuddApa.c.
|
static |
Function********************************************************************
Synopsis [Frees the memory used to store the minterm counts recorded in the visited table.]
Description [Frees the memory used to store the minterm counts recorded in the visited table. Returns st__CONTINUE.]
SideEffects [None]
Definition at line 972 of file cuddApa.c.
|
static |
CFile***********************************************************************
FileName [cuddApa.c]
PackageName [cudd]
Synopsis [Arbitrary precision arithmetic functions.]
Description [External procedures included in this module:
Static procedures included in this module:
]
Author [Fabio Somenzi]
Copyright [Copyright (c) 1995-2004, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]