Package: gambatools
GAMBA toolsThegambatoolspackage is a Python 3 package that aims to
support education in theoretical computer science atEindhoven 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.GAMBAThe 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 supportpractising and assessing formal language techniquesself-paced learning outside contact hoursimmediate feedback while practisingautomated grading for assessment(boffo: extremely successful, sensational)LicenseThe code is distributed under theGPL-3.0-or-laterlicense.InstallationThe package can be installed usingpip install gambatoolsThe required python packages can be found inrequirements.txt.Rendering imagesFor visualization thegraphvizpython
package is used.To render the generated DOT source code, you also need to install
Graphviz. See theGraphviz websitefor further instructions.
Make sure that the directory containing thedotexecutable is on your systems’ path.DocumentationThe filedoc/specifications.pdfcontains 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.NotebooksThe directorynotebookscontains a number of Jupyter notebooks
with exercises. Innotebooks/with-answersthe correct answers are
already given, while innotebooks/without-answersthey have been
left out.
The answers to the exercises are checked automatically.
Whenever the user makes a mistake, appropriate feedback is given.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 theexamplesdirectory 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 1Notebook generationFor convenience there is a mechanism to automatically generate notebooks from
templates.
The notebooks innotebooks/with-answersandnotebooks/without-answershave been generated using the commandsmake_notebook.py -o without-answers notebooks.batch
make_notebook.py --with-answers -o with-answers notebooks.batchThe templates contain tags of the form<<tag>>that are substituted by
themake_notebook.pyscript. This generation is still experimental, and
there is currently no documentation available for this.ConfigurationGambaTools.pda_epsilon_closure_max_iterations:
this parameter is a limit on the number of iterations in the
functionpda_epsilon_closure. This value is introduced to avoid infinite
computations on PDAs that contain epsilon-loops. Note that this limit may
cause the functionpda_words_up_to_nto miss words in exceptional cases.ContactIf 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.nlorj.w.wesselink@tue.nl.