Skip to main content

From Functional Logic Programs to Purely Functional Programs Preserving Laziness

  • Conference paper
Implementation and Application of Functional Languages (IFL 2008)

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

Included in the following conference series:

Abstract

Functional logic languages extend the setting of functional programming by non-deterministic choices, free variables and narrowing.

Most existing approaches to simulate logic features in functional languages do not preserve laziness, i.e., they can only model strict logic programming like in Prolog. Lazy functional logic programming however, has interesting properties supporting a more declarative style of programming search without sacrificing efficiency.

We will present a recently developed technique to reduce all logic extensions to the single problem of generating unique identifiers. The impact of this reduction is a general scheme for compiling functional logic programs to lazy functional programs without side effects.

One of the design goals is that the purely functional parts of a program should not suffer from significant run-time overhead. Preliminary experiments confirm our hope for significant improvements of run-time performance even for non-deterministic programs but suggest further work to improve the memory requirements of those.

This work has been partially supported by the German Research Council (DFG) under grant Ha 2457/5-1.

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 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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. Antoy, S.: Evaluation strategies for functional logic programming. Journal of Symbolic Computation 40(1), 875–903 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  2. Antoy, S., Hanus, M.: Compiling multi-paradigm declarative programs into Prolog. In: Kirchner, H. (ed.) FroCos 2000. LNCS, vol. 1794, pp. 171–185. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  3. Antoy, S., Hanus, M.: Functional logic design patterns. In: Hu, Z., Rodríguez-Artalejo, M. (eds.) FLOPS 2002. LNCS, vol. 2441, pp. 67–87. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  4. Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  5. Antoy, S., Hanus, M., Liu, J., Tolmach, A.: A virtual machine for functional logic computations. In: Grelck, C., Huch, F., Michaelson, G.J., Trinder, P. (eds.) IFL 2004. LNCS, vol. 3474, pp. 108–125. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  6. Augustsson, L., Rittri, M., Synek, D.: On generating unique names. Journal of Functional Programming 4(1), 117–123 (1994)

    Article  Google Scholar 

  7. Braßel, B., Huch, F.: The Kiel Curry system KiCS. In: Seipel, D., Hanus, M., Wolf, A. (eds.) INAP 2007. LNCS, vol. 5437, pp. 215–223. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  8. Braßel, B., Huch, F.: On a Tighter Integration of Functional and Logic Programming. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 122–138. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  9. Christiansen, J., Fischer, S.: EasyCheck — test data for free. In: Garrigue, J., Hermenegildo, M.V. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 322–336. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  10. Claessen, K., Hughes, J.: QuickCheck: A lightweight tool for random testing of Haskell programs. In: ICFP 2000: Proceedings of the ACM Internatioal Conference on Functional Programming, pp. 268–279. ACM, New York (2000)

    Google Scholar 

  11. Fernández, A.J., Hortalá-González, M.T., Sáenz-Pérez, F., del Vado-Vírseda, R.: Constraint functional logic programming over finite domains. Theory and Practice of Logic Programming (2007) (to appear)

    Google Scholar 

  12. Fischer, S., Kuchen, H.: Data-flow testing of declarative programs. In: Proc. of the 13th ACM SIGPLAN International Conference on Functional Programming (ICFP 2008), pp. 201–212. ACM Press, New York (2008)

    Google Scholar 

  13. Hanus, M.: A unified computation model for functional and logic programming. In: Proc. of the 24th ACM Symposium on Principles of Programming Languages, Paris, pp. 80–93 (1997)

    Google Scholar 

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

  15. Hanus, M., Antoy, S., Braßel, B., Engelke, M., Höppner, K., Koj, J., Niederau, P., Sadre, R., Steiner, F.: PAKCS: The Portland Aachen Kiel Curry System (2007), http://www.informatik.uni-kiel.de/~pakcs/

  16. Hanus, M., Réty, P.: Demand-driven search in functional logic programs. Research report rr-lifo-98-08, Univ. Orléans (1998)

    Google Scholar 

  17. Hanus, M., Sadre, R.: An abstract machine for curry and its concurrent implementation in java. Journal of Functional and Logic Programming 1999(6) (1999)

    Google Scholar 

  18. Hanus, M. (ed.): Curry: An integrated functional logic language (vers. 0.8.2) (2006), http://www.curry-language.org

  19. Hinze, R.: Deriving backtracking monad transformers. In: Wadler, P. (ed.) Proceedings of the 2000 International Conference on Functional Programming, Montreal, Canada, September 18-20, pp. 186–197 (2000)

    Google Scholar 

  20. Kiselyov, O.: Simple fair and terminating backtracking monad transformer (October 2005), http://okmij.org/ftp/Computation/monads.html#fair-bt-stream

  21. Lloyd, J.W.: Declarative programming in escher. Technical report cstr-95-013, University of Bristol (1995)

    Google Scholar 

  22. López-Fraguas, F., Sánchez-Hernández, 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 

  23. Lux, W., Kuchen, H.: An efficient abstract machine for curry. In: Beiersdörfer, K., Engels, G., Schäfer, W. (eds.) Informatik 1999 — Annual Meeting of the German Computer Science Society (GI), pp. 390–399. Springer, Heidelberg (1999)

    Google Scholar 

  24. Naylor, M., Axelsson, E., Runciman, C.: A functional-logic library for wired. In: Haskell 2007: Proceedings of the ACM SIGPLAN Workshop on Haskell Workshop, pp. 37–48. ACM, New York (2007)

    Chapter  Google Scholar 

  25. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  26. Plasmeijer, R., van Eekelen, M.: Clean language report version 2.0 (2002), http://clean.cs.ru.nl/CleanExtra/report20/

  27. Runciman, C., Naylor, M., Lindblad, F.: SmallCheck and Lazy SmallCheck: Automatic exhaustive testing for small values. In: Haskell 2008: Proceedings of the First ACM SIGPLAN Symposium on Haskell, pp. 37–48. ACM, New York (2008)

    Chapter  Google Scholar 

  28. Wadler, P.: How to replace failure by a list of successes. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 113–128. Springer, Heidelberg (1985)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Braßel, B., Fischer, S. (2011). From Functional Logic Programs to Purely Functional Programs Preserving Laziness. In: Scholz, SB., Chitil, O. (eds) Implementation and Application of Functional Languages. IFL 2008. Lecture Notes in Computer Science, vol 5836. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24452-0_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-24452-0_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-24451-3

  • Online ISBN: 978-3-642-24452-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics