Advertisement

Narrowing and unification in functional programming —An evaluation mechanism for absolute set abstraction

  • John Darlington
  • Yi-ke Guo
Regular Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 355)

Abstract

The expressive power of logic programming may be achieved within a functional programming framework by extending the functional language with the ability to evaluate absolute set abstractions. By absolute set abstraction, logical variables are introduced into functional languages as first class objects. Their set-valued interpretations are implicitly defined by the constraining equations. Narrowing and unification can be used to solve these constraining equations to produce the satisfying instantiations of the logic variables. In this paper, we study an execution mechanism for evaluating absolute set abstraction in a first order (non-strict) functional programming setting. First, we investigate the semantics of absolute set abstraction. It is shown that absolute set abstraction is no more than a setvalued expression involving the evaluation of function inversion. Functional equality is defined coinciding with the semantics of the continuous and strict equality function in functional programming. This new equality means that the well known techniques for equation solving can be adopted as a proper mechanism for solving the constraining equations which are the key to the evaluation of absolute set abstraction. The main result of this paper lies in the study of a particular narrowing strategy, called lazy pattern driven narrowing, which is proved to be complete and optimal for evaluating absolute set abstraction in the sense that a complete set of minimal solutions of the constraining equations can be generated by a semantic unification procedure based on this narrowing strategy. This indicates that a mechanism for equation solving can be developed within a functional programming context, producing a more expressive language.

Keywords

Logic Program Logic Programming Functional Programming Standard Derivation 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. [Bellia 86]
    Bellia,M. and Giorgio, L. "The Relation Between Logic and Functional Language: A Survey" The Journal of Logic Programming 3, Oct. 1986.Google Scholar
  2. [Burs 80]
    Burstall R. et.al. "Hope: an experimental applicative language" Proc. Lisp Conf. Stanford. 1980.Google Scholar
  3. [Darl 86]
    Darlington, J. Field, A.J. and Pull, H. "The unification of Functional and Logic languages" in Logic Programming: Functions, Relations and Equations, ed. Doug Degroot and G. Lindstrom, Prentice-Hall, 1986.Google Scholar
  4. [Darl 88]
    Darlington, J. et.al. "A Functional Programming Environment Supporting Execution, Partial Execution and Transformation" To appear.Google Scholar
  5. [Ders 85]
    Dershowitz, N. and Plaisted, D.A. "Equational programming" in Machine Intelligence, D.Michie, J.E. Hayes and J. Richards, eds., 1986.Google Scholar
  6. [DG88]
    Darlington, J, Yi-ke Guo "Narrowing and unification in Functional Programming" Research Report, FPS, DoC, Imperial College, Oct. 1988.Google Scholar
  7. [DG88-2]
    Darlington, J, Yi-ke Guo "On Constraint Functional Programming" To appear.Google Scholar
  8. [EmYu86]
    Van Emden, Maarten. H. and Yukawa, K. "Logic Programming with Equations" Journal of Logic Programming 4, 1986.Google Scholar
  9. [Fay 79]
    Fay, M.J., "First-order Unification in an Equational Theory" in 4th Workshop on Automated Deduction, 1979.Google Scholar
  10. [Frib85]
    Fribourg, L., "SLOG: A logic programming language interpreter based on clausal superposition and rewriting" in Proc. 1985 Symposium on Logic Programming, Boston, Mass.Google Scholar
  11. [GaSn87]
    Gallier, J.H. and Snyder, W. "A general Complete E-unification procedure", in Proc. of RTA87, LNCS 256,1987Google Scholar
  12. [Giov86]
    E. Giovannetti, G. Levi, C. Moiso and C.Palamidessi, Kernel LEAF: An experimental logic plus functional language-its syntax, semantics and computational model, ESPRIT Project 415, Second year report 1986.Google Scholar
  13. [Hull80]
    Hullot, J. M., "Canonical Forms and Unification, "in Proc. 5th conference on Automated Deduction, LNCS 80, 1980.Google Scholar
  14. [HuLe79]
    Huet, G. Levy, L.L. "Computations in Nonambiguous Linear Rewriting Systems" Research Report. INRIA. 1979.Google Scholar
  15. [HuOp80]
    Huet,G. and Oppen, D.C., "Equations and Rewrite Rules: A Survey" TR-CSL-111, SRI, Jan, 1980.Google Scholar
  16. [Huss88]
    Hussmann, H, "Nichtdeterministische Algebraische Spezifikationen (in German), Ph.D. thesis, Univ. of Passau, 1988.Google Scholar
  17. [JaLaMa86]
    Jaffar, J., Lassez, J. and Maher, M. "Constraint Logic Programming" in Proc. of. 14th ACM symp. POPL. 1987.Google Scholar
  18. [JaSi 86]
    Jayaraman, B. and Silberman,F., "Equations, Sets and Reduction Semantics for Functional and Logic Programming" in Proc. of. ACM Confs on LISP and Functional Programming, Aug. 1986.Google Scholar
  19. [Mate 86]
    Martelli, A. et,al "An algorithm for unification in equational theories", in Proc. 1986 International Symposium on Logic Programming, Salt Lake City, Utah, 1986.Google Scholar
  20. [Reddy85]
    Reddy, U.S. "Narrowing as the Operational Semantics of Functional Languages" Proc. of the 1985 Symp. on Logic Programming, July, 1985.Google Scholar
  21. [Reyno 70]
    Reynolds, J.C. "Transformational Systems and the Algebraic Structure of Atomic Formulas." Machine Intelligence 5. ed. Michie, D. Edinburgh Univ. Press, 1970.Google Scholar
  22. [You 88]
    You, Jia-Huai "Unification Modulo an Equality Theory for Embedding Functional Programming into Prolog" Extended Abstract, Dept. of Computing Science, Univ.of Alberta, Canada, May, 1988.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • John Darlington
    • 1
  • Yi-ke Guo
    • 1
  1. 1.Department of ComputingImperial College of Science and TechnologyLondonEngland

Personalised recommendations