Abstract
We investigate the complexity of a variety of normal-form transformations for extended context-free grammars, where by extended we mean that the set of right-hand sides for each nonterminal in such a grammar is a regular set. The study is motivated by the implementation project GraMa which will provide a C++ toolkit for the symbolic manipulation of context-free objects just as Grail does for regular objects. The results are that all transformations of interest take time linear in the size of the given grammar giving resulting grammars that are larger by a constant factor than the original grammar. Our results generalize known bounds for context-free grammars but do so in nontrivial ways. Specifically, we introduce a new representation scheme for extended context-free grammars (the symbol-threaded expression forest), a new normal form for these grammars (dot normal form) and new regular expression algorithms.
This research was supported under a grant from the Research Grants Council of Hong Kong SAR. It was carried out while the first and second authors were visiting HKUST.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
A.V. Aho and J.D. Ullman. The Theory of Parsing, Translation, and Compiling, Vol. I: Parsing. Prentice-Hall, Inc., Englewood Cliffs, NJ, 1972.
K.R. Barnes. Exploratory steps towards a grammatical manipulation package (GRAMPA). Master’s thesis, McMaster University, Hamilton, Ontario, Canada, 1972.
H.A. Cameron and D. Wood. Structural equivalence of extended context-free and extended E0L grammars. In preparation, 1998.
D.J. Cohen and C.C. Gotlieb. A list structure form of grammars for syntactic analysis. Computing Surveys, 2:65–82, 1970.
D. Connolly. W3C web page on XML. http://www.w3.org/XML/, 1997.
A. Ehrenfeucht and G. Rozenberg. An easy proof of Greibach normal form. Information and Control, 63:190–199, 1984.
D. Giammarresi and D. Wood. Transition diagram systems and normal form transformations. In Proceedings of the Sixth Italian Conference on Theoretical Computer Science, Singapore, 1998. World Scientific Publishing Co. Pte. Ltd.
S.A. Greibach. A new normal form theorem for context-free phrase structure grammars. Journal of the ACM, 12:42–52, 1965.
S.A. Greibach. A simple proof of the standard-form theorem for context-free grammars. Technical report, Harvard University, Cambridge, MA, 1967.
M.A. Harrison. Introduction to Formal Language Theory. Addison-Wesley, Reading, MA, 1978.
M.A. Harrison and A. Yehudai. Eliminating null rules in linear time. Computer Journal, 24:156–161, 1981.
G. Hotz. Normal-form transformations of context-free grammars. Acta Cybernetica, 4:65–84, 1978.
H.B. Hunt III, D.J. Rosenkrantz, and T.G. Szymanski. On the equivalence, containment and covering problems for the regular and context-free languages. Journal of Computer and System Sciences, 12:222–268, 1976.
ISO 8879: Information processing—Text and office systems— Standard Generalized Markup Language (SGML), October 1986. International Organization for Standardization.
P. Kilpeläinen and D. Wood. SGML and exceptions. In C. Nicholas and D. Wood, editors, Proceedings of the Third International Workshop on Principles of Document Processing (PODP 96), pages 39–49, Heidelberg, 1997. Springer-Verlag. Lecture Notes in Computer Science 1293.
R. Koch and N. Blum. Greibach normal form transformation revisited. In Reischuk and Morvan, editors, STACS’97 Proceedings, pages 47–54, New York, NY, 1997. Springer-Verlag. Lecture Notes in Computer Science 1200.
D. R. Raymond and D. Wood. Grail: Engineering automata in C++, version 2.5. Technical Report HKUST-CS96-24, Department of Computer Science, Hong Kong University of Science & Technology, Clear Water Bay, Kowloon, Hong Kong, 1996.
D.R. Raymond and D. Wood. Grail: A C++ library for automata and expressions. Journal of Symbolic Computation, 17:341–350, 1994.
R.J. Ross. Grammar Transformations Based on Regular Decompositions of Context-Free Derivations. PhD thesis, Department of Computer Science, Washington State University, Pullman, WA, USA, 1978.
R.J. Ross, G. Hotz, and D.B. Benson. A general Greibach normal form transformation. Technical Report CS-78-048, Department of Computer Science, Washington State University, Pullman, WA, USA, 1978.
A. Salomaa. Formal Languages. Academic Press, New York, NY, 1973.
D. Wood. Theory of Computation. John Wiley & Sons, Inc., New York, NY, 1987.
D. Wood. Theory of Computation. JohnWiley & Sons, Inc., New York, NY, second edition, 1998. In preparation.
A. Yehudai. On the Complexity of Grammar and Language Problems. PhD thesis, University of California, Berkeley, CA, 1977.
D. Ziadi. Regular expression for a language without empty word. Theoretical Computer Science, 163:309–315, 1996.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Albert, J., Giammaressi, D., Wood, D. (1999). Extended Context-Free Grammars and Normal Form Algorithms. In: Champarnaud, JM., Ziadi, D., Maurel, D. (eds) Automata Implementation. WIA 1998. Lecture Notes in Computer Science, vol 1660. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48057-9_1
Download citation
DOI: https://doi.org/10.1007/3-540-48057-9_1
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66652-3
Online ISBN: 978-3-540-48057-0
eBook Packages: Springer Book Archive