blob: b5f7dfe135c4459321851e3b2ac1486987ea145e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/********************* -*- C++ -*- */
/** expr_attribute.h
** This file is part of the CVC4 prototype.
**
** The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences
** New York University
**/
#ifndef __CVC4_EXPR_ATTRIBUTE_H
#define __CVC4_EXPR_ATTRIBUTE_H
namespace CVC4 {
template <class value_type>
class AttrTables;
// global (or TSS)
extern CDMap<uint_64t> g_hash_bool;
extern CDMap<uint_64t> g_hash_int;
extern CDMap<Expr> g_hash_expr;
extern CDMap<void*> g_hash_ptr;
template <>
class AttrTable<bool> {
public:
class BitAccessor {
uint64_t& d_word;
unsigned d_bit;
public:
BitAccessor& operator=(bool b);
// continue...
};
// bool specialization
static CDMap<uint_64t> *s_hash;
template <class Attr>
BitAccessor& find(Expr e, const Attr&);
template <class Attr>
bool find(Expr e, const Attr&) const;
};
template <>
class AttrTable<uint_64t> {
public:
// int(egral) specialization
static CDMap<uint64_t> *s_hash;
uint_64t& find(x);
uint_64t& find(x) const;
};
template <class T>
class AttrTable<T*> {
// pointer specialization
static CDMap<void*> *s_hash;
public:
};
template <>
class AttrTable<Expr> {
public:
// Expr specialization
static CDMap<Expr> *s_hash;
find(x)
};
template <> AttrTable<bool>::s_hash = &g_hash_bool;
template <> AttrTable<uint_64t>::s_hash = &g_hash_int;
template <> AttrTable<Expr>::s_hash = &g_hash_expr;
template <> AttrTable<void*>::s_hash = &g_hash_ptr;
template <class Attr>
class AttributeTable {
typedef typename Attr::value_type value_type;
AttrTable<value_type>& d_table;
};
} /* CVC4 namespace */
#endif /* __CVC4_EXPR_ATTRIBUTE_H */
|