catch warnings
This commit is contained in:
parent
6d2e2597b1
commit
e9eb030bb6
@ -9201,9 +9201,11 @@ Yap_absmi(int inp)
|
|||||||
GONext();
|
GONext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case (CELL)FunctorLongInt:
|
case (CELL)FunctorLongInt:
|
||||||
PREG = NEXTOP(PREG, xl);
|
PREG = NEXTOP(PREG, xl);
|
||||||
GONext();
|
GONext();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
PREG = PREG->u.xl.F;
|
PREG = PREG->u.xl.F;
|
||||||
GONext();
|
GONext();
|
||||||
|
@ -1201,7 +1201,7 @@ char* getFileName(const char *function) {
|
|||||||
DdNode* LineParser(DdManager *manager, namedvars varmap, DdNode **inter, int maxinter, char *function, int iline) {
|
DdNode* LineParser(DdManager *manager, namedvars varmap, DdNode **inter, int maxinter, char *function, int iline) {
|
||||||
int istart, iend, ilength, i, symbol, ivar, inegvar, inegoper, iconst;
|
int istart, iend, ilength, i, symbol, ivar, inegvar, inegoper, iconst;
|
||||||
long startAt, endAt;
|
long startAt, endAt;
|
||||||
double secs;
|
//double secs;
|
||||||
DdNode *bdd;//, *temp;
|
DdNode *bdd;//, *temp;
|
||||||
char *term, curoper;
|
char *term, curoper;
|
||||||
bdd = HIGH(manager);
|
bdd = HIGH(manager);
|
||||||
@ -1269,7 +1269,7 @@ DdNode* LineParser(DdManager *manager, namedvars varmap, DdNode **inter, int max
|
|||||||
} else {
|
} else {
|
||||||
switch(curoper) {
|
switch(curoper) {
|
||||||
case '+':
|
case '+':
|
||||||
if (inegvar ^ inegoper) ; else {
|
if (!(inegvar ^ inegoper)) {
|
||||||
bdd = HIGH(manager);
|
bdd = HIGH(manager);
|
||||||
Cudd_Ref(bdd);
|
Cudd_Ref(bdd);
|
||||||
}
|
}
|
||||||
@ -1281,12 +1281,12 @@ DdNode* LineParser(DdManager *manager, namedvars varmap, DdNode **inter, int max
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '#':
|
case '#':
|
||||||
if (inegvar ^ inegoper) ; else bdd = NOT(bdd);
|
if (!(inegvar ^ inegoper)) bdd = NOT(bdd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endAt = clock();
|
endAt = clock();
|
||||||
secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
//secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
||||||
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
||||||
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
||||||
if (bdd == NULL) {
|
if (bdd == NULL) {
|
||||||
@ -1318,7 +1318,7 @@ DdNode* LineParser(DdManager *manager, namedvars varmap, DdNode **inter, int max
|
|||||||
if (inegvar) bdd = BDD_Operator(manager, NOT(inter[ivar]), bdd, curoper, inegoper);
|
if (inegvar) bdd = BDD_Operator(manager, NOT(inter[ivar]), bdd, curoper, inegoper);
|
||||||
else bdd = BDD_Operator(manager, inter[ivar], bdd, curoper, inegoper);
|
else bdd = BDD_Operator(manager, inter[ivar], bdd, curoper, inegoper);
|
||||||
endAt = clock();
|
endAt = clock();
|
||||||
secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
//secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
||||||
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
||||||
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
||||||
if (bdd == NULL) {
|
if (bdd == NULL) {
|
||||||
@ -1513,7 +1513,7 @@ DdNode* OnlineGenerateBDD(DdManager *manager, namedvars *varmap) {
|
|||||||
DdNode* OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter, int maxinter, char *function, int iline) {
|
DdNode* OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter, int maxinter, char *function, int iline) {
|
||||||
int istart, iend, ilength, i, symbol, ivar, inegvar, inegoper, iconst;
|
int istart, iend, ilength, i, symbol, ivar, inegvar, inegoper, iconst;
|
||||||
long startAt, endAt;
|
long startAt, endAt;
|
||||||
double secs;
|
//double secs;
|
||||||
DdNode *bdd;
|
DdNode *bdd;
|
||||||
char *term, curoper;
|
char *term, curoper;
|
||||||
bdd = HIGH(manager);
|
bdd = HIGH(manager);
|
||||||
@ -1581,7 +1581,7 @@ DdNode* OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter,
|
|||||||
} else {
|
} else {
|
||||||
switch(curoper) {
|
switch(curoper) {
|
||||||
case '+':
|
case '+':
|
||||||
if (inegvar ^ inegoper) ; else {
|
if (!(inegvar ^ inegoper)) {
|
||||||
bdd = HIGH(manager);
|
bdd = HIGH(manager);
|
||||||
Cudd_Ref(bdd);
|
Cudd_Ref(bdd);
|
||||||
}
|
}
|
||||||
@ -1593,12 +1593,12 @@ DdNode* OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '#':
|
case '#':
|
||||||
if (inegvar ^ inegoper) ; else bdd = NOT(bdd);
|
if (!(inegvar ^ inegoper)) bdd = NOT(bdd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endAt = clock();
|
endAt = clock();
|
||||||
secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
//secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
||||||
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
||||||
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
||||||
if (bdd == NULL) {
|
if (bdd == NULL) {
|
||||||
@ -1630,7 +1630,7 @@ DdNode* OnlineLineParser(DdManager *manager, namedvars *varmap, DdNode **inter,
|
|||||||
if (inegvar) bdd = BDD_Operator(manager, NOT(inter[ivar]), bdd, curoper, inegoper);
|
if (inegvar) bdd = BDD_Operator(manager, NOT(inter[ivar]), bdd, curoper, inegoper);
|
||||||
else bdd = BDD_Operator(manager, inter[ivar], bdd, curoper, inegoper);
|
else bdd = BDD_Operator(manager, inter[ivar], bdd, curoper, inegoper);
|
||||||
endAt = clock();
|
endAt = clock();
|
||||||
secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
//secs = ((double) (endAt - startAt)) / ((double) CLOCKS_PER_SEC);
|
||||||
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
if (_debug) fprintf(stderr, "term: %s of line: %i took: %ld\n", term, iline, endAt - startAt);
|
||||||
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
//if ((endAt - startAt) > 10000000) Cudd_AutodynDisable(manager);
|
||||||
if (bdd == NULL) {
|
if (bdd == NULL) {
|
||||||
|
@ -761,7 +761,7 @@ double CalcExpectedCounts(extmanager * MyManager, DdNode *Current, char *query_i
|
|||||||
// fprintf(stderr,"%%calcing down\n");
|
// fprintf(stderr,"%%calcing down\n");
|
||||||
|
|
||||||
if (calcdown_needed != 0) {
|
if (calcdown_needed != 0) {
|
||||||
double retd=CalcExpectedCountsDown(MyManager,Current, query_id);
|
// double retd=CalcExpectedCountsDown(MyManager,Current, query_id);
|
||||||
}
|
}
|
||||||
/* if(1 != retd){ */
|
/* if(1 != retd){ */
|
||||||
/* fprintf(stderr,"down %e != up %e/%e\n",ret,retd,ret); */
|
/* fprintf(stderr,"down %e != up %e/%e\n",ret,retd,ret); */
|
||||||
@ -807,7 +807,7 @@ double CalcExpectedCounts(extmanager * MyManager, DdNode *Current, char *query_i
|
|||||||
#define LOG_EXPECTED 0
|
#define LOG_EXPECTED 0
|
||||||
|
|
||||||
|
|
||||||
|
static
|
||||||
void PrintNodeQueue(Queue q , extmanager MyManager){
|
void PrintNodeQueue(Queue q , extmanager MyManager){
|
||||||
|
|
||||||
QueueIterator qiter = QueueIteratorNew(q, 1);
|
QueueIterator qiter = QueueIteratorNew(q, 1);
|
||||||
@ -824,6 +824,8 @@ void PrintNodeQueue(Queue q , extmanager MyManager){
|
|||||||
/** also nesting in CalcExpected seems to not work (must be here nested only valid within function frame)*/
|
/** also nesting in CalcExpected seems to not work (must be here nested only valid within function frame)*/
|
||||||
/* will be changed at later stage */
|
/* will be changed at later stage */
|
||||||
static extmanager * ineedtostorethatsomehow;
|
static extmanager * ineedtostorethatsomehow;
|
||||||
|
|
||||||
|
static
|
||||||
int comparator(void *av, void *bv){
|
int comparator(void *av, void *bv){
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
DdNode* a = (DdNode*)av;
|
DdNode* a = (DdNode*)av;
|
||||||
@ -852,7 +854,11 @@ int comparator(void *av, void *bv){
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
skip_nodes_cnt(extmanager * MyManager, double (*counts)[] , int skipcnt, DdNode* l,double dprob, char *query_id);
|
||||||
|
|
||||||
/** output information for skipped nodes **/
|
/** output information for skipped nodes **/
|
||||||
|
static void
|
||||||
skip_nodes(extmanager * MyManager, double (*counts)[] , DdNode* node, DdNode* l,double dprob, char *query_id){
|
skip_nodes(extmanager * MyManager, double (*counts)[] , DdNode* node, DdNode* l,double dprob, char *query_id){
|
||||||
int skipcnt;
|
int skipcnt;
|
||||||
skipcnt = Cudd_ReadPerm(MyManager->manager,GetIndex(node))+1;
|
skipcnt = Cudd_ReadPerm(MyManager->manager,GetIndex(node))+1;
|
||||||
@ -866,9 +872,10 @@ skip_nodes(extmanager * MyManager, double (*counts)[] , DdNode* node, DdNode* l,
|
|||||||
Cudd_IsConstant(l)
|
Cudd_IsConstant(l)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return skip_nodes_cnt( MyManager, counts, skipcnt, l, dprob, query_id);
|
skip_nodes_cnt( MyManager, counts, skipcnt, l, dprob, query_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
skip_nodes_cnt(extmanager * MyManager, double (*counts)[] , int skipcnt, DdNode* l,double dprob, char *query_id){
|
skip_nodes_cnt(extmanager * MyManager, double (*counts)[] , int skipcnt, DdNode* l,double dprob, char *query_id){
|
||||||
if(LOG_EXPECTED) fprintf(stderr,"====================\n");
|
if(LOG_EXPECTED) fprintf(stderr,"====================\n");
|
||||||
double p;
|
double p;
|
||||||
@ -954,7 +961,7 @@ double CalcExpectedCountsDown(extmanager * MyManager, DdNode *Current, char *que
|
|||||||
if(LOG_EXPECTED){PrintNodeQueue(q,*MyManager);}
|
if(LOG_EXPECTED){PrintNodeQueue(q,*MyManager);}
|
||||||
node=QueueGet(q);
|
node=QueueGet(q);
|
||||||
curnode = GetNodeVarNameDisp(MyManager->manager, MyManager->varmap, node);
|
curnode = GetNodeVarNameDisp(MyManager->manager, MyManager->varmap, node);
|
||||||
int level = Cudd_ReadPerm(MyManager->manager,GetIndex(node));
|
// int level = Cudd_ReadPerm(MyManager->manager,GetIndex(node));
|
||||||
if(!Cudd_IsConstant(node)){
|
if(!Cudd_IsConstant(node)){
|
||||||
tvalue = MyManager->varmap.dvalue[GetIndex(node) - MyManager->varmap.varstart];
|
tvalue = MyManager->varmap.dvalue[GetIndex(node) - MyManager->varmap.varstart];
|
||||||
ivalue = MyManager->varmap.ivalue[GetIndex(node) - MyManager->varmap.varstart];
|
ivalue = MyManager->varmap.ivalue[GetIndex(node) - MyManager->varmap.varstart];
|
||||||
|
Reference in New Issue
Block a user