MINIMIZATION OF CONTEXT-FREE GRAMMARS

被引:0
|
作者
Ryazanov, Yu D. [1 ]
Nazina, S., V [1 ]
机构
[1] Belgorod State Technol Univ, Belgorod, Russia
来源
关键词
formal language; formal grammar; equivalence relation; minimization;
D O I
10.17223/20710410/45/10
中图分类号
O29 [应用数学];
学科分类号
070104 ;
摘要
This paper solves the problem of transforming the initial context-free grammar (CFgrammar) without excess characters into equivalent CF-grammar with less complexity. To solve this problem, the following relation on the set of a CF-grammar non-terminals is introduced: E = {(X, Y) : (X = Y) boolean OR (X -> alpha double left right arrow Y -> beta boolean AND vertical bar alpha vertical bar = vertical bar beta vertical bar boolean AND for all i (alpha(i) = = beta(i) boolean OR (alpha(i), beta(i)) is an element of E))} where X, Y are non-terminals, alpha, beta are chains of terminal and non-terminals, possibly blank, alpha(i) is the i-th character in chain alpha, beta(i) is the i-th character in chain beta. It is proved that the relation E has the equivalence property and splits the set of non-terminals into equivalence classes. An algorithm is proposed for splitting a set of non-terminals into equivalence classes based on the method of sequential decomposition of the set of non-terminals into subsets so that non-equivalent non-terminals fall into different subsets. New CF-grammar is built on a set of non-terminals N, which elements are representatives of equivalence classes. From the set of rules of the initial CF-grammar, the rules with the left parts belonging to the set N are chosen. If there is a non-terminal in the left side of any selected rule that does not belong to the set N, then it is replaced by its equivalent non-terminal from the set N. After such transformations in the CF-grammar, sets of identical rules may appear. From each set of identical rules, we leave only one rule. The result is a CF-grammar containing less rules and non-terminals than the initial CF-grammar. The paper provides an example of the implementation of the described transformations.
引用
收藏
页码:90 / 96
页数:7
相关论文
共 50 条
  • [41] Context-free Grammars for Triangular Arrays
    Robert X.J.HAO
    Larry X.W.WANG
    Harold R.L.YANG
    ActaMathematicaSinica, 2015, 31 (03) : 445 - 455
  • [42] DERIVATIONAL COMPLEXITY OF CONTEXT-FREE GRAMMARS
    SIPPU, S
    INFORMATION AND CONTROL, 1982, 53 (1-2): : 52 - 65
  • [43] Ordered Context-Free Grammars Revisited
    van der Merwe, Brink
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2023, 388 : 140 - 153
  • [44] Generalized Register Context-Free Grammars
    Senda, Ryoma
    Takata, Yoshiaki
    Seki, Hiroyuki
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2020, E103D (03): : 540 - 548
  • [45] ON A COVERING RELATION FOR CONTEXT-FREE GRAMMARS
    SOISALONSOININEN, E
    WOOD, D
    ACTA INFORMATICA, 1982, 17 (04) : 435 - 449
  • [46] Approximation of fuzzy context-free grammars
    Wang, Yongbing
    Li, Yongming
    INFORMATION SCIENCES, 2009, 179 (22) : 3920 - 3929
  • [47] Affinity Analysis for Context-Free Grammars
    Moraes, Santosh
    Godbole, Anand
    Gharpure, Prachi
    2017 IEEE INTERNATIONAL CONFERENCE ON POWER, CONTROL, SIGNALS AND INSTRUMENTATION ENGINEERING (ICPCSI), 2017, : 2471 - 2474
  • [48] The context-free grammars of artificial languages
    V. V. Gribova
    A. S. Kleschev
    D. A. Krylov
    Automatic Documentation and Mathematical Linguistics, 2013, 47 (2) : 59 - 67
  • [49] CONTEXT-FREE GRAMMARS WITH CANCELLATION PROPERTIES
    FROUGNY, C
    THEORETICAL COMPUTER SCIENCE, 1985, 39 (01) : 3 - 13
  • [50] Context-free grammars for triangular arrays
    Robert X. J. Hao
    Larry X. W. Wang
    Harold R. L. Yang
    Acta Mathematica Sinica, English Series, 2015, 31 : 445 - 455