GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/decision/justify_info.cpp Lines: 16 20 80.0 %
Date: 2021-08-16 Branches: 6 30 20.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds
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
 * Justification info.
14
 */
15
16
#include "decision/justify_info.h"
17
18
namespace cvc5 {
19
namespace decision {
20
21
196155
JustifyInfo::JustifyInfo(context::Context* c)
22
196155
    : d_node(c), d_desiredVal(c, prop::SAT_VALUE_UNKNOWN), d_childIndex(c, 0)
23
{
24
196155
}
25
26
196155
JustifyInfo::~JustifyInfo() {}
27
28
16923192
JustifyNode JustifyInfo::getNode() const
29
{
30
16923192
  return JustifyNode(d_node.get(), d_desiredVal.get());
31
}
32
33
17216886
size_t JustifyInfo::getNextChildIndex()
34
{
35
17216886
  size_t i = d_childIndex.get();
36
17216886
  d_childIndex = d_childIndex + 1;
37
17216886
  return i;
38
}
39
void JustifyInfo::revertChildIndex()
40
{
41
  Assert(d_childIndex.get() > 0);
42
  d_childIndex = d_childIndex - 1;
43
}
44
9357198
void JustifyInfo::set(TNode n, prop::SatValue desiredVal)
45
{
46
9357198
  d_node = n;
47
9357198
  d_desiredVal = desiredVal;
48
9357198
  d_childIndex = 0;
49
9357198
}
50
51
}
52
29340
}  // namespace cvc5