pyeda


Namepyeda JSON
Version 0.29.0 PyPI version JSON
download
home_pagehttps://github.com/cjdrake/pyeda
SummaryPython Electronic Design Automation
upload_time2023-11-19 17:38:55
maintainer
docs_urlNone
authorChris Drake
requires_python
licenseCopyright (c) 2012, Chris Drake All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords binary decision diagram boolean algebra boolean satisfiability combinational logic combinatorial logic computer arithmetic digital arithmetic digital logic eda electronic design automation espresso espresso-exact espresso-signature logic logic minimization logic optimization logic synthesis math mathematics picosat sat satisfiability truth table two-level logic minimization two-level logic optimization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            ***************************************
  Python Electronic Design Automation
***************************************

Hello all,
I haven't maintained this repository in years.
It appears to need some TLC.

PyEDA is a Python library for electronic design automation.

`Read the docs! <http://pyeda.rtfd.org>`_

Features
========

* Symbolic Boolean algebra with a selection of function representations:

  * Logic expressions
  * Truth tables, with three output states (0, 1, "don't care")
  * Reduced, ordered binary decision diagrams (ROBDDs)

* SAT solvers:

  * Backtracking
  * `PicoSAT <http://fmv.jku.at/picosat>`_

* `Espresso <http://embedded.eecs.berkeley.edu/pubs/downloads/espresso/index.htm>`_ logic minimization
* Formal equivalence
* Multi-dimensional bit vectors
* DIMACS CNF/SAT parsers
* Logic expression parser

Download
========

Bleeding edge code::

   $ git clone git://github.com/cjdrake/pyeda.git

For release tarballs and zipfiles,
visit PyEDA's page at the
`Cheese Shop <https://pypi.python.org/pypi/pyeda>`_.

Installation
============

Latest release version using
`pip <http://www.pip-installer.org/en/latest>`_::

   $ pip3 install pyeda

Installation from the repository::

   $ python3 setup.py install

Note that you will need to have Python headers and libraries in order to
compile the C extensions.
For MacOS, the standard Python installation should have everything you need.
For Linux, you will probably need to install the Python3 "development" package.

For Debian-based systems (eg Ubuntu, Mint)::

   $ sudo apt-get install python3-dev

For RedHat-based systems (eg RHEL, Centos)::

   $ sudo yum install python3-devel

