cudd
3.0.0
The University of Colorado Decision Diagram Package
|
A very simple reachability analysis program. More...
Macros | |
#define | NTR_MAX_DEP_SIZE 20 |
Functions | |
int | Ntr_buildDDs (BnetNetwork *net, DdManager *dd, NtrOptions *option, BnetNetwork *net2) |
Builds DDs for a network outputs and next state functions. More... | |
NtrPartTR * | Ntr_buildTR (DdManager *dd, BnetNetwork *net, NtrOptions *option, int image) |
Builds the transition relation for a network. More... | |
void | Ntr_freeTR (DdManager *dd, NtrPartTR *TR) |
Frees the transition relation for a network. More... | |
NtrPartTR * | Ntr_cloneTR (NtrPartTR *TR) |
Makes a copy of a transition relation. More... | |
int | Ntr_Trav (DdManager *dd, BnetNetwork *net, NtrOptions *option) |
Poor man's traversal procedure. More... | |
int | Ntr_SCC (DdManager *dd, BnetNetwork *net, NtrOptions *option) |
Computes the SCCs of the STG. More... | |
int | Ntr_ClosureTrav (DdManager *dd, BnetNetwork *net, NtrOptions *option) |
Transitive closure traversal procedure. More... | |
DdNode * | Ntr_TransitiveClosure (DdManager *dd, NtrPartTR *TR, NtrOptions *option) |
Builds the transitive closure of a transition relation. More... | |
DdNode * | Ntr_initState (DdManager *dd, BnetNetwork *net, NtrOptions *option) |
Builds the BDD of the initial state(s). More... | |
DdNode * | Ntr_getStateCube (DdManager *dd, BnetNetwork *net, char *filename, int pr) |
Reads a state cube from a file or creates a random one. More... | |
int | Ntr_Envelope (DdManager *dd, NtrPartTR *TR, FILE *dfp, NtrOptions *option) |
Poor man's outer envelope computation. More... | |
int | Ntr_maxflow (DdManager *dd, BnetNetwork *net, NtrOptions *option) |
Maximum 0-1 flow between source and sink states. More... | |
static DdNode * | makecube (DdManager *dd, DdNode **x, int n) |
Builds a positive cube of all the variables in x. More... | |
static void | ntrInitializeCount (BnetNetwork *net, NtrOptions *option) |
Initializes the count fields used to drop DDs. More... | |
static void | ntrCountDFS (BnetNetwork *net, BnetNode *node) |
Does a DFS from a node setting the count field. More... | |
static DdNode * | ntrImage (DdManager *dd, NtrPartTR *TR, DdNode *from, NtrOptions *option) |
Computes the image of a set given a transition relation. More... | |
static DdNode * | ntrPreimage (DdManager *dd, NtrPartTR *T, DdNode *from) |
Computes the preimage of a set given a transition relation. More... | |
static DdNode * | ntrChooseFrom (DdManager *dd, DdNode *neW, DdNode *reached, NtrOptions *option) |
Chooses the initial states for a BFS step. More... | |
static DdNode * | ntrUpdateReached (DdManager *dd, DdNode *oldreached, DdNode *to) |
Updates the reached states after a traversal step. More... | |
static int | ntrLatchDependencies (DdManager *dd, DdNode *reached, BnetNetwork *net, NtrOptions *option) |
Analyzes the reached states after traversal to find dependent latches. More... | |
static NtrPartTR * | ntrEliminateDependencies (DdManager *dd, NtrPartTR *TR, DdNode **states, NtrOptions *option) |
Eliminates dependent variables from a transition relation. More... | |
static int | ntrUpdateQuantificationSchedule (DdManager *dd, NtrPartTR *T) |
Updates the quantification schedule of a transition relation. More... | |
static int | ntrSignatureCompare (int *ptrX, int *ptrY) |
Comparison function used by qsort. More... | |
static int | ntrSignatureCompare2 (int *ptrX, int *ptrY) |
Comparison function used by qsort. More... | |
static int | ntrPartCompare (int *ptrX, int *ptrY) |
Comparison function used by qsort. More... | |
static char ** | ntrAllocMatrix (int nrows, int ncols) |
Allocates a matrix of char's. More... | |
static void | ntrFreeMatrix (char **matrix) |
Frees a matrix of char's. More... | |
static void | ntrPermuteParts (DdNode **a, DdNode **b, int *comesFrom, int *goesTo, int size) |
Sorts parts according to given permutation. More... | |
static void | ntrIncreaseRef (void *e, void *arg) |
Calls Cudd_Ref on its first argument. | |
static void | ntrDecreaseRef (void *e, void *arg) |
Calls Cudd_RecursiveDeref on its first argument. | |
Variables | |
static char const * | onames [] = {"T", "R"} |
static double * | signatures |
static BnetNetwork * | staticNet |
static DdNode ** | staticPart |
A very simple reachability analysis program.
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.
Builds a positive cube of all the variables in x.
int Ntr_buildDDs | ( | BnetNetwork * | net, |
DdManager * | dd, | ||
NtrOptions * | option, | ||
BnetNetwork * | net2 | ||
) |
Builds DDs for a network outputs and next state functions.
The method is really brain-dead, but it is very simple. Some inputs to the network may be shared with another network whose DDs have already been built. In this case we want to share the DDs as well.
net | network for which DDs are to be built |
dd | DD manager |
option | option structure |
net2 | companion network with which inputs may be shared |
NtrPartTR* Ntr_buildTR | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
NtrOptions * | option, | ||
int | image | ||
) |
Builds the transition relation for a network.
dd | manager |
net | network |
option | options |
image | image type: monolithic ... |
Makes a copy of a transition relation.
int Ntr_ClosureTrav | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
NtrOptions * | option | ||
) |
Transitive closure traversal procedure.
Traversal procedure based on the transitive closure of the transition relation.
dd | DD manager |
net | network |
option | options |
int Ntr_Envelope | ( | DdManager * | dd, |
NtrPartTR * | TR, | ||
FILE * | dfp, | ||
NtrOptions * | option | ||
) |
Poor man's outer envelope computation.
Based on the monolithic transition relation.
dd | DD manager |
TR | transition relation |
dfp | pointer to file for DD dump |
option | program options |
Frees the transition relation for a network.
DdNode* Ntr_getStateCube | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
char * | filename, | ||
int | pr | ||
) |
Reads a state cube from a file or creates a random one.
DdNode* Ntr_initState | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
NtrOptions * | option | ||
) |
Builds the BDD of the initial state(s).
int Ntr_maxflow | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
NtrOptions * | option | ||
) |
Maximum 0-1 flow between source and sink states.
int Ntr_SCC | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
NtrOptions * | option | ||
) |
Computes the SCCs of the STG.
Computes the strongly connected components of the state transition graph. Only the first 10 SCCs are computed.
dd | DD manager |
net | network |
option | options |
DdNode* Ntr_TransitiveClosure | ( | DdManager * | dd, |
NtrPartTR * | TR, | ||
NtrOptions * | option | ||
) |
Builds the transitive closure of a transition relation.
Uses a simple squaring algorithm.
int Ntr_Trav | ( | DdManager * | dd, |
BnetNetwork * | net, | ||
NtrOptions * | option | ||
) |
Poor man's traversal procedure.
Based on the monolithic transition relation.
dd | DD manager |
net | network |
option | options |
|
static |
Allocates a matrix of char's.
|
static |
Chooses the initial states for a BFS step.
The reference count of the result is already incremented.
|
static |
Does a DFS from a node setting the count field.
|
static |
Eliminates dependent variables from a transition relation.
|
static |
Frees a matrix of char's.
|
static |
Computes the image of a set given a transition relation.
The image is returned in terms of the present state variables; its reference count is already increased.
|
static |
Initializes the count fields used to drop DDs.
Before actually building the BDDs, we perform a DFS from the outputs to initialize the count fields of the nodes. The initial value of the count field will normally coincide with the fanout of the node. However, if there are nodes with no path to any primary output or next state variable, then the initial value of count for some nodes will be less than the fanout. For primary outputs and next state functions we add 1, so that we will never try to free their DDs. The count fields of the nodes that are not reachable from the outputs are set to -1.
|
static |
Analyzes the reached states after traversal to find dependent latches.
The algorithm is greedy and determines a local optimum, not a global one.
|
static |
Comparison function used by qsort.
Used to order the parts according to their BDD addresses.
|
static |
Sorts parts according to given permutation.
|
static |
Comparison function used by qsort.
Used to order the variables according to their signatures.
|
static |
Comparison function used by qsort.
Used to order the variables according to their signatures.
Updates the quantification schedule of a transition relation.
Updates the reached states after a traversal step.
The reference count of the result is already incremented.
dd | manager |
oldreached | old reached state set |
to | result of last image computation |
|
static |
names of functions to be dumped
|
static |
signatures for all variables
|
static |
pointer to network used by qsort comparison function
|
static |
pointer to parts used by qsort comparison function