void RunTimes::print()
{
if (0 != category_stack.size())
- BEEV::FatalError("category stack is not yet emptuy");
+ {
+ std::cerr << "size:" << category_stack.size() << std::endl;
+ std::cerr << "top:" << CategoryNames[category_stack.top().first] << std::endl;
+ BEEV::FatalError("category stack is not yet empty!!");
+ }
std::ostringstream result;
result << "statistics\n";
} //End of convertFormulaToCNFPosNOT()
void CNFMgr::convertFormulaToCNFPosAND(const ASTNode& varphi,
- ClauseList* defs)
- {
+ ClauseList* defs) {
//****************************************
// (pos) AND ~> UNION
//****************************************
- ASTVec::const_iterator it = varphi.GetChildren().begin();
- convertFormulaToCNF(*it, defs);
- ClauseList* psi = COPY(*(info[*it]->clausespos));
- for (it++; it != varphi.GetChildren().end(); it++)
- {
- convertFormulaToCNF(*it, defs);
- INPLACE_UNION(psi, *(info[*it]->clausespos));
- reduceMemoryFootprintPos(*it);
- }
- info[varphi]->clausespos = psi;
- } //End of convertFormulaToCNFPosAND()
+ ASTVec::const_iterator it = varphi.GetChildren().begin();
+ convertFormulaToCNF(*it, defs);
+ ClauseList* psi = COPY(*(info[*it]->clausespos));
+
+ for (it++; it != varphi.GetChildren().end(); it++) {
+ convertFormulaToCNF(*it, defs);
+ CNFInfo* x = info[*it];
+
+ if (sharesPos(*x) == 1) {
+ psi->insert(psi->end(),x->clausespos->begin(), x->clausespos->end());
+ delete (x->clausespos);
+ x->clausespos = NULL;
+ if (x->clausesneg == NULL) {
+ delete x;
+ info.erase(*it);
+ }
+ } else {
+ INPLACE_UNION(psi, *(x->clausespos));
+ reduceMemoryFootprintPos(*it);
+ }
+ }
+ info[varphi]->clausespos = psi;
+} //End of convertFormulaToCNFPosAND()
void CNFMgr::convertFormulaToCNFPosNAND(const ASTNode& varphi,
ClauseList* defs)
//terminating early
// cout << "Percentage clauses added: "
// << percentage << endl;
- bm->GetRunTimes()->start(RunTimes::Solving);
+ bm->GetRunTimes()->stop(RunTimes::SendingToSAT);
+ bm->GetRunTimes()->start(RunTimes::Solving);
newS.solve();
bm->GetRunTimes()->stop(RunTimes::Solving);
if(!newS.okay())
}
count = 0;
flag = 1;
+ bm->GetRunTimes()->start(RunTimes::SendingToSAT);
}
if (newS.okay())
{
- continue;
+ continue;
}
else
{