Skip to main content

Generalized Predictive Shift-Reduce Parsing for Hyperedge Replacement Graph Grammars

  • Conference paper
  • First Online:
Language and Automata Theory and Applications (LATA 2019)

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

Abstract

Parsing for graph grammars based on hyperedge replacement (HR) is in general NP-hard, even for a particular grammar. The recently developed predictive shift-reduce (PSR) parsing is efficient, but restricted to a subclass of unambiguous HR grammars. We have implemented a generalized PSR parsing algorithm that applies to all HR grammars, and pursues severals parses in parallel whenever decision conflicts occur. We compare GPSR parsers with the Cocke-Younger-Kasami parser and show that a GPSR parser, despite its exponential worst-case complexity, can be much faster.

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

Similar content being viewed by others

Notes

  1. 1.

    In the graph parser generator Grappa, available at www.unibw.de/inf2/grappa.

  2. 2.

    \(V_{\!\gamma }\) may contain isolated nodes that are not attached to any edge in \(\gamma \).

  3. 3.

    I.e., a match \(\mu \) makes sure that the nodes of \(\alpha ^\mu \) that do not occur in \(\bar{A} = A^\mu \) do not collide with the other nodes in \(\gamma \).

  4. 4.

    We silently assume that input graphs do not have isolated nodes. This is no real restriction as one can add special edges to such nodes.

  5. 5.

    Actually, series-parallel graphs do also have a unique sink (without outgoing edges), which could be used as a second start node bound to y. However, this variation of the grammar would exhibit less peculiarities of the GPSR parser.

  6. 6.

    This property can be determined by the parser generator as well. However, it does not hold for the grammar of series-parallel graphs.

  7. 7.

    Homepage: www.unibw.de/inf2/diagen.

References

  1. Chiang, D., Andreas, J., Bauer, D., Hermann, K.M., Jones, B., Knight, K.: Parsing graphs with hyperedge replacement grammars. In: Proceedings of the 51st Annual Meeting Association for Computational Linguistics, vol. 1, pp. 924–932 (2013)

    Google Scholar 

  2. Drewes, F., Hoffmann, B.: Contextual hyperedge replacement. Acta Inf. 52, 497–524 (2015)

    Article  MathSciNet  Google Scholar 

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

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

  5. Drewes, F., Hoffmann, B., Minas, M.: Approximating Parikh images for generating deterministic graph parsers. In: Milazzo, P., Varró, D., Wimmer, M. (eds.) STAF 2016. LNCS, vol. 9946, pp. 112–128. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-50230-4_9

    Chapter  Google Scholar 

  6. Drewes, F., Hoffmann, B., Minas, M.: Formalization and correctness of predictive shift-reduce parsers for graph grammars based on hyperedge replacement. J. Log. Algebr. Meth. Program. (2018). https://doi.org/10.1016/j.jlamp.2018.12.006. https://arxiv.org/abs/1812.11927

  7. Groschwitz, J., Koller, A., Teichmann, C.: Graph parsing with s-graph grammars. In: Proceedings of the 53rd Annual Meeting Association for Computational Linguistics, ACL 2015, Volume 1: Long Papers, pp. 1481–1490. The Association for Computer Linguistics (2015)

    Google Scholar 

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

    Book  MATH  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  11. Minas, M.: Concepts and realization of a diagram editor generator based on hypergraph transformation. Sci. Comput. Program. 44(2), 157–180 (2002)

    Article  Google Scholar 

  12. Tomita, M.: An efficient context-free parsing algorithm for natural languages. In: Proceedings of the 9th International Joint Conference on Artificial Intelligence, pp. 756–764. Morgan Kaufmann (1985)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mark Minas .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hoffmann, B., Minas, M. (2019). Generalized Predictive Shift-Reduce Parsing for Hyperedge Replacement Graph Grammars. In: Martín-Vide, C., Okhotin, A., Shapira, D. (eds) Language and Automata Theory and Applications. LATA 2019. Lecture Notes in Computer Science(), vol 11417. Springer, Cham. https://doi.org/10.1007/978-3-030-13435-8_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-13435-8_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-13434-1

  • Online ISBN: 978-3-030-13435-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics