Abstract
It is proved that every LL(k)-linear grammar can be transformed to an equivalent LL(1)-linear grammar. The transformation incurs a blow-up in the number of nonterminal symbols by a factor of m2k−O(1), where m is the size of the alphabet. A close lower bound is established: for certain LL(k)-linear grammars with n nonterminal symbols, every equivalent LL(1)-linear grammar must have at least \(n \cdot (m-1)^{2k-O(\log k)}\) nonterminal symbols.
Similar content being viewed by others
Change history
11 February 2023
A Correction to this paper has been published: https://doi.org/10.1007/s00224-023-10120-4
References
Aho, A. V., Ullman, J. D.: The Theory of Parsing, Translation and Compiling, vol. 1, Parsing. Prentice-Hall (1972)
de la Higuera, C., Oncina, J.: Inferring deterministic linear languages. In: Computational Learning Theory (COLT 2002, Sydney, Australia, July 8–10, 2002, LNCS 2375, 185–200 (2002)
Holzer, M., Lange, K. -J.: On the complexities of linear LL(1) and LR(1) grammars. In: Fundamentals of Computation Theory (FCT 1993, Hungary, August 23–27, 1993), LNCS 710, 299–308 (1993)
Ibarra, O. H., Jiang, T., Ravikumar, B.: Some subclasses of context-free languages in NC1. Inf. Process. Lett. 29(3), 111–117 (1988)
Jirásková, G., Klíma, O.: On linear languages recognized by deterministic biautomata. Inf. Comput. 286, 104778 (2022)
Knuth, D. E.: Top-down syntax analysis. Acta Inf. 1, 79–110 (1971)
Kurki-Suonio, R.: Notes on top-down languages. BIT Numer. Math. 9(3), 225–238 (1969)
Lewis, P. M. II., Stearns, R. E.: Syntax-directed transduction. J. ACM 15(3), 465–488 (1968)
Okhotin, A.: Expressive power of LL(k) Boolean grammars. Theor. Comput. Sci. 412(39), 5132–5155 (2011)
Okhotin, A.: Underlying principles and recurring ideas of formal grammars. In: Language and Automata Theory and Applications (LATA 2018, Bar-Ilan near Tel Aviv, Israel, 9–11 April 2018), LNCS 10792, 36–59 (2018)
Rosenkrantz, D. J., Stearns, R. E.: Properties of deterministic top-down grammars. Inf. Control. 17, 226–256 (1970)
Acknowledgements
The authors are grateful to Henning Fernau and Dominik Kempa for interesting comments on the conference paper, and, in particular, for suggesting the idea of Section 7. Thanks are due to an anonymous referee for careful reading, and for convincing the authors to make numerous improvements to the presentation.
This work was carried out during the first author’s appointment at the Leonhard Euler International Mathematical Institute at St. Petersburg State University, Russia, and was supported by the Ministry of Science and Higher Education of the Russian Federation, agreement 075-15-2022-287.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
A preliminary version of this paper was presented at Computer Science in Russia (CSR 2020) conference, and its extended abstract appeared in the proceedings.
The original online version of this article was revised to update the affiliation of corresponding author Ilya Olkhovsky.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Olkhovsky, I., Okhotin, A. On the Transformation of LL(k)-linear to LL(1)-linear Grammars. Theory Comput Syst 67, 234–262 (2023). https://doi.org/10.1007/s00224-022-10108-6
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-022-10108-6