summaryrefslogtreecommitdiff
path: root/src/theory/uf
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2017-10-02 22:48:00 -0700
committerGitHub <noreply@github.com>2017-10-02 22:48:00 -0700
commitd0faa2b676130119c5d01e00851427fa97f44464 (patch)
tree76e25b4558e6752d75230c7ac297af97f870ea24 /src/theory/uf
parent6861f66d2e2b54fc31d9151b4dbeb2964ea07f94 (diff)
Unify hash functions for pairs (#1161)
CVC4 was implementing multiple, slightly different hash functions for pairs. With pull request #1157, we have a decent generic hash function for pairs. This commit replaces the existing hash function implementations with a typedef of the generic hash function.
Diffstat (limited to 'src/theory/uf')
-rw-r--r--src/theory/uf/equality_engine_types.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/theory/uf/equality_engine_types.h b/src/theory/uf/equality_engine_types.h
index ed0afa904..b3b8ac7d6 100644
--- a/src/theory/uf/equality_engine_types.h
+++ b/src/theory/uf/equality_engine_types.h
@@ -17,10 +17,15 @@
#include "cvc4_private.h"
+#ifndef __CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H
+#define __CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H
+
#include <string>
#include <iostream>
#include <sstream>
+#include "util/hash.h"
+
namespace CVC4 {
namespace theory {
namespace eq {
@@ -264,15 +269,8 @@ public:
/** A pair of ids */
typedef std::pair<EqualityNodeId, EqualityNodeId> EqualityPair;
-
-struct EqualityPairHashFunction {
- size_t operator () (const EqualityPair& pair) const {
- size_t hash = 0;
- hash = 0x9e3779b9 + pair.first;
- hash ^= 0x9e3779b9 + pair.second + (hash << 6) + (hash >> 2);
- return hash;
- }
-};
+using EqualityPairHashFunction =
+ PairHashFunction<EqualityNodeId, EqualityNodeId>;
enum FunctionApplicationType {
/** This application is an equality a = b */
@@ -362,3 +360,5 @@ struct TriggerInfo {
} // namespace eq
} // namespace theory
} // namespace CVC4
+
+#endif /* __CVC4__THEORY__UF__EQUALITY_ENGINE_TYPES_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback