Abstract
Contextual hyperedge replacement (CHR) strengthens the generative power of hyperedge replacement (HR) significantly, thus increasing its usefulness for practical modeling. We define top-down parsing for CHR grammars by graph transformation, and prove that it is correct as long as the generation and use of context nodes in productions does not create cyclic dependencies. An efficient predictive version of this algorithm can be obtained as in the case of HR grammars.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Note that, while t is a derivation tree over the borrowing HR grammar \({\hat{\varGamma }}\), the ordering of right-hand sides of productions in \({\hat{\varGamma }}\) ignores edges that are labeled with and \(\circledcirc \), so that it is the same as in \(\varGamma \) and provides the required edge ordering.
- 2.
The mentioned CHR grammars can be downloaded at www.unibw.de/inf2/grappa. The graph parser distiller grappa developed by Mark Minas, generates PTD parsers that run in quadratic time, and often even in linear time [6]. The website also contains specifications of the PTD parser for linked trees with the AGG system [11] along the lines of Example 5.
References
Chiang, D., Andreas, J., Bauer, D., Hermann, K.M., Jones, B., Knight, K.: Parsing graphs with hyperedge replacement grammars. In: Proceedings of 51st Annual Meeting of the Association for Computational Linguistics (vol. 1: Long Papers), Sofia, Bulgaria, pp. 924–932. Association for Computational Linguistics, August 2013
Courcelle, B.: The monadic second-order logic of graphs V: on closing the gap between definability and recognizability. Theoret. Comput. Sci. 80, 153–202 (1991)
Drewes, F., Habel, A., Kreowski, H.J.: Hyperedge replacement graph grammars. In: Rozenberg [20], chapter. 2, pp. 95–162
Drewes, F., Hoffmann, B.: Contextual hyperedge replacement. Acta Informatica 52(6), 497–524 (2015). https://doi.org/10.1007/s00236-015-0223-4
Drewes, F., Hoffmann, B., Minas, M.: Contextual hyperedge replacement. In: Schürr, A., Varró, D., Varró, G. (eds.) AGTIVE 2011. LNCS, vol. 7233, pp. 182–197. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-34176-2_16
Drewes, F., Hoffmann, B., Minas, M.: Predictive top-down parsing for hyperedge replacement grammars. In: Parisi-Presicce, F., Westfechtel, B. (eds.) ICGT 2015. LNCS, vol. 9151, pp. 19–34. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21145-9_2
Drewes, F., Hoffmann, B., Minas, M.: Formalization and correctness of predictive shift-reduce parsers for graph grammars based on hyperedge replacement. J. Log. Algebraic Methods Program. (JLAMP) 104, 303–341 (2019). https://doi.org/10.1016/j.jlamp.2018.12.006
Drewes, F., Hoffmann, B., Minas, M.: Graph parsing as graph transformation. In: Gadducci, F., Kehrer, T. (eds.) ICGT 2020. LNCS, vol. 12150, pp. 221–238. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-51372-6_13
Ehrig, H., Ehrig, K., Prange, U., Taentzer, G.: Fundamentals of Algebraic Graph Transformation. MTCSAES, Springer, Heidelberg (2006). https://doi.org/10.1007/3-540-31188-2
Engelfriet, J., Rozenberg, G.: Node replacement graph grammars. In: Rozenberg [20], chapter. 1, pp. 1–94
Ermel, C., Rudolf, M., Gabriele, T.: The AGG approach: language and environment. In: Engels, G., Ehrig, H., Kreowski, H.J., Rozenberg, G. (eds.) Handbook of Graph Grammars and Computing by Graph Transformation, Vol. II: Applications, Languages, and Tools, pp. 551–603. World Scientific, Singapore (1999)
Gilroy, S., Lopez, A., Maneth, S.: Parsing graphs with regular graph grammars. In: Proceedings of the 6th Joint Conference on Lexical and Computational Semantics (*SEM 2017), Vancouver, Canada, pp. 199–208. Association for Computational Linguistics, August 2017. https://doi.org/10.18653/v1/S17-1024
Habel, A.: Hyperedge Replacement: Grammars and Languages. LNCS, vol. 643. Springer, Heidelberg (1992). https://doi.org/10.1007/BFb0013875
Habel, A., Pennemann, K.H.: Correctness of high-level transformation systems relative to nested conditions. Math. Struct. Comput. Sci. 19(2), 245–296 (2009)
Kaul, M.: Practical applications of precedence graph grammars. In: Ehrig, H., Nagl, M., Rozenberg, G., Rosenfeld, A. (eds.) Graph Grammars 1986. LNCS, vol. 291, pp. 326–342. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-18771-5_62
Lange, K.J., Welzl, E.: String grammars with disconnecting or a basic root of the difficulty in graph grammar parsing. Discret. Appl. Math. 16, 17–30 (1987)
Lautemann, C.: The complexity of graph languages generated by hyperedge replacement. Acta Informatica 27, 399–421 (1990)
Minas, M.: Diagram editing with hypergraph parser support. In: Proceedings of 1997 IEEE Symposium on Visual Languages (VL 1997), Capri, Italy, pp. 226–233. IEEE Computer Society Press (1997)
Pavlidis, T.: Linear and context-free graph grammars. J. ACM 19(1), 11–22 (1972). https://doi.org/10.1145/321679.321682
Rozenberg, G. (ed.): Handbook of Graph Grammars and Computing by Graph Transformation, Vol. I: Foundations. World Scientific, Singapore (1997)
Acknowledgments
We thank Annegret Habel, Verone Stillger, and the anonymous reviewers for their advice.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Drewes, F., Hoffmann, B., Minas, M. (2021). Rule-Based Top-Down Parsing for Acyclic Contextual Hyperedge Replacement Grammars. In: Gadducci, F., Kehrer, T. (eds) Graph Transformation. ICGT 2021. Lecture Notes in Computer Science(), vol 12741. Springer, Cham. https://doi.org/10.1007/978-3-030-78946-6_9
Download citation
DOI: https://doi.org/10.1007/978-3-030-78946-6_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-78945-9
Online ISBN: 978-3-030-78946-6
eBook Packages: Computer ScienceComputer Science (R0)