summaryrefslogtreecommitdiff
path: root/src/theory/uf
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2017-07-20 17:04:30 -0700
committerGitHub <noreply@github.com>2017-07-20 17:04:30 -0700
commit8b0659e6cd342ae40b676781b5e819d5fd2b3af7 (patch)
tree5ac55f64d115b3e8865ce8f691f38da65fc82a94 /src/theory/uf
parent6d82ee2d1f84065ff4a86f688a3b671b85728f80 (diff)
Moving from the gnu extensions for hash maps to the c++11 hash maps
* Replacing __gnu_cxx::hash_map with std::unordered_map. * Replacing __gnu_cxx::hash_set with std::unordered_set. * Replacing __gnu_cxx::hash with std::hash. * Adding missing includes.
Diffstat (limited to 'src/theory/uf')
-rw-r--r--src/theory/uf/equality_engine.h8
-rw-r--r--src/theory/uf/symmetry_breaker.cpp10
-rw-r--r--src/theory/uf/symmetry_breaker.h11
-rw-r--r--src/theory/uf/theory_uf.cpp2
4 files changed, 16 insertions, 15 deletions
diff --git a/src/theory/uf/equality_engine.h b/src/theory/uf/equality_engine.h
index 7c8e27575..5be32ab90 100644
--- a/src/theory/uf/equality_engine.h
+++ b/src/theory/uf/equality_engine.h
@@ -20,8 +20,8 @@
#pragma once
#include <deque>
-#include <ext/hash_map>
#include <queue>
+#include <unordered_map>
#include <vector>
#include "base/output.h"
@@ -234,10 +234,10 @@ private:
std::map<unsigned, const PathReconstructionNotify*> d_pathReconstructionTriggers;
/** Map from nodes to their ids */
- __gnu_cxx::hash_map<TNode, EqualityNodeId, TNodeHashFunction> d_nodeIds;
+ std::unordered_map<TNode, EqualityNodeId, TNodeHashFunction> d_nodeIds;
/** Map from function applications to their ids */
- typedef __gnu_cxx::hash_map<FunctionApplication, EqualityNodeId, FunctionApplicationHashFunction> ApplicationIdsMap;
+ typedef std::unordered_map<FunctionApplication, EqualityNodeId, FunctionApplicationHashFunction> ApplicationIdsMap;
/**
* A map from a pair (a', b') to a function application f(a, b), where a' and b' are the current representatives
@@ -611,7 +611,7 @@ private:
*/
std::vector<TriggerTermSetRef> d_nodeIndividualTrigger;
- typedef std::hash_map<EqualityPair, DisequalityReasonRef, EqualityPairHashFunction> DisequalityReasonsMap;
+ typedef std::unordered_map<EqualityPair, DisequalityReasonRef, EqualityPairHashFunction> DisequalityReasonsMap;
/**
* A map from pairs of disequal terms, to the reason why we deduced they are disequal.
diff --git a/src/theory/uf/symmetry_breaker.cpp b/src/theory/uf/symmetry_breaker.cpp
index cffa367cf..8a1c30ba6 100644
--- a/src/theory/uf/symmetry_breaker.cpp
+++ b/src/theory/uf/symmetry_breaker.cpp
@@ -61,7 +61,7 @@ SymmetryBreaker::Template::Template() :
}
TNode SymmetryBreaker::Template::find(TNode n) {
- hash_map<TNode, TNode, TNodeHashFunction>::iterator i = d_reps.find(n);
+ unordered_map<TNode, TNode, TNodeHashFunction>::iterator i = d_reps.find(n);
if(i == d_reps.end()) {
return n;
} else {
@@ -400,8 +400,8 @@ void SymmetryBreaker::assertFormula(TNode phi) {
break;
}
}
- hash_map<TNode, set<TNode>, TNodeHashFunction>& ps = t.partitions();
- for(hash_map<TNode, set<TNode>, TNodeHashFunction>::iterator i = ps.begin();
+ unordered_map<TNode, set<TNode>, TNodeHashFunction>& ps = t.partitions();
+ for(unordered_map<TNode, set<TNode>, TNodeHashFunction>::iterator i = ps.begin();
i != ps.end();
++i) {
Debug("ufsymm") << "UFSYMM partition*: " << (*i).first;
@@ -421,9 +421,9 @@ void SymmetryBreaker::assertFormula(TNode phi) {
}
if(!d_template.match(phi)) {
// we hit a bad match, extract the partitions and reset the template
- hash_map<TNode, set<TNode>, TNodeHashFunction>& ps = d_template.partitions();
+ unordered_map<TNode, set<TNode>, TNodeHashFunction>& ps = d_template.partitions();
Debug("ufsymm") << "UFSYMM hit a bad match---have " << ps.size() << " partitions:" << endl;
- for(hash_map<TNode, set<TNode>, TNodeHashFunction>::iterator i = ps.begin();
+ for(unordered_map<TNode, set<TNode>, TNodeHashFunction>::iterator i = ps.begin();
i != ps.end();
++i) {
Debug("ufsymm") << "UFSYMM partition: " << (*i).first;
diff --git a/src/theory/uf/symmetry_breaker.h b/src/theory/uf/symmetry_breaker.h
index a814c670b..64ca41df2 100644
--- a/src/theory/uf/symmetry_breaker.h
+++ b/src/theory/uf/symmetry_breaker.h
@@ -46,6 +46,7 @@
#include <iostream>
#include <list>
+#include <unordered_map>
#include <vector>
#include "context/cdlist.h"
@@ -64,8 +65,8 @@ class SymmetryBreaker : public context::ContextNotifyObj {
class Template {
Node d_template;
NodeBuilder<> d_assertions;
- std::hash_map<TNode, std::set<TNode>, TNodeHashFunction> d_sets;
- std::hash_map<TNode, TNode, TNodeHashFunction> d_reps;
+ std::unordered_map<TNode, std::set<TNode>, TNodeHashFunction> d_sets;
+ std::unordered_map<TNode, TNode, TNodeHashFunction> d_reps;
TNode find(TNode n);
bool matchRecursive(TNode t, TNode n);
@@ -73,7 +74,7 @@ class SymmetryBreaker : public context::ContextNotifyObj {
public:
Template();
bool match(TNode n);
- std::hash_map<TNode, std::set<TNode>, TNodeHashFunction>& partitions() { return d_sets; }
+ std::unordered_map<TNode, std::set<TNode>, TNodeHashFunction>& partitions() { return d_sets; }
Node assertions() {
switch(d_assertions.getNumChildren()) {
case 0: return Node::null();
@@ -91,7 +92,7 @@ public:
typedef TNode Term;
typedef std::list<Term> Terms;
typedef std::set<Term> TermEq;
- typedef std::hash_map<Term, TermEq, TNodeHashFunction> TermEqs;
+ typedef std::unordered_map<Term, TermEq, TNodeHashFunction> TermEqs;
private:
@@ -113,7 +114,7 @@ private:
Permutations d_permutations;
Terms d_terms;
Template d_template;
- std::hash_map<Node, Node, NodeHashFunction> d_normalizationCache;
+ std::unordered_map<Node, Node, NodeHashFunction> d_normalizationCache;
TermEqs d_termEqs;
TermEqs d_termEqsOnly;
diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp
index 783585f8f..6d4d96a87 100644
--- a/src/theory/uf/theory_uf.cpp
+++ b/src/theory/uf/theory_uf.cpp
@@ -300,7 +300,7 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder<>& learned) {
vector<TNode> workList;
workList.push_back(n);
- __gnu_cxx::hash_set<TNode, TNodeHashFunction> processed;
+ std::unordered_set<TNode, TNodeHashFunction> processed;
while(!workList.empty()) {
n = workList.back();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback