cudd  3.0.0
The University of Colorado Decision Diagram Package
ntr.h
Go to the documentation of this file.
1 
46 #ifndef _NTR
47 #define _NTR
48 
49 /*---------------------------------------------------------------------------*/
50 /* Nested includes */
51 /*---------------------------------------------------------------------------*/
52 
53 #include "dddmp.h"
54 #include "bnet.h"
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /*---------------------------------------------------------------------------*/
61 /* Constant declarations */
62 /*---------------------------------------------------------------------------*/
63 
64 #define PI_PS_FROM_FILE 0
65 #define PI_PS_DFS 1
66 #define PI_PS_GIVEN 2
67 
68 #define NTR_IMAGE_MONO 0
69 #define NTR_IMAGE_PART 1
70 #define NTR_IMAGE_CLIP 2
71 #define NTR_IMAGE_DEPEND 3
72 
73 #define NTR_UNDER_APPROX 0
74 #define NTR_OVER_APPROX 1
75 
76 #define NTR_FROM_NEW 0
77 #define NTR_FROM_REACHED 1
78 #define NTR_FROM_RESTRICT 2
79 #define NTR_FROM_COMPACT 3
80 #define NTR_FROM_SQUEEZE 4
81 #define NTR_FROM_UNDERAPPROX 5
82 #define NTR_FROM_OVERAPPROX 6
83 
84 #define NTR_GROUP_NONE 0
85 #define NTR_GROUP_DEFAULT 1
86 #define NTR_GROUP_FIXED 2
87 
88 #define NTR_SHORT_NONE 0
89 #define NTR_SHORT_BELLMAN 1
90 #define NTR_SHORT_FLOYD 2
91 #define NTR_SHORT_SQUARE 3
92 
93 /*---------------------------------------------------------------------------*/
94 /* Stucture declarations */
95 /*---------------------------------------------------------------------------*/
96 
97 /*---------------------------------------------------------------------------*/
98 /* Type declarations */
99 /*---------------------------------------------------------------------------*/
100 
104 typedef struct NtrOptions {
105  long initialTime;
106  int verify;
107  char *file1;
108  char *file2;
109  int second;
110  int traverse;
111  int depend;
112  int image;
113  double imageClip;
114  int approx;
115  int threshold;
116  int from;
117  int groupnsps;
118  int closure;
119  double closureClip;
120  int envelope;
121  int scc;
122  int zddtest;
124  int maxflow;
125  int shortPath;
127  char *sinkfile;
128  int partition;
129  int char2vect;
130  int density;
131  double quality;
132  int decomp;
133  int cofest;
134  double clip;
135  int dontcares;
137  int clauses;
138  int noBuild;
139  int stateOnly;
140  char *node;
141  int locGlob;
142  int progress;
143  int cacheSize;
144  size_t maxMemory;
145  size_t maxMemHard;
146  unsigned int maxLive;
147  int slots;
148  int ordering;
149  char *orderPiPs;
151  int autoDyn;
153  char *treefile;
155  int countDead;
157  int maxGrowth;
163  int recomb;
164  int nodrop;
166  int gaOnOff;
169  int bdddump;
170  int dumpFmt;
172  char *dumpfile;
173  int store;
174  char *storefile;
175  int load;
176  char *loadfile;
177  int verb;
178  int32_t seed;
179 } NtrOptions;
180 
184 typedef struct NtrHeapSlot NtrHeapSlot;
185 
189 typedef struct NtrHeap NtrHeap;
190 
194 typedef struct NtrPartTR {
195  int nparts;
204  int nlatches;
205  DdNode **x;
206  DdNode **y;
207 } NtrPartTR;
208 
209 /*---------------------------------------------------------------------------*/
210 /* Variable declarations */
211 /*---------------------------------------------------------------------------*/
212 
213 /*---------------------------------------------------------------------------*/
214 /* Macro declarations */
215 /*---------------------------------------------------------------------------*/
216 
217 #ifndef TRUE
218 # define TRUE 1
219 #endif
220 #ifndef FALSE
221 # define FALSE 0
222 #endif
223 
230 #define STRING_EQUAL(s1,s2) (strcmp((s1),(s2)) == 0)
231 
232 
235 /*---------------------------------------------------------------------------*/
236 /* Function prototypes */
237 /*---------------------------------------------------------------------------*/
238 
239 extern int Ntr_buildDDs (BnetNetwork *net, DdManager *dd, NtrOptions *option, BnetNetwork *net2);
240 extern NtrPartTR * Ntr_buildTR (DdManager *dd, BnetNetwork *net, NtrOptions *option, int image);
241 extern DdNode * Ntr_TransitiveClosure (DdManager *dd, NtrPartTR *TR, NtrOptions *option);
242 extern int Ntr_Trav (DdManager *dd, BnetNetwork *net, NtrOptions *option);
243 extern int Ntr_SCC (DdManager *dd, BnetNetwork *net, NtrOptions *option);
244 extern int Ntr_ClosureTrav (DdManager *dd, BnetNetwork *net, NtrOptions *option);
245 extern void Ntr_freeTR (DdManager *dd, NtrPartTR *TR);
246 extern NtrPartTR * Ntr_cloneTR (NtrPartTR *TR);
247 extern DdNode * Ntr_initState (DdManager *dd, BnetNetwork *net, NtrOptions *option);
248 extern DdNode * Ntr_getStateCube (DdManager *dd, BnetNetwork *net, char *filename, int pr);
249 extern int Ntr_Envelope (DdManager *dd, NtrPartTR *TR, FILE *dfp, NtrOptions *option);
250 extern int Ntr_TestMinimization (DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option);
251 extern int Ntr_TestDensity (DdManager *dd, BnetNetwork *net1, NtrOptions *option);
252 extern int Ntr_TestDecomp (DdManager *dd, BnetNetwork *net1, NtrOptions *option);
253 extern int Ntr_VerifyEquivalence (DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option);
254 extern int Ntr_TestCofactorEstimate (DdManager * dd, BnetNetwork * net, NtrOptions * option);
255 extern int Ntr_TestClipping (DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option);
256 extern int Ntr_TestEquivAndContain (DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option);
257 extern int Ntr_TestClosestCube (DdManager * dd, BnetNetwork * net, NtrOptions * option);
258 extern int Ntr_TestTwoLiteralClauses (DdManager * dd, BnetNetwork * net1, NtrOptions * option);
259 extern int Ntr_TestCharToVect(DdManager * dd, BnetNetwork * net1, NtrOptions * option);
260 extern int Ntr_maxflow (DdManager *dd, BnetNetwork *net, NtrOptions *option);
261 extern double Ntr_maximum01Flow (DdManager *bdd, DdNode *sx, DdNode *ty, DdNode *E, DdNode **F, DdNode **cut, DdNode **x, DdNode **y, DdNode **z, int n, int pr);
262 extern int Ntr_testZDD (DdManager *dd, BnetNetwork *net, NtrOptions *option);
263 extern int Ntr_testISOP (DdManager *dd, BnetNetwork *net, NtrOptions *option);
264 extern NtrHeap * Ntr_InitHeap (int size);
265 extern void Ntr_FreeHeap (NtrHeap *heap);
266 extern int Ntr_HeapInsert (NtrHeap *heap, void *item, int key);
267 extern int Ntr_HeapExtractMin (NtrHeap *heap, void *item, int *key);
268 extern int Ntr_HeapCount (NtrHeap *heap);
269 extern NtrHeap * Ntr_HeapClone (NtrHeap *source);
270 extern void Ntr_HeapForeach (NtrHeap *heap, void (*f)(void *e, void *arg), void *arg);
271 extern int Ntr_TestHeap (NtrHeap *heap, int i);
272 extern int Ntr_ShortestPaths (DdManager *dd, BnetNetwork *net, NtrOptions *option);
273 
277 #ifdef __cplusplus
278 }
279 #endif
280 
281 #endif /* _NTR */
int Ntr_HeapInsert(NtrHeap *heap, void *item, int key)
Inserts an item in a priority queue.
Definition: ntrHeap.c:176
int Ntr_Envelope(DdManager *dd, NtrPartTR *TR, FILE *dfp, NtrOptions *option)
Poor man's outer envelope computation.
Definition: ntr.c:1535
Cudd_ReorderingType reordering
Definition: ntr.h:150
int cofest
Definition: ntr.h:133
int verb
Definition: ntr.h:177
int Ntr_Trav(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Poor man's traversal procedure.
Definition: ntr.c:777
double clip
Definition: ntr.h:134
Cudd_AggregationType
Type of aggregation methods.
Definition: cudd.h:123
DdNode ** x
Definition: ntr.h:205
int Ntr_TestCharToVect(DdManager *dd, BnetNetwork *net1, NtrOptions *option)
Test char-to-vect conversion.
Definition: ntrBddTest.c:738
int ordering
Definition: ntr.h:148
size_t maxMemory
Definition: ntr.h:144
int stateOnly
Definition: ntr.h:139
int store
Definition: ntr.h:173
Decision diagram node.
Definition: cuddInt.h:261
int Ntr_testISOP(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Builds ZDD covers.
Definition: ntrZddTest.c:302
int approx
Definition: ntr.h:114
Simple-minded package to read a blif file.
DdNode * Ntr_getStateCube(DdManager *dd, BnetNetwork *net, char *filename, int pr)
Reads a state cube from a file or creates a random one.
Definition: ntr.c:1429
DdNode * Ntr_TransitiveClosure(DdManager *dd, NtrPartTR *TR, NtrOptions *option)
Builds the transitive closure of a transition relation.
Definition: ntr.c:1266
int from
Definition: ntr.h:116
int cacheSize
Definition: ntr.h:143
int32_t seed
Definition: ntr.h:178
Heap-based priority queue.
Definition: ntrHeap.c:74
int progress
Definition: ntr.h:142
int selectiveTrace
Definition: ntr.h:126
Data structure for partitioned transition relation.
Definition: ntr.h:194
int Ntr_buildDDs(BnetNetwork *net, DdManager *dd, NtrOptions *option, BnetNetwork *net2)
Builds DDs for a network outputs and next state functions.
Definition: ntr.c:126
int bdddump
Definition: ntr.h:169
double Ntr_maximum01Flow(DdManager *bdd, DdNode *sx, DdNode *ty, DdNode *E, DdNode **F, DdNode **cut, DdNode **x, DdNode **y, DdNode **z, int n, int pr)
Symbolic Dinit's algorithm.
Definition: ntrMflow.c:158
int image
Definition: ntr.h:112
NtrHeap * Ntr_InitHeap(int size)
Initializes a priority queue.
Definition: ntrHeap.c:127
int Ntr_maxflow(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Maximum 0-1 flow between source and sink states.
Definition: ntr.c:1639
int populationSize
Definition: ntr.h:167
int partition
Definition: ntr.h:128
Specialized DD symbol table.
Definition: cuddInt.h:399
char * storefile
Definition: ntr.h:174
int Ntr_TestCofactorEstimate(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Tests BDD cofactor estimate functions.
Definition: ntrBddTest.c:352
int traverse
Definition: ntr.h:110
Very simple boolean network data structure.
Definition: bnet.h:138
int countDead
Definition: ntr.h:155
int second
Definition: ntr.h:109
int shortPath
Definition: ntr.h:125
int load
Definition: ntr.h:175
int recomb
Definition: ntr.h:163
int char2vect
Definition: ntr.h:129
char * treefile
Definition: ntr.h:153
int Ntr_TestEquivAndContain(DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option)
Tests BDD equivalence and containment with don't cares.
Definition: ntrBddTest.c:472
NtrHeap * factors
Definition: ntr.h:203
int gaOnOff
Definition: ntr.h:166
void Ntr_HeapForeach(NtrHeap *heap, void(*f)(void *e, void *arg), void *arg)
Calls a function on all items in a heap.
Definition: ntrHeap.c:282
int locGlob
Definition: ntr.h:141
int Ntr_TestClipping(DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option)
Tests BDD clipping functions.
Definition: ntrBddTest.c:399
int clauses
Definition: ntr.h:137
int dumpFmt
Definition: ntr.h:170
int density
Definition: ntr.h:130
void Ntr_freeTR(DdManager *dd, NtrPartTR *TR)
Frees the transition relation for a network.
Definition: ntr.c:625
double closureClip
Definition: ntr.h:119
NtrPartTR * Ntr_cloneTR(NtrPartTR *TR)
Makes a copy of a transition relation.
Definition: ntr.c:669
DdNode * xw
Definition: ntr.h:202
int maxflow
Definition: ntr.h:124
char * loadfile
Definition: ntr.h:176
int firstReorder
Definition: ntr.h:154
struct NtrPartTR NtrPartTR
Data structure for partitioned transition relation.
int signatures
Definition: ntr.h:165
char * node
Definition: ntr.h:140
int maxGrowth
Definition: ntr.h:157
DdNode ** part
Definition: ntr.h:196
int Ntr_VerifyEquivalence(DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option)
Verify equivalence of combinational networks.
Definition: ntrBddTest.c:285
char * file1
Definition: ntr.h:107
int arcviolation
Definition: ntr.h:159
int Ntr_TestHeap(NtrHeap *heap, int i)
Tests the heap property of a priority queue.
Definition: ntrHeap.c:305
int Ntr_TestTwoLiteralClauses(DdManager *dd, BnetNetwork *net1, NtrOptions *option)
Tests extraction of two-literal clauses.
Definition: ntrBddTest.c:652
int decomp
Definition: ntr.h:132
int groupnsps
Definition: ntr.h:117
DdNode ** pcube
Definition: ntr.h:198
int Ntr_ShortestPaths(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Computes shortest paths in a state graph.
Definition: ntrShort.c:110
NtrHeap * Ntr_HeapClone(NtrHeap *source)
Clones a priority queue.
Definition: ntrHeap.c:256
int depend
Definition: ntr.h:111
char * file2
Definition: ntr.h:108
int nlatches
Definition: ntr.h:204
DdNode ** y
Definition: ntr.h:206
char * orderPiPs
Definition: ntr.h:149
int envelope
Definition: ntr.h:120
int printcover
Definition: ntr.h:123
char * sinkfile
Definition: ntr.h:127
Entry of NtrHeap.
Definition: ntrHeap.c:66
DdNode * prepabs
Definition: ntr.h:201
int closure
Definition: ntr.h:118
int threshold
Definition: ntr.h:115
NtrPartTR * Ntr_buildTR(DdManager *dd, BnetNetwork *net, NtrOptions *option, int image)
Builds the transition relation for a network.
Definition: ntr.c:329
int numberXovers
Definition: ntr.h:168
double imageClip
Definition: ntr.h:113
char * dumpfile
Definition: ntr.h:172
int verify
Definition: ntr.h:106
Options for nanotrav.
Definition: ntr.h:104
int symmviolation
Definition: ntr.h:161
int Ntr_HeapExtractMin(NtrHeap *heap, void *item, int *key)
Extracts the element with the minimum key from a priority queue.
Definition: ntrHeap.c:212
void Ntr_FreeHeap(NtrHeap *heap)
Frees a priority queue.
Definition: ntrHeap.c:155
double quality
Definition: ntr.h:131
int Ntr_ClosureTrav(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Transitive closure traversal procedure.
Definition: ntr.c:1180
int Ntr_testZDD(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Tests ZDDs.
Definition: ntrZddTest.c:95
int zddtest
Definition: ntr.h:122
unsigned int maxLive
Definition: ntr.h:146
int Ntr_HeapCount(NtrHeap *heap)
Returns the number of items in a priority queue.
Definition: ntrHeap.c:239
struct NtrOptions NtrOptions
Options for nanotrav.
int Ntr_TestDensity(DdManager *dd, BnetNetwork *net1, NtrOptions *option)
Tests BDD density-related functions.
Definition: ntrBddTest.c:185
int slots
Definition: ntr.h:147
int Ntr_TestDecomp(DdManager *dd, BnetNetwork *net1, NtrOptions *option)
Tests BDD decomposition functions.
Definition: ntrBddTest.c:232
Cudd_AggregationType groupcheck
Definition: ntr.h:158
int nodrop
Definition: ntr.h:164
int noBuild
Definition: ntr.h:138
DdNode * Ntr_initState(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Builds the BDD of the initial state(s).
Definition: ntr.c:1366
int autoDyn
Definition: ntr.h:151
int Ntr_TestClosestCube(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Tests the Cudd_bddClosestCube function.
Definition: ntrBddTest.c:556
int nparts
Definition: ntr.h:195
long initialTime
Definition: ntr.h:105
int scc
Definition: ntr.h:121
DdNode ** nscube
Definition: ntr.h:199
int Ntr_TestMinimization(DdManager *dd, BnetNetwork *net1, BnetNetwork *net2, NtrOptions *option)
Tests BDD minimization functions.
Definition: ntrBddTest.c:116
Cudd_ReorderingType
Type of reordering algorithm.
Definition: cudd.h:94
DdNode * preiabs
Definition: ntr.h:200
Cudd_ReorderingType autoMethod
Definition: ntr.h:152
int closestCube
Definition: ntr.h:136
DdNode ** icube
Definition: ntr.h:197
int Ntr_SCC(DdManager *dd, BnetNetwork *net, NtrOptions *option)
Computes the SCCs of the STG.
Definition: ntr.c:934
size_t maxMemHard
Definition: ntr.h:145
int dontcares
Definition: ntr.h:135