Advertisement

Adding equations to NU-Prolog

  • Lee Naish
Session: Functional And Logic Programming
Part of the Lecture Notes in Computer Science book series (LNCS, volume 528)

Abstract

This paper describes an extension to NU-Prolog which allows evaluable functions to be defined using equations. We consider it to be the most pragmatic way of combining functional and relational programming. The implementation consists of several hundred lines of Prolog code and the underlying Prolog implementation was not modified at all. However, the system is reasonably efficient and supports coroutining, optional lazy evaluation, higher order functions and parallel execution. Efficiency is gained in several ways. First, we use some new implementation techniques. Second, we exploit some of the unique features of NU-Prolog, though these features are not essential to the implementation. Third, the language is designed so that we can take advantage of implicit mode and determinism information. Although we have not concentrated on the semantics of the language, we believe that our language design decisions and implementation techniques will be useful in the next generation of combined functional and relational languages.

Keywords

Logic Program Logic Programming Function Definition Choice Point Functional Language 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [BCM88]
    P.G. Bosco, C. Cecchi, and C. Moiso. Exploiting the full power of logic plus functional programming. In Kenneth A. Bowen and Robert A. Kowalski, editors, Proceedings of the Fifth International Conference/Symposium on Logic Programming, pages 3–17, Seattle, Washington, August 1988.Google Scholar
  2. [BCM+90]
    P.G. Bosco, C. Cecchi, C. Moiso, M. Porta, and G. Sofi. Logic and functional programming on distributed memory architectures. In Proceedings of the Seventh International Conference on Logic Programming, Jerusalem, Israel, June 1990.Google Scholar
  3. [CvER90]
    M.H.M. Cheng, M.H. van Emden, and B.E. Richards. On warren's method for functional programming in logic. In Proceedings of the Seventh International Conference on Logic Programming, Jerusalem, Israel, June 1990.Google Scholar
  4. [DFP85]
    J. Darlington, A.J. Field, and H. Pull. The unification of functional and logic languages. In Doug DeGroot and Gary Lindstrom, editors, Logic programming: relations, functions, and equations, pages 37–70. Prentice-Hall, 1985.Google Scholar
  5. [DW86]
    Saumya K. Debray and David S. Warren. Detection and optimisation of functional computations in prolog. In Ehud Shapiro, editor, Proceedings of the Third International Conference on Logic Programming, pages 490–504, London, England, July 1986. published as Lecture Notes in Computer Science 225 by Springer-Verlag.Google Scholar
  6. [Fri85]
    Laurent Fribourg. SLOG: a logic programming language interpreter based on clausal superposition and rewriting. In Proceedings of the Second IEEE Symposium on Logic Programming, pages 172–184, Boston, Massachusetts, July 1985.Google Scholar
  7. [GM85]
    Joseph A. Goguen and Jose Meseguer. EQLOG: equality, types, and generic modules for logic programming. In Doug DeGroot and Gary Lindstrom, editors, Logic programming: relations, functions, and equations, pages 295–363. Prentice-Hall, 1985.Google Scholar
  8. [Gre87]
    Steve Gregory. Parallel logic programming in parlog. Addison-Wesley, Wokingham, England, 1987.Google Scholar
  9. [JD86]
    Alan Josephson and Nachum Dershowitz. An implementation of narrowing the RITE way. In Proceedings of the Third IEEE Symposium on Logic Programming, pages 187–197, Salt Lake City, Utah, September 1986.Google Scholar
  10. [Jon87]
    S. Peyton Jones. The implementation of functional programming languages. Prentice Hall International series in computer science. Prentice Hall, London, 1987.Google Scholar
  11. [Nai86]
    Lee Naish. Negation and control in Prolog. Number 238 in Lecture Notes in Computer Science. Springer-Verlag, New York, 1986.Google Scholar
  12. [Nai88]
    Lee Naish. Parallelizing NU-Prolog. In Kenneth A. Bowen and Robert A. Kowalski, editors, Proceedings of the Fifth International Conference/Symposium on Logic Programming, pages 1546–1564, Seattle, Washington, August 1988.Google Scholar
  13. [Nai90]
    Lee Naish. Adding equations to NU-prolog. Technical Report 91/2, Department of Computer Science, University of Melbourne, Melbourne, Australia, 1990.Google Scholar
  14. [Nar86]
    Sanjai Narain. A technique for doing lazy evaluation in logic. Journal of Logic Programming, 3(3):259–276, October 1986.Google Scholar
  15. [Nar88]
    Sanjai Narain. LOG(F): An optimal combination of logic programming, rewriting and lazy evaluation. Ph.d. thesis, Dept. of computer science, UCLA, Los Angeles, CA, 1988.Google Scholar
  16. [Red85]
    Uday S. Reddy. Narrowing as the operational semantics of functional languages. In Proceedings of the Second IEEE Symposium on Logic Programming, pages 138–151, Boston, Massachusetts, July 1985.Google Scholar
  17. [She90]
    Yeh-Heng Sheng. HIFUNLOG: logic programming with higher-order relational functions. In Proceedings of the Seventh International Conference on Logic Programming, Jerusalem, Israel, June 1990.Google Scholar
  18. [SY85]
    P.A. Subrahmanyam and Jia-Huai You. FUNLOG: a computational model integrating logic programming and functional programming. In Doug DeGroot and Gary Lindstrom, editors, Logic programming: relations, functions, and equations, pages 157–198. Prentice-Hall, 1985.Google Scholar
  19. [War82]
    David H.D. Warren. Higher-order extensions to prolog: are they needed? In J.E. Hayes, Donald Michie, and Y-H. Pao, editors, Machine Intelligence 10, pages 441–454. Ellis Horwood Ltd., Chicester, England, 1982.Google Scholar
  20. [War83]
    David H.D. Warren. An abstract Prolog instruction set. Tecnical Note 309, SRI International, Menlo Park, California, October 1983.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Lee Naish
    • 1
  1. 1.Department of Computer ScienceUniversity of MelbourneParkvilleAustralia

Personalised recommendations