On the complexity of general context-free language parsing and recognition

Extended abstract
  • Walter L. Ruzzo
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 71)


Several results on the computational complexity of general context-free language parsing and recognition are given. In particular we show that parsing strings of length n is harder than recognizing such strings by a factor of only 0(log n), at most. The same is true for linear and/or unambiguous context-free languages. We also show that the time to multiply \(\sqrt n \times \sqrt n\) Boolean Matrices is a lower bound on the time to recognize all prefixes of a string (or do on-line recognition), which in turn is a lower bound on the time to generate a particular convenient representation of all parses of a string (in an ambiguous grammar). Thus these problems are solvable in linear time only if n×n Boolean matrix multiplication can be done in 0(n2).


Turing Machine Parse Tree Boolean Matrix Convenient Representation Boolean Matrice 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Adleman, L., K.S. Booth, F.P. Preparata and W.L. Ruzzo, "Improved time and space bounds for Boolean matrix multiplication", Acta Informatica, 11 (1978), 61–70.Google Scholar
  2. Aho, A.V., J.E. Hopcroft and J.D. Ullman, The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading, MA (1974).Google Scholar
  3. Earley, J., "An efficient context-free parsing algorithm", Comm. ACM 13:1 (1970), 94–102.Google Scholar
  4. Fischer, M.J. and A.R. Meyer, "Boolean matrix multiplication and transitive closure", Conference Record IEEE 12th Annual Symposium on Switching and Automata Theory (1971), 129–131.Google Scholar
  5. Furman, M.E., "Application of a method of fast multiplication of matrices in the problem of finding the transitive closure of a graph", Soviet Math Dokl. 11:5 (1970), 1252.Google Scholar
  6. Gallaire, H., "Recognition time of context free languages by on-line Turing machines", Information and Control 15 (1969), 288–295.Google Scholar
  7. Graham, S.L., M.A. Harrison and W.L. Ruzzo, "Online context free language recognition in less than cubic time", Proc. 8th Annual ACM Symposium on Theory of Computing (1976), 112–120.Google Scholar
  8. Gray, J. and M.A. Harrison, "On the covering and reduction problems for context-free grammars", JACM 19 (1972), 675–698.Google Scholar
  9. Harrison, M.A., Introduction to Formal Language Theory, Addison-Wesley, Reading, MA (1978).Google Scholar
  10. Harrison, M.A. and I. Havel, "On the parsing of strict deterministic languages", JACM 21 (1974), 525–548.Google Scholar
  11. Hays, D.G., "Automatic language-data processing", in Computer Applications in the Behavioral Sciences, H. Borko (ed.), Prentice-Hall, Englewoods Cliffs, NJ (1962), 394–423.Google Scholar
  12. Kasami, T., "An efficient recognition and syntax analysis algorithm for context free languages", Science Report AF CRL-65-758, Air Force Cambridge Research Laboratory, Bedford, MA (1965).Google Scholar
  13. Munro, J.I., "Efficient determination of the transitive closure of a directed graph", Information Processing Letters 1:2 (1971), 56–58.Google Scholar
  14. Pan, V.Ya., "Strassen's algorithm is not optimal: Trilinear technique of aggregating, uniting and cancelling for constructing fast algorithms for matrix operations", IEEE 19th Annual Symposium on Foundations of Computer Science, (1978), 166–176.Google Scholar
  15. Ruzzo, W.L., "General Context-Free Language Recognition". Ph.D. Dissertation, U. C. Berkeley (1978).Google Scholar
  16. Strassen, V., "Gaussian elimination is not optimal", Numerische Mathematik 13 (1969), 354–356.Google Scholar
  17. Thatcher, J.W., "Characterizing derivation trees of context-free grammars through a generalization of finite automata theory", JCSS 1:4 (1967) 317–322.Google Scholar
  18. Thatcher, J.W. and J.B. Wright, "Generalized finite automata theory with an application to a decision problem of second-order logic", Math. Sys. Th. 2:1 (1968) 57–81.Google Scholar
  19. Valiant, L., "General context free recognition in less than cubic time", J. Computer and System Sciences 10 (1975), 308–315.Google Scholar
  20. Weiner, P., "Linear pattern matching algorithms", Conference Record IEEE 14th Annual Symposium on Switching and Automata Theory (1973), 1–11.Google Scholar
  21. Younger, D.H., "Recognition of context-free languages in time n3", Information and Control 10:2 (Feb. 1967), 189–208.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1979

Authors and Affiliations

  • Walter L. Ruzzo
    • 1
  1. 1.Department of Computer ScienceUniversity of WashingtonSeattleUSA

Personalised recommendations