Project: pyformlang

A python framework for formal grammars

Project Details

Latest version
1.0.4
Home Page
https://github.com/Aunsiels/pyformlang
PyPI Page
https://pypi.org/project/pyformlang/

Project Popularity

PageRank
0.0034222971975987654
Number of downloads
104930

pyformlang

Python package pypi Documentation badge

A python library to manipulate formal grammar. In general, it can be used to better understand algorithms in a formal way.

If you use Pyformlang in your project, please cite our paper:

@InProceedings{pyformlang,
author="Romero, Julien",
title="Pyformlang: An Educational Library for Formal Language Manipulation",
booktitle="SIGCSE",
year="2021"
doi = {https://doi.org/10.1145/3408877.3432464}
}

Installation

pip3 install pyformlang

Sources

Most algorithms come from Introduction to Automata Theory, Languages, and Computation (2nd edition) by John E. Hopcroft, Rajeev Motwani and Jeferey D. Ullman.

Indexed grammars come from the original paper Index Grammars - An Extension of Context-free grammars by Alfred V. Aho.

On the implementation of Hopcroft minimization algorithm: Implementation of Hopcroft's Algorithm, Hang Zhou

Intersection CFG/Regex and a better written version

Usage

Please refer to the official documentation: pyformlang.readthedocs.io.