Skip to content

A project that converts a given Context-Free Grammar(CFG) into Chomsky Normal Form (CNF) through grammar simplification

Notifications You must be signed in to change notification settings

msm-mir/CFG-to-Chomsky-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–¨οΈ CFG to CNF Converter

This project converts a given Context-Free Grammar (CFG) into Chomsky Normal Form (CNF). The purpose of this transformation is to simplify the grammar and prepare it for parsing algorithms such as CYK. This program is implemented in C++ as part of a Theory of Automata and Formal Language course and based on an object-oriented programming (OOP).


πŸ’‘ Features

  • Reads a context-free grammar from input.
  • Input include: terminal symbols, non-terminal symbols, and production rules.
  • Converts the CFG to CNF step by step using standard transformation rules.
  • Outputs the resulting CNF grammar in the same format as the input.

πŸ› οΈ Technical Details

  • Implemented in C++
  • The core concept of the project is the transformation of CFGs into Chomsky Normal Form (CNF)

πŸ“ Project Structure

/CFGtoChomskyConverterProject
β”œβ”€β”€ main.cpp
β”œβ”€β”€ ProductionRule.h / .cpp
β”œβ”€β”€ Terminal.h / .cpp
β”œβ”€β”€ Variable.h / .cpp
└── README.md

About

A project that converts a given Context-Free Grammar(CFG) into Chomsky Normal Form (CNF) through grammar simplification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages