XOR 1 - Form
IFF 1 - Form
IMPLIES 2 2 Form
-FOR 5 5 Form
PARAMBOOL 2 2 Form
# array operations
if (3 != n.Degree())
FatalError("BVTypeCheck:ITE must have exactly 3 ChildNodes", n);
break;
- case FOR:
- //FIXME: Todo
- break;
default:
FatalError("BVTypeCheck: Unrecognized kind: ");
break;
result = nf->CreateNode(k, vec);
break;
}
- case FOR:
- {
- //Insert in a global list of FOR constructs. Return TRUE now
- //GlobalList_Of_FiniteLoops.push_back(simpleForm);
- return ASTTrue;
- break;
- }
case PARAMBOOL:
{
//If the parameteric boolean variable is of the form
}
SOLVER_RETURN_TYPE result;
- if(bm->UserFlags.num_absrefine_flag)
- {
- result = UserGuided_AbsRefine(NewSolver,
- original_input);
- }
- else
- {
- result = TopLevelSTPAux(NewSolver,
+ result = TopLevelSTPAux(NewSolver,
original_input, original_input);
- }
delete newS;
return res;
}
- if (!bm->UserFlags.num_absrefine_flag)
+// if (!bm->UserFlags.num_absrefine_flag)
{
FatalError("TopLevelSTPAux: reached the end without proper conclusion:"
"either a divide by zero in the input or a bug in STP");
//bogus return to make the compiler shut up
return SOLVER_ERROR;
}
- else
+ // else
{
- return res;
+ // return res;
}
} //End of TopLevelSTPAux
+#if 0
+
//UserGuided abstraction refinement
SOLVER_RETURN_TYPE
STP::
"either a divide by zero in the input or a bug in STP");
return SOLVER_ERROR;
} //End of UserGuided_AbsRefine()
+#endif
+
}; //end of namespace
ASTUndefined = CreateNode(UNDEFINED);
runTimes = new RunTimes();
_current_query = ASTUndefined;
- UserFlags.num_absrefine = 2;
CreateBVConstVal = NULL;
}
bool print_counterexample_flag;
bool print_binary_flag;
- //Expands out the finite for-construct completely
- bool expand_finitefor_flag;
-
- //Determines the number of abstraction-refinement loop count for the
- //for-construct
- bool num_absrefine_flag;
- int num_absrefine;
-
//if this option is true then print the way dawson wants using a
//different printer. do not use this printer.
bool print_arrayval_declaredorder_flag;
output_CNF_flag = false;
output_bench_flag = false;
- //Expands out the finite for-construct completely
- expand_finitefor_flag = false;
-
- //Determines the number of abstraction-refinement loop count for the
- //for-construct
- num_absrefine_flag = false;
- num_absrefine = 0;
-
//if this option is true then print the way dawson wants using a
//different printer. do not use this printer.
print_arrayval_declaredorder_flag = false;
output = bm->NewParameterized_BooleanVar(form[0],form[1]);
output = ComputeFormulaUsingModel(output);
break;
- case FOR:
- //output = Check_FiniteLoop_UsingModel(form);
- output = ASTTrue;
- break;
default:
cerr << _kind_names[k];
FatalError(" ComputeFormulaUsingModel: "
"-c : construct counterexample\n";
helpstring +=
"-d : check counterexample\n";
- helpstring +=
- "-e : expand finite-for construct\n";
helpstring +=
"-f : number of abstraction-refinement loops\n";
helpstring +=
b->UserFlags.construct_counterexample_flag = true;
b->UserFlags.check_counterexample_flag = true;
break;
- case 'e':
- b->UserFlags.expand_finitefor_flag = true;
- break;
- case 'f':
- b->UserFlags.num_absrefine_flag = true;
- b->UserFlags.num_absrefine = param_value;
- break;
case 'h':
fprintf(stderr,BEEV::usage,BEEV::prog);
cout << helpstring;
XOR,
IFF,
IMPLIES,
- FOR,
PARAMBOOL,
READ,
WRITE,
bm->UserFlags.construct_counterexample_flag = true;
bm->UserFlags.check_counterexample_flag = true;
break;
- case 'e':
- bm->UserFlags.expand_finitefor_flag = true;
- break;
- case 'f':
- 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;
"NAND" { return NAND_TOK;}
"NOR" { return NOR_TOK;}
"NOT" { return NOT_TOK; }
-"FOR" { return FOR_TOK; }
"EXCEPT" { return EXCEPT_TOK; }
"OR" { return OR_TOK; }
"/=" { return NEQ_TOK; }
%token AND_TOK "AND"
%token OR_TOK "OR"
%token NOT_TOK "NOT"
-%token FOR_TOK "FOR"
%token EXCEPT_TOK "EXCEPT"
%token XOR_TOK "XOR"
%token NAND_TOK "NAND"
delete $1;
delete $3;
}
-| FOR_TOK '(' ForDecl ';' BVCONST_TOK ';' BVCONST_TOK ';' BVCONST_TOK ';' EXCEPT_TOK Formula ')' '{' Formula '}'
-{
- //Allows a compact representation of
- //parameterized set of formulas (bounded
- //universal quantification)
- //
- //parameter name (a variable)
- //
- //initial value (BVCONST)
- //
- //limit value (BVCONST)
- //
- //increment value (BVCONST)
- //
- //formula (it can be a nested forloop)
-
- ASTVec vec;
- vec.push_back(*$3);
- vec.push_back(*$5);
- vec.push_back(*$7);
- vec.push_back(*$9);
- vec.push_back(*$12);
- vec.push_back(*$15);
- ASTNode * n = new ASTNode(parserInterface->nf->CreateNode(FOR,vec));
- $$ = n;
- delete $3;
- delete $5;
- delete $7;
- delete $9;
- delete $12;
- delete $15;
-}
-| FOR_TOK '(' ForDecl ';' BVCONST_TOK ';' BVCONST_TOK ';' BVCONST_TOK ')' '{' Formula '}'
-{
- //Allows a compact representation of
- //parameterized set of formulas (bounded
- //universal quantification)
- //
- //parameter name (a variable)
- //
- //initial value (BVCONST)
- //
- //limit value (BVCONST)
- //
- //increment value (BVCONST)
- //
- //formula (it can be a nested forloop)
-
- ASTVec vec;
- vec.push_back(*$3);
- vec.push_back(*$5);
- vec.push_back(*$7);
- vec.push_back(*$9);
- vec.push_back(parserInterface->CreateNode(FALSE));
- vec.push_back(*$12);
- ASTNode * n = new ASTNode(parserInterface->nf->CreateNode(FOR,vec));
- $$ = n;
- delete $3;
- delete $5;
- delete $7;
- delete $9;
- delete $12;
-}
| NOT_TOK Formula
{
$$ = new ASTNode(parserInterface->nf->CreateNode(NOT, *$2));
PL_Print1(os, c[1], indentation, letize);
os << ")";
break;
- case FOR:
- // if(expand_finitefor_flag)
- // {
- // ASTNode expandedfor = bm->Expand_FiniteLoop_TopLevel(n);
- // PL_Print1(os, expandedfor, indentation, letize);
- // }
- // else
- {
- os << "FOR(";
- PL_Print1(os, c[0], indentation, letize);
- os << ";";
- PL_Print1(os, c[1], indentation, letize);
- os << ";";
- PL_Print1(os, c[2], indentation, letize);
- os << ";";
- PL_Print1(os, c[3], indentation, letize);
- os << ";";
- os << "EXCEPT ";
- PL_Print1(os, c[4], indentation, letize);
- os << "){ \n";
- PL_Print1(os, c[5], indentation, letize);
- os << "} \n";
- }
- break;
case BVLT: // two arity, prefixed function name.
case BVLE:
ASTVec ca = a.GetChildren();
if (!(IMPLIES == kind ||
ITE == kind ||
- FOR == kind ||
PARAMBOOL==kind ||
isAtomic(kind)))
{
case ITE:
output = SimplifyIteFormula(a, pushNeg, VarConstMap);
break;
- case FOR:
- output = SimplifyForFormula(a, pushNeg, VarConstMap);
- break;
default:
//kind can be EQ,NEQ,BVLT,BVLE,... or a propositional variable
output = SimplifyAtomicFormula(a, pushNeg, VarConstMap);