Skip to main content

A Functional-Logic Perspective of Parsing

  • Conference paper
Functional and Logic Programming (FLOPS 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1722))

Included in the following conference series:

Abstract

Parsing has been a traditional workbench for showing the virtues of declarative programming. Both logic and functional programming claim the ability of writing parsers in a natural and concise way. We address here the task from a functional-logic perspective. By modelling parsers as non-deterministic functions we achieve a very natural manner of building parsers, which combines the nicest properties of the functional and logic approaches. In particular, we are able to define parsers within our framework in a style very close to that of functional programming parsers, but using simpler concepts. Moreover, we have moved beyond usual declarative approaches to parsers, since the functional-logic parsers presented here can be considered as truly data values. As an example of this feature we define a function that detects ambiguous 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 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. Arenas-Sánchez, P., Hortalá-González, T., López-Fraguas, F.J., Ullán-Hernández, E.: Functional Logic programming with Real Numbers. In: Chakavrarty, M., Guo, Y., Ida, T. (eds.) Multiparadigm Logic Programming, Post-Conference Workshop of the JICLP 1996, TU Berlin Report 96-28, pp. 47–58 (1996)

    Google Scholar 

  2. Arenas-Sánchez, P., Rodríguez-Artalejo, M.: A Semantic Framework for Functional Logic Programming with Algebraic Polymorphic Types. In: Bidoit, M., Dauchet, M. (eds.) CAAP 1997, FASE 1997, and TAPSOFT 1997. LNCS, vol. 1214, pp. 453–464. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  3. Caballero-Roldán, R., López Fraguas, F.J., Sánchez-Hernández, J.: User’s Manual For TOY. Technical Report D.I.A. 57/97, Univ. Complutense de Madrid (1997), The system is, available at http://mozart.sip.ucm.es/incoming/toy.html

  4. Caballero-Roldán, R., López-Fraguas, F.J.: Functional-Logic Parsers in TOY. Technical Report S.I.P. 74/98. Univ. Complutense de Madrid (1998), Available at http://mozart.sip.ucm.es/papers/1998/trparser.ps.gz

  5. Caballero, R., López-Fraguas, F.J.: Extensions: A Technique for Structuring Functional-Logic Programs. In: PSI 1999. LNCS, Springer, Heidelberg (1999) (to appear)

    Google Scholar 

  6. Fokker, J.: Functional Parsers. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925. Springer, Heidelberg (1995)

    Google Scholar 

  7. González-Moreno, J.C., Hortalá-González, T., López-Fraguas, F.J., Rodríguez- Artalejo, M.: An Approach to Declarative Programming Based on a Rewriting Logic. Journal of Logic Programming 40(1), 47–87 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  8. González-Moreno, J.C., Hortalá-González, T., Rodríguez-Artalejo, M.: A Higher Order Rewriting Logic for Functional Logic Programming. In: Procs. of ICLP 1997, pp. 153–167. The MIT Press, Cambridge (1997)

    Google Scholar 

  9. González-Moreno, J.C.: A Correctness Proof for Warren’s HO into FO Translation. In: Procs. of GULP 1993, pp. 569–585 (1993)

    Google Scholar 

  10. Hanus, M.: The Integration of Functions into Logic Programming: A Survey. J. of Logic Programming, 19–20; Special issue Ten Years of Logic Programming, 583–628 (1994)

    Google Scholar 

  11. Hanus, M. (ed.): Curry, an Integrated Functional Logic Language, Draft (1998)

    Google Scholar 

  12. Jones, S.P., Hughes, J.(eds.): Report on the Programming Language Haskell 1998: a Non-strict, Purely Functional Language. (February 1999)

    Google Scholar 

  13. Hutton, G.: Higher-Order Functions for Parsing. J. of Functional Programming 2(3), 323–343 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  14. Hutton, G., Meijer, E.: Functional Pearls. Monadic Parsing in Haskell. Journal of Functional Programming 8(4), 437–444 (1998)

    Article  MATH  Google Scholar 

  15. Leermakers, R.: The Functional Treatment of Parsing. Kluwer Academic Publishers, Dordrecht (1993)

    MATH  Google Scholar 

  16. Loogen, R., López-Fraguas, F.J., Rodríguez-Artalejo, M.: A Demand Driven Computation Strategy for Lazy Narrowing. In: Penjam, J., Bruynooghe, M. (eds.) PLILP 1993. LNCS, vol. 714, pp. 184–200. Springer, Heidelberg (1993)

    Google Scholar 

  17. López-Fraguas, F.J., Sánchez-Hérnandez, J.: TOY: A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  18. Meijer, E., Jeuring, J.: Merging Monads and Folds for Functional Programming. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 228–266. Springer, Heidelberg (1995)

    Google Scholar 

  19. Sterling, L., Shapiro, E.: The Art of Prolog. MIT Press, Cambridge (1986)

    MATH  Google Scholar 

  20. Wadler, P.: Monads for functional programming. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925. Springer, Heidelberg (1995)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Caballero, R., López-Fraguas, F.J. (1999). A Functional-Logic Perspective of Parsing. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_6

Download citation

  • DOI: https://doi.org/10.1007/10705424_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66677-6

  • Online ISBN: 978-3-540-47950-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics