Hostname: page-component-cd9895bd7-dzt6s Total loading time: 0 Render date: 2024-12-26T07:03:15.517Z Has data issue: false hasContentIssue false

Constraint functional logic programming over finite domains

Published online by Cambridge University Press:  01 September 2007

ANTONIO J. FERNÁNDEZ
Affiliation:
Dpto. de Lenguajes y Ciencias de la Computación, Universidad de Málaga, Spain E-mail: afdez@lcc.uma.es
TERESA HORTALÁ-GONZÁLEZ
Affiliation:
Dpto. de Sistemas Informáticos y Programación Universidad Complutense de Madrid, Spain E-mails: teresa@sip.ucm.es, fernan@sip.ucm.es, rdelvado@sip.ucm.es
FERNANDO SÁENZ-PÉREZ
Affiliation:
Dpto. de Sistemas Informáticos y Programación Universidad Complutense de Madrid, Spain E-mails: teresa@sip.ucm.es, fernan@sip.ucm.es, rdelvado@sip.ucm.es
RAFAEL DEL VADO-VÍRSEDA
Affiliation:
Dpto. de Sistemas Informáticos y Programación Universidad Complutense de Madrid, Spain E-mails: teresa@sip.ucm.es, fernan@sip.ucm.es, rdelvado@sip.ucm.es

Abstract

