// worth doing explicitly (e.g., a = b, a = ~b, etc.)
else
{
- // return _bm->CreateSimpForm(OR,
- // _bm->CreateSimpForm(AND, a, b),
- // _bm->CreateSimpForm(AND, b, c),
- // _bm->CreateSimpForm(AND, a, c));
- return _bm->CreateSimpForm(AND,
- _bm->CreateSimpForm(OR, a, b),
- _bm->CreateSimpForm(OR, b, c),
- _bm->CreateSimpForm(OR, a, c));
-
+// return _bm->CreateSimpForm(OR,
+// _bm->CreateSimpForm(AND, a, b),
+// _bm->CreateSimpForm(AND, b, c),
+// _bm->CreateSimpForm(AND, a, c));
+ return
+ _bm->CreateSimpForm(AND,
+ _bm->CreateSimpForm(OR, a, b),
+ //_bm->CreateSimpForm(XOR,a,b)),
+ _bm->CreateSimpForm(OR, b, c),
+ //_bm->CreateSimpForm(XOR,b,c)),
+ _bm->CreateSimpForm(OR, a, c)
+ //_bm->CreateSimpForm(XOR,a,c)
+ );
}
}
const ASTNode& yi,
const ASTNode& cin)
{
- // For some unexplained reason, XORs are faster than converting
- // them to cluases at this point
ASTNode S0 = _bm->CreateSimpForm(XOR,
- _bm->CreateSimpForm(XOR, xi, yi),
+ //_bm->CreateSimpForm(XOR, xi, yi),
+ xi,
+ yi,
cin);
return S0;
- // ASTNode S1 = _bm->CreateSimpForm(OR,xi,yi,cin);
- // ASTNode S2 = _bm->CreateSimpForm(OR,
- // _bm->CreateSimpForm(NOT,xi),
- // _bm->CreateSimpForm(NOT,yi),
- // cin);
- // ASTNode S3 = _bm->CreateSimpForm(OR,
- // _bm->CreateSimpForm(NOT,xi),
- // yi,
- // _bm->CreateSimpForm(NOT,cin));
- // ASTNode S4 = _bm->CreateSimpForm(OR,
- // xi,
- // _bm->CreateSimpForm(NOT,yi),
- // _bm->CreateSimpForm(NOT,cin));
- // ASTVec S;
- // S.push_back(S1);
- // S.push_back(S2);
- // S.push_back(S3);
- // S.push_back(S4);
- // return _bm->CreateSimpForm(AND,S);
}
// Bitwise complement
namespace BEEV
{
- //Bucketize clauses into buckets of size 1,2,...MAX_BUCKET_LIMIT
+ //Bucketize clauses into buckets of size 1,2,...CLAUSAL_BUCKET_LIMIT
static ClauseBuckets * Sort_ClauseList_IntoBuckets(ClauseList * cl)
{
ClauseBuckets * cb = new ClauseBuckets();
{
ClausePtr cptr = *it;
int cl_size = cptr->size();
- if(cl_size >= MAX_BUCKET_LIMIT)
+ if(cl_size >= CLAUSAL_BUCKET_LIMIT)
{
- cl_size = MAX_BUCKET_LIMIT;
+ cl_size = CLAUSAL_BUCKET_LIMIT;
}
//If no clauses of size cl_size have been seen, then create a
ClauseBuckets::iterator itend = cb->end();
bool sat = false;
- for(;it!=itend;it++)
+ for(int count=1;it!=itend;it++, count++)
{
ClauseList *cl = (*it).second;
- sat = toSATandSolve(SatSolver,*cl);
+// if(CLAUSAL_BUCKET_LIMIT == count)
+// {
+// sat = toSATandSolve(SatSolver,*cl, false, true);
+// }
+// else
+ {
+ sat = toSATandSolve(SatSolver,*cl);
+ }
if(!sat)
{
return sat;
* unsat. else continue.
*/
bool ToSAT::toSATandSolve(MINISAT::Solver& newSolver,
- ClauseList& cll, bool add_xor_clauses)
+ ClauseList& cll,
+ bool add_xor_clauses,
+ bool enable_clausal_abstraction)
{
CountersAndStats("SAT Solver", bm);
bm->GetRunTimes()->start(RunTimes::SendingToSAT);
if(bm->UserFlags.print_cnf_flag)
{
- #define DEBUG_LIB
+ //newSolver.cnfDump = true;
}
#ifdef CRYPTOMINISAT
newSolver.startClauseAdding();
#else
newSolver.addClause(satSolverClause);
#endif
- float percentage=CLAUSAL_ABSTRACTION_CUTOFF;
- if(count++ >= input_clauselist_size*percentage)
+ if(enable_clausal_abstraction &&
+ count++ >= input_clauselist_size*CLAUSAL_ABSTRACTION_CUTOFF)
{
//Arbitrary adding only 60% of the clauses in the hopes of
//terminating early
#if defined CRYPTOMINISAT2
newSolver.set_gaussian_decision_until(100);
- newSolver.performReplace = false;
- newSolver.xorFinder = false;
+ //newSolver.performReplace = true;
+ //newSolver.xorFinder = true;
#endif
newSolver.solve();
bm->GetRunTimes()->stop(RunTimes::Solving);