-
Notifications
You must be signed in to change notification settings - Fork 2
/
IncrementalData.cpp
80 lines (52 loc) · 1.61 KB
/
IncrementalData.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "IncrementalData.h"
using namespace std;
IncrementalData::IncrementalData()
{
}
IncrementalData::~IncrementalData()
{
}
bool IncrementalData::operator==(const IncrementalData& other) const
{
return false;
}
AMOIncrementalData::AMOIncrementalData(vector< int32_t >& geqOneClause) : geqOneClause(geqOneClause)
{
}
void AMOIncrementalData::encodeNewGeq(int64_t newGeq, ClauseDatabase& formula, AuxVarManager& auxVars, vector< int32_t > conditionals)
{
formula.addConditionals(conditionals);
assert(newGeq == 1);
formula.addClause(geqOneClause);
for (int i = 0; i < conditionals.size(); ++i)
formula.getConditionals().pop_back();
}
void AMOIncrementalData::encodeNewLeq(int64_t newLeq, ClauseDatabase& formula, AuxVarManager& auxVars, vector< int32_t > conditionals)
{
assert(false && "this should never happen");
}
AMOIncrementalData::~AMOIncrementalData()
{
}
void IncrementalDontCare::encodeNewGeq(int64_t newGeq, ClauseDatabase& formula, AuxVarManager& auxVars, vector< int32_t > conditionals)
{
formula.addConditionals(conditionals);
if (newGeq > 0)
formula.addUnsat();
for (int i = 0; i < conditionals.size(); ++i)
formula.getConditionals().pop_back();
}
void IncrementalDontCare::encodeNewLeq(int64_t newLeq, ClauseDatabase& formula, AuxVarManager& auxVars, vector< int32_t > conditionals)
{
formula.addConditionals(conditionals);
if (newLeq < 0)
formula.addUnsat();
for (int i = 0; i < conditionals.size(); ++i)
formula.getConditionals().pop_back();
}
IncrementalDontCare::IncrementalDontCare()
{
}
IncrementalDontCare::~IncrementalDontCare()
{
}