Skip to main content

pybind11-based binding of glucose SAT solver

Project description

pyglucose

Build Status (Travis-CI) Build status (AppVeyor) License

pybind11-based binding of glucose SAT solver.

Installation

pip install git+https://github.com/msakai/glucose-pybind11/

Basic Usage

The pyglucose module exports Solver and Lit.

A SAT problem can be solved as follows:

  1. Construct a solver instance using solver = Solver().
  2. Allocate variables using var = solver.new_var(). A variable is returned as integer value and can be converted to Lit by Lit(var). A literal lit can be negated as ~lit.
  3. Add clauses using solver.add_clause(clause). A clause is represented as Iterable[Lit].
  4. Solve the problem using solver.solve()
  5. If solver.okay property is True then the problem is SATISFIABLE, and satisfying assignment can be retrieved using solver.model property. Otherwise, the problem is UNSATISFIABLE.

License

MIT License

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyglucose, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pyglucose-0.0.1.tar.gz (84.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page