Greibach normal form transformation, revisited
We develop a direct method for placing a given context-free grammar into Greibach normal form with only polynomial increase of its size; i.e., we don't use any algebraic concept like formal power series. Starting with a cfg G in Chomsky normal form, we will use standard methods for the construction of an equivalent context-free grammar from a finite automaton and vice versa for transformation of G into an equivalent cfg G′ in Greibach normal form. The size of G′ will be O(¦G¦3), where ¦G¦ is the size of G. Moreover, we show that it would be more efficient to apply the algorithm to a context-free grammar in canonical two form, obtaining a context-free grammar where, up to chain rules, the productions fulfill the Greibach normal form properties, and then to use the standard method for chain rule elimination for the transformation of this grammar into Greibach normal form. The size of the constructed grammar is O(¦G¦4) instead of O(¦G¦6), which we would obtain if we transform G into Chomsky normal form and then into Greibach normal form.
Unable to display preview. Download preview PDF.
- 1.A. V. Aho, and J. D. Ullman, The Theory of Parsing, Translation, and Compiling, Vol. I: Parsing, Prentice-Hall (1972).Google Scholar
- 4.M. A. Harrison, Introduction to Formal Language Theory, Addison-Wesley (1978).Google Scholar
- 6.J. E. Hopcroft, and J. D. Ullman, Introduction to Autmata Theory, Languages, and Computation, Addison-Wesley (1979).Google Scholar
- 9.D. Wood, Theory of Computation, Harper & Row (1987).Google Scholar