//DAG is minimized as much as possibly, and ideally should
//garuntee that all liketerms in BVPLUSes have been combined.
bm->SimplifyWrites_InPlace_Flag = false;
- bm->Begin_RemoveWrites = false;
- bm->start_abstracting = false;
+ //bm->Begin_RemoveWrites = false;
+ //bm->start_abstracting = false;
bm->TermsAlreadySeenMap_Clear();
do
{
bm->TermsAlreadySeenMap_Clear();
- bm->start_abstracting = false;
+ //bm->start_abstracting = false;
bm->SimplifyWrites_InPlace_Flag = false;
- bm->Begin_RemoveWrites = false;
+ //bm->Begin_RemoveWrites = false;
long final_difficulty_score = difficulty.score(simplified_solved_InputToSAT);
if (bm->UserFlags.stats_flag)
{
if (READ == term.GetKind()
&& WRITE == term[0].GetKind()
- && !GetRemoveWritesFlag())
+ /*&& !GetRemoveWritesFlag()*/)
{
return false;
}
if (READ == term.GetKind()
&& WRITE == term[0].GetKind()
- && GetRemoveWritesFlag())
+ /*&& GetRemoveWritesFlag()*/)
{
return true;
}
return false;
}//End of VarSeenInTerm
-
+
ASTNode STPMgr::NewParameterized_BooleanVar(const ASTNode& var,
const ASTNode& constant)
{
return CurrentSymbol;
} // End of NewParameterized_BooleanVar()
+
//If ASTNode remain with references (somewhere), this will segfault.
STPMgr::~STPMgr() {
ASTTrue = ASTNode(0);
ASTUndefined = ASTNode(0);
_current_query = ASTNode(0);
- dummy_node = ASTNode(0);
+ //dummy_node = ASTNode(0);
zeroes.clear();
ones.clear();
ASTBVConst::ASTBVConstHasher,
ASTBVConst::ASTBVConstEqual> ASTBVConstSet;
+#if 0
typedef HASHMAP<
ASTNode,
ASTNodeSet,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTNodeToSetMap;
+#endif
// Unique node tables that enables common subexpression sharing
ASTInteriorSet _interior_unique_table;
// Global for assigning new node numbers.
int _max_node_num;
- ASTNode dummy_node;
-
+ uint8_t last_iteration;
+
public:
HashingNodeFactory* hashingNodeFactory;
NodeFactory *defaultNodeFactory;
//frequently used nodes
ASTNode ASTFalse, ASTTrue, ASTUndefined;
- uint8_t last_iteration;
-
// No nodes should already have the iteration number that is returned from here.
// This never returns zero.
uint8_t getNextIteration()
// logical context is represented by a ptr to a vector of
// assertions in that logical context. Logical contexts are
// created by PUSH/POP
- //std::vector<ASTVec *> _asserts;
std::vector<IntToASTVecMap *> _asserts;
// Memo table that tracks terms already seen
// Flags indicates that counterexample will now be checked by the
// counterexample checker, and hence simplifyterm must switch off
// certain optimizations. In particular, array write optimizations
- bool start_abstracting;
- bool Begin_RemoveWrites;
+ //bool start_abstracting;
+ //bool Begin_RemoveWrites;
bool SimplifyWrites_InPlace_Flag;
//count is used in the creation of new variables
{
_max_node_num = 0;
- Begin_RemoveWrites = false;
+ //Begin_RemoveWrites = false;
ValidFlag = false;
bvdiv_exception_occured = false;
counterexample_checking_during_refinement = false;
- start_abstracting = false;
- Begin_RemoveWrites = false;
+ //start_abstracting = false;
+ //Begin_RemoveWrites = false;
SimplifyWrites_InPlace_Flag = false;
// Need to initiate the node factories before any nodes are created.
return runTimes;
}
+#if 0
void SetRemoveWritesFlag(bool in)
{
Begin_RemoveWrites = in;
{
return Begin_RemoveWrites;
}
+#endif
int NewNodeNum()
{
BEEV::ASTVec v = b->GetAsserts();
BEEV::Simplifier * simp = new BEEV::Simplifier(b);
for(BEEV::ASTVec::iterator i=v.begin(),iend=v.end();i!=iend;i++) {
- b->Begin_RemoveWrites = true;
+ //b->Begin_RemoveWrites = true;
BEEV::ASTNode q =
(simplify_print == 1) ?
simp->SimplifyFormula_TopLevel(*i,false) : *i;
q =
(simplify_print == 1) ?
simp->SimplifyFormula_TopLevel(q,false) : q;
- b->Begin_RemoveWrites = false;
+ //b->Begin_RemoveWrites = false;
os << "ASSERT( ";
q.PL_Print(os);
os << ");" << endl;
vc_printAssertsToStream(vc, os, simplify_print);
os << "%----------------------------------------------------" << endl;
os << "QUERY( ";
- b->Begin_RemoveWrites = true;
+ //b->Begin_RemoveWrites = true;
BEEV::ASTNode q =
(simplify_print == 1) ?
simp->SimplifyFormula_TopLevel(*((nodestar)e),false) :
*(nodestar)e;
- b->Begin_RemoveWrites = false;
+ //b->Begin_RemoveWrites = false;
q.PL_Print(os);
os << " );" << endl;
{
nodestar round1 =
new node(simp->SimplifyFormula_TopLevel(*a,false));
- b->Begin_RemoveWrites = true;
+ //b->Begin_RemoveWrites = true;
nodestar output =
new node(simp->SimplifyFormula_TopLevel(*round1,false));
//if(cinterface_exprdelete_on) created_exprs.push_back(output);
- b->Begin_RemoveWrites = false;
+ //b->Begin_RemoveWrites = false;
delete round1;
return output;
}
else
{
nodestar round1 = new node(simp->SimplifyTerm(*a));
- b->Begin_RemoveWrites = true;
+ //b->Begin_RemoveWrites = true;
nodestar output = new node(simp->SimplifyTerm(*round1));
//if(cinterface_exprdelete_on) created_exprs.push_back(output);
- b->Begin_RemoveWrites = false;
+ //b->Begin_RemoveWrites = false;
delete round1;
return output;
}
//boost::object_pool<ASTNode> node_pool;
bool alreadyWarned;
bool print_success;
+
+ // Used to cache prior queries.
+ struct Entry
+ {
+ explicit
+ Entry(SOLVER_RETURN_TYPE result_)
+ {
+ result = result_;
+ }
+
+ SOLVER_RETURN_TYPE result;
+ ASTNode node;
+
+ void
+ print()
+ {
+ if (result == SOLVER_UNSATISFIABLE)
+ cerr << "u";
+ else if (result == SOLVER_SATISFIABLE)
+ cerr << "s";
+ else if (result == SOLVER_UNDECIDED)
+ cerr << "?";
+ }
+ };
+ vector<Entry> cache;
+ vector<vector<ASTNode> > symbols;
+
+
public:
LETMgr letMgr;
NodeFactory* nf;
print_success = false;
}
+ void
+ startup()
+ {
+ CONSTANTBV::ErrCode c = CONSTANTBV::BitVector_Boot();
+ if(0 != c) {
+ cout << CONSTANTBV::BitVector_Error(c) << endl;
+ FatalError("Bad startup");
+ }
+ }
+
const ASTVec
GetAsserts(void)
{
//node_pool.destroy(n);
}
- struct Entry
- {
- explicit
- Entry(SOLVER_RETURN_TYPE result_)
- {
- result = result_;
- }
-
- SOLVER_RETURN_TYPE result;
- ASTNode node;
-
- void
- print()
- {
- if (result == SOLVER_UNSATISFIABLE)
- cerr << "u";
- else if (result == SOLVER_SATISFIABLE)
- cerr << "s";
- else if (result == SOLVER_UNDECIDED)
- cerr << "?";
- }
- };
- vector<Entry> cache;
- vector<vector<ASTNode> > symbols;
-
void
addSymbol(ASTNode &s)
{
};
}
-#endif /* PARSERINTERFACE_H_ */
+#endif
//want to print the output always from the commandline.
bm->UserFlags.print_output_flag = true;
ASTVec * AssertsQuery = new ASTVec;
- CONSTANTBV::ErrCode c = CONSTANTBV::BitVector_Boot();
- if(0 != c) {
- cout << CONSTANTBV::BitVector_Error(c) << endl;
- return 0;
- }
bm->GetRunTimes()->start(RunTimes::Parsing);
{
else
parserInterface = &piTypeCheckSimp;
+ parserInterface->startup();
+
if (onePrintBack)
{
if (bm->UserFlags.smtlib2_parser_flag)
ASTNode
Simplifier::SimplifyFormula_NoRemoveWrites(const ASTNode& b, bool pushNeg, ASTNodeMap* VarConstMap)
{
- _bm->Begin_RemoveWrites = false;
+ //_bm->Begin_RemoveWrites = false;
ASTNode out = SimplifyFormula(b, pushNeg, VarConstMap);
return out;
}