formal grammar teaching toolkit
Project description
Formgram is a toolkit for teaching and or learning formal grammars with a focus on exploring the code and experimenting with and on it.
Students can use it to verify their findings in exercise problems and to understand taught algorithms by looking at their implemented form (and experimenting on them to see where those might break).
Teachers can use it to teach algorithms in their implemented form as an alternative to pure mathematical pseudocode.
>>> from formgram.classes.grammar import Grammar >>> grammar_string = \ >>> """ # A simple context free grammar >>> <Sentence> ::= <Subject> " " <Verb> " " <Object> >>> <Subject> ::= <Noun> >>> <Object> ::= <Noun> >>> <Verb> ::= "bites" | "adores" >>> <Noun> ::= "Human" | "Dog" | "Cat" >>> """ >>> grammar = Grammar.from_str(grammar_string) >>> type(grammar) formgram.classes.grammar.ContextFreeGrammar
Installing Formgram and Supported Versions
Formgram is available on PyPI:
$ python -m pip install formgram
Formgram is written and tested on Python 3.8 and should work on any later version.
Features
Formgram is created to enable working with formal grammars in context of a lecture on formal languages. It can:
Determine Chomsky hierarchy level
Determine grammar normal forms
Import/export grammars to string format
Transform to and from corresponding machines
API Reference and User Guide available on gwdg pages
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file formgram-0.0.6.tar.gz.
File metadata
- Download URL: formgram-0.0.6.tar.gz
- Upload date:
- Size: 55.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a375b3f648da6605154569458114754b9f899df127e17558a989df9ce32c5fe1
|
|
| MD5 |
ff1ced789e7f545187e2e8f870907e40
|
|
| BLAKE2b-256 |
7457c77df12b7cc4860b8b3794ea89ef1d2f201613acea4381fe42ac096aa66a
|
File details
Details for the file formgram-0.0.6-py3-none-any.whl.
File metadata
- Download URL: formgram-0.0.6-py3-none-any.whl
- Upload date:
- Size: 152.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b34f4cd16dc8c17dc9caf80b9977ed27c22dcdb7e483bdd4a1bb0aa7d665c660
|
|
| MD5 |
f7c812d82934a02468b7db849fe1da10
|
|
| BLAKE2b-256 |
a6f357d294cfa2d23ead5c717c7d0a67f7e6cd2cf436723d237fd0523f51db27
|