Skip to main content
Log in

A new generic scheme for functional logic programming with constraints

  • Published:
Higher-Order and Symbolic Computation

Abstract

In this paper we propose a new generic scheme CFLP풟, intended as a logical and semantic framework for lazy Constraint Functional Logic Programming over a parametrically given constraint domain 풟. As in the case of the well known CLP풟 scheme for Constraint Logic Programming, 풟 is assumed to provide domain specific data values and constraints. CFLP풟 programs are presented as sets of constrained rewrite rules that define the behavior of possibly higher order and/or non-deterministic lazy functions over 풟. As a main novelty w.r.t. previous related work, we present a Constraint Rewriting Logic CRWL풟 which provides a declarative semantics for CFLP풟 programs. This logic relies on a new formalization of constraint domains and program interpretations, which allows a flexible combination of domain specific data values and user defined data constructors, as well as a functional view of constraints.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abengózar-Carneros, M., Arenas-Sánchez, P., Caballero-Roldán, R., Gil-Luezas, A., González-Moreno, J.C., Leach-Albert, J., López-Fraguas, F.J., Martí-Oliet, N., Molina-Bravo, J.M., Pimentel-Sánchez, E., Rodríguez-Artalejo, M., Roldán-García, M.M., Ruz-Ortiz, J.J., Sánchez-Hernández, J.: TOY: A Multiparadigm Declarative Language. Version 2.0. Technical Report, Dpto. Sistemas Informáticos y Programación, Universidad Complutense de Madrid, February (2002). System and documentation available at http://toy.sourceforge.net.

  2. Antoy, S., Echahed, R., Hanus, M.: A needed narrowing strategy. In: Proc. ACM Symp. on Principles of Programming Languages (POPL’94), pp. 268–279. ACM Press, Portland (1994)

  3. Antoy, S., Echahed, R., Hanus, M.: A needed narrowing strategy. J. ACM 74(4), 776–822 (2000)

    Google Scholar 

  4. Aït-Kaci, H., Podelski, A.: A feature constraint system for logic programming with entailment. Theor. Comput. Sci. 122, 263–283 (1994)

    Article  MATH  Google Scholar 

  5. Apt, K.R.: Logic programming. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, Chapter 10, pp. 493–574. Elsevier and The MIT Press (1990)

  6. Apt, K.R., Gabbrielli, M.: Declarative interpretations reconsidered. In: Proc. Int. Conf. on Logic Programming (ICLP’94), Santa Margherita Ligure, pp. 74–89. The MIT Press (1994)

  7. Arenas-Sánchez, P., Gil-Luezas, A., López-Fraguas, F.J.: Combining lazy narrowing with disequality constraints. In: Proc. Int. Symp. on Programming Language Implementation and Logic Programming (PLILP’94), pp. 385–399. Springer LNCS 844 (1994)

  8. Arenas-Sánchez, P., López-Fraguas, F.J., Rodríguez-Artalejo, M.: Embedding multiset constraints into a lazy functional logic language. In: Proc. Int. Symp. on Programming Language Implementation and Logic Programming (PLILP’98), held jointly with the 6th Int. Conf. on Algebraic and Logic Programming (ALP’98), pp. 429–444. Pisa, Springer LNCS 1490 (1998)

  9. Arenas-Sánchez, P., López-Fraguas, F.J., Rodríguez-Artalejo, M.: Functional plus logic programming with built-in and symbolic constraints. In: Proc. Int. Conf. on Principles and Practice of Declarative Programming (PPDP’99), pp. 152–169. Paris, Springer LNCS 1702 (1999)

  10. Arenas-Sánchez, P., Rodríguez-Artalejo, M.: A semantic framework for functional logic programming with algebraic polymorphic types. In: Proc. Int. Joint Conference on Theory and Practice of Software Development (TAPSOFT’97), pp. 453–464. Springer LNCS 1214 (1997)

  11. Arenas-Sánchez, P., Rodríguez-Artalejo, M.: A lazy narrowing calculus for functional logic programming with algebraic polymorphic types. In: Proc. Int. Symp. on Logic Programming (ILPS’97), pp. 53–68. The MIT Press (1997)

  12. Arenas-Sánchez, P., Rodríguez-Artalejo, M.: A general framework for lazy functional logic programming with algebraic polymorphic types. Theory Pract. Log. Program. 1(2), 185–245 (2001)

    Google Scholar 

  13. Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press (1998)

  14. Backofen, R.: A complete axiomatization of a theory with feature and arity constraints. J. Log. Program. 24(1&2), 37–71 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  15. Backofen, R., Smolka, G.: A complete and recursive feature theory. Theor. Comput. Sci. 146, 243–268 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  16. Bossi, A., Gabbrielli, M., Levi, G., Martelli, M.: The s-Semantics approach: Theory and applications. J. Log. Program. 19&20, 149–197 (1994)

    Article  MathSciNet  Google Scholar 

  17. Caballero, R., López-Fraguas, F.J., Rodríguez-Artalejo, M.: Theoretical foundations for the declarative debugging of lazy functional logic programs. In: Proc. of the 5th International Symposium on Functional and Logic Programming (FLOPS’2001), pp. 170–184. Springer LNCS 2024 (2001)

  18. Caballero, R., Rodríguez-Artalejo, M.: A declarative debugging system for lazy functional logic programs. Electronic Notes Theor. Comput. Sci. 64, 63 (2002)

    Google Scholar 

  19. Caballero R., Rodríguez-Artalejo, M.: DDT: A declarative debugging tool for functional logic languages. In: Proc. of the 7th International Symposium on Functional and Logic Programming (FLOPS’2004), pp. 70–84. Springer LNCS 2988 (2004)

  20. Caballero, R., Rodríguez-Artalejo, M., del Vado-Vírseda, R.: Declarative diagnosis of wrong answers in constraint functional-logic programming. In: Proc. of the Twenty Second Interntational Conference on Logic Programming (ICLP 2006), LNCS vol. 4079, Springer-Verlag (2006)

  21. Clark, K.L.: Predicate logic as a computational formalism. Research Report DOC 79/59, Imperial College, Department of Computing, London (1979)

  22. Colmerauer, A.: Prolog and infinite trees. In: Clark, K.L., Tärnlud, S.A. (eds.) Logic Programming, pp. 153–172. Academic Press (1982)

  23. Colmerauer, A.: Equations and inequations on finite and infinite trees. In: Proc. of the 2nd International Conference on Fifth Generation Computer Systems, pp. 85–89 (1984)

  24. Damas, L., Milner, R.: Principal type schemes for functional programs. In: Proc. ACM Symp. on Principles of Programming Languages (POPL’82), pp. 207–212. ACM Press (1982)

  25. Darlington, J., Guo, Y.K.: Constraint functional programming. Technical Report, Imperial College, November (1989)

  26. Darlington, J., Guo, Y.K.: Constraint equational deduction. In: Proc. of 2nd Int. Workshop on Conditional and Typed Rewriting Systems (CTRS’90), pp. 11–14. Springer LNCS 516 (1991)

  27. Darlington, J., Guo, Y.K., Pull, H.: Introducing constraint functional logic programming. PHOENIX Seminar and Workshop on Declarative Programming (DP’91), Springer Workshops in Computing, pp. 20–34, (1992)

  28. Darlington, J., Guo, Y.K., Pull, H.: A new perspective on the integration of functional and logic languages. In: Proc. of the Int. Conf. on Fifth Generation Computer Systems (FGCS’92), pp. 682–693. IOS Press (1992)

  29. DeGroot, D., Lindstrom, G. (eds.): Logic Programming: Functions, Relations and Equations. Prentice-Hall, Englewood Cliffs (1986)

  30. Dershowitz, N., Jouannaud, J.P.: Rewrite systems. In: van Leeuwenm, J. (ed.) Handbook of Theoretical Computer Science, vol. B, Chapter 6, pp. 243–320. Elsevier and The MIT Press (1990)

  31. Dershowitz, N., Okada, M.: A rationale for conditional equational programming. Theor. Comput. Sci. 75, 111–138 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  32. Estévez-Martín, S., del Vado-Vírseda, R.: Designing an efficient computation strategy in FD using definitional trees. In: Proc. of the International Workshop on Curry and Functional Logic Programming (WCFLP 2005), pp. 23-31 (2005)

  33. Falaschi, M., Levi, G., Martelli, M., Palamidessi, C.: Declarative modeling of the operational behavior of logic languages. Theor. Comput. Sci. 69(3), 289–318 (1989)

    Article  MathSciNet  Google Scholar 

  34. Falaschi, M., Levi, G., Martelli, M., Palamidessi, C.: A model-theoretic reconstruction of the operational semantics of logic programs. Inf. Comput. 102(1), 86–113 (1993)

    Article  MathSciNet  Google Scholar 

  35. Fay, M.J.: First-order unification in an equational theory. In: Proc. Workshop on Automated Deduction (CADE’79), pp. 161–177. Academic Press (1979)

  36. Fernández, A.J., Hortalá-González, M.T., Sáenz Pérez, F.: Solving combinatorial problems with a constraint functional logic language. In: Proc. 5th International Symposium on Principles and Practice of Declarative Languages (PADL’2003), pp. 320–338. Springer LNCS 2562 (2003)

  37. Fernández, A.J., Hortalá-González, M.T., Sáenz Pérez, F.: TOY(FD): Sketch of operational semantics.In: Proc. 9th International Conference on Principles and Practice of Constraint Programming (CP’03), pp. 827–831. Springer LNCS 2833 (2003)

  38. Fernández, A.J., Hortalá-González, M.T., Sáenz Pérez, F.: TOY(FD): Version 0.8 User Manual, October 27, (2003). System and documentation available at http://toy.sourceforge.net.

  39. Gabbrielli, M., Levi, G.: Modeling answer constraints in constraint logic programs. In: Proc. of the Eigth Int. Conf. on Logic Programming (ICLP’91), pp. 238–252. The MIT Press (1991)

  40. Gabbrielli, M., Dore, G.M., Levi, G.: Observable semantics for constraint logic programs. J. Logic Comput. 5(2), 133–171 (1995)

    Article  MathSciNet  Google Scholar 

  41. González-Moreno, J.C., Hortalá-González, M.T., López-Fraguas, F.J., Rodríguez-Artalejo, M.: A rewriting logic for declarative programming. In: Proc. European Symp. on Programming (ESOP’96), pp. 156–172. Springer LNCS 1058 (1996)

  42. 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. J. Logic Program. 40(1), 47–87 (1999)

    Article  Google Scholar 

  43. González-Moreno, J.C., Hortalá-González, M.T., Rodríguez-Artalejo, M.: A higher order rewriting logic for functional logic programming. In: Proc. Int. Conf. on Logic Programming, pp. 153–167. The MIT Press (1997)

  44. González-Moreno, J.C., Hortalá-González, M.T., Rodríguez-Artalejo, M.: Polymorphic types in functional logic programming. FLOPS’99 special issue of the Journal of Functional and Logic Programming (2001). http://danae.uni-muenster.de/lehre/kuchen/JFLP.

  45. Gunter, C.A., Scott, D.: Semantic domains. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, Chapter 6, pp. 633–674. Elsevier and The MIT Press (1990)

  46. Hanus, M.: The integration of functions into logic programming: from theory to practice. J. Logic Program. 19&20, 583–628 (1994)

    Article  MathSciNet  Google Scholar 

  47. Hanus M.: A unified computation model for functional and logic programming. In: Proc. 24st ACM Symposium on Principles of Programming Languages (POPL’97), pp. 80–93. ACM Press (1997)

  48. Hanus, M.: Curry: an Integrated Functional Logic Language, Version 0.8.2, March 28 (2006). http://www-i2.informatik.uni-kiel.de/~curry/.

  49. Henz, M., Smolka, G., Würtz, J.: Object-oriented concurrent constraint programming in Oz. In: Saraswat, V., Hentenryck, P.V., (eds.) Principles and Practice of Constraint Programming, Chapter 2, pp. 27–48. The MIT Press (1995)

  50. Hullot, J.M.: Canonical forms and unification. In: Proc. Conf. on Automated Deduction (CADE’80), pp. 318–334. Springer LNCS 87 (1980)

  51. Hussmann, H.: Nichtdeterministische Algebraische Spezifikationen. Ph. D. Thesis, University of Passau (1988)

  52. Hussmann, H.: Nondeterministic algebraic specifications and nonconfluent term rewriting. J. Logic Program. 12, 237–255 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  53. Hussmann, H.: Non-determinism in Algebraic Specifications and Algebraic Programs. Birkhäuser Verlag (1993)

  54. Jaffar, J., Lassez, J.L.: Constraint logic programming. In: Proc. ACM Symp. on Principles of Programming Languages (POPL’87), pp. 111–119. ACM Press (1987)

  55. Jaffar, J., Maher, M.J.: Constraint logic programming: A survey. J. Logic Program. 19&20, 503–581 (1994)

    Article  MathSciNet  Google Scholar 

  56. Jaffar, J., Maher, M.J., Marriott, K., Stuckey, P.J.: The semantics of constraint logic programs. J. Logic Program. 37(1–3), 1–46 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  57. Jaffar, J., Michaylov, S., Stuckey, P.J., Yap, R.H.C.: The CLP(R) language and system. ACM Trans. Program. Lang. Syst. 14(3), 339–395 (1992)

    Article  Google Scholar 

  58. Kirchner, C., Kirchner, H., Rusinowitch, M.: Deduction with symbolic constraints. Revue Française d’Intelligence Artificielle 4(3), 9–52 (1990)

    Google Scholar 

  59. Klop, J.W.: Term rewriting systems. In: Abramsky, S., Gabbay, D.M., Maibaum, T.S.E. (eds.) Handbook of Logic in Computer Science, vol. 2, pp. 2–116. Oxford University Press (1992)

  60. Kuchen, H., López-Fraguas, F.J., Moreno-Navarro, J.J., Rodríguez-Artalejo, M.: Implementing a lazy functional logic language with disequality constraints. In: Proc. Joint Int. Conf. and Symposium on Logic Programming (JICSLP’92), pp. 207–221. The MIT Press (1992)

  61. Lankford, D.S.: Canonical inference. Technical Report ATP-32, Department of Mathematics and Computer Science, University of Texas at Austin (1975)

  62. Lloyd, J.W.: Foundations of Logic Programming. 2nd edn. Springer Verlag (1987)

  63. Loogen, R., López-Fraguas, F.J., Rodríguez-Artalejo, M.: A demand driven computation strategy for lazy narrowing. In: Proc. Int. Symp. on Programming Language Implementation and Logic Programming (PLILP’93), pp. 184–200. Springer LNCS 714 (1993)

  64. López-Fraguas, F.J.: A general scheme for constraint functional logic programming. In: Proc. Int. Conf. on Algebraic and Logic Programming (ALP’92), pp. 213–227. Springer LNCS 632 (1992)

  65. López-Fraguas, F.J.: Programación Funcional y Lógica con Restricciones. Ph.D. Thesis, Univ. Complutense Madrid (1994)

  66. López-Fraguas, F.J., Rodríguez-Artalejo, M., del Vado Vírseda, R.: Constraint functional logic programming revisited. In: Proc. of the 5th International Workshop on Rewriting Logic and its Applications (WRLA’2004), Electronic Notes in Theoretical Computer Science, vol. 117, pp. 5–50 (2005)

  67. López-Fraguas, F.J., Rodríguez-Artalejo, M., del Vado Vírseda, R.: A lazy narrowing calculus for declarative constraint programming. In: Proc. ACM SIGPLAN Conf. on Principles and Practice of Declarative Programming (PPDP’04), pp. 43–54 . ACM Press (2004)

  68. López-Fraguas, F.J., Sánchez-Hernández, J.: Disequalities may help to narrow. In: Proc. APPIA-GULP-PRODE’99, pp. 89–104 (1999)

  69. López-Fraguas, F.J., Sánchez-Hernández, J.: TOY: A multiparadigm declarative system. In: Proc. RTA’99, pp. 244–247. Springer LNCS 1631 (1999)

  70. López-Fraguas, F.J., Sánchez-Hernández, J.: Failure and equality in functional logic programming. Electronic Notes in Theor. Comput. Sci. 86(3), 21 (2003)

    Google Scholar 

  71. López-Fraguas, F.J., Sánchez-Hernández, J.: A proof theoretic approach to failure in functional logic programming. Theory Pract. Logic Program. 4(1), 41–74 (2004)

    Article  Google Scholar 

  72. Maher, M.J.: Complete axiomatization of the algebras of finite, rational and infinite trees. In: Proc. of the Third Annual Symposium of Logic in Computer Science (LICS’88), pp. 348–357. IEEE Computer Society Press (1988)

  73. Mandel, L.: Constrained Lambda Calculus. Aachen Verlag Shaker (1995)

  74. Marin, M.: Functional Logic Programming with Distributed Constraint Solving. Ph. D. Thesis, Johannes Kepler Universität Linz (2000)

  75. Marin, M., Ida, T., Schreiner, W.: CFLP: a mathematica implementation of a distributed constraint solving system. In: Third International Mathematical Symposium (IMS’99), p. 10. Hagenberg, Austria, August 23–25 (1999)

  76. Marin, M., Ida, T., Suzuki, T.: Cooperative constraint functional logic programming. In: International Symposium on Principles of Software Evolution (IPSE’2000), pp. 223–230, November 1–2 (2000)

  77. Marriott, K., Stuckey, P.J.: Programming with Constraints, An Introduction. The MIT Press (1998)

  78. Martí-Oliet, N., Meseguer, J.: Rewriting logic: roadmap and bibliography. Theor. Comput. Sci. 285(2), 121–154 (2002)

    Article  Google Scholar 

  79. Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theor. Comput. Sci. 96, 73–155 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  80. Middeldorp, A., Hamoen, E.: Completeness results for basic narrowing. Appl. Algebra Eng. Commun. Comput. 5, 213–253 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  81. Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sciences 17, 348–375 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  82. Möller, B.: On the algebraic specification of infinite objects - ordered and continuous models of algebraic types. Acta Inform. 22, 537–578 (1985)

    MATH  MathSciNet  Google Scholar 

  83. Mück, A., Streicher, T.: A tiny constrain functional logic language and its continuation semantics. In: Proc. European Symp. on Programming (ESOP’94), pp. 439–453. Springer LNCS 788 (1994)

  84. Palomino Tarjuelo, M.: Comparing meseguer’s rewriting logic with the logic CRWL. Electronic Notes in Theoretical Computer Science 64, 22 (2002)

    Google Scholar 

  85. Palomino Tarjuelo, M.: A Comparison between two logical formalism for rewriting. In: Falaschi, M., Maher, M. (eds.) Multiparadigm Languages and Constraint Programming (special issue). To appear in Theory and Practice of Logic Programming

  86. Robinson, J.A., Sibert, E.E.: LOGLISP: Motivation, design and implementation. In: Clark, K.L., Tärnlund, S.A (eds.) Logic Programming, pp. 299–313. Academic Press (1982)

  87. Rodríguez-Artalejo, M.: Functional and constraint logic programming. In: Comon, H., Marché, C., Treinen, R. (eds.) Constraints in Computational Logics, Theory and Applications. Revised Lectures of the International Summer School CCL’99, Chapter 5, pp. 202–270. Springer LNCS 2002 (2001)

  88. Saraswat, V.: Concurrent constraint programming languages. PhD Thesis, Carnegie Mellon University, 1989. In ACM distinguished dissertation series. The MIT press (1993)

  89. Saraswat, V., Rinard, M.: Concurrent constraint programming. In: Proc. of the 17th Annual Symposium on Principles of Programming Languages (POPL’90), pp. 232–245. ACM Computer Society Press (1990)

  90. Saraswat, V., Rinard, M., Panangaden, P.: Semantic foundations of concurrent constraint programming. In: Proc. of the 18th Annual Symposium on Principles of Programming Languages (POPL’91), pp. 333–352. ACM Computer Society Press (1991)

  91. Scott, D.S.: Domains for denotational semantics. In: Proc. ICALP’82, pp. 577–613. Springer LNCS 140 (1982)

  92. SICStus Prolog user’s manual, release 3.11.0, October 2003. Swedish Institute of Computer Science, Sweden. System available at http://www.sics.se/isl/sicstus.

  93. Slagle, J.R.: Automated theorem-proving for theories with simplifiers, commutativity and associativity. J. ACM 21(4), 622–642 (1974)

    Article  MathSciNet  Google Scholar 

  94. Smolka, G., Treinen, R.: Records for logic programming. J. Logic Program. 18, 229–258 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  95. Tarski, A.: A lattice-theoretical fixpoint theorem and its applications. Pac. J. Math. 5, 285–309 (1955)

    MATH  MathSciNet  Google Scholar 

  96. Tessier, A., Ferrand, G.: Declarative diagnosis in the CLP scheme. In: Deransart, P., Hermenegildo, M., Maiuszynski, J. (eds.) Analysis and Visualization Tools for Constraint Programming, Chapter 5, pp. 151–174. Springer LNCS 1870 (2000)

  97. del Vado Vírseda, R.: A demand-driven narrowing calculus with overlapping definitional trees. In: Proc. ACM SIGPLAN Conf. on Principles and Practice of Declarative Programming (PPDP’03), pp. 213–227. ACM Press (2003)

  98. del Vado Vírseda, R.: Declarative constraint programming with definitional trees. In: Proc. 5th International Workshop on Frontiers of Combining Systems (FroCoS’05), pp. 184–199. Springer LNAI 3717 (2005)

  99. Van Hentenryck, P.: Constraint Satisfaction in Logic P“rogramming. Logic Programming Series, The MIT Press (1989)

  100. Van Hentenryck, P.: Constraint logic programming. Knowl. Eng. Rev. 6(3), 151–194 (1991)

    Article  Google Scholar 

  101. Van Hentenryck, P., Simonis, H., Dincbas, M.: Constraint Satisfaction Using Constraint Logic Programming. Artif. Intell. 58, 113–159 (1994)

    Article  MathSciNet  Google Scholar 

  102. Van Hentenryck, P., Saraswat, V., Deville, Y.: Design, implementation and evaluation of the constraint language cc(FD). J. Logic Program. 37, 139–164 (1998)

    Article  MATH  Google Scholar 

  103. Van Roy, P., Brand, P., Duchier, D., Haridi, S., Henz, M., Schulte, C.: Logic programming in the context of multiparadigm programming: the Oz experience. Theory Pract. Logic Program. 3(6), 717–763 (2003)

    Article  Google Scholar 

  104. Winskel, G.: On powerdomains and modality. Theor. Comput. Sci. 36, 127–137 (1985)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Francisco J. López Fraguas.

Additional information

This research has been partially supported by the Spanish National Projects MELODIAS (TIC2002-01167), MERIT-FORMS (TIN2005-09207-C03-03) and PROMESAS-CAM (S-0505/TIC/0407).

Rights and permissions

Reprints and permissions

About this article

Cite this article

López Fraguas, F.J., Rodríguez Artalejo, M. & Vírseda, R.d.V. A new generic scheme for functional logic programming with constraints. Higher-Order Symb Comput 20, 73–122 (2007). https://doi.org/10.1007/s10990-007-9002-4

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10990-007-9002-4

Keywords

Navigation