extern int smtparse(void*);
extern int cvcparse(void*);
+// callback for SIGALRM.
+void handle_time_out(int parameter){
+ printf("Timed Out.\n");
+ exit(0);
+}
+
+
// Amount of memory to ask for at beginning of main.
static const intptr_t INITIAL_MEMORY_PREALLOCATION_SIZE = 4000000;
/********************************************************************
ToSAT * tosat = new ToSAT(bm, simp);
AbsRefine_CounterExample * Ctr_Example =
new AbsRefine_CounterExample(bm, simp, arrayTransformer, tosat);
+ itimerval timeout;
ParserBM = bm;
GlobalSTP =
"-e : expand finite-for construct\n";
helpstring +=
"-f : number of abstraction-refinement loops\n";
+ helpstring +=
+ "-g : timeout (seconds until STP gives up)\n";
helpstring +=
"-h : help\n";
helpstring +=
bm->UserFlags.num_absrefine_flag = true;
bm->UserFlags.num_absrefine = atoi(argv[++i]);
break;
+ case 'g':
+ signal(SIGVTALRM, handle_time_out);
+ timeout.it_interval.tv_usec = 0;
+ timeout.it_interval.tv_sec = 0;
+ timeout.it_value.tv_usec = 0;
+ timeout.it_value.tv_sec = atoi(argv[++i]);
+ setitimer(ITIMER_VIRTUAL, &timeout, NULL);
+ break;
case 'h':
fprintf(stderr,usage,prog);
cout << helpstring;
0h{HEX}+ { cvclval.node = new BEEV::ASTNode(BEEV::ParserBM->CreateBVConst(yytext+2, 16)); return BVCONST_TOK;}
0hex{HEX}+ { cvclval.node = new BEEV::ASTNode(BEEV::ParserBM->CreateBVConst(yytext+4, 16)); return BVCONST_TOK;}
{DIGIT}+ { cvclval.uintval = strtoul(yytext, NULL, 10); return NUMERAL_TOK;}
+\'b[0-1]+ { cvclval.str = strdup(yytext+2); return BIN_BASED_NUMBER;}
+\'d[0-9]+ { cvclval.str = strdup(yytext+2); return DEC_BASED_NUMBER;}
+\'h[0-9a-fA-F]+ { cvclval.str = strdup(yytext+2); return HEX_BASED_NUMBER;}
"%" { BEGIN COMMENT;}
<COMMENT>"\n" { BEGIN INITIAL; /* return to normal mode */}
//ASTNode,ASTVec
BEEV::ASTNode *node;
BEEV::ASTVec *vec;
+ char* str;
//Hash_Map to hold Array Updates during parse A map from array index
//to array values. To support the WITH construct
%token <node> BVCONST_TOK
%token <node> TERMID_TOK FORMID_TOK COUNTEREXAMPLE_TOK
%token <uintval> NUMERAL_TOK
+%token <str> BIN_BASED_NUMBER
+%token <str> DEC_BASED_NUMBER
+%token <str> HEX_BASED_NUMBER
%%
$$ = new ASTNode(ParserBM->CreateTerm(ITE,1,*$3,one,zero));
delete $3;
}
+| NUMERAL_TOK BIN_BASED_NUMBER
+{
+ std::string* vals = new std::string($2);
+ $$ = new ASTNode(ParserBM->CreateBVConst(vals, 2, $1));
+ free($2); delete vals;
+}
+| NUMERAL_TOK DEC_BASED_NUMBER
+{
+ std::string* vals = new std::string($2);
+ $$ = new ASTNode(ParserBM->CreateBVConst(vals, 10, $1));
+ free($2); delete vals;
+}
+| NUMERAL_TOK HEX_BASED_NUMBER
+{
+ std::string* vals = new std::string($2);
+ $$ = new ASTNode(ParserBM->CreateBVConst(vals, 16, $1));
+ free($2); delete vals;
+}
| Expr '[' Expr ']'
{
// valuewidth is same as array, indexwidth is 0.
#include "SolverTypes.h"
-namespace MINISAT {
-
-/*************************************************************************************/
#ifdef _MSC_VER
#include <ctime>
-static inline double cpuTime(void) {
- return (double)clock() / CLOCKS_PER_SEC; }
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
+#endif
+
+namespace MINISAT {
+
+/*************************************************************************************/
+#ifdef _MSC_VER
+
+static inline double cpuTime(void) {
+ return (double)clock() / CLOCKS_PER_SEC; }
+#else
static inline double cpuTime(void) {
struct rusage ru;