Skip to content

Commit

Permalink
Improve README.md with an example
Browse files Browse the repository at this point in the history
  • Loading branch information
sbeyer committed Aug 4, 2024
1 parent 28dbdf9 commit 5163d40
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CommonSAT

CommonSAT is intended as a common C++11 SAT solver interface for different SAT solvers.
CommonSAT is intended as a common SAT solver interface for different SAT solvers.

The minimum required C++ version is C++11.

[![CodeDocs](https://codedocs.xyz/sbeyer/commonsat.svg)](https://codedocs.xyz/sbeyer/commonsat/)

Expand Down Expand Up @@ -33,6 +35,24 @@ for SAT solver libraries like
Note that the things mentioned above are TODO list items that are probably not
implemented.

## Code example

```c++
/* commonsat::SolverInterface solver */
solver.add_clause({1, 2});
solver.add_clause({1, -2, 3});
solver.add_clause({-1, 2});
solver.add_clause({-1, -2});
bool isSatisfiable = solver.solve();
if (isSatisfiable) {
for (int i : std::views::iota(1, 4)) {
std::println("Variable {} is assigned {}", i, solver.is_true(2));
}
} else {
std::println("Not satisfiable");
}
```

## How do I get something to run ...quickly?

The quickest way to get started is along the following lines:
Expand Down

0 comments on commit 5163d40

Please sign in to comment.