/* GLOBAL FUNCTION: parser
*/
-extern int cvcparse();
+extern int cvcparse(void*);
void vc_setFlags(char c) {
std::string helpstring = "Usage: stp [-option] [infile]\n\n";
}
#endif
+// Expr vc_parseExpr(VC vc, char* infile) {
+// bmstar b = (bmstar)vc;
+// extern FILE* cvcin;
+// const char * prog = "stp";
+
+// cvcin = fopen(infile,"r");
+// if(cvcin == NULL) {
+// fprintf(stderr,"%s: Error: cannot open %s\n",prog,infile);
+// BEEV::FatalError("");
+// }
+
+// BEEV::GlobalBeevMgr = b;
+
+// CONSTANTBV::ErrCode c = CONSTANTBV::BitVector_Boot();
+// if(0 != c) {
+// cout << CONSTANTBV::BitVector_Error(c) << endl;
+// return 0;
+// }
+
+// cvcparse();
+// nodelist aaa = b->GetAsserts();
+
+// //Don't add the query. It gets added automatically if the input file
+// //has QUERY in it
+// //
+// //node bbb = b->CreateNode(BEEV::NOT,b->GetQuery());
+// node o = b->CreateNode(BEEV::AND,aaa);
+// //node o = b->CreateNode(BEEV::AND,oo,bbb);
+
+// nodestar output = new node(o);
+// return output;
+// } //end of vc_parseExpr()
+
+
Expr vc_parseExpr(VC vc, char* infile) {
bmstar b = (bmstar)vc;
extern FILE* cvcin;
}
BEEV::GlobalBeevMgr = b;
-
CONSTANTBV::ErrCode c = CONSTANTBV::BitVector_Boot();
if(0 != c) {
cout << CONSTANTBV::BitVector_Error(c) << endl;
return 0;
}
- cvcparse();
- nodelist aaa = b->GetAsserts();
-
- //Don't add the query. It gets added automatically if the input file
- //has QUERY in it
- //
- //node bbb = b->CreateNode(BEEV::NOT,b->GetQuery());
- node o = b->CreateNode(BEEV::AND,aaa);
- //node o = b->CreateNode(BEEV::AND,oo,bbb);
-
+ BEEV::ASTVec * AssertsQuery = new BEEV::ASTVec;
+ cvcparse((void*)AssertsQuery);
+ BEEV::ASTNode asserts = (*(BEEV::ASTVec*)AssertsQuery)[0];
+ BEEV::ASTNode query = (*(BEEV::ASTVec*)AssertsQuery)[1];
+ //b->TopLevelSAT(asserts, query);
+
+ node oo = b->CreateNode(BEEV::NOT,query);
+ node o = b->CreateNode(BEEV::AND,asserts,oo);
nodestar output = new node(o);
return output;
} //end of vc_parseExpr()