Abstract
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.
Preview
Unable to display preview. Download preview PDF.
References
A. V. Aho, and J. D. Ullman, The Theory of Parsing, Translation, and Compiling, Vol. I: Parsing, Prentice-Hall (1972).
N. Blum, More on the power of chain rules in context-free grammars, TCS 27 (1983), 287–295.
S. A. Greibach, A new normal-form theorem for context-free, phrase-structure grammars, JACM 12 (1965), 42–52.
M. A. Harrison, Introduction to Formal Language Theory, Addison-Wesley (1978).
M. A. Harrison, and A. Yehudai, Eliminating null rules in linear time, The Computer Journal 24 (1981), 156–161.
J. E. Hopcroft, and J. D. Ullman, Introduction to Autmata Theory, Languages, and Computation, Addison-Wesley (1979).
A. Kelemenová, Complexity of normal form grammars, TCS 28 (1984), 299–314.
D. J. Rosenkrantz, Matrix equations and normal forms for context-free grammers, JACM 14 (1967), 501–507.
D. Wood, Theory of Computation, Harper & Row (1987).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Koch, R., Blum, N. (1997). Greibach normal form transformation, revisited. In: Reischuk, R., Morvan, M. (eds) STACS 97. STACS 1997. Lecture Notes in Computer Science, vol 1200. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0023447
Download citation
DOI: https://doi.org/10.1007/BFb0023447
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-62616-9
Online ISBN: 978-3-540-68342-1
eBook Packages: Springer Book Archive