Python library to convert between AIGER and CNF
Project description
py-aiger-cnf
Python library to convert between AIGER and CNF
Table of Contents
Installation
If you just need to use aiger_cnf
, you can just run:
$ pip install py-aiger-cnf
For developers, note that this project uses the poetry python package/dependency management tool. Please familarize yourself with it and then run:
$ poetry install
Usage
The primary entry point for using aiger_cnf
is the aig2cnf
function which, unsurprisingly, maps AIG
objects to CNF
objects.
import aiger
from aiger_cnf import aig2cnf
x, y, z = map(aiger.atom, ('x', 'y', 'z'))
expr = (x & y) | ~z
cnf = aig2cnf(expr.aig)
Note that this library also supports aiger
wrapper libraries so long
as they export a .aig
attribute. Thus, could also
write:
cnf = aig2cnf(expr)
The CNF
object is a NamedTuple
with the following three fields:
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
Built Distribution
Hashes for py_aiger_cnf-4.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e6376449af03454e31a8b8fb09903eb1c093a357157d0356cd6edd5c4eb6c51 |
|
MD5 | fd59c1d3a42db1adec6cb8a02ede7276 |
|
BLAKE2b-256 | 8c3ea4b42f61b382fa92d023c76e9d5ef9b44e2d9d645d432b16eb0c853d4dfd |