GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/sygus/type_node_id_trie.h Lines: 1 1 100.0 %
Date: 2021-03-23 Branches: 0 0 0.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file type_node_id_trie.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds
6
 ** This file is part of the CVC4 project.
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.\endverbatim
11
 **
12
 ** \brief Type node identifier trie data structure
13
 **/
14
15
#include "cvc4_private.h"
16
17
#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS__TYPE_NODE_ID_TRIE_H
18
#define CVC4__THEORY__QUANTIFIERS__SYGUS__TYPE_NODE_ID_TRIE_H
19
20
#include <map>
21
#include <vector>
22
23
#include "expr/node.h"
24
25
namespace CVC4 {
26
namespace theory {
27
namespace quantifiers {
28
29
/**
30
 * A trie indexed by types that assigns unique identifiers to nodes based on
31
 * a vector of types.
32
 */
33
3332
class TypeNodeIdTrie
34
{
35
 public:
36
  /** children of this node */
37
  std::map<TypeNode, TypeNodeIdTrie> d_children;
38
  /** the data stored at this node */
39
  std::vector<Node> d_data;
40
  /** add v to this trie, indexed by types */
41
  void add(Node v, std::vector<TypeNode>& types);
42
  /**
43
   * Assign each node in this trie an identifier such that
44
   * assign[v1] = assign[v2] iff v1 and v2 are indexed by the same values.
45
   */
46
  void assignIds(std::map<Node, unsigned>& assign, unsigned& idCount);
47
};
48
49
}  // namespace quantifiers
50
}  // namespace theory
51
}  // namespace CVC4
52
53
#endif /* CVC4__THEORY__QUANTIFIERS__SYGUS__TYPE_NODE_ID_TRIE_H */