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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 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
Aho, A.V., Ullman, J.D.: The Theory of Parsing, Translation, and Compiling, vol I: Parsing. Prentice-Hall, Inc, Englewood Cliffs (1972)
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)
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)
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)
Basten, H.J.: The usability of ambiguity detection methods for context-free grammars. Electron. Notes Theor. Comput. Sci. 238(5), 35–46 (2009)
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)
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)
Brabrand, C., Giegerich, R., Møller, A.: Analyzing ambiguity of context-free grammars. Sci. Comput. Program. 75(3), 176–191 (2010)
Clark, A., Fox, C., Lappin, S. (eds.): The Handbook of Computational Linguistics and Natural Language Processing. Wiley, Malden (2013)
Earley, J.: An efficient context-free parsing algorithm. Commun. ACM 13(2), 94–102 (1970)
Grune, D., Jacobs, C.: Parsing Techniques, a Practical Guide. Monographs in Computer Science, 2nd edn. Springer, New York (2007)
Kennedy, K., Ramanathan, J.: A Deterministic Attribute Grammar Evaluator Based on Dynamic Sequencing. ACM Trans. Program. Lang. Syst. 1(1), 142–160 (1979)
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)
Scott, E.: SPPF-style parsing from earley recognisers. Electron. Notes Theor. Comput. Sci. 203(2), 53–67 (2008)
Scott, E., Johnstone, A.: Recognition is not parsing—SPPF-style parsing from cubic recognisers. Sci. Comput. Program. 75(1), 55–70 (2010)
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)
Tomita, M.: Efficient Parsing for Natural Language. Kluwer Academic, Boston (1986)
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)
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
Corresponding author
Editor information
Editors and Affiliations
Rights 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)