For Windows, just grab the binaries from Christoph Gohlke's
*excellent* `pythonlibs page <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.

Logic Expressions
=================

Invoke your favorite Python terminal,
and invoke an interactive ``pyeda`` session::

   >>> from pyeda.inter import *

Create some Boolean expression variables::

   >>> a, b, c, d = map(exprvar, "abcd")

Construct Boolean functions using overloaded Python operators:
``~`` (NOT), ``|`` (OR), ``^`` (XOR), ``&`` (AND), ``>>`` (IMPLIES)::

   >>> f0 = ~a & b | c & ~d
   >>> f1 = a >> b
   >>> f2 = ~a & b | a & ~b
   >>> f3 = ~a & ~b | a & b
   >>> f4 = ~a & ~b & ~c | a & b & c
   >>> f5 = a & b | ~a & c

Construct Boolean functions using standard function syntax::

   >>> f10 = Or(And(Not(a), b), And(c, Not(d)))
   >>> f11 = Implies(a, b)
   >>> f12 = Xor(a, b)
   >>> f13 = Xnor(a, b)
   >>> f14 = Equal(a, b, c)
   >>> f15 = ITE(a, b, c)
   >>> f16 = Nor(a, b, c)
   >>> f17 = Nand(a, b, c)

Construct Boolean functions using higher order operators::

   >>> OneHot(a, b, c)
   And(Or(~a, ~b), Or(~a, ~c), Or(~b, ~c), Or(a, b, c))
   >>> OneHot0(a, b, c)
   And(Or(~a, ~b), Or(~a, ~c), Or(~b, ~c))
   >>> Majority(a, b, c)
   Or(And(a, b), And(a, c), And(b, c))
   >>> AchillesHeel(a, b, c, d)
   And(Or(a, b), Or(c, d))

Investigate a function's properties::

   >>> f0.support
   frozenset({a, b, c, d})
   >>> f0.inputs
   (a, b, c, d)
   >>> f0.top
   a
   >>> f0.degree
   4
   >>> f0.cardinality
   16
   >>> f0.depth
   2

Convert expressions to negation normal form (NNF),
with only OR/AND and literals::

   >>> f11.to_nnf()
   Or(~a, b)
   >>> f12.to_nnf()
   Or(And(~a, b), And(a, ~b))
   >>> f13.to_nnf()
   Or(And(~a, ~b), And(a, b))
   >>> f14.to_nnf()
   Or(And(~a, ~b, ~c), And(a, b, c))
   >>> f15.to_nnf()
   Or(And(a, b), And(~a, c))
   >>> f16.to_nnf()
   And(~a, ~b, ~c)
   >>> f17.to_nnf()
   Or(~a, ~b, ~c)

Restrict a function's input variables to fixed values,
and perform function composition::

   >>> f0.restrict({a: 0, c: 1})
   Or(b, ~d)
   >>> f0.compose({a: c, b: ~d})
   Or(And(~c, ~d), And(c, ~d))

Test function formal equivalence::

   >>> f2.equivalent(f12)
   True
   >>> f4.equivalent(f14)
   True

Investigate Boolean identities::

   # Double complement
   >>> ~~a
   a

   # Idempotence
   >>> a | a
   a
   >>> And(a, a)
   a

   # Identity
   >>> Or(a, 0)
   a
   >>> And(a, 1)
   a

   # Dominance
   >>> Or(a, 1)
   1
   >>> And(a, 0)
   0

   # Commutativity
   >>> (a | b).equivalent(b | a)
   True
   >>> (a & b).equivalent(b & a)
   True

   # Associativity
   >>> Or(a, Or(b, c))
   Or(a, b, c)
   >>> And(a, And(b, c))
   And(a, b, c)

   # Distributive
   >>> (a | (b & c)).to_cnf()
   And(Or(a, b), Or(a, c))
   >>> (a & (b | c)).to_dnf()
   Or(And(a, b), And(a, c))

   # De Morgan's
   >>> Not(a | b).to_nnf()
   And(~a, ~b)
   >>> Not(a & b).to_nnf()
   Or(~a, ~b)

Perform Shannon expansions::

   >>> a.expand(b)
   Or(And(a, ~b), And(a, b))
   >>> (a & b).expand([c, d])
   Or(And(a, b, ~c, ~d), And(a, b, ~c, d), And(a, b, c, ~d), And(a, b, c, d))

Convert a nested expression to disjunctive normal form::

   >>> f = a & (b | (c & d))
   >>> f.depth
   3
   >>> g = f.to_dnf()
   >>> g
   Or(And(a, b), And(a, c, d))
   >>> g.depth
   2
   >>> f.equivalent(g)
   True

Convert between disjunctive and conjunctive normal forms::

   >>> f = ~a & ~b & c | ~a & b & ~c | a & ~b & ~c | a & b & c
   >>> g = f.to_cnf()
   >>> h = g.to_dnf()
   >>> g
   And(Or(a, b, c), Or(a, ~b, ~c), Or(~a, b, ~c), Or(~a, ~b, c))
   >>> h
   Or(And(~a, ~b, c), And(~a, b, ~c), And(a, ~b, ~c), And(a, b, c))

Multi-Dimensional Bit Vectors
=============================

Create some four-bit vectors, and use slice operators::

   >>> A = exprvars('a', 4)
   >>> B = exprvars('b', 4)
   >>> A
   farray([a[0], a[1], a[2], a[3]])
   >>> A[2:]
   farray([a[2], a[3]])
   >>> A[-3:-1]
   farray([a[1], a[2]])

Perform bitwise operations using Python overloaded operators:
``~`` (NOT), ``|`` (OR), ``&`` (AND), ``^`` (XOR)::

   >>> ~A
   farray([~a[0], ~a[1], ~a[2], ~a[3]])
   >>> A | B
   farray([Or(a[0], b[0]), Or(a[1], b[1]), Or(a[2], b[2]), Or(a[3], b[3])])
   >>> A & B
   farray([And(a[0], b[0]), And(a[1], b[1]), And(a[2], b[2]), And(a[3], b[3])])
   >>> A ^ B
   farray([Xor(a[0], b[0]), Xor(a[1], b[1]), Xor(a[2], b[2]), Xor(a[3], b[3])])

Reduce bit vectors using unary OR, AND, XOR::

   >>> A.uor()
   Or(a[0], a[1], a[2], a[3])
   >>> A.uand()
   And(a[0], a[1], a[2], a[3])
   >>> A.uxor()
   Xor(a[0], a[1], a[2], a[3])

Create and test functions that implement non-trivial logic such as arithmetic::

   >>> from pyeda.logic.addition import *
   >>> S, C = ripple_carry_add(A, B)
   # Note "1110" is LSB first. This says: "7 + 1 = 8".
   >>> S.vrestrict({A: "1110", B: "1000"}).to_uint()
   8

Other Function Representations
==============================

Consult the `documentation <http://pyeda.rtfd.org>`_ for information about
truth tables, and binary decision diagrams.
Each function representation has different trade-offs,
so always use the right one for the job.

