// Datatype for Clauselists
typedef vector<ClausePtr> ClauseList;
+
+ //Datatype for ClauseLists
+ typedef MAP<
+ int,
+ ClauseList *> ClauseBuckets;
// Function to dump contents of ASTNodeMap
ostream &operator<<(ostream &os, const ASTNodeMap &nmap);
namespace BEEV
{
+
+ static ClauseBuckets * SortClauseList_IntoBuckets(ClauseList * cl)
+ {
+ ClauseBuckets * cb = new ClauseBuckets();
+
+ //Sort the clauses, and bucketize by the size of the clauses
+ for(ClauseList::iterator it = cl->begin(), itend = cl->end();
+ it!=itend; it++)
+ {
+ ClausePtr cptr = *it;
+ int cl_size = cptr->size();
+
+ //If no clauses of size cl_size have been seen, then create a
+ //bucket for that size
+ if(cb->find(cl_size) == cb->end())
+ {
+ ClauseList * cllist = new ClauseList();
+ cllist->push_back(cptr);
+ (*cb)[cl_size] = cllist;
+ }
+ else
+ {
+ ClauseList * cllist = (*cb)[cl_size];
+ cllist->push_back(cptr);
+ }
+ }
+
+ return cb;
+ } //End of SortClauseList_IntoBuckets()
+
//Call the SAT solver, and check the result before returning. This
//can return one of 3 values, SOLVER_VALID, SOLVER_INVALID or
//SOLVER_UNDECIDED
CNFMgr* cm = new CNFMgr(bm);
ClauseList* cl = cm->convertToCNF(BBFormula);
+ ClauseBuckets * cb = SortClauseList_IntoBuckets(cl);
bool sat = toSATandSolve(SatSolver, *cl);
cm->DELETE(cl);
delete cm;
// -*- c++ -*-
/********************************************************************
- * AUTHORS: Vijay Ganesh
+ * AUTHORS: Vijay Ganesh, Mike Katelman
*
* BEGIN DATE: November, 2005
*
//########################################
// data types
- // for the meaning of control bits, see "utilities for contol bits".
+ // for the meaning of control bits, see "utilities for contol
+ // bits".
typedef struct
{
int control;
STPMgr *bm;
ASTNodeToCNFInfoMap info;
ASTNodeToASTNodePtrMap store;
-
+
//########################################
//########################################
// utility predicates