-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
29 lines (26 loc) · 887 Bytes
/
main.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
#include <vector>
#include <iostream>
#include "sat.h"
void printResults(const std::optional<std::vector<bool>>& result) {
if (!result.has_value()) {
std::cout << "unsatisfiable" << std::endl;
} else {
for (const auto b : result.value()) {
std::cout << b;
}
std::cout << std::endl;
}
}
int main() {
auto simple = NaiveSAT::parse("examples/simple.dimacs");
printResults(simple.solve());
auto simple_unsat = NaiveSAT::parse("examples/simple-unsat.dimacs");
printResults(simple_unsat.solve());
auto complex = NaiveSAT::parse("examples/complex.dimacs");
printResults(complex.solve());
auto wiki = NaiveSAT::parse("examples/wiki.dimacs");
printResults(wiki.solve());
auto format_example = NaiveSAT::parse("examples/format-example.dimacs");
printResults(format_example.solve());
return 0;
}