PicoSAT SAT Solver C Extension
==============================

PyEDA includes an extension to the industrial-strength
`PicoSAT <http://fmv.jku.at/picosat>`_ SAT solving engine.

Use the ``satisfy_one`` method to finding a single satisfying input point::

   >>> f = OneHot(a, b, c)
   >>> f.satisfy_one()
   {a: 0, b: 0, c: 1}

Use the ``satisfy_all`` method to iterate through all satisfying input points::

   >>> list(f.satisfy_all())
   [{a: 0, b: 0, c: 1}, {a: 0, b: 1, c: 0}, {a: 1, b: 0, c: 0}]

For more interesting examples, see the following documentation chapters:

* `Solving Sudoku <http://pyeda.readthedocs.org/en/latest/sudoku.html>`_
* `All Solutions to the Eight Queens Puzzle <http://pyeda.readthedocs.org/en/latest/queens.html>`_

Espresso Logic Minimization C Extension
=======================================

PyEDA includes an extension to the famous Espresso library for the minimization
of two-level covers of Boolean functions.

Use the ``espresso_exprs`` function to minimize multiple expressions::

   >>> f1 = Or(~a & ~b & ~c, ~a & ~b & c, a & ~b & c, a & b & c, a & b & ~c)
   >>> f2 = Or(~a & ~b & c, a & ~b & c)
   >>> f1m, f2m = espresso_exprs(f1, f2)
   >>> f1m
   Or(And(~a, ~b), And(a, b), And(~b, c))
   >>> f2m
   And(~b, c)

Use the ``espresso_tts`` function to minimize multiple truth tables::

   >>> X = exprvars('x', 4)
   >>> f1 = truthtable(X, "0000011111------")
   >>> f2 = truthtable(X, "0001111100------")
   >>> f1m, f2m = espresso_tts(f1, f2)
   >>> f1m
   Or(x[3], And(x[0], x[2]), And(x[1], x[2]))
   >>> f2m
   Or(x[2], And(x[0], x[1]))

Execute Unit Test Suite
=======================

If you have `PyTest <https://pytest.org>`_ installed,
run the unit test suite with the following command::

   $ make test

If you have `Coverage <https://pypi.python.org/pypi/coverage>`_ installed,
generate a coverage report (including HTML) with the following command::

   $ make cover

Perform Static Lint Checks
==========================

If you have `Pylint <http://www.pylint.org>`_ installed,
perform static lint checks with the following command::

   $ make lint

Build the Documentation
=======================

If you have `Sphinx <http://sphinx-doc.org>`_ installed,
build the HTML documentation with the following command::

   $ make html

Python Versions Supported
=========================

PyEDA is developed using Python 3.3+.
It is **NOT** compatible with Python 2.7, or Python 3.2.

Citations
=========

I recently discovered that people actually use this software in the real world.
Feel free to send me a pull request if you would like your project listed here
as well.

* `A Model-Based Approach for Reliability Assessment in Component-Based Systems <https://www.phmsociety.org/sites/phmsociety.org/files/phm_submission/2014/phmc_14_025.pdf>`_
* `bunsat <http://www.react.uni-saarland.de/tools/bunsat>`_,
  used for the SAT paper `Fast DQBF Refutation <http://www.react.uni-saarland.de/publications/sat14.pdf>`_
