pyglucose
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:
- Construct a solver instance using
solver = Solver(). - Allocate variables using
var = solver.new_var(). A variable is returned as integer value and can be converted toLitbyLit(var). A literallitcan be negated as~lit. - Add clauses using
solver.add_clause(clause). A clause is represented asIterable[Lit]. - Solve the problem using
solver.solve() - If
solver.okayproperty isTruethen the problem isSATISFIABLE, and satisfying assignment can be retrieved usingsolver.modelproperty. Otherwise, the problem isUNSATISFIABLE.
License
Release files for pyglucose 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyglucose-0.0.1.tar.gz | 84.4 kB | Details |
Release files / pyglucose-0.0.1.tar.gz
| Download URL | pyglucose-0.0.1.tar.gz |
|---|---|
| Size | 84.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97cd6e91b6b8aab8f7c33d0e6b029d50c0df04fe94671f7c88910da414461c27
|
|
BLAKE2b-256 checksum How to use checksums |
d0abc090ade934444eb4e4a56781ad2baed6e86675eb864f823975f9ef5ed69c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
|