GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bags/term_registry.cpp Lines: 5 12 41.7 %
Date: 2021-05-22 Branches: 4 28 14.3 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mudathir Mohamed, Aina Niemetz
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
 * Implementation of bags term registry object.
14
 */
15
16
#include "theory/bags/term_registry.h"
17
18
#include "theory/bags/inference_manager.h"
19
#include "theory/bags/solver_state.h"
20
21
using namespace std;
22
using namespace cvc5::kind;
23
24
namespace cvc5 {
25
namespace theory {
26
namespace bags {
27
28
9459
TermRegistry::TermRegistry(SolverState& state, InferenceManager& im)
29
    : d_im(im),
30
9459
      d_proxy(state.getUserContext()),
31
18918
      d_proxy_to_term(state.getUserContext())
32
{
33
9459
}
34
35
Node TermRegistry::getEmptyBag(TypeNode tn)
36
{
37
  std::map<TypeNode, Node>::iterator it = d_emptybag.find(tn);
38
  if (it != d_emptybag.end())
39
  {
40
    return it->second;
41
  }
42
  Node n = NodeManager::currentNM()->mkConst(EmptySet(tn));
43
  d_emptybag[tn] = n;
44
  return n;
45
}
46
47
}  // namespace bags
48
}  // namespace theory
49
28191
}  // namespace cvc5