Overlapping Rules and Logic Variables in Functional Logic Programs

  • Sergio Antoy
  • Michael Hanus
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4079)


Functional logic languages extend purely functional languages with two features: operations defined by overlapping rules and logic variables in both defining rules and expressions to evaluate. In this paper, we show that only one of these features is sufficient in a core language. On the one hand, overlapping rules can be eliminated by introducing logic variables in rules. On the other hand, logic variables can be eliminated by introducing operations defined by overlapping rules. The proposed transformations between different classes of programs not only give a better understanding of the features of functional logic programs but also may simplify implementations of functional logic languages.


Logic Program Abstract Machine Functional Language Extra Variable Functional Logic 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 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)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Albert, E., Hanus, M., Vidal, G.: A Practical Partial Evaluator for a Multi-Paradigm Declarative Language. Journal of Functional and Logic Programming 2002(1) (2002)Google Scholar
  3. 3.
    Antoy, S.: Definitional Trees. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 143–157. Springer, Heidelberg (1992)CrossRefGoogle Scholar
  4. 4.
    Antoy, S.: Optimal Non-Deterministic Functional Logic Computations. In: Hanus, M., Heering, J., Meinke, K. (eds.) ALP 1997 and HOA 1997. LNCS, vol. 1298, pp. 16–30. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  5. 5.
    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)CrossRefGoogle Scholar
  6. 6.
    Antoy, S.: Evaluation Strategies for Functional Logic Programming. Journal of Symbolic Computation 40(1), 875–903 (2005)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Antoy, S., Echahed, R., Hanus, M.: A Needed Narrowing Strategy. Journal of the ACM 47(4), 776–822 (2000)CrossRefMathSciNetGoogle Scholar
  8. 8.
    Antoy, S., Hanus, M.: Overlapping Rules and Logic Variables in Functional Logic Programs. Technical Report 0608, Christian-Albrechts-Universität Kiel (2006)Google Scholar
  9. 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)CrossRefGoogle Scholar
  10. 10.
    Antoy, S., Tolmach, A.: Typed Higher-Order Narrowing without Higher-Order Strategies. In: Middeldorp, A. (ed.) FLOPS 1999. LNCS, vol. 1722, pp. 335–352. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  11. 11.
    Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)Google Scholar
  12. 12.
    Bergstra, J.A., Klop, J.W.: Conditional Rewrite Rules: Confluence and Termination. Journal of Computer and System Sciences 32(3), 323–362 (1986)zbMATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Brassel, B., Hanus, M., Huch, F., Silva, J., Vidal, G.: Run-Time Profiling of Functional Logic Programs. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 182–197. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  14. 14.
    Braßel, B., Hanus, M., Huch, F., Vidal, G.: A Semantics for Tracing Declarative Multi-Paradigm Programs. In: Proceedings of the 6th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2004), pp. 179–190. ACM Press, New York (2004)CrossRefGoogle Scholar
  15. 15.
    Braßel, B., Huch, F.: Translating Curry to Haskell. In: Proc. of the ACM SIGPLAN 2005 Workshop on Curry and Functional Logic Programming (WCFLP 2005), pp. 60–65. ACM Press, New York (2005)Google Scholar
  16. 16.
    Claessen, K., Ljunglöf, P.: Typed Logical Variables in Haskell. In: Proc. ACM SIGPLAN Haskell Workshop, Montreal (2000)Google Scholar
  17. 17.
    de Dios Castro, J., López-Fraguas, F.J.: Elimination of Extra Variables in Functional Logic Programs. Personal communication (2006)Google Scholar
  18. 18.
    Dershowitz, N., Jouannaud, J.-P.: Rewrite Systems. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, pp. 243–320. Elsevier, Amsterdam (1990)Google Scholar
  19. 19.
    Giovannetti, E., Levi, G., Moiso, C., Palamidessi, C.: Kernel LEAF: A Logic plus Functional Language. Journal of Computer and System Sciences 42(2), 139–185 (1991)zbMATHCrossRefGoogle Scholar
  20. 20.
    Hanus, M.: The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming 19&20, 583–628 (1994)CrossRefMathSciNetGoogle Scholar
  21. 21.
    Hanus, M.: A Unified Computation Model for Functional and Logic Programming. In: Proc. of the 24th ACM Symposium on Principles of Programming Languages (Paris), pp. 80–93 (1997)Google Scholar
  22. 22.
    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
  23. 23.
    Hanus, M. (ed.): Curry: An Integrated Functional Logic Language (Vers. 0.8.2) (2006), Available at:
  24. 24.
    Huet, G., Lévy, J.-J.: Computations in Orthogonal Rewriting Systems. In: Lassez, J.-L., Plotkin, G. (eds.) Computational Logic: Essays in Honor of Alan Robinson, pp. 395–443. MIT Press, Cambridge (1991)Google Scholar
  25. 25.
    Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. 20th ACM Symposium on Principles of Programming Languages (POPL 1993), pp. 144–154. ACM Press, New York (1993)CrossRefGoogle Scholar
  26. 26.
    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)CrossRefGoogle Scholar
  27. 27.
    Lux, W., Kuchen, H.: An Efficient Abstract Machine for Curry. In: Beiersdörfer, K., Engels, G., Schäfer, W. (eds.) Informatik 1999 — Annual meeting of the German Computer Science Society (GI), pp. 390–399. Springer, Heidelberg (1999)Google Scholar
  28. 28.
    Moreno-Navarro, J.J., Rodríguez-Artalejo, M.: Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming 12, 191–223 (1992)zbMATHCrossRefGoogle Scholar
  29. 29.
    Ochoa, C., Silva, J., Vidal, G.: Dynamic Slicing Based on Redex Trails. In: Proc. of the ACM SIGPLAN 2004 Symposium on Partial Evaluation and Program Manipulation (PEPM 2004), pp. 123–134. ACM Press, New York (2004)CrossRefGoogle Scholar
  30. 30.
    Tolmach, A., Antoy, S., Nita, M.: Implementing Functional Logic Languages Using Multiple Threads and Stores. In: Proc. of the Ninth ACM SIGPLAN International Conference on Functional Programming (ICFP 2004), pp. 90–102. ACM Press, New York (2004)CrossRefGoogle Scholar
  31. 31.
    Warren, D.H.D.: Higher-order extensions to PROLOG: are they needed? Machine Intelligence 10, 441–454 (1982)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Sergio Antoy
    • 1
  • Michael Hanus
    • 2
  1. 1.Computer Science DepartmentPortland State UniversityPortlandUSA
  2. 2.Institut für InformatikCAU KielKielGermany

Personalised recommendations