GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bags/term_registry.cpp Lines: 5 12 41.7 %
Date: 2021-09-10 Branches: 6 30 20.0 %

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 "expr/emptyset.h"
19
#include "theory/bags/inference_manager.h"
20
#include "theory/bags/solver_state.h"
21
22
using namespace std;
23
using namespace cvc5::kind;
24
25
namespace cvc5 {
26
namespace theory {
27
namespace bags {
28
29
9913
TermRegistry::TermRegistry(Env& env, SolverState& state, InferenceManager& im)
30
    : EnvObj(env),
31
      d_im(im),
32
9913
      d_proxy(userContext()),
33
19826
      d_proxy_to_term(userContext())
34
{
35
9913
}
36
37
Node TermRegistry::getEmptyBag(TypeNode tn)
38
{
39
  std::map<TypeNode, Node>::iterator it = d_emptybag.find(tn);
40
  if (it != d_emptybag.end())
41
  {
42
    return it->second;
43
  }
44
  Node n = NodeManager::currentNM()->mkConst(EmptySet(tn));
45
  d_emptybag[tn] = n;
46
  return n;
47
}
48
49
}  // namespace bags
50
}  // namespace theory
51
29502
}  // namespace cvc5