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


Download files

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

Source Distribution

pyglucose-0.0.1.tar.gz (84.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page