GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/bound_var_manager.cpp Lines: 12 17 70.6 %
Date: 2021-03-22 Branches: 9 28 32.1 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file bound_var_manager.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds
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 Bound variable manager
13
 **/
14
15
#include "expr/bound_var_manager.h"
16
17
#include "expr/node_manager_attributes.h"
18
19
namespace CVC4 {
20
21
7165
BoundVarManager::BoundVarManager() : d_keepCacheVals(false) {}
22
23
7144
BoundVarManager::~BoundVarManager() {}
24
25
962
void BoundVarManager::enableKeepCacheValues(bool isEnabled)
26
{
27
962
  d_keepCacheVals = isEnabled;
28
962
}
29
30
void BoundVarManager::setNameAttr(Node v, const std::string& name)
31
{
32
  v.setAttribute(expr::VarNameAttr(), name);
33
}
34
35
1703
Node BoundVarManager::getCacheValue(TNode cv1, TNode cv2)
36
{
37
1703
  return NodeManager::currentNM()->mkNode(kind::SEXPR, cv1, cv2);
38
}
39
40
4825
Node BoundVarManager::getCacheValue(TNode cv1, TNode cv2, size_t i)
41
{
42
  return NodeManager::currentNM()->mkNode(
43
4825
      kind::SEXPR, cv1, cv2, getCacheValue(i));
44
}
45
46
4825
Node BoundVarManager::getCacheValue(size_t i)
47
{
48
4825
  return NodeManager::currentNM()->mkConst(Rational(i));
49
}
50
51
Node BoundVarManager::getCacheValue(TNode cv, size_t i)
52
{
53
  return getCacheValue(cv, getCacheValue(i));
54
}
55
56
26676
}  // namespace CVC4