Improved normal form for grammars with one-sided contexts

Formal grammars equipped with operators for specifying the form of the context of a substring were recently studied by Barash and Okhotin ("An extension of context-free grammars with one-sided context specifications", Inform. and Comput., 2014) further extending the author's earlier work on propositional connectives in grammars (A. Okhotin, "Conjunctive grammars", J. Autom. Lang. Comb., 2001). These grammars allow two types of context specifications: for a substring v of a string uvx, a proper left context operator ?D states that u is of the form described by D, and an extended left context operator ?E states that uv is described by E. This paper establishes a normal form for these grammars, in which extended left contexts are never used, whereas left contexts may be applied only to individual symbols, so that all rules are of the form A ? B 1 C 1 & ? & B m C m or A ? a & ? D . This eliminates circular dependencies in the grammar and leads to a new, clearer version of the known cubic-time parsing algorithm. With some further improvements, the algorithm is accelerated from time O ( n 3 ) to time O ( n 3 log ? n ) .

[1]  David H. D. Warren,et al.  Parsing as Deduction , 1983, ACL.

[2]  Alexander Okhotin,et al.  An extension of context-free grammars with one-sided context specifications , 2014, Inf. Comput..

[3]  William C. Rounds,et al.  LFP A Logic for Linguistic Descriptions and an Analysis of its Complexity , 1988, Comput. Linguistics.

[4]  Alexander Okhotin,et al.  Conjunctive Grammars , 2001, J. Autom. Lang. Comb..

[5]  Alexander Okhotin,et al.  Boolean Grammars , 2003, Developments in Language Theory.

[6]  Ryan Williams,et al.  Matrix-vector multiplication in sub-quadratic time: (some preprocessing required) , 2007, SODA '07.

[7]  Alexander Okhotin,et al.  Defining Contexts in Context-Free Grammars , 2012, LATA.

[8]  Leslie G. Valiant,et al.  General Context-Free Recognition in Less than Cubic Time , 1975, J. Comput. Syst. Sci..

[9]  Alexander Okhotin Parsing by matrix multiplication generalized to Boolean grammars , 2014, Theor. Comput. Sci..

[10]  Noam Chomsky,et al.  On Certain Formal Properties of Grammars , 1959, Inf. Control..

[11]  Walter L. Ruzzo,et al.  An Improved Context-Free Recognizer , 1980, ACM Trans. Program. Lang. Syst..

[12]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[13]  Mikhail Barash,et al.  Programming language specification by a grammar with contexts , 2013, NCMA.

[14]  Alexander Okhotin,et al.  Generalized LR Parsing for Grammars with Contexts , 2015, CSR.

[15]  Robert A. Kowalski,et al.  Logic for problem solving , 1982, The computer science library : Artificial intelligence series.

[16]  Alexander Okhotin Fast Parsing for Boolean Grammars: A Generalization of Valiant's Algorithm , 2010, Developments in Language Theory.

[17]  Alexander Okhotin,et al.  Conjunctive and Boolean grammars: The true general case of the context-free grammars , 2013, Comput. Sci. Rev..

[18]  Daniel Götzmann Multiple Context-Free Grammars , 2007 .