cudd
3.0.0
The University of Colorado Decision Diagram Package
|
Functions for the detection of essential variables. More...
Data Structures | |
struct | DdTlcInfo |
This structure holds the set of clauses for a node. More... | |
struct | TlClause |
This structure is for temporary representation of sets of clauses. More... | |
Macros | |
#define | BPL 64 |
#define | LOGBPL 6 |
Typedefs | |
typedef ptruint | BitVector |
typedef struct TlClause | TlClause |
Functions | |
DdNode * | Cudd_FindEssential (DdManager *dd, DdNode *f) |
Finds the essential variables of a DD. More... | |
int | Cudd_bddIsVarEssential (DdManager *manager, DdNode *f, int id, int phase) |
Determines whether a given variable is essential with a given phase in a BDD. More... | |
DdTlcInfo * | Cudd_FindTwoLiteralClauses (DdManager *dd, DdNode *f) |
Finds the two literal clauses of a DD. More... | |
int | Cudd_ReadIthClause (DdTlcInfo *tlc, int i, unsigned *var1, unsigned *var2, int *phase1, int *phase2) |
Accesses the i-th clause of a DD. More... | |
int | Cudd_PrintTwoLiteralClauses (DdManager *dd, DdNode *f, char **names, FILE *fp) |
Prints the one- and two-literal clauses of a DD. More... | |
void | Cudd_tlcInfoFree (DdTlcInfo *t) |
Frees a DdTlcInfo Structure. More... | |
static DdNode * | ddFindEssentialRecur (DdManager *dd, DdNode *f) |
Implements the recursive step of Cudd_FindEssential. More... | |
static DdTlcInfo * | ddFindTwoLiteralClausesRecur (DdManager *dd, DdNode *f, st_table *table, BitVector *Tolv, BitVector *Tolp, BitVector *Eolv, BitVector *Eolp) |
Implements the recursive step of Cudd_FindTwoLiteralClauses. More... | |
static DdTlcInfo * | computeClauses (DdTlcInfo *Tres, DdTlcInfo *Eres, DdHalfWord label, int size, BitVector *Tolv, BitVector *Tolp, BitVector *Eolv, BitVector *Eolp) |
Computes the two-literal clauses for a node. More... | |
static DdTlcInfo * | computeClausesWithUniverse (DdTlcInfo *Cres, DdHalfWord label, short phase) |
Computes the two-literal clauses for a node. More... | |
static DdTlcInfo * | emptyClauseSet (void) |
Returns an enpty set of clauses. More... | |
static int | sentinelp (DdHalfWord var1, DdHalfWord var2) |
Returns true iff the argument is the sentinel clause. More... | |
static int | equalp (DdHalfWord var1a, short phase1a, DdHalfWord var1b, short phase1b, DdHalfWord var2a, short phase2a, DdHalfWord var2b, short phase2b) |
Returns true iff the two arguments are identical clauses. More... | |
static int | beforep (DdHalfWord var1a, short phase1a, DdHalfWord var1b, short phase1b, DdHalfWord var2a, short phase2a, DdHalfWord var2b, short phase2b) |
Returns true iff the first argument precedes the second in the clause order. More... | |
static int | oneliteralp (DdHalfWord var) |
Returns true iff the argument is a one-literal clause. More... | |
static int | impliedp (DdHalfWord var1, short phase1, DdHalfWord var2, short phase2, BitVector *olv, BitVector *olp) |
Returns true iff either literal of a clause is in a set of literals. More... | |
static BitVector * | bitVectorAlloc (int size) |
Allocates a bit vector. More... | |
static void | bitVectorClear (BitVector *vector, int size) |
Clears a bit vector. More... | |
static void | bitVectorFree (BitVector *vector) |
Frees a bit vector. More... | |
static short | bitVectorRead (BitVector *vector, int i) |
Returns the i-th entry of a bit vector. More... | |
static void | bitVectorSet (BitVector *vector, int i, short val) |
Sets the i-th entry of a bit vector to a value. More... | |
static DdTlcInfo * | tlcInfoAlloc (void) |
Allocates a DdTlcInfo Structure. More... | |
Functions for the detection of essential variables.
Copyright (c) 1995-2015, 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.
|
static |
Returns true iff the first argument precedes the second in the clause order.
A clause precedes another if its first lieral precedes the first literal of the other, or if the first literals are the same, and its second literal precedes the second literal of the other clause. A literal precedes another if it has a higher index, of if it has the same index, but it has lower phase. Phase 0 is the positive phase, and it is lower than Phase 1 (negative phase).
|
static |
Allocates a bit vector.
The parameter size gives the number of bits. This procedure allocates enough words to hold the specified number of bits.
|
static |
Clears a bit vector.
The parameter size gives the number of bits.
|
static |
|
static |
|
static |
|
static |
Computes the two-literal clauses for a node.
Computes the two-literal clauses for a node given the clauses for its children and the label of the node.
Tres | list of clauses for T child |
Eres | list of clauses for E child |
label | variable labeling the current node |
size | number of variables in the manager |
Tolv | variable bit vector for T child |
Tolp | phase bit vector for T child |
Eolv | variable bit vector for E child |
Eolp | phase bit vector for E child |
|
static |
Computes the two-literal clauses for a node.
Computes the two-literal clauses for a node with a zero child, given the clauses for its other child and the label of the node.
Determines whether a given variable is essential with a given phase in a BDD.
Uses Cudd_bddIteConstant. Returns 1 if phase == 1 and f–>x_id, or if phase == 0 and f–>x_id'.
Finds the essential variables of a DD.
Returns the cube of the essential variables. A positive literal means that the variable must be set to 1 for the function to be
Finds the two literal clauses of a DD.
Returns the one- and two-literal clauses of a DD. For a constant DD, the empty set of clauses is returned. This is obviously correct for a non-zero constant. For the constant zero, it is based on the assumption that only those clauses containing variables in the support of the function are considered. Since the support of a constant function is empty, no clauses are returned.
Prints the one- and two-literal clauses of a DD.
The argument "names" can be NULL, in which case the variable indices are printed.
int Cudd_ReadIthClause | ( | DdTlcInfo * | tlc, |
int | i, | ||
unsigned * | var1, | ||
unsigned * | var2, | ||
int * | phase1, | ||
int * | phase2 | ||
) |
Accesses the i-th clause of a DD.
Accesses the i-th clause of a DD given the clause set which must be already computed.
void Cudd_tlcInfoFree | ( | DdTlcInfo * | t | ) |
Implements the recursive step of Cudd_FindEssential.
|
static |
Implements the recursive step of Cudd_FindTwoLiteralClauses.
The DD node is assumed to be not constant.
|
static |
Returns an enpty set of clauses.
No bit vector for the phases is allocated.
|
static |
Returns true iff the two arguments are identical clauses.
Since literals are sorted, we only need to compare literals in the same position.
|
static |
Returns true iff either literal of a clause is in a set of literals.
The first four arguments specify the clause. The remaining two arguments specify the literal set.
|
static |
Returns true iff the argument is a one-literal clause.
A one-litaral clause has the constant FALSE as second literal. Since the constant TRUE is never used, it is sufficient to test for a constant.
|
static |
Returns true iff the argument is the sentinel clause.
A sentinel clause has both variables equal to 0.
|
static |
Allocates a DdTlcInfo Structure.