Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simre1/sat-solver
https://github.com/simre1/sat-solver
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/simre1/sat-solver
- Owner: Simre1
- License: bsd-2-clause
- Created: 2024-04-22T07:10:03.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T11:19:17.000Z (7 months ago)
- Last Synced: 2024-11-07T18:29:07.662Z (2 months ago)
- Language: Rust
- Size: 248 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sat-solver
## Installation
Set up a recent rust installation and then build it:
```bash
cargo build
```
## RunningRun it by providing a CNF file in DIMACS format and choose one of the algorithms (simple, dpll, cdcl)
```bash
cargo run -- -a simple --cnf test-files/test1.cnf
cargo run -- -a dpll --cnf test-files/test1.cnf
cargo run -- -a cdcl --cnf test-files/test1.cnf
```## Algorithms
We have implemented:
- A simple recursive algorithm which tries to find a solution in a brute-force manner: [simple.rs](https://github.com/Simre1/sat-solver/blob/main/src/algorithm/simple.rs)
- A dpll algorithm: [dpll.rs](https://github.com/Simre1/sat-solver/blob/main/src/algorithm/dpll.rs)
- A cdcl algorithm (although buggy): [cdcl.rs](https://github.com/Simre1/sat-solver/blob/main/src/algorithm/cdcl.rs)## Benchmarking
`./bench.sh` will run the the algorithms for each algorithm in the `test-formulas/bench` folder in parallel.
It uses the `time` and the `timeout` linux utilities to measure the time and stop them at 5 minutes.`./bench-csv-format.sh` formats the output of `bench.sh` into the csv format in order to easily create diagrams.