1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Type node identifier trie data structure. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__THEORY__QUANTIFIERS__SYGUS__TYPE_NODE_ID_TRIE_H |
19 |
|
#define CVC5__THEORY__QUANTIFIERS__SYGUS__TYPE_NODE_ID_TRIE_H |
20 |
|
|
21 |
|
#include <map> |
22 |
|
#include <vector> |
23 |
|
|
24 |
|
#include "expr/node.h" |
25 |
|
|
26 |
|
namespace cvc5 { |
27 |
|
namespace theory { |
28 |
|
namespace quantifiers { |
29 |
|
|
30 |
|
/** |
31 |
|
* A trie indexed by types that assigns unique identifiers to nodes based on |
32 |
|
* a vector of types. |
33 |
|
*/ |
34 |
2738 |
class TypeNodeIdTrie |
35 |
|
{ |
36 |
|
public: |
37 |
|
/** children of this node */ |
38 |
|
std::map<TypeNode, TypeNodeIdTrie> d_children; |
39 |
|
/** the data stored at this node */ |
40 |
|
std::vector<Node> d_data; |
41 |
|
/** add v to this trie, indexed by types */ |
42 |
|
void add(Node v, std::vector<TypeNode>& types); |
43 |
|
/** |
44 |
|
* Assign each node in this trie an identifier such that |
45 |
|
* assign[v1] = assign[v2] iff v1 and v2 are indexed by the same values. |
46 |
|
*/ |
47 |
|
void assignIds(std::map<Node, unsigned>& assign, unsigned& idCount); |
48 |
|
}; |
49 |
|
|
50 |
|
} // namespace quantifiers |
51 |
|
} // namespace theory |
52 |
|
} // namespace cvc5 |
53 |
|
|
54 |
|
#endif /* CVC5__THEORY__QUANTIFIERS__SYGUS__TYPE_NODE_ID_TRIE_H */ |