Skip to main content

Functional-Logic Graph Parser Combinators

  • Conference paper
Rewriting Techniques and Applications (RTA 2008)

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

Included in the following conference series:

Abstract

Parser combinators are a popular technique among functional programmers for writing parsers. They allow the definition of parsers for string languages in a manner quite similar to BNF rules. In recent papers we have shown that the combinator approach is also beneficial for graph parsing. However, we have noted as well that certain graph languages are difficult to describe in a purely functional way.

In this paper we demonstrate that functional-logic languages can be used to conveniently implement graph parsers. Therefore, we provide a direct mapping from hyperedge replacement grammars to graph parsers. As in the string setting, our combinators closely reflect the building blocks of this grammar formalism. Finally, we show by example that our framework is strictly more powerful than hyperedge replacement grammars.

We make heavy use of key features of both the functional and the logic programming approach: Higher-order functions allow the treatment of parsers as first class citizens. Non-determinism and logical variables are beneficial for dealing with errors and incomplete information. Parsers can even be applied backwards and thus be used as generators or for graph completion.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Hutton, G.: Higher-order functions for parsing. Journal of Functional Programming 2(3), 323–343 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  2. Fokker, J.: Functional parsers. In: Advanced Functional Programming, First Intl. Spring School on Advanced Functional Programming Techniques-Tutorial Text, London, UK, pp. 1–23. Springer, Heidelberg (1995)

    Google Scholar 

  3. Mazanek, S., Minas, M.: Graph parser combinators. In: Proc. of 19th Intl. Symp. on the Impl. and Appl. of Functional Languages. Springer, Heidelberg (2008)

    Google Scholar 

  4. Mazanek, S., Minas, M.: Parsing of hyperedge replacement grammars with graph parser combinators. In: Proc. of 7th Intl. Workshop on Graph Transf. and Visual Modeling Techniques. Electronic Communications of the EASST (to appear, 2008)

    Google Scholar 

  5. Minas, M.: Concepts and realization of a diagram editor generator based on hypergraph transformation. Science of Computer Programming 44(2), 157–180 (2002)

    Article  MATH  Google Scholar 

  6. Drewes, F., Habel, A., Kreowski, H.J.: Hyperedge replacement graph grammars. In: Rozenberg, G. (ed.) Handbook of Graph Grammars and Computing by Graph Transformation. Foundations, vol. I, pp. 95–162. World Scientific, Singapore (1997)

    Google Scholar 

  7. Tanaka, T.: Definite-clause set grammars: a formalism for problem solving. J. Log. Program. 10(1), 1–17 (1991)

    Article  Google Scholar 

  8. Hanus, M.: Multi-paradigm declarative languages. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 45–75. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  9. Caballero, R., López-Fraguas, F.J.: A functional-logic perspective of parsing. In: Middeldorp, A. (ed.) FLOPS 1999. LNCS, vol. 1722, pp. 85–99. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  11. Antoy, S., Echahed, R., Hanus, M.: A needed narrowing strategy. J. ACM 47(4), 776–822 (2000)

    Article  MathSciNet  Google Scholar 

  12. Swierstra, S.D., Azero Alcocer, P.R.: Fast, error correcting parser combinators: a short tutorial. In: Pavelka, J., Tel, G., Bartosek, M. (eds.) SOFSEM 1999. LNCS, vol. 1725, pp. 111–129. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  13. Antoy, S., Hanus, M.: Functional logic design patterns. In: Proc. of the 6th Intl. Symposium on Functional and Logic Programming. LNCS, vol. 2441, pp. 67–87. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  14. Hutton, G., Meijer, E.: Monadic parser combinators. Technical Report NOTTCS-TR-96-4, Department of Computer Science, University of Nottingham (1996)

    Google Scholar 

  15. Seifert, S., Fischer, I.: Parsing string generating hypergraph grammars. In: Ehrig, H., Engels, G., Parisi-Presicce, F., Rozenberg, G. (eds.) ICGT 2004. LNCS, vol. 3256, pp. 352–367. Springer, Heidelberg (2004)

    Google Scholar 

  16. Habel, A., Kreowski, H.J.: Pretty patterns produced by hyperedge replacement. In: Göttler, H., Schneider, H.-J. (eds.) WG 1987. LNCS, vol. 314, pp. 32–45. Springer, Heidelberg (1988)

    Google Scholar 

  17. Taentzer, G., et al.: Generation of sierpinski triangles: A case study for graph transformation tools. In: Proc. of AGTIVE 2007. LNCS. Springer, Heidelberg (2008)

    Google Scholar 

  18. Girard, J.Y.: Linear logic. Theoretical Computer Science 50, 1–102 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  19. Bottoni, P., Meyer, B., Marriott, K., Parisi-Presicce, F.: Deductive parsing of visual languages. In: Proc. of the 4th Intl. Conference on Logical Aspects of Computational Linguistics, London, UK, pp. 79–94. Springer, Heidelberg (2001)

    Google Scholar 

  20. Hodas, J.S., Miller, D.: Logic programming in a fragment of intuitionistic linear logic. Inf. Comput. 110(2), 327–365 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  21. Costagliola, G., Lucia, A.D., Orefice, S., Tortora, G.: A parsing methodology for the implementation of visual systems. IEEE Trans. Softw. Eng. 23(12), 777–799 (1997)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Andrei Voronkov

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mazanek, S., Minas, M. (2008). Functional-Logic Graph Parser Combinators. In: Voronkov, A. (eds) Rewriting Techniques and Applications. RTA 2008. Lecture Notes in Computer Science, vol 5117. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-70590-1_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-70590-1_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-70588-8

  • Online ISBN: 978-3-540-70590-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics