CUDD 执行中的分段错误
Segmentation fault in CUDD execution
为了编译我使用了:
1) ./configure --enable-dddmp --enable-obj --enable-shared --enable-static; make
2) gcc test.c -o testprogram -I /path/to/cudd-3.0.0/cudd -I /path/to/cudd-3.0.0/util -I /path/to/cudd-3.0.0/ -static -L /path/to/cudd-3.0.0/cudd/.libs/ -lcudd -lm
程序编译成功。我正在使用 cudd3.0.0 包。之后我在执行中遇到了这个分段错误:
请建议执行此操作的正确方法以及为什么会出现此错误?
我正在添加主要功能:
int main (int argc, char *argv[])
{
char filename[30];
DdManager *gbm; /* Global BDD manager. */
gbm = Cudd_Init(0,0,CUDD_UNIQUE_SLOTS,CUDD_CACHE_SLOTS,0); /* Initialize a new BDD manager. */
DdNode *bdd, *var, *tmp_neg, *tmp;
int i;
bdd = Cudd_ReadOne(gbm); /*Returns the logic one constant of the manager*/
Cudd_Ref(bdd); /*Increases the reference count of a node*/
for (i = 3; i >= 0; i--) {
var = Cudd_bddIthVar(gbm,i); /*Create a new BDD variable*/
tmp_neg = Cudd_Not(var); /*Perform NOT boolean operation*/
tmp = Cudd_bddAnd(gbm, tmp_neg, bdd); /*Perform AND boolean operation*/
Cudd_Ref(tmp);
Cudd_RecursiveDeref(gbm,bdd);
bdd = tmp;
}
bdd = Cudd_BddToAdd(gbm, bdd); /*Convert BDD to ADD for display purpose*/
print_dd (gbm, bdd, 2,4); /*Print the dd to standard output*/
sprintf(filename, "./bdd/graph.dot"); /*Write .dot filename to a string*/
write_dd(gbm, bdd, filename); /*Write the resulting cascade dd to a file*/
Cudd_Quit(gbm);
return 0;
}
是的,已解决。我没有在代码行的正确位置创建名为 'bdd' 的文件夹:
sprintf(filename, "./bdd/graph.dot");
现在,正在执行中。抱歉,我以为是概念错误。
为了编译我使用了:
1) ./configure --enable-dddmp --enable-obj --enable-shared --enable-static; make
2) gcc test.c -o testprogram -I /path/to/cudd-3.0.0/cudd -I /path/to/cudd-3.0.0/util -I /path/to/cudd-3.0.0/ -static -L /path/to/cudd-3.0.0/cudd/.libs/ -lcudd -lm
程序编译成功。我正在使用 cudd3.0.0 包。之后我在执行中遇到了这个分段错误:
请建议执行此操作的正确方法以及为什么会出现此错误?
我正在添加主要功能:
int main (int argc, char *argv[])
{
char filename[30];
DdManager *gbm; /* Global BDD manager. */
gbm = Cudd_Init(0,0,CUDD_UNIQUE_SLOTS,CUDD_CACHE_SLOTS,0); /* Initialize a new BDD manager. */
DdNode *bdd, *var, *tmp_neg, *tmp;
int i;
bdd = Cudd_ReadOne(gbm); /*Returns the logic one constant of the manager*/
Cudd_Ref(bdd); /*Increases the reference count of a node*/
for (i = 3; i >= 0; i--) {
var = Cudd_bddIthVar(gbm,i); /*Create a new BDD variable*/
tmp_neg = Cudd_Not(var); /*Perform NOT boolean operation*/
tmp = Cudd_bddAnd(gbm, tmp_neg, bdd); /*Perform AND boolean operation*/
Cudd_Ref(tmp);
Cudd_RecursiveDeref(gbm,bdd);
bdd = tmp;
}
bdd = Cudd_BddToAdd(gbm, bdd); /*Convert BDD to ADD for display purpose*/
print_dd (gbm, bdd, 2,4); /*Print the dd to standard output*/
sprintf(filename, "./bdd/graph.dot"); /*Write .dot filename to a string*/
write_dd(gbm, bdd, filename); /*Write the resulting cascade dd to a file*/
Cudd_Quit(gbm);
return 0;
}
是的,已解决。我没有在代码行的正确位置创建名为 'bdd' 的文件夹:
sprintf(filename, "./bdd/graph.dot");
现在,正在执行中。抱歉,我以为是概念错误。