Skip to main content

Rule-Based Top-Down Parsing for Acyclic Contextual Hyperedge Replacement Grammars

  • Conference paper
  • First Online:
Book cover Graph Transformation (ICGT 2021)

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.

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

Notes

  1. 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. 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

  1. 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

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  3. Drewes, F., Habel, A., Kreowski, H.J.: Hyperedge replacement graph grammars. In: Rozenberg [20], chapter. 2, pp. 95–162

    Google Scholar 

  4. Drewes, F., Hoffmann, B.: Contextual hyperedge replacement. Acta Informatica 52(6), 497–524 (2015). https://doi.org/10.1007/s00236-015-0223-4

    Article  MathSciNet  MATH  Google Scholar 

  5. 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

    Chapter  Google Scholar 

  6. 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

    Chapter  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  8. 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

    Chapter  Google Scholar 

  9. 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

    Book  MATH  Google Scholar 

  10. Engelfriet, J., Rozenberg, G.: Node replacement graph grammars. In: Rozenberg [20], chapter. 1, pp. 1–94

    Google Scholar 

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

    Google Scholar 

  12. 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

  13. Habel, A.: Hyperedge Replacement: Grammars and Languages. LNCS, vol. 643. Springer, Heidelberg (1992). https://doi.org/10.1007/BFb0013875

    Book  MATH  Google Scholar 

  14. Habel, A., Pennemann, K.H.: Correctness of high-level transformation systems relative to nested conditions. Math. Struct. Comput. Sci. 19(2), 245–296 (2009)

    Article  MathSciNet  Google Scholar 

  15. 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

    Chapter  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  17. Lautemann, C.: The complexity of graph languages generated by hyperedge replacement. Acta Informatica 27, 399–421 (1990)

    Article  MathSciNet  Google Scholar 

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

    Google Scholar 

  19. Pavlidis, T.: Linear and context-free graph grammars. J. ACM 19(1), 11–22 (1972). https://doi.org/10.1145/321679.321682

    Article  MathSciNet  MATH  Google Scholar 

  20. Rozenberg, G. (ed.): Handbook of Graph Grammars and Computing by Graph Transformation, Vol. I: Foundations. World Scientific, Singapore (1997)

    Google Scholar 

Download references

Acknowledgments

We thank Annegret Habel, Verone Stillger, and the anonymous reviewers for their advice.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Berthold Hoffmann .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics