Skip to main content

KiCS2: A New Compiler from Curry to Haskell

  • Conference paper
Book cover Functional and Constraint Logic Programming (WFLP 2011)

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

Included in the following conference series:

Abstract

In this paper we present our first steps towards a new system to compile functional logic programs of the source language Curry into purely functional Haskell programs. Our implementation is based on the idea to represent non-deterministic results as values of the data types corresponding to the results. This enables the application of various search strategies to extract values from the search space. We show by several benchmarks that our implementation can compete with or outperform other existing implementations of Curry.

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. Albert, E., Hanus, M., Huch, F., Oliver, J., Vidal, G.: Operational semantics for declarative multi-paradigm languages. Journal of Symbolic Computation 40(1), 795–829 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  2. Alqaddoumi, A., Antoy, S., Fischer, S., Reck, F.: The pull-tab transformation. In: Proc. of the Third International Workshop on Graph Computation Models, pp. 127–132. Enschede, The Netherlands (2010), http://gcm-events.org/gcm2010/pages/gcm2010-preproceedings.pdf

  3. Antoy, S.: Constructor-based conditional narrowing. In: Proc. of the 3rd International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP 2001), pp. 199–206. ACM Press, New York (2001)

    Google Scholar 

  4. Antoy, S.: On the correctness of the pull-tab transformation. In: To Appear in Proceedings of the 27th International Conference on Logic Programming, ICLP 2011 (2011)

    Google Scholar 

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

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

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

  8. Antoy, S., Hanus, M.: Functional logic programming. Communications of the ACM 53(4), 74–85 (2010)

    Article  Google Scholar 

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

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

    Article  Google Scholar 

  11. Braßel, B.: Implementing Functional Logic Programs by Translation into Purely Functional Programs. PhD thesis, Christian-Albrechts-Universität zu Kiel (2011)

    Google Scholar 

  12. Braßel, B., Fischer, S.: From functional logic programs to purely functional programs preserving laziness. In: Pre-Proceedings of the 20th Workshop on Implementation and Application of Functional Languages, IFL 2008 (2008)

    Google Scholar 

  13. Braßel, B., Fischer, S., Hanus, M., Reck, F.: Transforming functional logic programs into monadic functional programs. In: Mariño, J. (ed.) WFLP 2010. LNCS, vol. 6559, pp. 30–47. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  14. Braßel, B., Hanus, M., Müller, M.: High-level database programming in curry. In: Hudak, P., Warren, D.S. (eds.) PADL 2008. LNCS, vol. 4902, pp. 316–332. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

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

  16. Braßel, B., Huch, F.: The kiel curry system kiCS. In: Seipel, D., Hanus, M., Wolf, A. (eds.) INAP 2007. LNCS(LNAI), vol. 5437, pp. 195–205. Springer, Heidelberg (2009)

    Google Scholar 

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

  18. Fischer, S.: A functional logic database library. In: Proc. of the ACM SIGPLAN 2005 Workshop on Curry and Functional Logic Programming (WCFLP 2005), pp. 54–59. ACM Press, New York (2005)

    Chapter  Google Scholar 

  19. Fischer, S., Kiselyov, O., Shan, C.: Purely functional lazy non-deterministic programming. In: Proceeding of the 14th ACM SIGPLAN International Conference on Functional Programming (ICFP 2009), pp. 11–22. ACM, New York (2009)

    Chapter  Google Scholar 

  20. González-Moreno, J.C., Hortalá-González, M.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, 47–87 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  21. Hanus, M.: A functional logic programming approach to graphical user interfaces. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, pp. 47–62. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  22. Hanus, M.: High-level server side web scripting in curry. In: Ramakrishnan, I.V. (ed.) PADL 2001. LNCS, vol. 1990, pp. 76–92. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  23. Hanus, M.: Type-oriented construction of web user interfaces. In: Proceedings of the 8th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2006), pp. 27–38. ACM Press, New York (2006)

    Google Scholar 

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

  25. 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 (2010), http://www.informatik.uni-kiel.de/~pakcs/

  26. Hanus, M., Koschnicke, S.: An ER-based framework for declarative web programming. In: Carro, M., Peña, R. (eds.) PADL 2010. LNCS, vol. 5937, pp. 201–216. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

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

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

  29. Hussmann, H.: Nondeterministic algebraic specifications and nonconfluent term rewriting. Journal of Logic Programming 12, 237–255 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  30. Fraguas, F.J.L., Hernández, J.S.: 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 

  31. López-Fraguas, F.J., Rodríguez-Hortalá, J., Sánchez-Hernández, J.: A simple rewrite notion for call-time choice semantics. In: Proceedings of the 9th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2007), pp. 197–208. ACM Press, New York (2007)

    Google Scholar 

  32. Lux, W.: Implementing encapsulated search for a lazy functional logic language. In: Middeldorp, A. (ed.) FLOPS 1999. LNCS, vol. 1722, pp. 100–113. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  33. Moreno-Navarro, J.J., Kuchen, H., Loogen, R., Rodríguez-Artalejo, M.: Lazy narrowing in a graph machine. In: Kirchner, H., Wechler, W. (eds.) ALP 1990. LNCS, vol. 463, pp. 298–317. Springer, Heidelberg (1990)

    Chapter  Google Scholar 

  34. Partain, W.: The nofib benchmark suite of Haskell programs. In: Proceedings of the 1992 Glasgow Workshop on Functional Programming, pp. 195–202. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

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

    MATH  Google Scholar 

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

  37. Zartmann, F.: Denotational Abstract Interpretation of Functional Logic Programs. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, pp. 141–156. Springer, Heidelberg (1997)

    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., Hanus, M., Peemöller, B., Reck, F. (2011). KiCS2: A New Compiler from Curry to Haskell. In: Kuchen, H. (eds) Functional and Constraint Logic Programming. WFLP 2011. Lecture Notes in Computer Science, vol 6816. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22531-4_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22531-4_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22530-7

  • Online ISBN: 978-3-642-22531-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics