/********************************************************************
* PROGRAM NAME: STP (Simple Theorem Prover)
*
- * AUTHORS: Vijay Ganesh, David L. Dill
+ * AUTHORS: Vijay Ganesh
*
* BEGIN DATE: November, 2005
*
//vector<BEEV::ASTNode *> created_exprs;
bool cinterface_exprdelete_on = false;
+/* GLOBAL FUNCTION: parser
+ */
+extern int yyparse();
+
void vc_setFlags(char c) {
std::string helpstring = "Usage: stp [-option] [infile]\n\n";
helpstring += "-r : switch refinement off (optimizations are ON by default)\n";
}
#endif
+
+Expr vc_parseExpr(VC vc, char* infile) {
+ bmstar b = (bmstar)vc;
+ extern FILE* yyin;
+ const char * prog = "stp";
+
+ yyin = fopen(infile,"r");
+ if(yyin == NULL) {
+ fprintf(stderr,"%s: Error: cannot open %s\n",prog,infile);
+ BEEV::FatalError("");
+ }
+
+ BEEV::globalBeevMgr_for_parser = b;
+
+ CONSTANTBV::ErrCode c = CONSTANTBV::BitVector_Boot();
+ if(0 != c) {
+ cout << CONSTANTBV::BitVector_Error(c) << endl;
+ return 0;
+ }
+
+ yyparse();
+ nodelist aaa = b->GetAsserts();
+ node o = b->CreateNode(BEEV::AND,aaa);
+
+ nodestar output = new node(o);
+ return output;
+} //end of vc_parseExpr()
+
char* exprString(Expr e){
stringstream ss;
((nodestar)e)->PL_Print(ss,0);
#ifdef __cplusplus
extern "C" {
#endif
+
+#include <stdio.h>
#ifdef STP_STRONG_TYPING
#else
//! Array update; equivalent to "array WITH [index] := newValue"
Expr vc_writeExpr(VC vc, Expr array, Expr index, Expr newValue);
- // Expr I/O
- //! Expr vc_parseExpr(VC vc, char* s);
+ // Expr I/O: Parses directly from file in the c_interface. pretty cool!!
+ Expr vc_parseExpr(VC vc, char* s);
//! Prints 'e' to stdout.
void vc_printExpr(VC vc, Expr e);