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

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