Skip to main content

Context-Free Ambiguity Detection Using Multi-stack Pushdown Automata

  • Conference paper
  • First Online:
Developments in Language Theory (DLT 2016)

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

Included in the following conference series:

  • 575 Accesses

Abstract

We propose a method for detecting ambiguity in context-free grammars using multi-stack pushdown automata. Since the ambiguity problem is undecidable in general, we use restricted MPDAs that have a limited configuration space. The analysis might thus not be complete, but it is able to detect both ambiguity and unambiguity. Our method is general in the type of automata used. We discuss the suitability of existing MPDAs in our setting and present a new class called bounded-balance MPDAs. These MPDAs allow for infinitely deep nesting/nesting intersection, as long as the nesting depth differences within each scope stay within the balance bound. We compare our contributions to various related MPDAs and ambiguity detection methods.

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 EPUB and 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

References

  1. Abdulla, P., Atig, M., Rezine, O., Stenman, J.: Budget-bounded model-checking pushdown systems. Form. Methods Syst. Des. 45(2), 273–301 (2014)

    Article  MATH  Google Scholar 

  2. Atig, M.F., Bollig, B., Habermehl, P.: Emptiness of multi-pushdown automata is 2ETIME-complete. In: Ito, M., Toyama, M. (eds.) DLT 2008. LNCS, vol. 5257, pp. 121–133. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  3. Axelsson, R., Heljanko, K., Lange, M.: Analyzing context-free grammars using an incremental SAT solver. In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008, Part II. LNCS, vol. 5126, pp. 410–422. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Basten, H.J.S.: Tracking down the origins of ambiguity in context-free grammars. In: Cavalcanti, A., Deharbe, D., Gaudel, M.-C., Woodcock, J. (eds.) ICTAC 2010. LNCS, vol. 6255, pp. 76–90. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  5. Basten, H.J.S.: Ambiguity detection for programming language grammars. Ph.D. thesis, Universiteit van Amsterdam (2011)

    Google Scholar 

  6. Basten, H.J.S., Vinju, J.J.: Faster ambiguity detection by grammar filtering. In: Proceedings of the Tenth Workshop on Language Descriptions, Tools and Applications (LDTA 2010), pp. 5:1–5:9. ACM (2010)

    Google Scholar 

  7. Brabrand, C., Giegerich, R., Møller, A.: Analyzing ambiguity of context-free grammars. Sci. Comput. Program. 75(3), 176–191 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  8. Breveglieri, L., Cherubini, A., Citrini, C., Reghizzi, S.C.: Multi-push-down languages and grammars. Int. J. Found. Comput. Sci. 07(03), 253–291 (1996)

    Article  MATH  Google Scholar 

  9. Cheung, B.S.N., Uzgalis, R.C.: Ambiguity in context-free grammars. In: Proceedings of the 1995 ACM Symposium on Applied Computing (SAC 1995), pp. 272–276. ACM, New York (1995)

    Google Scholar 

  10. Clarke, E., Kroning, D., Lerda, F.: A tool for checking ANSI-C programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  11. Ginsburg, S., Harrison, M.A.: Bracketed context-free languages. J. Comput. Syst. Sci. 1(1), 1–23 (1967)

    Article  MathSciNet  MATH  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  13. Kieżun, A., Ganesh, V., Guo, P.J., Hooimeijer, P., Ernst, M.D.: HAMPI: a solver for string constraints. In: Proceedings of the 2009 International Symposium on Software Testing and Analysis (ISSTA 2009), pp. 105–116. ACM (2009)

    Google Scholar 

  14. Knuth, D.E.: On the translation of languages from left to right. Inf. Control 8(6), 607–639 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  15. Knuth, D.E.: Top-down syntax analysis. Acta Informatica 1, 79–110 (1971)

    Article  MATH  Google Scholar 

  16. La Torre, S., Madhusudan, P., Parlato, G.: A robust class of context-sensitive languages. In: 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007), pp. 161–170. IEEE (2007)

    Google Scholar 

  17. La Torre, S., Napoli, M.: Reachability of multistack pushdown systems with scope-bounded matching relations. In: Katoen, J.-P., König, B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 203–218. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  18. La Torre, S., Parlato, G.: Scope-bounded multistack pushdown systems: fixed-point, sequentialization, and tree-width. In: IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2012), pp. 173–184 (2012)

    Google Scholar 

  19. Nederhof, M.: Practical experiments with regular approximation of context-free languages. Comput. Linguist. 26(1), 17–44 (2000)

    Article  MathSciNet  Google Scholar 

  20. Qadeer, S., Rehof, J.: Context-bounded model checking of concurrent software. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 93–107. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  21. Schmitz, S.: Conservative ambiguity detection in context-free grammars. In: Arge, L., Cachin, C., Jurdziński, T., Tarlecki, A. (eds.) ICALP 2007. LNCS, vol. 4596, pp. 692–703. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  22. Schröer, F.W.: AMBER, an ambiguity checker for context-free grammars. Technical report (2001). compilertools.net, http://accent.compilertools.net/Amber.html

  23. Schwoon, S.: Model-checking pushdown systems. Ph.D. thesis, Technische Universität München, June 2002

    Google Scholar 

  24. Scott, E., Johnstone, A.: Generalized bottom up parsers with reduced stack activity. Comput. J. 48(5), 565–587 (2005)

    Article  Google Scholar 

  25. Vasudevan, N., Tratt, L.: Detecting ambiguity in programming language grammars. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds.) SLE 2013. LNCS, vol. 8225, pp. 157–176. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to H. J. S. Basten .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Basten, H.J.S. (2016). Context-Free Ambiguity Detection Using Multi-stack Pushdown Automata. In: Brlek, S., Reutenauer, C. (eds) Developments in Language Theory. DLT 2016. Lecture Notes in Computer Science(), vol 9840. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-53132-7_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-53132-7_1

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-53131-0

  • Online ISBN: 978-3-662-53132-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics