-
Notifications
You must be signed in to change notification settings - Fork 2
/
VectorClauseDatabase.cpp
58 lines (39 loc) · 1.04 KB
/
VectorClauseDatabase.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
#include "VectorClauseDatabase.h"
#include "helper.h"
using namespace std;
VectorClauseDatabase::~VectorClauseDatabase()
{
if (local_clauses)
delete clauses;
}
VectorClauseDatabase::VectorClauseDatabase(PBConfig config): ClauseDatabase(config), local_clauses(true), clauses(new vector<vector<int32_t> >())
{
}
VectorClauseDatabase::VectorClauseDatabase(PBConfig config, vector< vector< int32_t > > * clauses): ClauseDatabase(config), local_clauses(false), clauses(clauses)
{
}
void VectorClauseDatabase::clearDatabase()
{
assert(local_clauses);
clauses->clear();
resetInternalUnsatState();
}
void VectorClauseDatabase::resetInternalUnsatState()
{
deleteIsSetToUnsatFlag();
}
void VectorClauseDatabase::addClauseIntern(const vector< int32_t >& clause)
{
clauses->push_back(clause);
}
vector< vector< int32_t > > const & VectorClauseDatabase::getClauses()
{
return *clauses;
}
void VectorClauseDatabase::printFormula(ostream & output)
{
for (int i = 0; i < clauses->size(); ++i)
{
cout << (*clauses)[i] << " 0" << endl;
}
}