Skip to main content

Vyakarana

The Python face of Tape-n-Trace, an interactive Theory of Computation workbench built for BTOCH503 (Hopcroft, Motwani & Ullman, 2nd edition). Build a machine in a notebook cell; the bundled TypeScript engine computes the trace and the web app's own renderers draw it inline — the diagram, the tape, the ID sequence, with transport controls.

from vyakarana import DFA

d = DFA(states={"a", "b"}, alphabet={"0", "1"},
        transitions={("a", "0"): "b", ("a", "1"): "a", ("b", "0"): "a", ("b", "1"): "b"},
        start="a", accepting={"b"})
d.accepts("011")   # True — an odd number of 0s
d.run("011")       # the run, step by step, in the cell

Works in Colab, JupyterLab, Jupyter Notebook, VS Code and under nbconvert — no Node, no extension to enable. Every value-returning call is synchronous: the engine runs in an embedded V8 (mini-racer), the same engine the web app runs in the browser.

Covers: DFA, NFA, ENFA, RegularExpression, CFG, PDA, TM, and a gallery of the textbook's machines — simulation, the subset construction, minimisation, state elimination, Thompson's construction, derivations and ambiguity, the CNF pipeline, PDA acceptance conversions, the multitape reduction. Python never reimplements an algorithm: it builds the object, the engine computes, a Trace comes back.

Honest by construction. A search that stops at a bound says so (NoCounterexample is not a proof of unambiguity); a Turing machine that runs past the move cap returns Halted.NO — falsy, but never False — and offers to continue; the ID sequence is the textbook's, character for character.

Documentation: vyakarana/docs/documentation.md. Licence: MIT.

Download files

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

Source Distribution

vyakarana-0.1.0.tar.gz (174.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vyakarana-0.1.0-py3-none-any.whl (169.1 kB view details)

Uploaded Python 3

File details

Details for the file vyakarana-0.1.0.tar.gz.

File metadata

  • Download URL: vyakarana-0.1.0.tar.gz
  • Upload date:
  • Size: 174.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vyakarana-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9cfc221e75214f759cd8202dc1d99371c560997a7613862abd9bb78bdbc86d45
MD5 0895eacb24e2dcec1c72759be802a0a8
BLAKE2b-256 81e01bd7b01a3d1cfb6a30f4250feab058e062076fd813ca9f7942b584f4fe56

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyakarana-0.1.0.tar.gz:

Publisher: release.yml on ShivamMalge/Tape-n-Trace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vyakarana-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vyakarana-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 169.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vyakarana-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea1edf222de065f77c50aadae3d42fecfb8f3b62a158eea295c2027b8a01eea7
MD5 d562b6ff1353165e4619d98ad5fba777
BLAKE2b-256 2717777c2e00290efeb6cf6e4c7021edbff774add4a33c67689a5aea8b74e103

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyakarana-0.1.0-py3-none-any.whl:

Publisher: release.yml on ShivamMalge/Tape-n-Trace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

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