A sophisticated tool for working with Context-Free Grammars (CFG) and Greibach Normal Form (GNF).
- Converts any valid Context-Free Grammar (CFG) to Greibach Normal Form (GNF)
- Validates whether input strings are accepted by the grammar
- Provides step-by-step transformation process
- Efficient implementation in Rust for optimal performance
This tool implements the following algorithmic steps:
- Elimination of Ξ΅-productions
- Removal of unit productions
- Conversion to Chomsky Normal Form (CNF)
- Final transformation to Greibach Normal Form (GNF)
- Rust compiler (rustc)
- Basic understanding of formal languages and grammars
# Compile the program
rustc grammar_forge.rs
# Run the executable
./grammar_forge
The program will guide you through:
- Input your grammar rules
- View the transformed GNF
- Test strings against the grammar
This implementation is part of the Theory of Computation course assignment, demonstrating practical applications of formal language theory.