Library for moving between sequential circuits AIGs and DFAs.
Project description
py-aiger-dfa
Python library for converting between AIG circuits and DFAs.
Installation
If you just need to use aiger_dfa
, you can just run:
$ pip install py-aiger-dfa
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 main entry points for using this library are the dfa2aig
and
aig2dfa
functions. DFAs are represented using the
dfa package. Familiarity with the
dfa
, py-aiger
, and py-aiger-bv
packages is assumed.
DFA to AIG
An example of going from a DFA
to an AIG
object
is shown below.
from dfa import DFA
from aiger_dfa import aig2dfa, dfa2aig
my_dfa = DFA(
start=0,
inputs={0, 1},
label=lambda s: (s % 4) == 3,
transition=lambda s, c: (s + c) % 4,
)
my_aig, relabels = dfa2aig(my_dfa)
Now circ
is an AIG
and relabels
is a mapping from the inputs,
states, and outputs of my_dfa
to their 1-hot encoded
counterparts in my_aig
.
AIG to DFA
TODO
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_dfa-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1922f079b2c83253116319e646f605a7f7227dda2bbf4a4ae42dd930373d2d5f |
|
MD5 | 513eefbdfe58d5942635c4aa92c9be91 |
|
BLAKE2b-256 | e1b78d5be8410fb789fbc3063cbd122c543e843e3b281fbf067944527324c7fe |