Pattern driven lazy reduction: A unifying evaluation mechanism for functional and logic programs

  • Authors:
  • P. A. Subrahmanyam;J-H. You

  • Affiliations:
  • Department of Computer Science, University of Utah, Salt Lake City, Utah;Department of Computer Science, University of Utah, Salt Lake City, Utah

  • Venue:
  • POPL '84 Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
  • Year:
  • 1984

Quantified Score

Hi-index 0.00

Visualization

Abstract

A novel lazy evaluation mechanism, pattern-driven lazy reduction, is developed that serves as a unifying evaluation mechanism for both functional and logic programs. The reduction of a function call can be viewed as “semantically” unifying the function call with the left hand side of a defining equation, and applying the unifier to the right hand side. Lazy reduction is achieved by the pattern which the function call matches against. Function reductions are actually “driven” by patterns in this sense. It is shown that this evaluation mechanism works well for both functional programs and logic programs that involve “executable” functions. As a result, logic programs can be enhanced with (1) the availability of a functional computing environment where there is no notion of backtracking, thus alleviating the degree of control difficulties typically encountered in logic programs, and (2) the ability to terminate “infinite computations” without the introduction of complex control issues at the user-level. On the other hand, functional programs can be equipped with the power of logic programming languages, e.g., Prolog.