Algorithm for transforming context-free expressions into equivalent L-graphs

Jingyuan Mu

Abstract


This work examines context-free grammars and their alternative representations—context-free expressions and context-free L-graphs. A context-free expression serves as an algebraic form for representing context-free grammars, matching known methods in conciseness while simultaneously providing a more detailed and visual demonstration of how language strings are generated from subordinate strings. A context-free L-graph is a directed graph whose arcs are labeled with symbols from a primary alphabet and additional bracket markers that affect the successful traversal of a path from the initial vertex to the final vertex (bracket balance is required). This article focuses on the algorithm for converting context- free expressions into equivalent L-graphs. The proposed algorithm is accompanied by a correctness proof and incorporates the idea of removing redundant vertices. Such a synthesis of algebraic and graphical approaches combines their key advantages: on one hand, context-free expressions ensure compact and clear descriptions, while on the other hand, context-free L-graphs provide intuitive visualization of the language structure. This combined approach opens prospects for developing more effective tools for analyzing and transforming language models in compilers and text processing systems.


Full Text:

PDF (Russian)

References


Hopkroft, 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.

Volkova I. A., Vylitok A. A., Rudenko T. V. Formal Grammars and Languages. Elements of Translation Theory. — 3rd ed. — Moscow : Lomonosov Moscow State University, Faculty of Computational Mathematics and Cybernetics Publishing Department, 2009. — 115 p.

Aho A., Ullman J. The Theory of Parsing, Translation and Compiling / Ed. by V. M. Kurochkin. — Moscow : Mir Publishers, 1978. — Vol. 1. — Translated from English: Aho A., Ullman J. The Theory of Parsing, Translation and Compiling. Vol. 1.

Stanevichene L. I. On the Theory of Context-Free Languages. — Moscow, 2000. — Deposited in VINITI RAS 29.05.2000, No. 1546-B00.

Gomozov A. L., Stanevichene L. I. On One Generalization of Regular Expressions // Programming and Computer Software. — 2000. — No. 5. — P. 31-43. — Bibliogr.: p.43.

Vylitok A. A., Sutyrin P. G. Characterization of Formal Languages by Graphs // Abstracts of the Scientific Conference "Tikhonov Readings". — Moscow, Lomonosov Moscow State University, Faculty of Computational Mathematics and Cybernetics, 2010. — P. 82-83.

Stanevichene L. I. On Some Definitions of the Class of Context-Free Languages // Programming and Computer Software. — 1999. — No. 5. — P. 15-25. — UDC 519.682.1.


Refbacks

  • There are currently no refbacks.


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

ISSN: 2307-8162