Skip to main content

A library for formal language education. It contains support for DFAs, NFAs, PDAs, Turing machines, context free grammars and regular expressions.

Reason this release was yanked:

The code was not up to date

Project description

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 doc/specifications.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.

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.

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

gambatools-0.11.tar.gz (65.4 kB view details)

Uploaded Source

Built Distribution

gambatools-0.11-py3-none-any.whl (85.0 kB view details)

Uploaded Python 3

File details

Details for the file gambatools-0.11.tar.gz.

File metadata

  • Download URL: gambatools-0.11.tar.gz
  • Upload date:
  • Size: 65.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for gambatools-0.11.tar.gz
Algorithm Hash digest
SHA256 e0f08767004d9ba14cff7226c3065c84c2a9b907681921a1bbb1406f87fb653e
MD5 cb9881d11c0f34d405587faf0ccc45fe
BLAKE2b-256 3d4b51512b48c6ba51152da729a5ef0323c959c8afd62b4228db451fae0f8c14

See more details on using hashes here.

File details

Details for the file gambatools-0.11-py3-none-any.whl.

File metadata

  • Download URL: gambatools-0.11-py3-none-any.whl
  • Upload date:
  • Size: 85.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for gambatools-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 9991057d3a40fa4988a05639c514d63f7fc7daa747359540e22dba7ca1b3e31e
MD5 43cf5afb1284e0fe871d5328a2513baf
BLAKE2b-256 35f3fe901f5e729889017ec718b74735d9436aa8666d854f078e923ecabd2d19

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