In this paper, we present our proposal to Constraint Functional Logic Programming over Finite Domains (CFLP()) with a lazy functional logic programming language which seamlessly embodies finite domain () constraints. This proposal increases the expressiveness and power of constraint logic programming over finite domains (CLP()) by combining functional and relational notation, curried expressions, higher-order functions, patterns, partial applications, non-determinism, lazy evaluation, logical variables, types, domain variables, constraint composition, and finite domain constraints. We describe the syntax of the language, its type discipline, and its declarative and operational semantics. We also describe , an implementation for CFLP(), and a comparison of our approach with respect to CLP() from a programming point of view, showing the new features we introduce. And, finally, we show a performance analysis which demonstrates that our implementation is competitive with respect to existing CLP() systems and that clearly outperforms the closer approach to CFLP().

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2007

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Aït-kaci, H. and Podelski, A. 1993. Towards a meaning of LIFE. Journal of Logic Programming 16 3, 195–234. A preliminary version appeared in Maluszynski and Wirsing (1991), pp. 255274.CrossRefGoogle Scholar
Antoy, S. 1992. Definitional trees. In 3rd International Conference on Algebraic and Logic Programming (ALP'92). Number 632 in LNCS. Springer-Verlag, Volterra, Italy, 143157.Google Scholar
Antoy, S., Echahed, R., and Hanus, M. 2000. A needed narrowing strategy. J. ACM 47 4, 776822.Google Scholar
Antoy, S. and Hanus, M. 2000. Compiling multi-paradigm declarative programs into prolog. In 3rd International Workshop on Frontiers of Combining Systems (FroCoS'2000), Kirchner, H. and Ringeissen, C., Eds. Number 1794 in LNCS. Springer, Nancy, France, 171185.CrossRefGoogle Scholar
Apt, K. 2003. Principles of constraint programming. Cambridge University Press.Google Scholar
Arenas, P., Hortalá, M., López-Fraguas, F., and Ullán, E. 1996. Real constraints within a functional logic language. In Joint Conference on Declarative Programming (APPIA-GULP-PRODE'96), Lucio, P., Martelli, M., and Navarro, M., Eds. Donostia-San Sebastian, Spain.Google Scholar
Barnier, N. and Brisset, P. 2001. FaCiLe: a functional constraint library. ALP Newsletter 14, 2 (May).Google Scholar
Caballero, R., López-Fraguas, F., and Sánchez, J. 1997. User's manual for TOY. Technical report SIP-5797, Universidad Complutense de Madrid, Dpto. Lenguajes., Sistemas Informáticos y Programación.Google Scholar
Carlsson, M., Ottosson, G., and Carlson, B. 1997. An open-ended finite domain constraint solver. In 9th International Symposium on Programming Languages: Implementations, Logics and Programs (PLILP'97), Montanari, U. and Rossi, F., Eds. Number 1292 in LNCS. Springer-Verlag, Southampton, UK, 191206.Google Scholar
Codognet, P. and Diaz, D. 1996. Compiling constraints in clp(FD). The Journal of Logic Programming 27, 3, 185226.Google Scholar
Damas, L. and Milner, R. 1982. Principal type-schemes for functional programs. In Ninth ACM Symposium on Principles of Programming Languages (POPL'82). ACM Press, Albuquerque, New Mexico, 207212.CrossRefGoogle Scholar
Darlington, J., Guo, Y., and Pull, H. 1992. A new perspective on the integration of functional and logic languages. In International Conference on Fifth Generation Computer Systems (FGCS'92), Staff, I., Ed. IOS Press, Tokyo, Japan, 682693.Google Scholar
Dechter, R. 2003. Constraint Processing. Morgan Kaufmann.Google Scholar
del Vado-Vírseda, R. 2003. A demand-driven narrowing calculus with overlapping definitional trees. In ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP'03). ACM Press, Uppsala, Sweden, 213227.Google Scholar
del Vado-Vírseda, R. 2005. Declarative constraint programming with definitional trees. In 5th International Workshop on Frontiers of Combining Systems (FroCoS'05). Lecture Notes in Computer Science, vol. 3717. Springer, Vienna, Austria, 184199.Google Scholar
Diaz, D. and Codognet, P. 2001. Design and implementation of the GNU prolog system. Journal of Functional and Logic Programming 2001, 6 (October).Google Scholar
Dincbas, M., Simonis, H., and Van Hentenryck, P. 1988. Solving the car-sequencing problem in constraint logic programming. In 8th European Conference on Artificial Intelligence (ECAI'88), Kodratoff, Y., Ed. Pitmann Publishing, London, Munich, Germany, 290295.Google Scholar
Estévez-Martín, S. and delVado-Vírseda, R. 2005. Designing an efficient computation strategy in FD using definitional trees. In 2005 ACM SIGPLAN workshop on Curry and functional logic programming (WCFLP'05). ACM Press, New York, NY, USA, 2331.Google Scholar
Fernández, A. J., Hortalá-González, M. T. and Sáenz-Pérez, F. 2002. A constraint functional logic language for solving combinatorial problems. In Research and Development in Intelligent Systems XIX, Bramer, A. P. M. and Coenen, F., Eds. BCS Conference Series. Springer-Verlag, Cambridge, England, 337350.Google Scholar
Fernández, A. J., Hortalá-González, M. T., and Sáenz-Pérez, F. 2003. Solving combinatorial problems with a constraint functional logic language. In 5th International Symposium on Practical Aspects of Declarative Languages (PADL'2003), Wadler, P. and Dahl, V., Eds. Number 2562 in LNCS. Springer-Verlag, New Orleans, Louisiana, USA, 320338.Google Scholar
Fernández, A. J., Hortalá-González, T., and Sáenz-Pérez, F. 2004. TOY(FD): System, Sources and user manual. Available at http://toy.sourceforge.net/.Google Scholar
Fernández, M. 1992. Narrowing based procedures for equational disunification. Applicable Algebra in Engineering Communication and Computing 3 126.Google Scholar
Fourer, R., Gay, D., and Kernighan, B. 1993. AMPL: A modeling language for mathematical programming. Scientific Press.Google Scholar
Frühwirth, T. and Abdennadher, S. 2003. Essentials of constraint programming. Cognitive Technologies Series. Springer.Google Scholar
González-Moreno, J., Hortalá-González, M., López-Fraguas, F., and Rodríguez-Artalejo, M. 1999a. An approach to declarative programming based on a rewriting logic. The Journal of Logic Programming 40, 1 (July), 4787.Google Scholar
González-Moreno, J., Hortalá-González, M., and Rodríguez-Artalejo, M. 1999b. Polymorphic types in functional logic programming. In 4th International Symposium on Functional and Logic Programming (FLOPS'99), Middeldorp, A. and Sato, T., Eds. Number 1722 in LNCS. Springer-Verlag, Tsukuba, Japan, 120. Also published in a special issue of the Journal of Functional and Logic Programming, 2001. See http://danae.uni-muenster.de/lehre/kuchen/JFLP.Google Scholar
Gunter, C. and Scott, D. 1990. Semantic domains. In Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics, van Leeuwen, J., Ed. Elsevier and The MIT Press, 633674.Google Scholar
Hanus, M. 1994. The integration of functions into logic programming: a survey. The Journal of Logic Programming 19-20, 583–628. Special issue: Ten Years of Logic Programming.Google Scholar
Hanus, M. 1999. Curry: a truly integrated functional logic language. http://www.informatik.uni-kiel.de/~curry/.Google Scholar
Hanus, M. (editor). 2005. PAKCS 1.7.1, User manual (version of December 2005). The Portland Aachen Kiel Curry System. Available from http://www.informatik.uni-kiel.de/~pakcs/.Google Scholar
Haralick, R. and Elliot, G. 1980. Increasing tree search efficiency for constraint satisfaction problems. Artificial Intelligence 14, 263313.CrossRefGoogle Scholar
Henz, M. and Müller, T. 2000. An overview of finite domain constraint programming. In 5th Conference of the Association of Asia-Pacific Operational Research Societies. Singapore.Google Scholar
Jaffar, J. and Maher, M. 1994. Constraint logic programming: a survey. The Journal of Logic Programming 19–20, 503581.CrossRefGoogle Scholar
Loogen, R., López-Fraguas, F. J. and Rodríguez-Artalejo, M. 1993. A demand driven computation strategy for lazy narrowing. In 5th International Symposium on Programming Language Implementation and Logic Programming PLILP'93, Bruynooghe, M. and Penjam, J., Eds. Lecture Notes in Computer Science, vol. 714. Springer, Tallinn, Estonia, 184200.Google Scholar
López-Fraguas, F. 1992. A general scheme for constraint functional logic programming. In 3rd International Conference on Algebraic and Logic Programming (ALP'92), Kirchner, H. and Levi, G., Eds. Number 632 in LNCS. Springer-Verlag, Volterra, Italy, 213227.Google Scholar
López-Fraguas, F., Rodríguez-Artalejo, M., and del Vado-Vírseda, R. 2004a. Constraint functional logic programming revisited. In 5th International Workshop on Rewriting Logic and its Applications (WRLA'2004). Barcelona, Spain. An. extended and revised version has also been published in Elsevier ENTCS series 117:550, 2005.Google Scholar
López-Fraguas, F., Rodríguez-Artalejo, M., and del Vado-Vírseda, R. 2004b. A lazy narrowing calculus for declarative constraint programming. In 6th ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP'04). ACM Press, Verona, Italy, 4354.Google Scholar
López-Fraguas, F. and Sánchez-Hernández, J. 1999. TOY: A multiparadigm declarative system. In 10th International Conference on Rewriting Techniques and Applications, Narendran, P. and Rusinowitch, M., Eds. Number 1631 in LNCS. Springer-Verlag, Trento, Italy, 244247.CrossRefGoogle Scholar
Lux, W. 2001. Adding linear constraints over real numbers to Curry. In 5th International Symposium on Functional and Logic Programming (FLOPS'2001), Middeldorp, A., Kuchen, H., and Ueda, K., Eds. Number 2024 in LNCS. Springer-Verlag, Tokyo, Japan, 185200.Google Scholar
Maluszynski, J. and Wirsing, M., Eds. 1991. Programming Language Implementation and Logic Programming, 3rd International Symposium, PLILP'91, Passau, Germany, August 26–28, 1991, Proceedings. Lecture Notes in Computer Science, vol. 528. Springer.CrossRefGoogle Scholar
Marin, M. 2000. Functional logic programming with distributed constraint solving. Ph.D. thesis, Research Institute for Symbolic Computation (RISC), Johannes Kepler University, Linz.Google Scholar
Marin, M., Ida, T., and Schreiner, W. 1999. CFLP: a mathematica implementation of a distributed constraint solving system. In 3rd International Mathematical Symposium (IMS'99). Computational Mechanics Publications. WIT Press, Hagenberg, Austria, 2325.Google Scholar
Marin, M., Ida, T., and Suzuki, T. 2000. Cooperative constraint functional logic programming. In International Symposium on Principles of Software Evolution (IPSE'2000), Katayama, T., Tamai, T., and Yonezaki, N., Eds. IEEE, Kanazawa, Japan, 223230.Google Scholar
Marriot, K. and Stuckey, P. J. 1998. Programming with constraints. The MIT Press, Cambridge, Massachusetts.Google Scholar
Middeldorp, A. and Okui, S. 1998. Deterministic lazy narrowing calculus. Journal of Symbolic Computation 25 6, 733757.Google Scholar
Middeldorp, A., Suzuki, T., and Hamada, M. 2002. Complete selection functions for a lazy conditional narrowing calculus. Journal of Functional and Logic Programming 3.Google Scholar
Peyton-Jones, S. 1987. The implementation of functional programming languages. Prentice Hall, Englewood Cliffs, N.J.Google Scholar
Shearer, J. 1990. Some new optimum golomb rulers. IEEE Transactions on Information Theory 36, 183184.Google Scholar
Tsang, E. 1993. Foundations of constraint satisfaction. Academic Press, London and San Diego.Google Scholar
Van Hentenryck, P. 1989. Constraint satisfaction in logic programming. The MIT Press, Cambridge, MA.Google Scholar
Van Hentenryck, P. 1999. The OPL optimization programming language. The MIT Press, Cambridge, MA.Google Scholar
Van Roy, P., Brand, P., Duchier, D., Haridi, S., Henz, M., and Schulte, C. 2003. Logic programming in the context of multiparadigm programming: the Oz experience. Theory and Practice of Logic Programming 3, 6 (November), 717763.Google Scholar
Van Roy, P. and Haridi, S. 2004. Concepts, techniques and models of computer programming. The MIT Press, Cambridge, MA.Google Scholar
Wielemaker, J. 2003. An overview of the SWI-Prolog programming environment. In Proceedings of the 13th International Workshop on Logic Programming Environments, Mesnard, F. and Serebenik, A., Eds. Katholieke Universiteit Leuven, Heverlee, Belgium, 116. CW 371.Google Scholar