//print the input back
bool print_STPinput_back = false;
+ enum BEEV::inputStatus input_status = NOT_DECLARED;
+
+ // Used only in smtlib lexer/parser
+ ASTNode SingleBitOne;
+ ASTNode SingleBitZero;
+
//global BEEVMGR for the parser
BeevMgr * globalBeevMgr_for_parser;
for(ASTtoBitvectorMap::iterator it=_ASTNode_to_Bitvector.begin(),
itend=_ASTNode_to_Bitvector.end();it!=itend;it++) {
(it->second)->clear();
+ delete (it->second);
}
_ASTNode_to_Bitvector.clear();
for(ASTtoBitvectorMap::iterator it=_ASTNode_to_Bitvector.begin(),
itend=_ASTNode_to_Bitvector.end();it!=itend;it++) {
(it->second)->clear();
+ delete (it->second);
}
_ASTNode_to_Bitvector.clear();
//print the input back
extern bool print_STPinput_back;
+ enum inputStatus
+ {
+ NOT_DECLARED =0, // Not included in the input file / stream
+ TO_BE_SATISFIABLE,
+ TO_BE_UNSATISFIABLE,
+ TO_BE_UNKNOWN // Specified in the input file as unknown.
+ };
+
+ extern enum inputStatus input_status;
+
extern void (*vc_error_hdlr)(const char* err_msg);
/*Spacer class is basically just an int, but the new class allows
overloading of << with a special definition that prints the int as
//This function prints the output of the STP solver
void BeevMgr::PrintOutput(bool true_iff_valid) {
//self-explanatory
+ if(print_output) {
+ if(smtlib_parser_enable)
+ {
+ if (true_iff_valid && (BEEV::input_status == TO_BE_SATISFIABLE))
+ {
+ cerr << "Warning. Expected satisfiable, FOUND unsatisfiable" << endl;
+ }
+ else
+ if (!true_iff_valid && (BEEV::input_status == TO_BE_UNSATISFIABLE))
+ {
+ cerr << "Warning. Expected unsatisfiable, FOUND satisfiable" << endl;
+ }
+ }
+ }
+
if(true_iff_valid) {
ValidFlag = true;
if(print_output) {
extern int cvcparse();
+namespace BEEV
+{
+extern BEEV::ASTNode SingleBitOne;
+extern BEEV::ASTNode SingleBitZero;
+}
+
+
+
/* GLOBAL VARS: Some global vars for the Main function.
*
*/
// Amount of memory to ask for at beginning of main.
static const intptr_t INITIAL_MEMORY_PREALLOCATION_SIZE = 4000000;
-// Used only in smtlib lexer/parser
-BEEV::ASTNode SingleBitOne;
-BEEV::ASTNode SingleBitZero;
-
/******************************************************************************
* MAIN FUNCTION:
*
BEEV::print_output = true;
BEEV::globalBeevMgr_for_parser = new BEEV::BeevMgr();
- SingleBitOne = BEEV::globalBeevMgr_for_parser->CreateOneConst(1);
- SingleBitZero = BEEV::globalBeevMgr_for_parser->CreateZeroConst(1);
+ BEEV::SingleBitOne = BEEV::globalBeevMgr_for_parser->CreateOneConst(1);
+ BEEV::SingleBitZero = BEEV::globalBeevMgr_for_parser->CreateZeroConst(1);
//BEEV::smtlib_parser_enable = true;
if (smtlibParser)
}
}
+namespace BEEV
+{
extern BEEV::ASTNode SingleBitOne;
extern BEEV::ASTNode SingleBitZero;
+ }
/* Changed for smtlib speedup */
/* bv{DIGIT}+ { smtlval.node = new BEEV::ASTNode(BEEV::_bm->CreateBVConst(smttext+2, 10)); return BVCONST_TOK;} */
bit{DIGIT}+ {
char c = smttext[3];
if (c == '1') {
- smtlval.node = new BEEV::ASTNode(SingleBitOne);
+ smtlval.node = new BEEV::ASTNode(BEEV::SingleBitOne);
}
else {
- smtlval.node = new BEEV::ASTNode(SingleBitZero);
+ smtlval.node = new BEEV::ASTNode(BEEV::SingleBitZero);
}
return BITCONST_TOK;
};
"not" { return NOT_TOK; }
"implies" { return IMPLIES_TOK; }
"ite" { return ITE_TOK;}
+"if_then_else" { return ITE_TOK;} // This is in the SMTLIB benchmarks.
"and" { return AND_TOK; }
"or" { return OR_TOK; }
"xor" { return XOR_TOK; }
"let" { return LET_TOK; }
"flet" { return FLET_TOK; }
"notes" { return NOTES_TOK; }
-"cvc_command" { return CVC_COMMAND_TOK; }
"sorts" { return SORTS_TOK; }
"funs" { return FUNS_TOK; }
"preds" { return PREDS_TOK; }
"nand" { return NAND_TOK;}
"nor" { return NOR_TOK;}
-"/=" { return NEQ_TOK; }
- ":=" { return ASSIGN_TOK;}
-"shift_left0" { return BVLEFTSHIFT_TOK;}
"bvshl" { return BVLEFTSHIFT_1_TOK;}
-"shift_right0" { return BVRIGHTSHIFT_TOK;}
"bvlshr" { return BVRIGHTSHIFT_1_TOK;}
"bvashr" { return BVARITHRIGHTSHIFT_TOK;}
"bvadd" { return BVPLUS_TOK;}
;
status:
- SAT_TOK { $$ = NULL; }
- | UNSAT_TOK { $$ = NULL; }
- | UNKNOWN_TOK { $$ = NULL; }
-;
+ SAT_TOK {
+ BEEV::input_status = BEEV::TO_BE_SATISFIABLE;
+ $$ = NULL;
+ }
+ | UNSAT_TOK {
+ BEEV::input_status = BEEV::TO_BE_UNSATISFIABLE;
+ $$ = NULL;
+ }
+ | UNKNOWN_TOK
+ {
+ BEEV::input_status = BEEV::TO_BE_UNKNOWN;
+ $$ = NULL;
+ }
+ ;
/* annotations: */