Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python program to convert a Context Free Grammar to Chomsky Normal Form.

License

NotificationsYou must be signed in to change notification settings

BaseMax/CFG2CNF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python tool able to convert a Context Free Grammar in Chomsky Normal Form

Convert a Context Free Grammar to Chomsky Normal Form

Python program to convert a Context Free Grammar to Chomsky Normal Form.

I read 7 chapters of the book and the result of my study was writing this program.

References: Formal Languages and Automata

Context Free Grammar Book

An Introduction to Formal Languages and Automataby Peter Linz

What is Chomsky Normal Form

Chomsky Normal Form is a context-free grammar that has been put into a specific format. It was developed by Noam Chomsky in 1978 and is part of formal language theory.

https://en.wikipedia.org/wiki/Chomsky_normal_form

What is Context Free Grammar

https://en.wikipedia.org/wiki/Context-free_grammar

Using

git clone https://github.com/BaseMax/CFG2CNFcd CFG2CNFpython main.py

Input

S -> SaB | aBB -> bB | $*

The above grammar is equivalent to the following grammar:

S -> SaBS -> aBB -> bBB -> $*

Automata is useful?

The image below will change your think of the Automata:

Grammer sample image

Sure, We are need this subject all of the day, Also programming languages!

Follow this way by reading followingbook.

If you find a problem or bugs in program, please sendIssue orPR, i'm a new member in this study...

Automata Videos

Learn in some videos:

Thanks to Khalilian for providing these videos and the great help he did.

Good for start to checkMini Calculator Interpreter project.


Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team

About

Python program to convert a Context Free Grammar to Chomsky Normal Form.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2026 Movatter.jp