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 |
|
JustifyInfo::JustifyInfo(context::Context* c) |
22 |
|
: d_node(c), d_desiredVal(c, prop::SAT_VALUE_UNKNOWN), d_childIndex(c, 0) |
23 |
|
{ |
24 |
|
} |
25 |
|
|
26 |
|
JustifyInfo::~JustifyInfo() {} |
27 |
|
|
28 |
|
JustifyNode JustifyInfo::getNode() const |
29 |
|
{ |
30 |
|
return JustifyNode(d_node.get(), d_desiredVal.get()); |
31 |
|
} |
32 |
|
|
33 |
|
size_t JustifyInfo::getNextChildIndex() |
34 |
|
{ |
35 |
|
size_t i = d_childIndex.get(); |
36 |
|
d_childIndex = d_childIndex + 1; |
37 |
|
return i; |
38 |
|
} |
39 |
|
void JustifyInfo::revertChildIndex() |
40 |
|
{ |
41 |
|
Assert(d_childIndex.get() > 0); |
42 |
|
d_childIndex = d_childIndex - 1; |
43 |
|
} |
44 |
|
void JustifyInfo::set(TNode n, prop::SatValue desiredVal) |
45 |
|
{ |
46 |
|
d_node = n; |
47 |
|
d_desiredVal = desiredVal; |
48 |
|
d_childIndex = 0; |
49 |
|
} |
50 |
|
|
51 |
|
} |
52 |
28191 |
} // namespace cvc5 |