Abstract
We present a divide-and-conquer algorithm for parsing context-free languages efficiently. Our algorithm is an instance of Valiant's (1975), who reduced the problem of parsing to matrix multiplications. We show that, while the conquer step of Valiant's is O(n3) in the worst case, it improves to O(logn3), under certain conditions satisfied by many useful inputs. These conditions occur for example in program texts written by humans. The improvement happens because the multiplications involve an overwhelming majority of empty matrices. This result is relevant to modern computing: divide-and-conquer algorithms can be parallelized relatively easily.
- L. Allison. Lazy Dynamic-Programming can be eager. Information Processing Letters, 43(4):207--212, 1992. Google Scholar
Digital Library
- J.-P. Bernardy. Yi: an editor in Haskell for Haskell. In Proc. of the first ACM SIGPLAN symposium on Haskell, pages 61--62. ACM, 2008. Google Scholar
Digital Library
- J.-P. Bernardy. Lazy functional incremental parsing. In Proc. of the 2nd ACM SIGPLAN symposium on Haskell, pages 49--60. ACM, 2009. Google Scholar
Digital Library
- R. Bird and O. de Moor. Algebra of programming. Prentice-Hall, Inc., 1997. Google Scholar
Digital Library
- N. Chomsky. On certain formal properties of grammars. Information and control, 2(2):137--167, 1959.Google Scholar
Cross Ref
- M. Chytil, M. Crochemore, B. Monien, and W. Rytter. On the parallel recognition of unambiguous context-free languages. Theor. Comp. Sci., 81(2):311--316, 1991. Google Scholar
Digital Library
- K. Claessen. Parallel parsing processes. J. Funct. Program., 14(6):741--757, 2004. Google Scholar
Digital Library
- J. Cocke. Programming languages and their compilers: Preliminary notes. Courant Institute of Mathematical Sci.s, New York University, 1969. Google Scholar
Digital Library
- T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to algorithms, second ed. MIT press, 2001. Google Scholar
Digital Library
- M. Forsberg and A. Ranta. BNFC Quick reference, chapter Appendix A, pages 175--192. College Publications, 2012.Google Scholar
- R. J. M. Hughes and S. D. Swierstra. Polish parsers, step by step. In Proc. of ICFP 2003, pages 239--248. ACM, 2003. Google Scholar
Digital Library
- T. Kasami. An efficient recognition and syntax analysis algorithm for context-free languages. Technical report, DTIC Document, 1965.Google Scholar
- M. Lange and H. Leiß. To CNF or not to CNF? an efficient yet presentable version of the CYK algorithm. Informatica Didactica (8)(2008--2010), 2009.Google Scholar
- B. O'Sullivan. The Criterion benchmarking library, 2013.Google Scholar
- W. Rytter and R. Giancarlo. Optimal parallel parsing of bracket languages. Theor. computer science, 53(2):295--306, 1987. Google Scholar
Digital Library
- K. Sikkel and A. Nijholt. Parsing of context-free languages, pages 61--100. Springer-Verlag, 1997.Google Scholar
- V. Strassen. Gaussian elimination is not optimal. Numerische Mathematik, 13:354--356, 1969. 10.1007/BF02165411.Google Scholar
Digital Library
- M. Tomita. Efficient Parsing for Natural Language. Kluwer Adademic Publishers, 1986. Google Scholar
Digital Library
- L. Valiant. General context-free recognition in less than cubic time. J. of computer and system sciences, 10(2):308--314, 1975. Google Scholar
Digital Library
- T. A. Wagner and S. L. Graham. Efficient and flexible incremental parsing. ACM Transactions on Programming Languages and Systems, 20(5): 980--1013, 1998. Google Scholar
Digital Library
- D. Younger. Recognition and parsing of context-free languages in time n3. Information and control, 10(2):189--208, 1967.Google Scholar
Cross Ref
Index Terms
Efficient divide-and-conquer parsing of practical context-free languages
Recommendations
Efficient divide-and-conquer parsing of practical context-free languages
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingWe present a divide-and-conquer algorithm for parsing context-free languages efficiently. Our algorithm is an instance of Valiant's (1975), who reduced the problem of parsing to matrix multiplications. We show that, while the conquer step of Valiant's ...
An efficient context-free parsing algorithm for natural languages
IJCAI'85: Proceedings of the 9th international joint conference on Artificial intelligence - Volume 2This paper introduces an efficient context-free parsing algorithm and emphasizes its practical value in natural language processing. The algorithm can be viewed as an extended LR parsing algorithm which embodies the concept of a "graph-structured stack."...
An efficient context-free parsing algorithm
Special 25th Anniversary IssueA parsing algorithm which seems to be the most efficient general context-free algorithm known is described. It is similar to both Knuth's LR(k) algorithm and the familiar top-down algorithm. It has a time bound proportional to n3 (where n is the length ...







Comments