A1 Refereed original research article in a scientific journal
Parsing by matrix multiplication generalized to Boolean grammars
Authors: Alexander Okhotin
Publication year: 2014
Journal: Theoretical Computer Science
Volume: 516
First page : 101
Last page: 120
Number of pages: 20
ISSN: 0304-3975
DOI: https://doi.org/10.1016/j.tcs.2013.09.011
The well-known parsing algorithm for context-free grammars due to Valiant (``General context-free recognition in less than cubic time'', \emph{Journal of Computer and System Sciences}, 10:2 (1975), 308--314) is analyzed and extended to handle the more general Boolean grammars, which are context-free grammars augmented with conjunction and negation operators in the rules. The algorithm reduces construction of a parsing table to computing multiple products of Boolean matrices of various sizes. Its time complexity on an input string of length $n$ is $O(\mathrm{BMM}(n) \log n)$, where $\mathrm{BMM}(n)$ is the number of operations needed to multiply two Boolean matrices of size $n \times n$, which is $O(n^\omega)$ with $\omega < 2.373$ as per the current knowledge. A parse tree can be constructed in time $\mathrm{MM}(n) \log^{O(1)} n$ (where $\mathrm{MM}(n)$ is the complexity of multiplying two integer matrices), by applying a known efficient procedure for determining witnesses for Boolean matrix multiplication. The algorithm has a succinct proof of correctness and is ready to be implemented.