0

Do we need to convert a context-free grammar into Chomsky normal form first to convert it into Greibach normal form?

vidit jain
  • 493
  • 1
  • 5
  • 13

1 Answers1

1

This question might be better suited to https://cs.stackexchange.com/, but there are also plenty of people who can answer it here.

The answer is no, you do not need to go through Chomsky Normal form. There is a method in the textbook: Hopcroft, J.E & Ullman J.D. (1969) Formal Languages and their relation to Automata, Addison-Wesley, pp.55-57. However, most simple convertions do go through Chomsky Normal Form first. Other techniques are longer and use Weak Greibach Normal Form as an intermediate step.

If you want more details on the method, there are plenty of class notes available on the net; for example here, here; however, many class notes only show the route through CNF.

Community
  • 1
  • 1
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129