P-complete

Context-free Grammar Membership (CFGmem)

Input

A context-free grammar $G = (N, T, P, S)$ and a string $x \in T^\ast$.

Problem

Is $x \in L(G)$?

Definitions

Here, $N$ is the set of nonterminal symbols, $T$ is the set of terminal symbols, $P$ is the set of production rules, and $S$ is the start symbol.

Status

$\P$-complete (Jones and Laaser [1]).

Remarks

The reduction to show hardness is from GEN. Goldschlager remarks it is the presence of $\epsilon$-productions in the input grammar that make the membership question difficult [2]. Lewis, Stearns, and Hartmanis’ $(\log n)^2$ space algorithm [3] and Ruzzo’s $\mathsf{AC}^1$ (hence $\NC^2$) algorithm [4] for general context free language recognition can both be modified to work with an $\epsilon$-free grammar given as part of the input. For a fixed grammar, unbounded fanin size $O(n^6)$ suffices [4].

Rytter shows context-free languages can be recognized on a cube connected computer in $O((\log n)^2)$ time using $n^6$ processors [5]. He also provides an $O(\log n)$ time $n^7$ processor COMMON CRCW- PRAM algorithm for the recognition of unambiguous context-free languages [6]. Klein and Reif give an $O(\log n)$ time $n^3$ processor CREW-PRAM algorithm for the recognition of deterministic context-free languages [7]. Dymond and Ruzzo give a somewhat simpler algorithm for this problem on the more restricted CROW- PRAM [8]. Kaji et al. prove Parallel Multiple Context-free Grammar Membership and Multiple Context-free Grammar Membership, which are problems involving generalizations of context-free grammars that are designed to model natural languages, are $\P$-complete [9].

References

  1. N. D. Jones and W. T. Laaser (1976). Complete problems for deterministic polynomial time.
  2. L. M. Goldschlager (1981). ϵ-productions in context-free grammars.
  3. P. M. Lewis, II, R. E. Stearns, and J. Hartmanis (1965). Memory bounds for recognition of context-free and context-sensitive languages.
  4. W. L. Ruzzo (1980). Tree-size bounded alternation.
  5. W. Rytter (1984). On the recognition of context-free languages.
  6. W. Rytter (1987). Parallel time O(log n) recognition of unambiguous context-free languages.
  7. P. N. Klein and J. H. Reif (1988). Parallel time O(log n) acceptance of deterministic CFLs on an exclusive-write P-RAM.
  8. P. W. Dymond and W. L. Ruzzo (1986). Parallel random access machines with owned global memory and deterministic context-free language recognition.
  9. Y. Kaji, R. Nakanishi, H. Seki, and T. Kasami (1992). The universal recognition problems for parallel multiple context-free grammars and for their subclasses.
  10. Greenlaw, R., Hoover, H. J., and Ruzzo, W. L. (1995). Limits to Parallel Computation: P-Completeness Theory. Oxford University Press. Problem A.7.1.