Coder Social home page Coder Social logo

bytesat's Introduction

BYTE SAT

This is a simple C function that solves small SAT problems, specifically limited to 8 variables. The maximum number of clauses is not limited.

This technique exploits 256-bit bitvector manipulation to brute force through all 256 possible states of such a SAT instance. As a result, it only takes a few clock cycles to execute (provided your CPU has good vector support). Work scales linearly with the number of clauses, as the exponential factor is absorbed entirely by the vector width.

This approach could be scaled to larger SAT problems, but scales exponentially with the number of variables. So that's not recommended.

One nice thing about this technique is that it doesn't give you only a single satisfying state; rather it gives you a bitset corresponding to all satisfying states. If it gives you an array of just zeros, your SAT problem is unsatisfiable. No, you don't get a proof, that's too expensive. This is the cheap and dirty solution.

On my machine, this is able to run about 125 million clauses per second, though that number goes up by over a factor of 3 under certain circumstances, if the compiler can find a good way to vectorize multiple iterations together. This is roughly 8-28 clock cycles per clause.

bytesat's People

Contributors

charlesrosenbauer avatar

Watchers

James Cloos avatar  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.