|
| 1 | +# GAMBA tools |
| 2 | + |
| 3 | +The `gambatools` package is a Python 3 package that aims to |
| 4 | +support education in theoretical computer science at |
| 5 | +[Eindhoven University of Technology](https://www.tue.nl/en/). |
| 6 | +It contains a library for |
| 7 | +DFAs, NFAs, PDAs, Turing machines, context free grammars and |
| 8 | +regular expressions. Moreover, the package provides Jupyter notebooks with |
| 9 | +exercises. The library has been developed by Wieger Wesselink, |
| 10 | +and it was designed together with Erik de Vink. |
| 11 | + |
| 12 | +# GAMBA |
| 13 | +The code was developed as part of the GAMBA project, which stands for: |
| 14 | +*Grammars and Automata Made Boffo and Assessible*. The goals of the project are |
| 15 | +to support |
| 16 | + |
| 17 | +* practising and assessing formal language techniques |
| 18 | +* self-paced learning outside contact hours |
| 19 | +* immediate feedback while practising |
| 20 | +* automated grading for assessment |
| 21 | + |
| 22 | +(*boffo*: extremely successful, sensational) |
| 23 | + |
| 24 | +# License |
| 25 | +The code is distributed under the `GPL-3.0-or-later` license. |
| 26 | + |
| 27 | +# Installation |
| 28 | +The package can be installed using |
| 29 | +``` |
| 30 | +pip install gambatools |
| 31 | +``` |
| 32 | +The required python packages can be found in `requirements.txt`. |
| 33 | + |
| 34 | +# Rendering images |
| 35 | +For visualization the [graphviz](https://pypi.org/project/graphviz/) python |
| 36 | +package is used. **To render the generated DOT source code, you also need to install |
| 37 | +Graphviz**. See the [Graphviz website](https://graphviz.org/) for further instructions. |
| 38 | +Make sure that the directory containing the `dot` executable is on your systems’ path. |
| 39 | + |
| 40 | +# Documentation |
| 41 | +The file `doc/specifications.pdf` contains formal specifications |
| 42 | +of the algorithms in the library. Note that the code maps almost one-to-one |
| 43 | +to the specifications, so in order to understand the code please consult the |
| 44 | +pseudocode specifications. |
| 45 | + |
| 46 | +# Notebooks |
| 47 | +The directory `notebooks` contains a number of Jupyter notebooks |
| 48 | +with exercises. In `notebooks/with-answers` the correct answers are |
| 49 | +already given, while in `notebooks/without-answers` they have been |
| 50 | +left out. |
| 51 | +The answers to the exercises are checked automatically. |
| 52 | +Whenever the user makes a mistake, appropriate feedback is given. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +For specifying a DFA, NFA, etc. a line based textual input format is used, |
| 57 | +see the example below. The documentation contains a section that describes |
| 58 | +the syntax, while in the `examples` directory a number of examples can be found. |
| 59 | +``` |
| 60 | +input_symbols 0 1 |
| 61 | +states qA qB qC qD |
| 62 | +
|
| 63 | +initial qA |
| 64 | +final qC |
| 65 | +
|
| 66 | +qA qB 0 |
| 67 | +qA qD 1 |
| 68 | +qB qB 0 |
| 69 | +qB qC 1 |
| 70 | +qC qB 0 |
| 71 | +qC qC 1 |
| 72 | +qD qD 0 |
| 73 | +qD qD 1 |
| 74 | +``` |
| 75 | + |
| 76 | +# Notebook generation |
| 77 | +For convenience there is a mechanism to automatically generate notebooks from |
| 78 | +templates. |
| 79 | +The notebooks in `notebooks/with-answers` and `notebooks/without-answers` |
| 80 | +have been generated using the commands |
| 81 | +``` |
| 82 | +make_notebook.py -o without-answers notebooks.batch |
| 83 | +make_notebook.py --with-answers -o with-answers notebooks.batch |
| 84 | +``` |
| 85 | +The templates contain tags of the form `<<tag>>` that are substituted by |
| 86 | +the `make_notebook.py` script. This generation is still experimental, and |
| 87 | +there is currently no documentation available for this. |
| 88 | + |
| 89 | +# Contact |
| 90 | +If you are interested in using the package for education or have questions |
| 91 | +or feedback, the authors can be reached by email: |
| 92 | +<e.p.d.vink@tue.nl> or <j.w.wesselink@tue.nl>. |
0 commit comments