Skip to main content

Analyzing Ambiguity of Context-Free Grammars

  • Conference paper
Implementation and Application of Automata (CIAA 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4783))

Included in the following conference series:

Abstract

It has been known since 1962 that the ambiguity problem for context-free grammars is undecidable. Ambiguity in context-free grammars is a recurring problem in language design and parser generation, as well as in applications where grammars are used as models of real-world physical structures.

We observe that there is a simple linguistic characterization of the grammar ambiguity problem, and we show how to exploit this to conservatively approximate the problem based on local regular approximations and grammar unfoldings. As an application, we consider grammars that occur in RNA analysis in bioinformatics, and we demonstrate that our static analysis of context-free grammars is sufficiently precise and efficient to be practically useful.

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. Hopcroft, J.E., Ullman, J.D.: Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading (1979)

    MATH  Google Scholar 

  2. Knuth, D.E.: On the translation of languages from left to right. Information and Control 8, 607–639 (1965)

    Article  MathSciNet  Google Scholar 

  3. Culik II, K., Cohen, R.S.: LR-regular grammars - an extension of LR(k) grammars. Journal of Computer and System Sciences 7(1), 66–96 (1973)

    MATH  MathSciNet  Google Scholar 

  4. Scott, E., Johnstone, A., Hussein, S.S.: Tomita style generalised parsers. Technical Report CSD-TR-00-A, Royal Holloway, University of London (2000)

    Google Scholar 

  5. Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (1997)

    Google Scholar 

  6. McPeak, S., Necula, G.C.: Elkhound: A fast, practical GLR parser generator. In: Duesterwald, E. (ed.) CC 2004. LNCS, vol. 2985, Springer, Heidelberg (2004)

    Google Scholar 

  7. van den Brand, M., Scheerder, J., Vinju, J.J., Visser, E.: Disambiguation filters for scannerless generalized LR parsers. In: Horspool, R.N. (ed.) CC 2002 and ETAPS 2002. LNCS, vol. 2304, Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  8. Brabrand, C., Schwartzbach, M.I., Vanggaard, M.: The metafront system: Extensible parsing and transformation. In: LDTA 2003. Proc. 3rd ACM SIGPLAN Workshop on Language Descriptions, Tools and Applications, ACM Press, New York (2003)

    Google Scholar 

  9. Gorn, S.: Detection of generative ambiguities in context-free mechanical languages. Journal of the ACM 10(2), 196–208 (1963)

    Article  MATH  MathSciNet  Google Scholar 

  10. Cheung, B.S.N., Uzgalis, R.C.: Ambiguity in context-free grammars. In: SAC 1995. Proc. ACM Symposium on Applied Computing, ACM Press, New York (1995)

    Google Scholar 

  11. Schmitz, S.: Conservative ambiguity detection in context-free grammars. In: ICALP 2007. Proc. 34th International Colloquium on Automata, Languages and Programming (2007)

    Google Scholar 

  12. Kuich, W.: Systems of pushdown acceptors and context-free grammars. Elektronische Informationsverarbeitung und Kybernetik 6(2), 95–114 (1970)

    MathSciNet  Google Scholar 

  13. Durbin, R., Eddy, S.R., Krogh, A., Mitchison, G.: Biological Sequence Analysis. Cambridge University Press, Cambridge (1998)

    MATH  Google Scholar 

  14. Giegerich, R., Meyer, C., Steffen, P.: A discipline of dynamic programming over sequence data. Science of Computer Programming 51(3), 215–263 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  15. Giegerich, R.: Explaining and controlling ambiguity in dynamic programming. In: Giancarlo, R., Sankoff, D. (eds.) CPM 2000. LNCS, vol. 1848, pp. 46–59. Springer, Heidelberg (2000)

    Google Scholar 

  16. Dowell, R.D., Eddy, S.R.: Evaluation of several lightweight stochastic context-free grammars for RNA secondary structure prediction. BMC Bioinformatics 5(71) (2004)

    Google Scholar 

  17. Brabrand, C., Møller, A., Schwartzbach, M.I.: Dual syntax for XML languages. In: Bierman, G., Koch, C. (eds.) DBPL 2005. LNCS, vol. 3774, Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  18. Mohri, M., Nederhof, M.J.: 9: Regular Approximation of Context-Free Grammars through Transformation. In: Robustness in Language and Speech Technology, Kluwer Academic Publishers, Dordrecht (2001)

    Google Scholar 

  19. Brabrand, C., Giegerich, R., Møller, A.: Analyzing ambiguity of context-free grammars. Technical Report RS-07-10, BRICS (2007)

    Google Scholar 

  20. Møller, A.: dk.brics.automaton – finite-state automata and regular expressions for Java (2007), http://www.brics.dk/automaton/

  21. Aho, A.V., Ullman, J.D.: The Theory of Parsing, Translation and Compiling, vol. 1: Parsing. Prentice-Hall, Englewood Cliffs (1972)

    Google Scholar 

  22. Reeder, J., Steffen, P., Giegerich, R.: Effective ambiguity checking in biosequence analysis. BMC Bioinformatics 6(153) (2005)

    Google Scholar 

  23. Voss, B., Giegerich, R., Rehmsmeier, M.: Complete probabilistic analysis of RNA shapes. BMC Biology 4(5) (2006)

    Google Scholar 

  24. Reeder, J., Giegerich, R.: A graphical programming system for molecular motif search. In: GPCE 2006. Proc. 5th International Conference on Generative Programming and Component Engineering, pp. 131–140. ACM Press, New York (2006)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Jan Holub Jan Žďárek

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Brabrand, C., Giegerich, R., Møller, A. (2007). Analyzing Ambiguity of Context-Free Grammars. In: Holub, J., Žďárek, J. (eds) Implementation and Application of Automata. CIAA 2007. Lecture Notes in Computer Science, vol 4783. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-76336-9_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-76336-9_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-76335-2

  • Online ISBN: 978-3-540-76336-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics