Skip to main content

Abstract

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 Ω(logn) queries.

Here we describe a sublinear-time algorithm for testing all Dyck languages. Specifically, the running time of our algorithm is Õ(n 2/33), where ε is the given distance parameter. Furthermore, we improve the lower bound for testing Dyck languages to \( \tilde \Omega (n^{1/11} ) \) for constant ε. We also have a testing algorithm for the context free language L REV = {w = uuτvvτ: w ∈ Σn}, where Σ is a fixed alphabet. The running time of our algorithm is \( \tilde O(\sqrt n / \in ) \), which almost matches the lower bound given by Alon et al. [1].

Supported by the Israel Science Foundation (grant number 32/00-1).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. N. Alon, M. Krivelevich, I. Newman, and M Szegedy. Regular languages are testable with a constant number of queries. In Proceedings of the Fortieth Annual Symposium on Foundations of Computer Science, pages 656–666, 1999.

    Google Scholar 

  2. O. Goldreich, S. Goldwasser, and D. Ron. Property testing and its connection to learning and approximation. JACM, 45(4):653–750, 1998.

    Article  MATH  MathSciNet  Google Scholar 

  3. M. Harrison. Introduction to formal language theory. Addison-Wesley, 1978.

    Google Scholar 

  4. D. E. Knuth, J. H. Morris, and V. R. Pratt. Fast pattern matching in strings. SIAM Journal on Computing, 6(2):323–350, 1977.

    Article  MATH  MathSciNet  Google Scholar 

  5. D. Kozen. Automata and Computability. Springer Verlag, 1997.

    Google Scholar 

  6. I. Newman. Testing of functions that have small width branching programs. In Proceedings of the Forty-First Annual Symposium on Foundations of Computer Science, pages 251–258, 2000.

    Google Scholar 

  7. M. Parnas, D. Ron, and R. Rubinfeld. Testing parenthesis languages. Available from: http://www.eng.tau.ac.il/~danar, 2001.

  8. D. Ron. Property testing. To appear in the Handbook on Randomization. Currently available from: http://www.eng.tau.ac.il/~danar, 2000.

  9. R. Rubinfeld and M. Sudan. Robust characterization of polynomials with applications to program testing. SIAM Journal on Computing, 25(2):252–271, 1996.

    Article  MathSciNet  Google Scholar 

  10. N. Chomsky M. P. Schotzenberger. The algebraic theory of context-free languages. In Computer Programming and Formal Languages, P. Braffort and D. Hirschberg, Eds, North Holland, pages 118–161, 1963.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Parnas, M., Ron, D., Rubinfeld, R. (2001). Testing Parenthesis Languages. In: Goemans, M., Jansen, K., Rolim, J.D.P., Trevisan, L. (eds) Approximation, Randomization, and Combinatorial Optimization: Algorithms and Techniques. RANDOM APPROX 2001 2001. Lecture Notes in Computer Science, vol 2129. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44666-4_29

Download citation

  • DOI: https://doi.org/10.1007/3-540-44666-4_29

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42470-3

  • Online ISBN: 978-3-540-44666-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics