GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bags/term_registry.cpp Lines: 5 12 41.7 %
Date: 2021-08-20 Branches: 4 26 15.4 %

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
9856
TermRegistry::TermRegistry(SolverState& state, InferenceManager& im)
30
    : d_im(im),
31
9856
      d_proxy(state.getUserContext()),
32
19712
      d_proxy_to_term(state.getUserContext())
33
{
34
9856
}
35
36
Node TermRegistry::getEmptyBag(TypeNode tn)
37
{
38
  std::map<TypeNode, Node>::iterator it = d_emptybag.find(tn);
39
  if (it != d_emptybag.end())
40
  {
41
    return it->second;
42
  }
43
  Node n = NodeManager::currentNM()->mkConst(EmptySet(tn));
44
  d_emptybag[tn] = n;
45
  return n;
46
}
47
48
}  // namespace bags
49
}  // namespace theory
50
29358
}  // namespace cvc5