Merge branch '1.4.x'
[cvc5.git] / src / expr / variable_type_map.h
1 /********************* */
2 /*! \file variable_type_map.h
3 ** \verbatim
4 ** Original author: Morgan Deters
5 ** Major contributors: none
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2014 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
11 **
12 ** \brief [[ Add one-line brief description here ]]
13 **
14 ** [[ Add lengthier description here ]]
15 ** \todo document this file
16 **/
17
18 #include "cvc4_public.h"
19
20 #ifndef __CVC4__VARIABLE_TYPE_MAP_H
21 #define __CVC4__VARIABLE_TYPE_MAP_H
22
23 #include "expr/expr.h"
24 #include "util/hash.h"
25
26 namespace CVC4 {
27
28 class Expr;
29 struct ExprHashFunction;
30 class Type;
31 struct TypeHashFunction;
32
33 class CVC4_PUBLIC VariableTypeMap {
34 /**
35 * A map Expr -> Expr, intended to be used for a mapping of variables
36 * between two ExprManagers.
37 */
38 std::hash_map<Expr, Expr, ExprHashFunction> d_variables;
39
40 /**
41 * A map Type -> Type, intended to be used for a mapping of types
42 * between two ExprManagers.
43 */
44 std::hash_map<Type, Type, TypeHashFunction> d_types;
45
46 public:
47 Expr& operator[](Expr e) { return d_variables[e]; }
48 Type& operator[](Type t) { return d_types[t]; }
49
50 };/* class VariableTypeMap */
51
52 typedef __gnu_cxx::hash_map<uint64_t, uint64_t> VarMap;
53
54 struct CVC4_PUBLIC ExprManagerMapCollection {
55 VariableTypeMap d_typeMap;
56 VarMap d_to;
57 VarMap d_from;
58 };/* struct ExprManagerMapCollection */
59
60 }/* CVC4 namespace */
61
62 #endif /* __CVC4__VARIABLE_MAP_H */