Skip to main content

Boolean circuits package for my students

Project description

Boolean circuits package

This Python 3 package implements Boolean circuits for my complexity theory class.

Example:

from bcirc import InputGates, AndGate, MultiOrGate, BooleanCircuit

a, b, c = InputGates(3)
d, e, f = AndGate(a, b), AndGate(a, c), AndGate(b, c)
g = MultiOrGate(d, e, f)
bc = BooleanCircuit((a, b, c), g)
print(bc(True, True, False))

h = a & ~(b | c)
a.set(True)
b.set(False)
c.set(False)
print(h.value())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bcirc-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

bcirc-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file bcirc-0.0.2.tar.gz.

File metadata

  • Download URL: bcirc-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for bcirc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 39308648439d8f79a5c58577b933e3254504d59b17d003f4972b7fc9b4f6e62e
MD5 8fa7257cbe34c6db1517d7f7dc50d323
BLAKE2b-256 d32a6d9060033f8bc644dcbc6a350dc77dbd04f61a061192397579420aa23704

See more details on using hashes here.

File details

Details for the file bcirc-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: bcirc-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for bcirc-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c43426b3c725fb98d740c5d646b336e9a7d5547a5dda41ad72b67fd001708a61
MD5 5a2ff2893cabb86646f3a374dc5c9765
BLAKE2b-256 5e5e70966c817cb3b7c652143068b7abd0f0e3df0d947f20c277b5419fb9ba40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page