klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExprHashMap.h
Go to the documentation of this file.
1 //===-- ExprHashMap.h -------------------------------------------*- C++ -*-===//
2 //
3 // The KLEE Symbolic Virtual Machine
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef KLEE_EXPRHASHMAP_H
11 #define KLEE_EXPRHASHMAP_H
12 
13 #include "klee/Expr.h"
14 #include <tr1/unordered_map>
15 #include <tr1/unordered_set>
16 
17 namespace klee {
18 
19  namespace util {
20  struct ExprHash {
21  unsigned operator()(const ref<Expr> e) const {
22  return e->hash();
23  }
24  };
25 
26  struct ExprCmp {
27  bool operator()(const ref<Expr> &a, const ref<Expr> &b) const {
28  return a==b;
29  }
30  };
31  }
32 
33  template<class T>
34  class ExprHashMap :
35 
36  public std::tr1::unordered_map<ref<Expr>,
37  T,
38  klee::util::ExprHash,
39  klee::util::ExprCmp> {
40  };
41 
42  typedef std::tr1::unordered_set<ref<Expr>,
45 
46 }
47 
48 #endif
unsigned operator()(const ref< Expr > e) const
Definition: ExprHashMap.h:21
virtual unsigned hash() const
Returns the pre-computed hash of the current expression.
Definition: Expr.h:192
bool operator()(const ref< Expr > &a, const ref< Expr > &b) const
Definition: ExprHashMap.h:27
std::tr1::unordered_set< ref< Expr >, klee::util::ExprHash, klee::util::ExprCmp > ExprHashSet
Definition: ExprHashMap.h:44