Giter VIP home page Giter VIP logo

sat_solver_resolution's Introduction

SAT-solver based on resolution method

Homework project in Discrete Mathematics for Algorithm and Software Design course, HSE. Based on PLY (Python Lex-Yacc) parsing tool.

Task description

Given a Boolean formula in 2-CNF, use the resolution method to determine whether it is satisfiable. Clauses of the 2-CNF can be of one of the two forms: α \/ β or α -> β, where α and β are literals (p or ~p, where p is a variable). The CNF is presented in the usual notation, for example: (p -> q) /\ (~r \/ s) /\ (~q -> p)

Example

$ python hw_ply.py
input > (p -> q) /\ (~r \/ s) /\ (~q -> p)

Resolution: (~p\/q)/\(~r\/s)/\(q\/p)/\(None\/q)
Satisfiable: True

input > (p->q) /\ (q->r) /\ (r->s) /\ p /\ ~s

Resolution: (~p\/q)/\(~q\/r)/\(~r\/s)/\(p\/None)/\(~s\/None)/\(~p\/r)/\(q\/None)/\(~q\/s)/\(~r\/None)/\(~p\/s)/\(r\/None)/\(~q\/None)/\(~p\/None)/\(None\/s)/\(None\/None)
Satisfiable: False

sat_solver_resolution's People

Contributors

vpozdnyakov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

qfireball

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.