The Complexity of Computing the Number of Strings of Given Length in Context-Free Languages

Abstract Computing the number of strings of given length contained in a language is related to classical problems of combinatorics, formal languages and computational complexity. Here we study the complexity of this problem in the case of context-free languages. It is shown that, for unambiguous context-free languages such a computation is “easy” and can be carried out by efficient parallel algorithms. On the contrary, for some context-free languages of ambiguity degree two, the problem becomes intractable. These results are related to other classical subjects concerning counting problems, exponential time recognizable languages and sparse sets.

[1]  R. Cori,et al.  Planar Maps are Well Labeled Trees , 1981, Canadian Journal of Mathematics.

[2]  Larry Joseph Stockmeyer,et al.  The complexity of decision problems in automata theory and logic , 1974 .

[3]  Evangelos Kranakis,et al.  Approximating the projective model , 1987 .

[4]  Stuart J. Berkowitz,et al.  On Computing the Determinant in Small Parallel Time Using a Small Number of Processors , 1984, Inf. Process. Lett..

[5]  Werner Kuich,et al.  The Characterization of Nonexpansive Grammars by Rational Power Series , 1981, Inf. Control..

[6]  Allan Borodin,et al.  On Relating Time and Space to Size and Depth , 1977, SIAM J. Comput..

[7]  Leslie G. Valiant,et al.  The Complexity of Enumeration and Reliability Problems , 1979, SIAM J. Comput..

[8]  Juris Hartmanis Context-free languages and turing machine computations , 1967 .

[9]  Stephen A. Cook,et al.  The Parallel Complexity of Abelian Permutation Group Problems , 1987, SIAM J. Comput..

[10]  Werner Kuich,et al.  Languages and the enumeration of planted plane trees , 1970 .

[11]  Jan A. Bergstra,et al.  Global Renaming Operators in Concrete Process Algebra , 1988, Inf. Comput..

[12]  Robin Milner,et al.  A Complete Inference System for a Class of Regular Behaviours , 1984, J. Comput. Syst. Sci..

[13]  Evangelos Kranakis,et al.  Fixed Point Equations with Parameters in the Projective Model , 1987, Inf. Comput..

[14]  Maurice Nivat,et al.  The metric space of infinite trees. Algebraic and topological properties , 1980, Fundam. Informaticae.

[15]  Nicholas Pippenger,et al.  On simultaneous resource bounds , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[16]  Neil Immerman,et al.  Sparse Sets in NP-P: EXPTIME versus NEXPTIME , 1985, Inf. Control..

[17]  Jan A. Bergstra,et al.  Ready-Trace Semantics for Concrete Process Algebra with the Priority Operator , 1987, Comput. J..

[18]  Andrew V. Goldberg,et al.  Compression and ranking , 1985, STOC '85.

[19]  Giancarlo Mauri,et al.  A characterization of the class of functions computable in polynomial time on Random Access Machines , 1981, STOC '81.

[20]  J. W. de Bakker,et al.  Denotational semantics of concurrency , 1982, STOC '82.

[21]  Robert Cori,et al.  Enumeration des graphes planaires a l'aide des series formelles en variables non commutatives , 1972, Discret. Math..

[22]  Marcel Paul Schützenberger,et al.  On Context-Free Languages and Push-Down Automata , 1963, Inf. Control..

[23]  Stephen A. Cook,et al.  Log Depth Circuits for Division and Related Problems , 1984, SIAM J. Comput..

[24]  W. Kuich,et al.  A context-free language and enumeration problems on infinite trees and digraphs , 1971 .

[25]  Jay R. Goldman,et al.  Formal Languages and Enumeration , 1978, J. Comb. Theory, Ser. A.

[26]  Gérard Viennot,et al.  Algebraic Languages and Polyominoes Enumeration , 1983, Theor. Comput. Sci..

[27]  Stephen A. Cook,et al.  A Taxonomy of Problems with Fast Parallel Algorithms , 1985, Inf. Control..

[28]  J. V. Tucker,et al.  Complete local rings as domains , 1988, Journal of Symbolic Logic (JSL).

[29]  Philippe Flajolet,et al.  Analytic Models and Ambiguity of Context-free Languages* , 2022 .

[30]  John H. Reif Logarithmic Depth Circuits for Algebraic Functions , 1986, SIAM J. Comput..

[31]  Jan A. Bergstra,et al.  Process Algebra for Synchronous Communication , 1984, Inf. Control..

[32]  Maurice Nivat,et al.  Metric Interpretations of Infinite Trees and Semantics of non Deterministic Recursive Programs , 1980, Theor. Comput. Sci..

[33]  Noam Chomsky,et al.  The Algebraic Theory of Context-Free Languages* , 1963 .

[34]  Leslie G. Valiant,et al.  The Complexity of Computing the Permanent , 1979, Theor. Comput. Sci..

[35]  Jan A. Bergstra,et al.  Readies and Failures in the Algebra of Communicating Processes , 1988, SIAM J. Comput..

[36]  C. A. R. Hoare,et al.  Communicating Sequential Processes (Reprint) , 1983, Commun. ACM.

[37]  Walter L. Ruzzo On Uniform Circuit Complexity , 1981, J. Comput. Syst. Sci..

[38]  Ingo Wegener,et al.  The complexity of Boolean functions , 1987 .

[39]  Arto Salomaa,et al.  Automata-Theoretic Aspects of Formal Power Series , 1978, Texts and Monographs in Computer Science.