pybind11-based binding of glucose SAT solver
Project description
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
Project details
Release history Release notifications | RSS feed
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 details)
File details
Details for the file pyglucose-0.0.1.tar.gz.
File metadata
- Download URL: pyglucose-0.0.1.tar.gz
- Upload date:
- Size: 84.4 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97cd6e91b6b8aab8f7c33d0e6b029d50c0df04fe94671f7c88910da414461c27
|
|
| MD5 |
e32da83354529bddab77a6fa291319be
|
|
| BLAKE2b-256 |
d0abc090ade934444eb4e4a56781ad2baed6e86675eb864f823975f9ef5ed69c
|