long initial_difficulty_score = DifficultyScore::score(original_input);
+ // A heap object so I can easily control its lifetime.
+ BVSolver* bvSolver = new BVSolver(bm,simp);
+
//round of substitution, solving, and simplification. ensures that
//DAG is minimized as much as possibly, and ideally should
//garuntee that all liketerms in BVPLUSes have been combined.
if(bm->UserFlags.wordlevel_solve_flag && bm->UserFlags.optimize_flag)
{
simplified_solved_InputToSAT =
- bvsolver->TopLevelBVSolve(simplified_solved_InputToSAT);
+ bvSolver->TopLevelBVSolve(simplified_solved_InputToSAT);
bm->ASTNodeStats("after solving: ", simplified_solved_InputToSAT);
}
if(bm->UserFlags.wordlevel_solve_flag && bm->UserFlags.optimize_flag)
{
simplified_solved_InputToSAT =
- bvsolver->TopLevelBVSolve(simplified_solved_InputToSAT);
+ bvSolver->TopLevelBVSolve(simplified_solved_InputToSAT);
bm->ASTNodeStats("after solving: ", simplified_solved_InputToSAT);
}
} while (inputToSAT != simplified_solved_InputToSAT);
// Deleting it clears out all the buckets associated with hashmaps etc. too.
- delete bvsolver;
- bvsolver = new BVSolver(bm,simp);
- //auto_ptr<BVSolver> bvCleaner(bvsolver);
+ delete bvSolver;
+ bvSolver = NULL;
if(bm->UserFlags.stats_flag)
simp->printCacheStatus();
****************************************************************/
STPMgr * bm;
Simplifier * simp;
- BVSolver * bvsolver;
ArrayTransformer * arrayTransformer;
ToSAT * tosat;
AbsRefine_CounterExample * Ctr_Example;
* Constructor and Destructor *
****************************************************************/
+ //Constructor
+ STP(STPMgr* b,
+ Simplifier* s,
+ ArrayTransformer * a,
+ ToSAT * ts,
+ AbsRefine_CounterExample * ce)
+ {
+ bm = b;
+ simp = s;
+ tosat = ts;
+ arrayTransformer = a;
+ Ctr_Example = ce;
+ }// End of constructor
+
+
//Constructor
STP(STPMgr* b,
Simplifier* s,
bm = b;
simp = s;
tosat = ts;
- bvsolver = bsolv;
+ delete bsolv; // Remove from the constructor later..
arrayTransformer = a;
Ctr_Example = ce;
}// End of constructor
~STP()
{
ClearAllTables();
- delete bvsolver;
delete Ctr_Example;
delete arrayTransformer;
delete tosat;
void ClearAllTables(void)
{
simp->ClearAllTables();
- bvsolver->ClearAllTables();
arrayTransformer->ClearAllTables();
tosat->ClearAllTables();
Ctr_Example->ClearAllTables();
Simplifier * simp = new Simplifier(bm);
auto_ptr<Simplifier> simpCleaner(simp);
- BVSolver* bvsolver = new BVSolver(bm, simp);
-
ArrayTransformer * arrayTransformer = new ArrayTransformer(bm, simp);
auto_ptr<ArrayTransformer> atClearner(arrayTransformer);
GlobalSTP =
new STP(bm,
simp,
- bvsolver,
arrayTransformer,
tosat,
Ctr_Example);