Skip to main content

pybind11-based binding of glucose SAT solver

Project description


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

pybind11-based binding of glucose SAT solver.


pip install git+

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.


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 Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page