//Takes a BVCONST and returns its constant value
unsigned int GetUnsignedConst(const ASTNode n);
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
ASTNode,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTNodeMap;
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
int32_t,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTNodeCountMap;
- typedef hash_set<
+ typedef HASHSET<
ASTNode,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTNodeSet;
- typedef hash_multiset<
+ typedef HASHMULTISET<
ASTNode,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTNodeMultiSet;
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
ASTVec,
ASTNode::ASTNodeHasher,
#include <iostream>
#include <vector>
+#include <cstring>
+
#ifdef EXT_HASH_MAP
-#include <ext/hash_set>
-#include <ext/hash_map>
+ #include <ext/hash_set>
+ #include <ext/hash_map>
#elif defined(TR1_UNORDERED_MAP)
-#include <tr1/unordered_map>
-#include <tr1/unordered_set>
+ #include <tr1/unordered_map>
+ #include <tr1/unordered_set>
#else
-#include <hash_set>
-#include <hash_map>
+ #include <hash_set>
+ #include <hash_map>
#endif
-#include <cstring>
+#define HASHMAP hash_map
+#define HASHSET hash_set
+#define HASHMULTISET hash_multiset
using namespace std;
namespace BEEV {
// Table for storing function count stats.
#ifdef TR1_UNORDERED_MAP
- typedef tr1::unordered_map<const char*,int,
- tr1::hash<const char *>,eqstr> function_counters;
+ typedef tr1::unordered_map<
+ const char*,
+ int,
+ tr1::hash<const char *>,
+ eqstr> function_counters;
#else
- typedef hash_map<const char*,int,
- hash<char *>,eqstr> function_counters;
+ typedef HASHMAP<
+ const char*,
+ int,
+ hash<char *>,
+ eqstr> function_counters;
#endif
void CountersAndStats(const char * functionname);
#include "../extlib-constbv/constantbv.h"
#include "RunTimes.h"
-#define HASHMAP hash_map;
-#define HASHSET hash_set;
+#define HASHMAP hash_map
+#define HASHSET hash_set
+#define HASHMULTISET hash_multiset
namespace BEEV {
****************************************************************/
// Typedef for unique Interior node table.
- typedef hash_set<
+ typedef HASHSET<
ASTInterior *,
ASTInterior::ASTInteriorHasher,
ASTInterior::ASTInteriorEqual> ASTInteriorSet;
// Typedef for unique Symbol node (leaf) table.
- typedef hash_set<
+ typedef HASHSET<
ASTSymbol *,
ASTSymbol::ASTSymbolHasher,
ASTSymbol::ASTSymbolEqual> ASTSymbolSet;
//Typedef for unique BVConst node (leaf) table.
- typedef hash_set<
+ typedef HASHSET<
ASTBVConst *,
ASTBVConst::ASTBVConstHasher,
ASTBVConst::ASTBVConstEqual> ASTBVConstSet;
// Table to uniquefy bvconst
ASTBVConstSet _bvconst_unique_table;
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
ASTNodeSet,
ASTNode::ASTNodeHasher,
// This map for building/printing counterexamples. MINISAT
// returns values for each bit (a BVGETBIT Node), and this maps
// allows us to assemble the bits into bitvectors.
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
- hash_map<unsigned int, bool> *,
+ HASHMAP<unsigned int, bool> *,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTtoBitvectorMap;
void CopySolverMap_To_CounterExample(void);
//Converts a vector of bools to a BVConst
- ASTNode BoolVectoBVConst(hash_map<unsigned, bool> * w, unsigned int l);
+ ASTNode BoolVectoBVConst(HASHMAP<unsigned, bool> * w, unsigned int l);
public:
unsigned int symbolWidth = symbol.GetValueWidth();
//'v' is the map from bit-index to bit-value
- hash_map<unsigned, bool> * v;
+ HASHMAP<unsigned, bool> * v;
if (_ASTNode_to_Bitvector.find(symbol) == _ASTNode_to_Bitvector.end())
_ASTNode_to_Bitvector[symbol] =
- new hash_map<unsigned, bool> (symbolWidth);
+ new HASHMAP<unsigned, bool> (symbolWidth);
//v holds the map from bit-index to bit-value
v = _ASTNode_to_Bitvector[symbol];
FatalError("ConstructCounterExample: error while constructing counterexample: not a variable: ", var);
//construct the bitvector value
- hash_map<unsigned, bool> * w = it->second;
+ HASHMAP<unsigned, bool> * w = it->second;
ASTNode value = BoolVectoBVConst(w, var.GetValueWidth());
//debugging
//cerr << value;
} //end of PrintSATModel()
//FUNCTION: this function accepts a boolvector and returns a BVConst
- ASTNode AbsRefine_CounterExample::BoolVectoBVConst(hash_map<unsigned, bool> * w, unsigned int l)
+ ASTNode AbsRefine_CounterExample::BoolVectoBVConst(HASHMAP<unsigned, bool> * w, unsigned int l)
{
unsigned len = w->size();
if (l < len)
FatalError("BoolVectorBVConst : "
- "length of bitvector does not match hash_map size:", ASTUndefined, l);
+ "length of bitvector does not match HASHMAP size:", ASTUndefined, l);
std::string cc;
for (unsigned int jj = 0; jj < l; jj++)
{
void outputBitVec(const ASTNode n, ostream& os);
- void Dot_Print1(ostream &os, const ASTNode n, hash_set<int> *alreadyOutput)
+ void Dot_Print1(ostream &os, const ASTNode n, HASHSET<int> *alreadyOutput)
{
// check if this node has already been printed. If so return.
os << "digraph G{" << endl;
// create hashmap to hold integers (node numbers).
- hash_set<int> alreadyOutput;
+ HASHSET<int> alreadyOutput;
Dot_Print1(os, n, &alreadyOutput);
};
} CNFInfo;
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
CNFInfo*,
ASTNode::ASTNodeHasher,
ASTNode::ASTNodeEqual> ASTNodeToCNFInfoMap;
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
ASTNode*,
ASTNode::ASTNodeHasher,
// ClauseList returned by CNF converter. For every new boolean
// variable in ASTClause a new MINISAT::Var is created (these vars
// typedefs for ints)
- typedef hash_map<
+ typedef HASHMAP<
ASTNode,
MINISAT::Var,
ASTNode::ASTNodeHasher,