GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/decision/justify_info.cpp Lines: 16 20 80.0 %
Date: 2021-09-07 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
197882
JustifyInfo::JustifyInfo(context::Context* c)
22
197882
    : d_node(c), d_desiredVal(c, prop::SAT_VALUE_UNKNOWN), d_childIndex(c, 0)
23
{
24
197882
}
25
26
197882
JustifyInfo::~JustifyInfo() {}
27
28
17486567
JustifyNode JustifyInfo::getNode() const
29
{
30
17486567
  return JustifyNode(d_node.get(), d_desiredVal.get());
31
}
32
33
17792055
size_t JustifyInfo::getNextChildIndex()
34
{
35
17792055
  size_t i = d_childIndex.get();
36
17792055
  d_childIndex = d_childIndex + 1;
37
17792055
  return i;
38
}
39
void JustifyInfo::revertChildIndex()
40
{
41
  Assert(d_childIndex.get() > 0);
42
  d_childIndex = d_childIndex - 1;
43
}
44
9696221
void JustifyInfo::set(TNode n, prop::SatValue desiredVal)
45
{
46
9696221
  d_node = n;
47
9696221
  d_desiredVal = desiredVal;
48
9696221
  d_childIndex = 0;
49
9696221
}
50
51
}
52
29502
}  // namespace cvc5