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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Narain, S.: Lazy evaluation in logic programming. In: Proc. 1990 Int. Conference on Computer Languages, pp. 218–227 (1990)
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)
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/
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/
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)
Deransart, P., Ed-Dbali, A., Cervoni, L.: Prolog: The Standard. Springer, Heidelberg (1996)
O’Keefe, R.: The Craft of Prolog. MIT Press, Cambridge (1990)
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)
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)
Cabeza, D., Hermenegildo, M.: Higher-order Logic Programming in Ciao. Technical Report CLIP7/99.0, Facultad de Informática, UPM (1999)
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)
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)
Quintus Computer Systems Inc. Mountain View CA 94041: Quintus Prolog User’s Guide and Reference Manual—Version 6 (1986)
Carlsson, M., Widen, J.: Sicstus Prolog User’s Manual, Po Box 1263, S-16313 Spanga, Sweden (1994)
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)
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)
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)
Van Roy, P.: 1983-1993: The Wonder Years of Sequential Prolog Implementation. Journal of Logic Programming 19(20), 385–441 (1994)
Henderson, F., et al.: (The Mercury Language Reference Manual), http://www.cs.mu.oz.au/research/mercury/information/doc/reference_manual_toc.html
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)
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)
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)
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/
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)
Bellia, M., Levi, G.: The relation between logic and functional languages. Journal of Logic Programming 3, 217–236 (1986)
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)
Chen, W., Kifer, M., Warren, D.: HiLog: A foundation for higher order logic programming. Journal of Logic Programming 15, 187–230 (1993)
Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury: an efficient purely declarative logic programming language. JLPÂ 29 (1996)
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)
Haridi, S., Franzén, N.: The Oz Tutorial. DFKI (2000), http://www.mozart-oz.org
Hanus, M., et al.: Curry: An Integrated Functional Logic Language, http://www.informatik.uni-kiel.de/~mh/curry/report.html
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)