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
File details
Details for the file py_aiger_cnf-5.0.8.tar.gz
.
File metadata
- Download URL: py_aiger_cnf-5.0.8.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.6.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 727a3a615016b1ce8ebc840ee37f73791d755e5be2883ba209db6d2c61de12a7 |
|
MD5 | 81a1cb7e973e6ba5cc7402c7e218b5b0 |
|
BLAKE2b-256 | 0ab1a752728fae9365bfffb4f07aef287a2d843f6257d8742f12e3b443185c62 |
File details
Details for the file py_aiger_cnf-5.0.8-py3-none-any.whl
.
File metadata
- Download URL: py_aiger_cnf-5.0.8-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.6.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccda9b726d001e485b0c40f47024a601332cb6e37a45f8fbe69306c853a64eac |
|
MD5 | b19c5005dbdc9fed7ff950bc772fc586 |
|
BLAKE2b-256 | 0c95aa9738d1f2d7a4dd7e91554bdbe149f965d64740867ba3ca2fb50cc88273 |