summaryrefslogtreecommitdiff
path: root/src/compat
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat')
-rw-r--r--src/compat/cvc3_compat.cpp18
-rw-r--r--src/compat/cvc3_compat.h10
2 files changed, 13 insertions, 15 deletions
diff --git a/src/compat/cvc3_compat.cpp b/src/compat/cvc3_compat.cpp
index 3309ce442..ffb299394 100644
--- a/src/compat/cvc3_compat.cpp
+++ b/src/compat/cvc3_compat.cpp
@@ -21,7 +21,6 @@
#include <iosfwd>
#include <iterator>
#include <sstream>
-#include <string>
#include "base/exception.h"
#include "base/output.h"
@@ -33,9 +32,6 @@
#include "parser/parser_builder.h"
#include "smt/command.h"
#include "util/bitvector.h"
-#include "util/hash.h"
-#include "util/integer.h"
-#include "util/rational.h"
#include "util/sexpr.h"
#include "util/subrange_bound.h"
@@ -60,22 +56,22 @@ namespace CVC3 {
// ExprManager-to-ExprManager import).
static std::map<CVC4::ExprManager*, ValidityChecker*> s_validityCheckers;
-static std::hash_map<Type, Expr, CVC4::TypeHashFunction> s_typeToExpr;
-static std::hash_map<Expr, Type, CVC4::ExprHashFunction> s_exprToType;
+static std::unordered_map<Type, Expr, CVC4::TypeHashFunction> s_typeToExpr;
+static std::unordered_map<Expr, Type, CVC4::ExprHashFunction> s_exprToType;
static bool typeHasExpr(const Type& t) {
- std::hash_map<Type, Expr, CVC4::TypeHashFunction>::const_iterator i = s_typeToExpr.find(t);
+ std::unordered_map<Type, Expr, CVC4::TypeHashFunction>::const_iterator i = s_typeToExpr.find(t);
return i != s_typeToExpr.end();
}
static Expr typeToExpr(const Type& t) {
- std::hash_map<Type, Expr, CVC4::TypeHashFunction>::const_iterator i = s_typeToExpr.find(t);
+ std::unordered_map<Type, Expr, CVC4::TypeHashFunction>::const_iterator i = s_typeToExpr.find(t);
assert(i != s_typeToExpr.end());
return (*i).second;
}
static Type exprToType(const Expr& e) {
- std::hash_map<Expr, Type, CVC4::ExprHashFunction>::const_iterator i = s_exprToType.find(e);
+ std::unordered_map<Expr, Type, CVC4::ExprHashFunction>::const_iterator i = s_exprToType.find(e);
assert(i != s_exprToType.end());
return (*i).second;
}
@@ -311,8 +307,8 @@ Expr Expr::substExpr(const std::vector<Expr>& oldTerms,
}
Expr Expr::substExpr(const ExprHashMap<Expr>& oldToNew) const {
- const hash_map<CVC4::Expr, CVC4::Expr, CVC4::ExprHashFunction>& o2n =
- *reinterpret_cast<const hash_map<CVC4::Expr, CVC4::Expr, CVC4::ExprHashFunction>*>(&oldToNew);
+ const unordered_map<CVC4::Expr, CVC4::Expr, CVC4::ExprHashFunction>& o2n =
+ *reinterpret_cast<const unordered_map<CVC4::Expr, CVC4::Expr, CVC4::ExprHashFunction>*>(&oldToNew);
return Expr(substitute(o2n));
}
diff --git a/src/compat/cvc3_compat.h b/src/compat/cvc3_compat.h
index be0dc3393..25e3ae32f 100644
--- a/src/compat/cvc3_compat.h
+++ b/src/compat/cvc3_compat.h
@@ -49,7 +49,10 @@
#define _cvc3__include__formula_value_h_
#include <stdlib.h>
+
#include <map>
+#include <string>
+#include <unordered_map>
#include <utility>
#include "base/exception.h"
@@ -58,7 +61,6 @@
#include "expr/type.h"
#include "parser/parser.h"
#include "smt/smt_engine.h"
-#include "util/hash.h"
#include "util/integer.h"
#include "util/rational.h"
@@ -267,7 +269,7 @@ class CVC4_PUBLIC ExprMap : public std::map<Expr, T> {
};/* class ExprMap<T> */
template <class T>
-class CVC4_PUBLIC ExprHashMap : public std::hash_map<Expr, T, CVC4::ExprHashFunction> {
+class CVC4_PUBLIC ExprHashMap : public std::unordered_map<Expr, T, CVC4::ExprHashFunction> {
public:
void insert(Expr a, Expr b);
};/* class ExprHashMap<T> */
@@ -521,8 +523,8 @@ class CVC4_PUBLIC ValidityChecker {
friend class Type; // to reach in to d_exprTypeMapRemove
- typedef std::hash_map<std::string, const CVC4::Datatype*, CVC4::StringHashFunction> ConstructorMap;
- typedef std::hash_map<std::string, std::pair<const CVC4::Datatype*, std::string>, CVC4::StringHashFunction> SelectorMap;
+ typedef std::unordered_map<std::string, const CVC4::Datatype*> ConstructorMap;
+ typedef std::unordered_map<std::string, std::pair<const CVC4::Datatype*, std::string>> SelectorMap;
ConstructorMap d_constructors;
SelectorMap d_selectors;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback