Skip to main content

Browsing the Parse Space

  • 323 Accesses

Part of the Communications in Computer and Information Science book series (CCIS,volume 563)

Abstract

Ambiguous context-free grammars can generate many (even infinite) parse trees for each input sentence. We will refer to all these parse trees as the parse space of the sentence. Thus, in many settings (computational linguistics, education in compiler construction, etc.) the need for browsing this parse space (i.e., for examining different trees in a systematic and ordered way) arises. In this paper we describe a browsing approach that works for arbitrary (even infinitely ambiguous) grammars. The approach, which is based on the well-known Earley’s algorithm, sorts the parse space according to structural complexity of the parse trees, lets users inspect a particular tree, and then to jump to the previous and/or the next tree. This approach has been implemented in EvDebugger, an educational system for the learning of the attribute grammar formalism.

Keywords

  • Parsing
  • Earley algorithm
  • Parse trees
  • Grammar debugging technique

This is a preview of subscription content, access via your institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-319-27653-3_12
  • Chapter length: 12 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
USD   54.99
Price excludes VAT (USA)
  • ISBN: 978-3-319-27653-3
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   69.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.
Fig. 3.
Fig. 4.
Fig. 5.
Fig. 6.
Fig. 7.
Fig. 8.
Fig. 9.

Notes

  1. 1.

    In the Earley’s original work lookahead symbols were also added to items, although later on it was shown that it does not substantially affect to algorithm performance.

References

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

    Google Scholar 

  2. Almeida-Martınez, F.J., Urquiza-Fuentes, J., Velázquez-Iturbide, J.: Visualization of syntax trees for language processing courses. J. Univ. Comput. Sci. 15(7), 1546–1561 (2009)

    Google Scholar 

  3. Almeida-Martínez, F.J., Urquiza-Fuentes, J., Velázquez-Iturbide, J.Á. VAST: visualization of abstract syntax trees within language processors courses. In: Proceedings of the 4th ACM Symposium on Software Visualization, pp. 209–210. ACM. (2008)

    Google Scholar 

  4. Bar-Hillel, Y., Perles, M., Shamir, E.: On formal properties of simple phrase structure grammars. STUF-Lang. Typology Univ. 14(1–4), 143–172 (1961)

    MathSciNet  MATH  Google Scholar 

  5. Basten, H.J.: The usability of ambiguity detection methods for context-free grammars. Electron. Notes Theor. Comput. Sci. 238(5), 35–46 (2009)

    CrossRef  Google Scholar 

  6. Basten, H.J., Vinju, J.J.: Parse forest diagnostics with Dr. Ambiguity. In: Sloane, A., Aßmann, U. (eds.) SLE 2011. LNCS, vol. 6940, pp. 283–302. Springer, Heidelberg (2012)

    CrossRef  Google Scholar 

  7. Billot, S., Lang, B.: The structure of shared forests in ambiguous parsing. In: Proceedings of the 27th Annual Meeting on Association for Computational Linguistics, pp. 143–151. Association for Computational Linguistics (1989)

    Google Scholar 

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

    MathSciNet  CrossRef  MATH  Google Scholar 

  9. Clark, A., Fox, C., Lappin, S. (eds.): The Handbook of Computational Linguistics and Natural Language Processing. Wiley, Malden (2013)

    Google Scholar 

  10. Earley, J.: An efficient context-free parsing algorithm. Commun. ACM 13(2), 94–102 (1970)

    CrossRef  MATH  Google Scholar 

  11. Grune, D., Jacobs, C.: Parsing Techniques, a Practical Guide. Monographs in Computer Science, 2nd edn. Springer, New York (2007)

    Google Scholar 

  12. Kennedy, K., Ramanathan, J.: A Deterministic Attribute Grammar Evaluator Based on Dynamic Sequencing. ACM Trans. Program. Lang. Syst. 1(1), 142–160 (1979)

    CrossRef  MATH  Google Scholar 

  13. Rodriguez-Cerezo, D., Henriques, P.R., Sierra, J.L.: Attribute grammars made easier: EvDebugger a visual debugger for attribute grammars. In: 2014 International Symposium on Computers in Education (SIIE), pp. 23–28. IEEE (2014)

    Google Scholar 

  14. Scott, E.: SPPF-style parsing from earley recognisers. Electron. Notes Theor. Comput. Sci. 203(2), 53–67 (2008)

    CrossRef  Google Scholar 

  15. Scott, E., Johnstone, A.: Recognition is not parsing—SPPF-style parsing from cubic recognisers. Sci. Comput. Program. 75(1), 55–70 (2010)

    MathSciNet  CrossRef  MATH  Google Scholar 

  16. Sierra, J.L., Fernández-Pampillon, A.M., Fernández-Valmayor, A.: An environment for supporting active learning in courses on language processing. ACM SIGCSE Bull. 40(3), 128–132 (2008)

    CrossRef  Google Scholar 

  17. Tomita, M.: Efficient Parsing for Natural Language. Kluwer Academic, Boston (1986)

    CrossRef  Google Scholar 

  18. 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)

    CrossRef  Google Scholar 

Download references

Acknowledgements

This work has been partially supported by the BBVA Foundation (research grant HUM14_251), by the Spanish R&D&I Plan (research grant TIN2014-52010-R), by Santander-UCM GR3/14 (group number 962022) and by the grant EDU/3445/201.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to José-Luis Sierra .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Rodríguez-Cerezo, D., Sierra, JL. (2015). Browsing the Parse Space. In: Sierra-Rodríguez, JL., Leal, JP., Simões, A. (eds) Languages, Applications and Technologies. SLATE 2015. Communications in Computer and Information Science, vol 563. Springer, Cham. https://doi.org/10.1007/978-3-319-27653-3_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-27653-3_12

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-27652-6

  • Online ISBN: 978-3-319-27653-3

  • eBook Packages: Computer ScienceComputer Science (R0)