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