Advertisement

Efficient translation of lazy functional logic programs into Prolog

  • Michael Hanus
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1048)

Abstract

In this paper, we present a high-level implementation of lazy functional logic programs by transforming them into Prolog programs. The transformation is controlled by generalized definitional trees which specify the narrowing strategy to be implemented. Since we consider a sophisticated narrowing strategy, a direct mapping of functions into predicates is not possible. Therefore, we present new techniques to reduce the interpretational overhead of the generated Prolog code. This leads to a portable and efficient implementation of functional logic programs.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    H. Aït-Kaci. Warren's Abstract Machine. MIT Press, 1991.Google Scholar
  2. 2.
    S. Antoy. Non-Determinism and Lazy Evaluation in Logic Programming. In Proc. Int. Workshop on Logic Program Synthesis and Transformation (LOPSTR'91), pp. 318–331. Springer Workshops in Computing, 1991.Google Scholar
  3. 3.
    S. Antoy. Definitional Trees. In Proc. of the 3rd Int. Conference on Algebraic and Logic Programming, pp. 143–157. Springer LNCS 632, 1992.Google Scholar
  4. 4.
    S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. In Proc. 21st ACM Symp. on Principles of Programming Languages, pp. 268–279, Portland, 1994.Google Scholar
  5. 5.
    P.G. Bosco, E. Giovannetti, and C. Moiso. Narrowing vs. SLD-Resolution. Theoretical Computer Science 59, pp. 3–23, 1988.Google Scholar
  6. 6.
    P.H. Cheong and L. Fribourg. Implementation of Narrowing: The Prolog-Based Approach. In Logic programming languages: constraints, functions, and objects, pp. 1–20. MIT Press, 1993.Google Scholar
  7. 7.
    N. Dershowitz and J.-P. Jouannaud. Rewrite Systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, Vol. B, pp. 243–320. Elsevier, 1990.Google Scholar
  8. 8.
    L. Pribourg. SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting. In Proc. IEEE Int. Symposium on Logic Programming, pp. 172–184, Boston, 1985.Google Scholar
  9. 9.
    J.P. Gallagher. Tutorial on Specialisation of Logic Programs. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based Program Manipulation (PEPM'93), pp. 88–98. ACM Press, 1993.Google Scholar
  10. 10.
    E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel LEAF: A Logic plus Functional Language. Journal of Computer and System Sciences, Vol. 42, No. 2, pp. 139–185, 1991.Google Scholar
  11. 11.
    W. Hans, R. Loogen, and S. Winkler. On the Interaction of Lazy Evaluation and Backtracking. In Proc. of the 4th Int. Symposium on Programming Language Implementation and Logic Programming, pp. 355–369. Springer LNCS 631, 1992.Google Scholar
  12. 12.
    M. Hanus. Compiling Logic Programs with Equality. In Proc. of the 2nd Int. Workshop on Programming Language Implementation and Logic Programming, pp. 387–401. Springer LNCS 456, 1990.Google Scholar
  13. 13.
    M. Hanus. Improving Control of Logic Programs by Using Functional Logic Languages. In Proc. of the 4th International Symposium on Programming Language Implementation and Logic Programming, pp. 1–23. Springer LNCS 631, 1992.Google Scholar
  14. 14.
    M. Hanus. Combining Lazy Narrowing and Simplification. In Proc. of the 6th International Symposium on Programming Language Implementation and Logic Programming, pp. 370–384. Springer LNCS 844, 1994.Google Scholar
  15. 15.
    M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, Vol. 19&20, pp. 583–628, 1994.Google Scholar
  16. 16.
    M. Hanus. On Extra Variables in (Equational) Logic Programming. In Proc. International Conference on Logic Programming, pp. 665–679. MIT Press, 1995.Google Scholar
  17. 17.
    J.A. Jiménez-Martin, J. Marino-Carballo, and J.J. Moreno-Navarro. Efficient Compilation of Lazy Narrowing into Prolog. In Proc. Int. Workshop on Logic Program Synthesis and Transformation (LOPSTR'92), pp. 253–270. Springer, 1992Google Scholar
  18. 18.
    H. Kuchen, R. Loogen, J.J. Moreno-Navarro, and M. Rodríguez-Artalejo. Graph-based Implementation of a Functional Logic Language. In Proc. ESOP 90, pp. 271–290. Springer LNCS 432, 1990.Google Scholar
  19. 19.
    R. Loogen, F. Lopez Fraguas, and M. Rodríguez Artalejo. A Demand Driven Computation Strategy for Lazy Narrowing. In Proc. of the 5th Int. Symp. on Programming Language Implementation and Logic Programming, pp. 184–200. Springer LNCS 714, 1993.Google Scholar
  20. 20.
    T. Mogensen. Personal Communication. 1995Google Scholar
  21. 21.
    J.J. Moreno-Navarro, H. Kuchen, R. Loogen, and M. Rodríguez-Artalejo. Lazy Narrowing in a Graph Machine. In Proc. Second International Conference on Algebraic and Logic Programming, pp. 298–317. Springer LNCS 463, 1990.Google Scholar
  22. 22.
    J.J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191–223, 1992.Google Scholar
  23. 23.
    L. Naish. Negation and Control in Prolog. Springer LNCS 238, 1987.Google Scholar
  24. 24.
    L. Naish. Adding equations to NU-Prolog. In Proc. of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, pp. 15–26. Springer LNCS 528, 1991.Google Scholar
  25. 25.
    U.S. Reddy. Narrowing as the Operational Semantics of Functional Languages. In Proc. IEEE Int. Symposium on Logic Programming, pp. 138–151, Boston, 1985.Google Scholar
  26. 26.
    J.R. Slagle. Automated Theorem-Proving for Theories with Simplifiers, Commutativity, and Associativity. Journal of the ACM, Vol. 21, No. 4, pp. 622–642, 1974.Google Scholar
  27. 27.
    L. Sterling and E. Shapiro. The Art of Prolog. MIT Press, 1986.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Michael Hanus
    • 1
  1. 1.Informatik IIRWTH AachenAachenGermany

Personalised recommendations