88[ ![ PyPI version shields.io] ( https://img.shields.io/pypi/v/py-aiger.svg )] ( https://pypi.python.org/pypi/py-aiger/ )
99[ ![ PyPI license] ( https://img.shields.io/pypi/l/py-aiger.svg )] ( https://pypi.python.org/pypi/py-aiger/ )
1010
11- # Table of Context
11+ # Table of Contents
1212- [ About] ( #about-py-aiger )
1313- [ Installation] ( #installation )
14- - [ Sequential Circuit DSL] ( #sequential-circuit-dsl )
1514- [ Boolean Expr DSL] ( #boolean-expression-dsl )
15+ - [ Sequential Circuit DSL] ( #sequential-circuit-dsl )
1616- [ Scripts] ( #scripts )
1717
1818
1919# About Py-Aiger
2020
21211 . Q: How is Py-Aiger pronounced? A: Like "pie" + "grrr".
22- 2 . Q: Why python? Aren't you worried about performance?! A: No. The goals of this library are expressibility , ease of use, and hackability.
22+ 2 . Q: Why python? Aren't you worried about performance?! A: No. The goals of this library are expressivity , ease of use, and hackability.
2323
2424# Installation
2525
@@ -30,6 +30,32 @@ or as a developer:
3030` $ python setup.py develop `
3131
3232
33+
34+ # Boolean Expression DSL
35+ While powerful, when writing combinatorial circuits, the Sequential
36+ Circuit DSL came be somewhat clumsy. For this common usecase, we have
37+ developed the Boolean Expression DSL. All circuits generated this way
38+ have a single output.
39+
40+ ``` python
41+ import aiger
42+ x, y = aiger.atom(' x' ), aiger.atom(' y' )
43+ expr1 = x & y # circuit with inputs 'x', 'y' and 1 output computing x AND y.
44+ expr2 = x | y # logical or.
45+ expr3 = x ^ y # logical xor.
46+ expr4 = x == y # logical ==, xnor.
47+ expr5 = x.implies(y)
48+ expr6 = ~ x # logical negation.
49+
50+ # Atoms can be constants.
51+ expr7 = x & aiger.atom(True ) # Equivilent to just x.
52+ expr8 = x & aiger.atom(False ) # Equivilent to const False.
53+
54+ # And you can inspect the AIG if needed.
55+ circ = x.aig
56+ ```
57+
58+
3359# Sequential Circuit DSL
3460
3561``` python
@@ -137,30 +163,6 @@ aiger.ite('test', ['i1', 'i2'], ['i3', 'i4'], outputs=['o1', 'o2'])
137163```
138164
139165
140- # Boolean Expression DSL
141- While powerful, when writing combinatorial circuits, the Sequential
142- Circuit DSL came be somewhat clumsy. For this common usecase, we have
143- developed the Boolean Expression DSL. All circuits generated this way
144- have a single output.
145-
146- ``` python
147- import aiger
148- x, y = aiger.atom(' x' ), aiger.atom(' y' )
149- expr1 = x & y # circuit with inputs 'x', 'y' and 1 output computing x AND y.
150- expr2 = x | y # logical or.
151- expr3 = x ^ y # logical xor.
152- expr4 = x == y # logical ==, xnor.
153- expr5 = x.implies(y)
154- expr6 = ~ x # logical negation.
155-
156- # Atoms can be constants.
157- expr7 = x & aiger.atom(True ) # Equivilent to just x.
158- expr8 = x & aiger.atom(False ) # Equivilent to const False.
159-
160- # And you can inspect the AIG if needed.
161- circ = x.aig
162- ```
163-
164166# Scripts
165167
166168Installing py-aiger should install two commandline scripts:
0 commit comments