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

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