Skip to main content

GAMBA tools

The gambatools package is a Python 3 package that aims to support education in theoretical computer science at Eindhoven University of Technology. It contains a library for DFAs, NFAs, PDAs, Turing machines, context free grammars and regular expressions. Moreover, the package provides Jupyter notebooks with exercises. The library has been developed by Wieger Wesselink, and it was designed together with Erik de Vink.

GAMBA

The code was developed as part of the GAMBA project, which stands for: Grammars and Automata Made Boffo and Assessible. The goals of the project are to support

  • practising and assessing formal language techniques
  • self-paced learning outside contact hours
  • immediate feedback while practising
  • automated grading for assessment

(boffo: extremely successful, sensational)

License

The code is distributed under the GPL-3.0-or-later license.

Installation

The package can be installed using

pip install gambatools

The required python packages can be found in requirements.txt.

Rendering images

For visualization the graphviz python package is used. To render the generated DOT source code, you also need to install Graphviz. See the Graphviz website for further instructions. Make sure that the directory containing the dot executable is on your systems’ path.

Documentation

The file https://wiegerw.github.io/gambatools/pdf/main.pdf contains formal specifications of the algorithms in the library. Note that the code maps almost one-to-one to the specifications, so in order to understand the code please consult the pseudocode specifications.

Notebooks

The directory notebooks contains a number of Jupyter notebooks with exercises. In notebooks/with-answers the correct answers are already given, while in notebooks/without-answers they have been left out. The answers to the exercises are checked automatically. Whenever the user makes a mistake, appropriate feedback is given.

NFA to DFA

For specifying a DFA, NFA, etc. a line based textual input format is used, see the example below. The documentation contains a section that describes the syntax, while in the examples directory a number of examples can be found.

input_symbols 0 1
states qA qB qC qD

initial qA
final qC

qA qB 0
qA qD 1
qB qB 0
qB qC 1
qC qB 0
qC qC 1
qD qD 0
qD qD 1

Notebook generation

For convenience there is a mechanism to automatically generate notebooks from templates. The notebooks in notebooks/with-answers and notebooks/without-answers have been generated using the commands

make_notebook.py -o without-answers notebooks.batch
make_notebook.py --with-answers -o with-answers notebooks.batch

The templates contain tags of the form <<tag>> that are substituted by the make_notebook.py script. This generation is still experimental, and there is currently no documentation available for this.

Configuration

  • GambaTools.pda_epsilon_closure_max_iterations: this parameter is a limit on the number of iterations in the function pda_epsilon_closure. This value is introduced to avoid infinite computations on PDAs that contain epsilon-loops. Note that this limit may cause the function pda_words_up_to_n to miss words in exceptional cases.

Contact

If you are interested in using the package for education or have questions or feedback, the authors can be reached by email: e.p.d.vink@tue.nl or j.w.wesselink@tue.nl.

Metadata

Release files for gambatools 0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gambatools 0.20
File Size Uploaded Provenance Actions
gambatools-0.20.tar.gz 75.1 kB Without provenance Details for gambatools-0.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gambatools 0.20
File Interpreter ABI Platform Actions
gambatools-0.20-py3-none-any.whl Python 3 none any Details for gambatools-0.20-py3-none-any.whl

Total release size: 163.0 kB

Release files / gambatools-0.20.tar.gz

Download URL gambatools-0.20.tar.gz
Size 75.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a255dcc010b33c6dfa4d384c399d7a92cacd9fb633a60a01a9229e8ca5c64ec0
BLAKE2b-256 checksum
How to use checksums
4dca7a42f14180511b467bfb039ec57b47811173b946e23409aaca7e89dc4585
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / gambatools-0.20-py3-none-any.whl

Download URL gambatools-0.20-py3-none-any.whl
Size 88.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27fc996ea45d188365db46a79d5c827acf730beeb7830f30b4a3ef2d211b6c3e
BLAKE2b-256 checksum
How to use checksums
a16d32b8beddce4c40fa58e01d8f31f826c2e3564172bef431a8ce8ab1366796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for gambatools 0.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.20 This release

2 release files No provenance

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