{
cl_size = CLAUSAL_BUCKET_LIMIT;
}
- // else
- // {
- // cl_size = CLAUSAL_BUCKET_LIMIT-1;
- // }
+ else
+ {
+ cl_size = CLAUSAL_BUCKET_LIMIT-1;
+ }
//If no clauses of size cl_size have been seen, then create a
//bucket for that size
for(int count=1;it!=itend;it++, count++)
{
ClauseList *cl = (*it).second;
- if(CLAUSAL_BUCKET_LIMIT == count)
- {
- sat = toSATandSolve(SatSolver,*cl, false, true);
- }
- else
+// if(CLAUSAL_BUCKET_LIMIT == count)
+// {
+// sat = toSATandSolve(SatSolver,*cl, false, true);
+// }
+// else
{
sat = toSATandSolve(SatSolver,*cl);
}
#if defined CRYPTOMINISAT || defined CRYPTOMINISAT2
if ((x->clausespos != NULL
- && x->clausespos->size() > 1)
- || (doRenamePos(*x) && !wasVisited(*x)))
+ && (x->clausespos->size() > 1
+ || (renameAllSiblings
+ && !(x->clausespos->size()==1)
+ && !wasRenamedPos(*x)))
+ || (doRenamePos(*x)
+ && !wasVisited(*x))))
{
if (doSibRenamingPos(*x)
|| sharesPos(*x) > 1
- || doRenamePos(*x))
+ || doRenamePos(*x)
+ || renameAllSiblings)
{
doRenamingPos(varphi, defs);
}
}
-
#else
- if (x->clausespos != NULL && x->clausespos->size() > 1)
+ if (x->clausespos != NULL
+ && (x->clausespos->size() > 1
+ || (renameAllSiblings
+ && !(x->clausesneg->size() == 1)
+ && !wasRenamedNeg(*x))))
{
if (doSibRenamingPos(*x)
- || sharesPos(*x) > 1)
+ || sharesPos(*x) > 1
+ || renameAllSiblings)
{
doRenamingPos(varphi, defs);
}
convertFormulaToCNFNegCases(varphi, defs);
}
- if (x->clausesneg != NULL && x->clausesneg->size() > 1)
+ if (x->clausesneg != NULL
+ && (x->clausesneg->size() > 1
+ || (renameAllSiblings
+ && !(x->clausesneg->size() == 1)
+ && !wasRenamedNeg(*x))))
{
- if (doSibRenamingNeg(*x) || sharesNeg(*x) > 1)
+ if (doSibRenamingNeg(*x)
+ || sharesNeg(*x) > 1
+ || renameAllSiblings)
{
doRenamingNeg(varphi, defs);
}
//########################################
//mark that we've already done the hard work
-
+
+ if(renameAllSiblings)
+ {
+ assert(info[varphi]->clausesneg == NULL
+ || info[varphi]->clausesneg->size() ==1);
+ }
+
setWasVisited(*x);
} //End of convertFormulaToCNF()
reduceMemoryFootprintPos(*it);
}
}
+ if (renameAllSiblings)
+ {
+ assert(((unsigned)psi->size()) == varphi.GetChildren().size());
+ }
+
info[varphi]->clausespos = psi;
} //End of convertFormulaToCNFPosAND()
xor_clause->insert(xor_clause->end(),
((*(info[*it]->clausespos))[0])->begin(),
((*(info[*it]->clausespos))[0])->end());
+ if(renameAllSiblings)
+ {
+ assert(info[*it]->clausespos->size() ==1);
+ assert(info[*it]->clausesneg->size() ==1);
+ }
}
doRenamingPosXor(varphi);
//ClauseList* psi = convertFormulaToCNFPosXORAux(varphi, 0, defs);
{
bm = bmgr;
clausesxor = new ClauseList();
+ renameAllSiblings = true;
}
//########################################
class CNFMgr
{
private:
+
+ // Setting this to true changes the behaviour of when new
+ // Tseitin variables are created. Normally a Tseitin
+ // variable is created only if: (the number of clauses is
+ // >1) && (renaming of the node is enabled || the node is
+ // shared). When this is set, every node is replaced by a
+ // new tseitin variable.
+ bool renameAllSiblings;
+
//########################################
//########################################
// data types