* `Solving Logic Riddles with PyEDA <http://nicky.vanforeest.com/misc/pyeda/puzzle.html>`_
* `Input-Aware Implication Selection Scheme Utilizing ATPG for Efficient Concurrent Error Detection <https://www.mdpi.com/2079-9292/7/10/258>`_
* `Generation Methodology for Good-Enough Approximate Modules of ATMR <https://www.dropbox.com/s/dx307ml5qlxn49z/electronicstestingppr.pdf>`_
* `Effect of FPGA Circuit Implementation on Error Detection Using Logic Implication Checking <https://www.dropbox.com/s/brwjnrqdlvkuxxe/08491817.pdf>`_

Presentations
=============

* Video from `SciPy 2015 <https://www.youtube.com/watch?v=cljDuK0ouRs>`_

Contact the Authors
===================

* Chris Drake (cjdrake AT gmail DOT com), http://cjdrake.github.io

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cjdrake/pyeda",
    "name": "pyeda",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "binary decision diagram,Boolean algebra,Boolean satisfiability,combinational logic,combinatorial logic,computer arithmetic,digital arithmetic,digital logic,EDA,electronic design automation,Espresso,Espresso-exact,Espresso-signature,logic,logic minimization,logic optimization,logic synthesis,math,mathematics,PicoSAT,SAT,satisfiability,truth table,Two-level logic minimization,Two-level logic optimization",
    "author": "Chris Drake",
    "author_email": "cjdrake@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8b/1f/ec1e7860b0931c61b7a31ea70a89efe669cfa74539768fb6fa5fbf9cc53f/pyeda-0.29.0.tar.gz",
    "platform": null,
    "description": "***************************************\r\n  Python Electronic Design Automation\r\n***************************************\r\n\r\nHello all,\r\nI haven't maintained this repository in years.\r\nIt appears to need some TLC.\r\n\r\nPyEDA is a Python library for electronic design automation.\r\n\r\n`Read the docs! <http://pyeda.rtfd.org>`_\r\n\r\nFeatures\r\n========\r\n\r\n* Symbolic Boolean algebra with a selection of function representations:\r\n\r\n  * Logic expressions\r\n  * Truth tables, with three output states (0, 1, \"don't care\")\r\n  * Reduced, ordered binary decision diagrams (ROBDDs)\r\n\r\n* SAT solvers:\r\n\r\n  * Backtracking\r\n  * `PicoSAT <http://fmv.jku.at/picosat>`_\r\n\r\n* `Espresso <http://embedded.eecs.berkeley.edu/pubs/downloads/espresso/index.htm>`_ logic minimization\r\n* Formal equivalence\r\n* Multi-dimensional bit vectors\r\n* DIMACS CNF/SAT parsers\r\n* Logic expression parser\r\n\r\nDownload\r\n========\r\n\r\nBleeding edge code::\r\n\r\n   $ git clone git://github.com/cjdrake/pyeda.git\r\n\r\nFor release tarballs and zipfiles,\r\nvisit PyEDA's page at the\r\n`Cheese Shop <https://pypi.python.org/pypi/pyeda>`_.\r\n\r\nInstallation\r\n============\r\n\r\nLatest release version using\r\n`pip <http://www.pip-installer.org/en/latest>`_::\r\n\r\n   $ pip3 install pyeda\r\n\r\nInstallation from the repository::\r\n\r\n   $ python3 setup.py install\r\n\r\nNote that you will need to have Python headers and libraries in order to\r\ncompile the C extensions.\r\nFor MacOS, the standard Python installation should have everything you need.\r\nFor Linux, you will probably need to install the Python3 \"development\" package.\r\n\r\nFor Debian-based systems (eg Ubuntu, Mint)::\r\n\r\n   $ sudo apt-get install python3-dev\r\n\r\nFor RedHat-based systems (eg RHEL, Centos)::\r\n\r\n   $ sudo yum install python3-devel\r\n\r\nFor Windows, just grab the binaries from Christoph Gohlke's\r\n*excellent* `pythonlibs page <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_.\r\n\r\nLogic Expressions\r\n=================\r\n\r\nInvoke your favorite Python terminal,\r\nand invoke an interactive ``pyeda`` session::\r\n\r\n   >>> from pyeda.inter import *\r\n\r\nCreate some Boolean expression variables::\r\n\r\n   >>> a, b, c, d = map(exprvar, \"abcd\")\r\n\r\nConstruct Boolean functions using overloaded Python operators:\r\n``~`` (NOT), ``|`` (OR), ``^`` (XOR), ``&`` (AND), ``>>`` (IMPLIES)::\r\n\r\n   >>> f0 = ~a & b | c & ~d\r\n   >>> f1 = a >> b\r\n   >>> f2 = ~a & b | a & ~b\r\n   >>> f3 = ~a & ~b | a & b\r\n   >>> f4 = ~a & ~b & ~c | a & b & c\r\n   >>> f5 = a & b | ~a & c\r\n\r\nConstruct Boolean functions using standard function syntax::\r\n\r\n   >>> f10 = Or(And(Not(a), b), And(c, Not(d)))\r\n   >>> f11 = Implies(a, b)\r\n   >>> f12 = Xor(a, b)\r\n   >>> f13 = Xnor(a, b)\r\n   >>> f14 = Equal(a, b, c)\r\n   >>> f15 = ITE(a, b, c)\r\n   >>> f16 = Nor(a, b, c)\r\n   >>> f17 = Nand(a, b, c)\r\n\r\nConstruct Boolean functions using higher order operators::\r\n\r\n   >>> OneHot(a, b, c)\r\n   And(Or(~a, ~b), Or(~a, ~c), Or(~b, ~c), Or(a, b, c))\r\n   >>> OneHot0(a, b, c)\r\n   And(Or(~a, ~b), Or(~a, ~c), Or(~b, ~c))\r\n   >>> Majority(a, b, c)\r\n   Or(And(a, b), And(a, c), And(b, c))\r\n   >>> AchillesHeel(a, b, c, d)\r\n   And(Or(a, b), Or(c, d))\r\n\r\nInvestigate a function's properties::\r\n\r\n   >>> f0.support\r\n   frozenset({a, b, c, d})\r\n   >>> f0.inputs\r\n   (a, b, c, d)\r\n   >>> f0.top\r\n   a\r\n   >>> f0.degree\r\n   4\r\n   >>> f0.cardinality\r\n   16\r\n   >>> f0.depth\r\n   2\r\n\r\nConvert expressions to negation normal form (NNF),\r\nwith only OR/AND and literals::\r\n\r\n   >>> f11.to_nnf()\r\n   Or(~a, b)\r\n   >>> f12.to_nnf()\r\n   Or(And(~a, b), And(a, ~b))\r\n   >>> f13.to_nnf()\r\n   Or(And(~a, ~b), And(a, b))\r\n   >>> f14.to_nnf()\r\n   Or(And(~a, ~b, ~c), And(a, b, c))\r\n   >>> f15.to_nnf()\r\n   Or(And(a, b), And(~a, c))\r\n   >>> f16.to_nnf()\r\n   And(~a, ~b, ~c)\r\n   >>> f17.to_nnf()\r\n   Or(~a, ~b, ~c)\r\n\r\nRestrict a function's input variables to fixed values,\r\nand perform function composition::\r\n\r\n   >>> f0.restrict({a: 0, c: 1})\r\n   Or(b, ~d)\r\n   >>> f0.compose({a: c, b: ~d})\r\n   Or(And(~c, ~d), And(c, ~d))\r\n\r\nTest function formal equivalence::\r\n\r\n   >>> f2.equivalent(f12)\r\n   True\r\n   >>> f4.equivalent(f14)\r\n   True\r\n\r\nInvestigate Boolean identities::\r\n\r\n   # Double complement\r\n   >>> ~~a\r\n   a\r\n\r\n   # Idempotence\r\n   >>> a | a\r\n   a\r\n   >>> And(a, a)\r\n   a\r\n\r\n   # Identity\r\n   >>> Or(a, 0)\r\n   a\r\n   >>> And(a, 1)\r\n   a\r\n\r\n   # Dominance\r\n   >>> Or(a, 1)\r\n   1\r\n   >>> And(a, 0)\r\n   0\r\n\r\n   # Commutativity\r\n   >>> (a | b).equivalent(b | a)\r\n   True\r\n   >>> (a & b).equivalent(b & a)\r\n   True\r\n\r\n   # Associativity\r\n   >>> Or(a, Or(b, c))\r\n   Or(a, b, c)\r\n   >>> And(a, And(b, c))\r\n   And(a, b, c)\r\n\r\n   # Distributive\r\n   >>> (a | (b & c)).to_cnf()\r\n   And(Or(a, b), Or(a, c))\r\n   >>> (a & (b | c)).to_dnf()\r\n   Or(And(a, b), And(a, c))\r\n\r\n   # De Morgan's\r\n   >>> Not(a | b).to_nnf()\r\n   And(~a, ~b)\r\n   >>> Not(a & b).to_nnf()\r\n   Or(~a, ~b)\r\n\r\nPerform Shannon expansions::\r\n\r\n   >>> a.expand(b)\r\n   Or(And(a, ~b), And(a, b))\r\n   >>> (a & b).expand([c, d])\r\n   Or(And(a, b, ~c, ~d), And(a, b, ~c, d), And(a, b, c, ~d), And(a, b, c, d))\r\n\r\nConvert a nested expression to disjunctive normal form::\r\n\r\n   >>> f = a & (b | (c & d))\r\n   >>> f.depth\r\n   3\r\n   >>> g = f.to_dnf()\r\n   >>> g\r\n   Or(And(a, b), And(a, c, d))\r\n   >>> g.depth\r\n   2\r\n   >>> f.equivalent(g)\r\n   True\r\n\r\nConvert between disjunctive and conjunctive normal forms::\r\n\r\n   >>> f = ~a & ~b & c | ~a & b & ~c | a & ~b & ~c | a & b & c\r\n   >>> g = f.to_cnf()\r\n   >>> h = g.to_dnf()\r\n   >>> g\r\n   And(Or(a, b, c), Or(a, ~b, ~c), Or(~a, b, ~c), Or(~a, ~b, c))\r\n   >>> h\r\n   Or(And(~a, ~b, c), And(~a, b, ~c), And(a, ~b, ~c), And(a, b, c))\r\n\r\nMulti-Dimensional Bit Vectors\r\n=============================\r\n\r\nCreate some four-bit vectors, and use slice operators::\r\n\r\n   >>> A = exprvars('a', 4)\r\n   >>> B = exprvars('b', 4)\r\n   >>> A\r\n   farray([a[0], a[1], a[2], a[3]])\r\n   >>> A[2:]\r\n   farray([a[2], a[3]])\r\n   >>> A[-3:-1]\r\n   farray([a[1], a[2]])\r\n\r\nPerform bitwise operations using Python overloaded operators:\r\n``~`` (NOT), ``|`` (OR), ``&`` (AND), ``^`` (XOR)::\r\n\r\n   >>> ~A\r\n   farray([~a[0], ~a[1], ~a[2], ~a[3]])\r\n   >>> A | B\r\n   farray([Or(a[0], b[0]), Or(a[1], b[1]), Or(a[2], b[2]), Or(a[3], b[3])])\r\n   >>> A & B\r\n   farray([And(a[0], b[0]), And(a[1], b[1]), And(a[2], b[2]), And(a[3], b[3])])\r\n   >>> A ^ B\r\n   farray([Xor(a[0], b[0]), Xor(a[1], b[1]), Xor(a[2], b[2]), Xor(a[3], b[3])])\r\n\r\nReduce bit vectors using unary OR, AND, XOR::\r\n\r\n   >>> A.uor()\r\n   Or(a[0], a[1], a[2], a[3])\r\n   >>> A.uand()\r\n   And(a[0], a[1], a[2], a[3])\r\n   >>> A.uxor()\r\n   Xor(a[0], a[1], a[2], a[3])\r\n\r\nCreate and test functions that implement non-trivial logic such as arithmetic::\r\n\r\n   >>> from pyeda.logic.addition import *\r\n   >>> S, C = ripple_carry_add(A, B)\r\n   # Note \"1110\" is LSB first. This says: \"7 + 1 = 8\".\r\n   >>> S.vrestrict({A: \"1110\", B: \"1000\"}).to_uint()\r\n   8\r\n\r\nOther Function Representations\r\n==============================\r\n\r\nConsult the `documentation <http://pyeda.rtfd.org>`_ for information about\r\ntruth tables, and binary decision diagrams.\r\nEach function representation has different trade-offs,\r\nso always use the right one for the job.\r\n\r\nPicoSAT SAT Solver C Extension\r\n==============================\r\n\r\nPyEDA includes an extension to the industrial-strength\r\n`PicoSAT <http://fmv.jku.at/picosat>`_ SAT solving engine.\r\n\r\nUse the ``satisfy_one`` method to finding a single satisfying input point::\r\n\r\n   >>> f = OneHot(a, b, c)\r\n   >>> f.satisfy_one()\r\n   {a: 0, b: 0, c: 1}\r\n\r\nUse the ``satisfy_all`` method to iterate through all satisfying input points::\r\n\r\n   >>> list(f.satisfy_all())\r\n   [{a: 0, b: 0, c: 1}, {a: 0, b: 1, c: 0}, {a: 1, b: 0, c: 0}]\r\n\r\nFor more interesting examples, see the following documentation chapters:\r\n\r\n* `Solving Sudoku <http://pyeda.readthedocs.org/en/latest/sudoku.html>`_\r\n* `All Solutions to the Eight Queens Puzzle <http://pyeda.readthedocs.org/en/latest/queens.html>`_\r\n\r\nEspresso Logic Minimization C Extension\r\n=======================================\r\n\r\nPyEDA includes an extension to the famous Espresso library for the minimization\r\nof two-level covers of Boolean functions.\r\n\r\nUse the ``espresso_exprs`` function to minimize multiple expressions::\r\n\r\n   >>> f1 = Or(~a & ~b & ~c, ~a & ~b & c, a & ~b & c, a & b & c, a & b & ~c)\r\n   >>> f2 = Or(~a & ~b & c, a & ~b & c)\r\n   >>> f1m, f2m = espresso_exprs(f1, f2)\r\n   >>> f1m\r\n   Or(And(~a, ~b), And(a, b), And(~b, c))\r\n   >>> f2m\r\n   And(~b, c)\r\n\r\nUse the ``espresso_tts`` function to minimize multiple truth tables::\r\n\r\n   >>> X = exprvars('x', 4)\r\n   >>> f1 = truthtable(X, \"0000011111------\")\r\n   >>> f2 = truthtable(X, \"0001111100------\")\r\n   >>> f1m, f2m = espresso_tts(f1, f2)\r\n   >>> f1m\r\n   Or(x[3], And(x[0], x[2]), And(x[1], x[2]))\r\n   >>> f2m\r\n   Or(x[2], And(x[0], x[1]))\r\n\r\nExecute Unit Test Suite\r\n=======================\r\n\r\nIf you have `PyTest <https://pytest.org>`_ installed,\r\nrun the unit test suite with the following command::\r\n\r\n   $ make test\r\n\r\nIf you have `Coverage <https://pypi.python.org/pypi/coverage>`_ installed,\r\ngenerate a coverage report (including HTML) with the following command::\r\n\r\n   $ make cover\r\n\r\nPerform Static Lint Checks\r\n==========================\r\n\r\nIf you have `Pylint <http://www.pylint.org>`_ installed,\r\nperform static lint checks with the following command::\r\n\r\n   $ make lint\r\n\r\nBuild the Documentation\r\n=======================\r\n\r\nIf you have `Sphinx <http://sphinx-doc.org>`_ installed,\r\nbuild the HTML documentation with the following command::\r\n\r\n   $ make html\r\n\r\nPython Versions Supported\r\n=========================\r\n\r\nPyEDA is developed using Python 3.3+.\r\nIt is **NOT** compatible with Python 2.7, or Python 3.2.\r\n\r\nCitations\r\n=========\r\n\r\nI recently discovered that people actually use this software in the real world.\r\nFeel free to send me a pull request if you would like your project listed here\r\nas well.\r\n\r\n* `A Model-Based Approach for Reliability Assessment in Component-Based Systems <https://www.phmsociety.org/sites/phmsociety.org/files/phm_submission/2014/phmc_14_025.pdf>`_\r\n* `bunsat <http://www.react.uni-saarland.de/tools/bunsat>`_,\r\n  used for the SAT paper `Fast DQBF Refutation <http://www.react.uni-saarland.de/publications/sat14.pdf>`_\r\n* `Solving Logic Riddles with PyEDA <http://nicky.vanforeest.com/misc/pyeda/puzzle.html>`_\r\n* `Input-Aware Implication Selection Scheme Utilizing ATPG for Efficient Concurrent Error Detection <https://www.mdpi.com/2079-9292/7/10/258>`_\r\n* `Generation Methodology for Good-Enough Approximate Modules of ATMR <https://www.dropbox.com/s/dx307ml5qlxn49z/electronicstestingppr.pdf>`_\r\n* `Effect of FPGA Circuit Implementation on Error Detection Using Logic Implication Checking <https://www.dropbox.com/s/brwjnrqdlvkuxxe/08491817.pdf>`_\r\n\r\nPresentations\r\n=============\r\n\r\n* Video from `SciPy 2015 <https://www.youtube.com/watch?v=cljDuK0ouRs>`_\r\n\r\nContact the Authors\r\n===================\r\n\r\n* Chris Drake (cjdrake AT gmail DOT com), http://cjdrake.github.io\r\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2012, Chris Drake All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  ",
    "summary": "Python Electronic Design Automation",
    "version": "0.29.0",
    "project_urls": {
        "Download": "https://pypi.python.org/packages/source/p/pyeda",
        "Homepage": "https://github.com/cjdrake/pyeda"
    },
    "split_keywords": [
        "binary decision diagram",
        "boolean algebra",
        "boolean satisfiability",
        "combinational logic",
        "combinatorial logic",
        "computer arithmetic",
        "digital arithmetic",
        "digital logic",
        "eda",
        "electronic design automation",
        "espresso",
        "espresso-exact",
        "espresso-signature",
        "logic",
        "logic minimization",
        "logic optimization",
        "logic synthesis",
        "math",
        "mathematics",
        "picosat",
        "sat",
        "satisfiability",
        "truth table",
        "two-level logic minimization",
        "two-level logic optimization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f7cdb0108f4c0e6e0fc65f3f4f28412dbc8b0d91ebefb615cc7917139279922",
                "md5": "c983b4e38220dd3089bd9e732aec2636",
                "sha256": "028bd63ab29bf92ce48d576ee2b8256c287e8d54d5e644d48af360ef2bbb0712"
            },
            "downloads": -1,
            "filename": "pyeda-0.29.0-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "c983b4e38220dd3089bd9e732aec2636",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": null,
            "size": 186124,
            "upload_time": "2023-11-19T17:38:52",
            "upload_time_iso_8601": "2023-11-19T17:38:52.932222Z",
            "url": "https://files.pythonhosted.org/packages/3f/7c/db0108f4c0e6e0fc65f3f4f28412dbc8b0d91ebefb615cc7917139279922/pyeda-0.29.0-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b1fec1e7860b0931c61b7a31ea70a89efe669cfa74539768fb6fa5fbf9cc53f",
                "md5": "cad90581bf89ab6a8a883b32c3eb0599",
                "sha256": "efd4d3e548079ca059f44f9babb9bd67b332ec1762897324fcceb8da1d0f5fed"
            },
            "downloads": -1,
            "filename": "pyeda-0.29.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cad90581bf89ab6a8a883b32c3eb0599",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 486837,
            "upload_time": "2023-11-19T17:38:55",
            "upload_time_iso_8601": "2023-11-19T17:38:55.323979Z",
            "url": "https://files.pythonhosted.org/packages/8b/1f/ec1e7860b0931c61b7a31ea70a89efe669cfa74539768fb6fa5fbf9cc53f/pyeda-0.29.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-19 17:38:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cjdrake",
    "github_project": "pyeda",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": false,
    "requirements": [],
    "lcname": "pyeda"
}
        
Elapsed time: 0.18158s