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

Line Exec Source
1
/*********************                                                        */
2
/*! \file term_registry.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Mudathir Mohamed
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 Bags state object
13
 **/
14
15
#include "cvc4_private.h"
16
17
#ifndef CVC4__THEORY__BAGS__TERM_REGISTRY_H
18
#define CVC4__THEORY__BAGS__TERM_REGISTRY_H
19
20
#include <map>
21
22
#include "context/cdhashmap.h"
23
#include "expr/node.h"
24
25
namespace CVC4 {
26
namespace theory {
27
namespace bags {
28
29
class InferenceManager;
30
class SolverState;
31
32
/**
33
 * Term registry, the purpose of this class is to maintain a database of
34
 * commonly used terms, and mappings from bags to their "proxy variables".
35
 */
36
8994
class TermRegistry
37
{
38
  typedef context::CDHashMap<Node, Node, NodeHashFunction> NodeMap;
39
40
 public:
41
  TermRegistry(SolverState& state, InferenceManager& im);
42
43
  /**
44
   * Returns the existing empty bag for type tn
45
   * or creates a new one and returns it.
46
   **/
47
  Node getEmptyBag(TypeNode tn);
48
49
 private:
50
  /** The inference manager */
51
  InferenceManager& d_im;
52
  /** Map from bag terms to their proxy variables */
53
  NodeMap d_proxy;
54
  /** Backwards map of above */
55
  NodeMap d_proxy_to_term;
56
  /** Map from types to empty bag of that type */
57
  std::map<TypeNode, Node> d_emptybag;
58
}; /* class Term */
59
60
}  // namespace bags
61
}  // namespace theory
62
}  // namespace CVC4
63
64
#endif /* CVC4__THEORY__BAGS__TERM_REGISTRY_H */