Chomsky Normal Form

Chomsky Normal Form

A context free grammar is said to be in chomsky normal form (CNF) if all its productions are of the form-

  1. S → AB 
  2. A → a
S,A,B are non-terminals and a is a terminal.

Above points can be, as
  1. Non-terminal -> two non terminals
  2. Non-terminal -> terminal
Example,

S -> AB
A -> a
B -> b

Above grammar is in CNF, because it all productions follow the above wo points of CNF.

What if grammar is not in CNF?
  1. Eliminate null productions
  2. Eliminate unit productions
  3. Eliminate unused production.
Find the grammar in Chomsky Normal form equivalent to S-->aAD;A->aB/bAB;B->b,D->d ?

Post a Comment

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.