Algorithms for transforming context-free grammars into L-graphs

Jiamian Li

Abstract


Formal language theory holds a significant place in computer science, where context-free grammars, due to their powerful expressiveness, are widely applied in areas such as programming language design, natural language processing, and compiler construction. Traditionally, pushdown automata have been the primary tool for recognizing and processing context-free languages. However, the fragmentation of state transition descriptions and stack operations into separate commands complicates the analysis of computations, hindering practical application. L-graphs are conceived as a more advanced and compact tool for representing and analyzing formal languages, thanks to their intuitive graphical structure and the clear semantics of graph paths that reflect computations. This paper presents a systematic transformation algorithm capable of converting an arbitrary context-free grammar into an equivalent context-free L-graph. This method performs an intuitive, one-to-one conversion of grammatical structures into graphical ones. Unlike pushdown automata, L-graphs do not involve explicit stack operations, instead using bracket labels to implement recursive structures, which makes their usage more intuitive. Furthermore, the study demonstrates the feasibility of efficient syntactic parsing using L-graphs, highlighting their practical value. While retaining the expressive power of contextfree grammars, L-graphs are more amenable to optimization (such as eliminating redundant vertices and arcs, reducing cyclic complexity, etc.), enhancing their effectiveness for both theoretical research and practical applications.

Full Text:

PDF (Russian)

References


Vylitok A. A., Sutyrin P. G. Characterization of formal languages by graphs // Collection of abstracts of the scientific conference “Tikhonov Readings”. — Moscow, Lomonosov Moscow State University, Faculty of Computational Mathematics and Cybernetics, 2010. P. 82–83 (in Russian).

Stanevichene L. I. On some definitions of the class of context-free languages for video data // Programmirovanie. 1999. No. 5. P. 15–25 (in Russian).

Stanevichene L. I. On the theory of context-free languages. — Moscow, 2000. — Deposited in VINITI RAS 29.05.2000, No. 1546-B00 (in Russian).

Vylitok A. A., Kondratiev G. D. Syntactic analysis using L-graphs // Lomonosov Readings: Scientific Conference. — Moscow, Faculty of Computational Mathematics and Cybernetics, Lomonosov Moscow State University, 2017. P. 124–125 (in Russian).

Hopcroft John E., Motwani Rajeev, Ullman Jeffrey D. Introduction to Automata Theory, Languages, and Computation / Ed. by A. B. Stavrovsky. — 2nd ed. — Moscow : Williams Publishing House, 2008. — 528 p. — Translation from English: Hopcroft J. E., Motwani R., Ullman J. D. Introduction to Automata Theory, Languages, and Computation. 2nd ed.

Vylitok A. A., Generalova V. G. Regularity conditions for L-graphs without pseudocyclic paths // Lomonosov Readings-2020. Section of Computational Mathematics and Cybernetics. — Moscow, Lomonosov Moscow State University, Faculty of Computational Mathematics and Cybernetics, 2020. P. 48–49 (in Russian).

Sipser Michael. Introduction to the Theory of Computation. — 2nd edition. — Boston, MA : Thomson Course Technology, 2005. — ISBN: 0-534-95097-3.

Context-free grammars and pushdown storage : QPR (Quarterly Progress Report) : 65 / Massachusetts Institute of Technology ; Executor: N. Chomsky. — Cambridge, MA : 1962. — P. 187–194. — Research Laboratory of Electronics.


Refbacks

  • There are currently no refbacks.


Abava  Кибербезопасность ИТ конгресс СНЭ

ISSN: 2307-8162