Skip to main content

A Syntactic Approach to Combining Functional Notation, Lazy Evaluation, and Higher-Order in LP Systems

  • Conference paper
Functional and Logic Programming (FLOPS 2006)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3945))

Included in the following conference series:

Abstract

Nondeterminism and partially instantiated data structures give logic programming expressive power beyond that of functional programming. However, functional programming often provides convenient syntactic features, such as having a designated implicit output argument, which allow function call nesting and sometimes results in more compact code. Functional programming also sometimes allows a more direct encoding of lazy evaluation, with its ability to deal with infinite data structures. We present a syntactic functional extension, used in the Ciao system, which can be implemented in ISO-standard Prolog systems and covers function application, predefined evaluable functors, functional definitions, quoting, and lazy evaluation. The extension is also composable with higher-order features and can be combined with other extensions to ISO-Prolog such as constraints. We also highlight the features of the Ciao system which help implementation and present some data on the overhead of using lazy evaluation with respect to eager evaluation.

M. Hermenegildo and A. Casas are supported in part by the Prince of Asturias Chair in Information Science and Technology at UNM. This work is also funded in part by projects EC FET IST-2001-38059 ASAP, and Spanish MEC TIC 2002-0055 CUBICO, TIN-2005-09207-C03-01 MERIT, and CAM S-0505/TIC/0407 PROMESAS. The authors also thank the anonymous referees for their useful comments.

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. Narain, S.: Lazy evaluation in logic programming. In: Proc. 1990 Int. Conference on Computer Languages, pp. 218–227 (1990)

    Google Scholar 

  2. Antoy, S.: Lazy evaluation in logic. In: Małuszyński, J., Wirsing, M. (eds.) PLILP 1991. LNCS, vol. 528, pp. 371–382. Springer, Heidelberg (1991)

    Chapter  Google Scholar 

  3. Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-García, P., Puebla, G. (eds.): The Ciao System. Reference Manual (v1.10). The ciao system documentation series–TR, School of Computer Science, Technical University of Madrid (UPM). System and on-line version of the manual (2004), http://clip.dia.fi.upm.es/Software/Ciao/

  4. Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-García, P., Puebla, G.: The Ciao Prolog System. Reference Manual. The Ciao System Documentation Series–TR CLIP3/97.1, School of Computer Science, Technical University of Madrid, UPM (1997) System and on-line version of the manual, http://clip.dia.fi.upm.es/Software/Ciao/

  5. Cabeza, D., Hermenegildo, M.: A New Module System for Prolog. In: Palamidessi, C., Moniz Pereira, L., Lloyd, J.W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 131–148. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  6. Deransart, P., Ed-Dbali, A., Cervoni, L.: Prolog: The Standard. Springer, Heidelberg (1996)

    Book  MATH  Google Scholar 

  7. O’Keefe, R.: The Craft of Prolog. MIT Press, Cambridge (1990)

    Google Scholar 

  8. Puebla, G., Bueno, F., Hermenegildo, M.: An Assertion Language for Constraint Logic Programs. In: Deransart, P., Hermenegildo, M., Maluszynski, J. (eds.) DiSCiPl 1999. LNCS, vol. 1870, pp. 23–61. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  9. Hermenegildo, M.V., Puebla, G., Bueno, F., López-García, P.: Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58, 115–140 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  10. Cabeza, D., Hermenegildo, M.: Higher-order Logic Programming in Ciao. Technical Report CLIP7/99.0, Facultad de Informática, UPM (1999)

    Google Scholar 

  11. Cabeza, D.: An Extensible, Global Analysis Friendly Logic Programming System. PhD thesis, Universidad Politécnica de Madrid (UPM), Facultad Informatica UPM, 28660-Boadilla del Monte, Madrid-Spain (2004)

    Google Scholar 

  12. Cabeza, D., Hermenegildo, M., Lipton, J.: Hiord: A Type-Free Higher-Order Logic Programming Language with Predicate Abstraction. In: Maher, M.J. (ed.) ASIAN 2004. LNCS, vol. 3321, pp. 93–108. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  13. Quintus Computer Systems Inc. Mountain View CA 94041: Quintus Prolog User’s Guide and Reference Manual—Version 6 (1986)

    Google Scholar 

  14. Carlsson, M., Widen, J.: Sicstus Prolog User’s Manual, Po Box 1263, S-16313 Spanga, Sweden (1994)

    Google Scholar 

  15. Cabeza, D., Hermenegildo, M.: The Ciao Modular Compiler and Its Generic Program Processing Library. In: ICLP 1999 WS on Parallelism and Implementation of (C)LP Systems, N.M. State U., pp. 147–164 (1999)

    Google Scholar 

  16. Carlsson, M.: Freeze, Indexing, and Other Implementation Issues in the Wam. In: Fourth International Conference on Logic Programming, University of Melbourne, pp. 40–58. MIT Press, Cambridge (1987)

    Google Scholar 

  17. Naish, L.: Adding equations to NU-Prolog. In: Małuszyński, J., Wirsing, M. (eds.) PLILP 1991. LNCS, vol. 528, pp. 15–26. Springer, Heidelberg (1991)

    Chapter  Google Scholar 

  18. Van Roy, P.: 1983-1993: The Wonder Years of Sequential Prolog Implementation. Journal of Logic Programming 19(20), 385–441 (1994)

    MathSciNet  MATH  Google Scholar 

  19. Henderson, F., et al.: (The Mercury Language Reference Manual), http://www.cs.mu.oz.au/research/mercury/information/doc/reference_manual_toc.html

  20. Morales, J., Carro, M., Hermenegildo, M.: Improving the Compilation of Prolog to C Using Moded Types and Determinism Information. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 86–103. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  21. Marriott, K., de la Banda, M.G., Hermenegildo, M.: Analyzing Logic Programs with Dynamic Scheduling. In: 20th Annual ACM Conf. on Principles of Programming Languages, pp. 240–254. ACM, New York (1994)

    Google Scholar 

  22. Carro, M., Hermenegildo, M.: A simple approach to distributed objects in prolog. In: Colloquium on Implementation of Constraint and LOgic Programming Systems (ICLP associated workshop), Copenhagen (2002)

    Google Scholar 

  23. Cabeza, D., Hermenegildo, M.: Distributed Concurrent Constraint Execution in the CIAO System. In: Proc. of the 1995 COMPULOG-NET Workshop on Parallelism and Implementation Technologies, Utrecht, NL, U. Utrecht / T.U. Madrid (1995), http://www.clip.dia.fi.upm.es/

  24. Barbuti, R., Bellia, M., Levi, G., Martelli, M.: On the integration of logic programming and functional programming. In: International Symposium on Logic Programming, Atlantic City, NJ, pp. 160–168. IEEE Computer Society, Los Alamitos (1984)

    Google Scholar 

  25. Bellia, M., Levi, G.: The relation between logic and functional languages. Journal of Logic Programming 3, 217–236 (1986)

    Article  MATH  Google Scholar 

  26. Nadathur, G., Miller, D.: An overview of λprolog. In: Proc. 5th Conference on Logic Programming & 5th Symposium on Logic Programming, Seattle, pp. 810–827. MIT Press, Cambridge (1988)

    Google Scholar 

  27. Chen, W., Kifer, M., Warren, D.: HiLog: A foundation for higher order logic programming. Journal of Logic Programming 15, 187–230 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  28. Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury: an efficient purely declarative logic programming language. JLP 29 (1996)

    Google Scholar 

  29. Becket, R., de la Banda, M.G., Marriott, K., Somogyi, Z., Stuckey, P.J., Wallace, M.: Adding constraint solving to mercury. In: Van Hentenryck, P. (ed.) PADL 2006. LNCS, vol. 3819, pp. 118–133. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  30. Haridi, S., Franzén, N.: The Oz Tutorial. DFKI (2000), http://www.mozart-oz.org

  31. Hanus, M., et al.: Curry: An Integrated Functional Logic Language, http://www.informatik.uni-kiel.de/~mh/curry/report.html

  32. Moreno Navarro, J., Rodríguez-Artalejo, M.: BABEL: A functional and logic programming language based on constructor discipline and narrowing. In: ALP 1989. LNCS, vol. 343, pp. 223–232. Springer, Heidelberg (1989)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Casas, A., Cabeza, D., Hermenegildo, M.V. (2006). A Syntactic Approach to Combining Functional Notation, Lazy Evaluation, and Higher-Order in LP Systems. In: Hagiya, M., Wadler, P. (eds) Functional and Logic Programming. FLOPS 2006. Lecture Notes in Computer Science, vol 3945. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11737414_11

Download citation

  • DOI: https://doi.org/10.1007/11737414_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-33438-5

  • Online ISBN: 978-3-540-33439-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics