Skip to main content

py-aiger-cnf

Python library to convert between AIGER and CNF

Build Status PyPI version License: MIT

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:

  1. clauses: A list of tuples of ints, e.g., [(1,2,3), (-1, 2)]. Each integer represents a variable's id, with the sign indicating the polarity of the variable.
  2. input2lit: A bidict from input names to variable ids.
  3. output2lit: A bidict from output names to variable ids.

Metadata

Release files for py-aiger-cnf 5.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-aiger-cnf 5.0.8
File Size Uploaded Provenance Actions
py_aiger_cnf-5.0.8.tar.gz 4.3 kB Without provenance Details for py_aiger_cnf-5.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-aiger-cnf 5.0.8
File Interpreter ABI Platform Actions
py_aiger_cnf-5.0.8-py3-none-any.whl Python 3 none any Details for py_aiger_cnf-5.0.8-py3-none-any.whl

Total release size: 9.5 kB

Release files / py_aiger_cnf-5.0.8.tar.gz

Download URL py_aiger_cnf-5.0.8.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
727a3a615016b1ce8ebc840ee37f73791d755e5be2883ba209db6d2c61de12a7
BLAKE2b-256 checksum
How to use checksums
0ab1a752728fae9365bfffb4f07aef287a2d843f6257d8742f12e3b443185c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.8 Linux/6.6.19

Release files / py_aiger_cnf-5.0.8-py3-none-any.whl

Download URL py_aiger_cnf-5.0.8-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccda9b726d001e485b0c40f47024a601332cb6e37a45f8fbe69306c853a64eac
BLAKE2b-256 checksum
How to use checksums
0c95aa9738d1f2d7a4dd7e91554bdbe149f965d64740867ba3ca2fb50cc88273
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.8 Linux/6.6.19

Security for py-aiger-cnf 5.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page