Testing Parenthesis Languages

We continue the investigation of properties defined by formal languages. This study was initiated by Alon et al. [1] who described an algorithm for testing properties defined by regular languages. Alon et al. also considered several context free languages, and in particular Dyck languages, which contain strings of properly balanced parentheses. They showed that the first Dyck language, which contains strings over a single type of pairs of parentheses, is testable in time independent of n, where n is the length of the input string. However, the second Dyck language, defined over two types of parentheses, requires Ω(log n) queries. Here we describe a sublinear-time algorithm for testing all Dyck languages. Specifically, the running time of our algorithm is O(n2/3/Ɛ3), where Ɛ is the given distance parameter. Furthermore, we improve the lower bound for testing Dyck languages to Ω(n1/11) for constant Ɛ. We also have a testing algorithm for the context free language LREV = {w = uurvvr: w ∈ Σn}, where Σ is a fixed alphabet. The running time of our algorithm is O(√n/Ɛ), which almost matches the lower bound given by Alon et al. [1].

[1]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[2]  Michael A. Harrison,et al.  Introduction to formal language theory , 1978 .

[3]  Dana Ron,et al.  Property testing and its connection to learning and approximation , 1998, JACM.

[4]  Noga Alon,et al.  Regular languages are testable with a constant number of queries , 1999, 40th Annual Symposium on Foundations of Computer Science (Cat. No.99CB37039).

[5]  Ronitt Rubinfeld,et al.  Robust Characterizations of Polynomials with Applications to Program Testing , 1996, SIAM J. Comput..

[6]  Dexter Kozen,et al.  Automata and Computability , 1997, Undergraduate Texts in Computer Science.

[7]  Ilan Newman Testing of function that have small width branching programs , 2000, Proceedings 41st Annual Symposium on Foundations of Computer Science.

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