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 条
  • [21] Binary Context-Free Grammars
    Turaev, Sherzod
    Abdulghafor, Rawad
    Alwan, Ali Amer
    Abd Almisreb, Ali
    Gulzar, Yonis
    SYMMETRY-BASEL, 2020, 12 (08):
  • [22] CONTEXT-FREE GRAPH GRAMMARS
    DELLAVIGNA, P
    GHEZZI, C
    INFORMATION AND CONTROL, 1978, 37 (02): : 207 - 233
  • [23] ORDERED CONTEXT-FREE GRAMMARS
    LEPISTO, T
    INFORMATION AND CONTROL, 1973, 22 (01): : 56 - 68
  • [24] PREDICTORS OF CONTEXT-FREE GRAMMARS
    TAI, KC
    SIAM JOURNAL ON COMPUTING, 1980, 9 (03) : 653 - 664
  • [25] INDEXED GRAMMARS - AN EXTENSION OF CONTEXT-FREE GRAMMARS
    AHO, AV
    JOURNAL OF THE ACM, 1968, 15 (04) : 647 - &
  • [26] On translating context-free grammars into Lambek grammars
    Kuznetsov, S. L.
    PROCEEDINGS OF THE STEKLOV INSTITUTE OF MATHEMATICS, 2015, 290 (01) : 63 - 69
  • [27] From context-free grammars to OPR-Grammars
    Elferchichi, Anis
    Essalmi, Fathi
    Ferchichi, Ahmed
    3rd International Conference on Education and Information Systems: Technologies and Applications, Vol 1, Proceedings, 2005, : 161 - 166
  • [29] Modelling dynamics with context-free grammars
    Garcia-Huerta, Juan-M.
    Jimenez-Hernandez, Hugo
    Herrera-Navarro, Ana-M.
    Hernandez-Diaz, Teresa
    Terol-Villalobos, Ivan
    VIDEO SURVEILLANCE AND TRANSPORTATION IMAGING APPLICATIONS 2014, 2014, 9026
  • [30] Estimation of probabilistic context-free grammars
    Chi, ZY
    Geman, S
    COMPUTATIONAL LINGUISTICS, 1998, 24 (02) : 299 - 305