Giter Club home page Giter Club logo

sat-solver's Introduction

Parallel SAT solver

Simple implementation of DPLL algorithm and its parallelization in C#. The code also contains some other NP-complete problems which are solved by being converted to the SAT problem, solving it and interpreting the results.

DPLL

DPLL is a backtracking algorithm which picks a literal (at a "branching point"), assigns a value to it and recursively checks the satisfiability of the simplified formula. If it is satisfiable, the original formula is as well. If it is not, the algorithm backtracks back to the branching point and assigns the literal the opposite value than before.

This algorithm can be improved by using 2 additional rules. The first is called unit propagation. It says that if a clause contains single literal then it can be assigned a value so that the clause is true.

The next rule called pure literal elimination says that if a literal is pure (a literal with only one sign in the whole formula) then it can be assigned a value so that it is true in all clauses. Using this rule the solver gets rid of all the clauses containing such literal.

Parallelization

The algorithm tries to divide the work equally between all threads. At the start of the algorithm several (according to the number of available logical processors) threads (Tasks) are created which share a queue, in which they add additional non-complete models to be solved. These models are added to the queue at the branching point. If one thread concludes that its model is unsatisfiable, it then tries to get another model to solve from the queue. A thread which finds a satisfiable model returns the model and all the other threads are aborted (Tasks cancelled). This is a version of the producer-consumer model in which the working threads are both producers and consumers.

sat-solver's People

Contributors

popa611 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.