All Projects → sukrutrao → SAT-Solver-DPLL

sukrutrao / SAT-Solver-DPLL

Licence: MIT license
A simple SAT solver that implements the DPLL algorithm with unit resolution

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to SAT-Solver-DPLL

slime-sat-solver
A Free World Class High Performance SAT Solver
Stars: ✭ 15 (-59.46%)
Mutual labels:  sat-solver, satisfiability
minisat-rust
Experimental minisat SAT solver reimplementation in Rust
Stars: ✭ 68 (+83.78%)
Mutual labels:  sat-solver
batsat
A (parametrized) Rust SAT solver originally based on MiniSat
Stars: ✭ 26 (-29.73%)
Mutual labels:  sat-solver
mSAT
A modular sat/smt solver with proof output.
Stars: ✭ 91 (+145.95%)
Mutual labels:  sat-solver
mios
A SAT solver written in Haskell.
Stars: ✭ 33 (-10.81%)
Mutual labels:  sat-solver
togasat
A Header-Only CDCL SAT Solver for Programming Contest
Stars: ✭ 51 (+37.84%)
Mutual labels:  sat-solver
haskell-picosat
Haskell bindings for PicoSAT solver
Stars: ✭ 15 (-59.46%)
Mutual labels:  sat-solver
discrete-math-python-scripts
Python code snippets from Discrete Mathematics for Computer Science specialization at Coursera
Stars: ✭ 98 (+164.86%)
Mutual labels:  sat-solver
gapt
GAPT: General Architecture for Proof Theory
Stars: ✭ 83 (+124.32%)
Mutual labels:  sat-solver
gini
A fast SAT solver
Stars: ✭ 139 (+275.68%)
Mutual labels:  sat-solver
minizinc-python
Access to all MiniZinc functionality directly from Python
Stars: ✭ 92 (+148.65%)
Mutual labels:  sat-solver

SAT-Solver-DPLL

Build Status

A SAT Solver based on the Davis-Putnam-Logemann-Loveland (DPLL) algorithm.

Installation

Prerequisites

  • g++ (or any other C++ compiler) with C++11 support
  • GNU make

Building the project

  • Clone the repository
$ git clone https://github.com/sukrutrao/SAT-Solver-DPLL.git
$ cd SAT-Solver-DPLL
  • Compile the program
$ make

If you use a different compiler, please edit the Makefile accordingly.

Running the solver

The solver accepts input from standard input (STDIN) and sends output to the standard output (STDOUT).

Input format

The input is a SAT formula is DIMACS format. A detailed description can be found here.

Output format

  • If the formula is satisfiable, the output consists of two lines. The first line of the output is a single word, SAT. The second line is any satisfying assignment. It consists of space separated boolean variables in ascending order, where the variables have a negative sign if assigned false and no negative sign if assigned true. The last variable is followed by a space and then a 0.
  • If the formula is unsatisfiable, the output consists of a single word, UNSAT.

Running the solver

If the input is in a file input.cnf, use

$ ./solver < input.cnf

Example

Let the input be

c 3 variables, 6 clauses
p cnf 3 6
1 2 0
1 -2 0
3 2 0
-3 1 0
1 2 3 0
-1 -2 0

The output is

SAT
1 -2 3 0

Here, the formuls is satisfiable. Variables 1 and 3 are assigned true, and variable 2 is assigned false. This is one possible satisfying assignment.

License

This project is licensed under the MIT License.

Author

Sukrut Rao

For any issues, queries, or suggestions, please open an issue.


This project was created as a part of the course CS6403: Constraint Solving at IIT Hyderabad.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].