Git Product home page Git Product logo

pycscl's Introduction

PyCSCL 0.3.0 (development version)

The Cute SAT Constraint encoder Library for Python 3

PyCSCL is a collection of propositional logic constraint encoders. You can use it e.g. to reduce instances of NP-complete problems to instances of the Boolean satisifability (SAT) problem, benefitting from the availability of powerful off-the-shelf SAT solvers.

Though PyCSCL is designed not to depend on a specific SAT solver interface, it contains a simple and easy-to-use binding for SAT solvers implementing the IPASIR interface.

The versioning scheme of PyCSCL is Semantic Versioning 2.0.0.

Installing PyCSCL

Prerequisites

PyCSCL has no dependencies beyond Python 3.7.

Release packages

PyCSCL releases are distributed on the Python Package Index. To be consistent with package naming conventions, the PyCSCL package is named pycscl. To install the latest PyCSCL release package, you can simply use pip:

python3 -m pip install pycscl

Custom packages

Alternatively, you can check out this repository and install PyCSCL by creating a package yourself. Navigate to the PyCSCL directory and issue the command

python3 setup.py sdist 

This will create a package pycscl-<Version>.tar.gz file in the directory dist. Now, you can install your custom PyCSCL package by running

python3 -m pip install <PathToPyCSCL>/dist/pycscl-<Version>.tar.gz

Documentation

Encoders

Cardinality (at-most-k) constraint encoders
  • Binomial encoding
  • LTSeq encoding
  • Commander encoding

Package: cscl.cardinality_constraint_encoders

Gate constraint encoders
  • AND, OR, binary XOR gates
  • Binary MUX gates
  • Half adder and full adder gates

Package: cscl.basic_gate_encoders

Bitvector constraint encoders
  • Bitvector AND, OR, XOR gates
  • Ripple-carry bitvector adder and (2's complement) subtractor gates
  • Parallel bitvector multiplier gate
  • Unsigned bitvector divider and modulo gate
  • Signed (2's complement) and unsigned bitvector comparison gates
  • Population-counter gate

Package: cscl.bitvector_gate_encoders

Examples

  • cscl_examples.factorization: integer factorization problem encoder
  • cscl_examples.sudoku: SAT-based Sudoku solver
  • cscl_examples.smt_qfbv_solver (under construction): simple QF_BV SMT solver

pycscl's People

Contributors

fkutzner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

drasive

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.