Curry: A Truly Functional Logic Language

Functional and logic programming are the most important declarative programming paradigms, and interest in combining them has grown over the last decade. However, integrated functional logic languages are currently not widely used. This is due to the fact that the operational principles are not well understood and many diierent evaluation strategies have been proposed which resulted in many diierent functional logic languages. To overcome this situation, we propose the functional logic language Curry which can deal as a standard language in this area. It includes important ideas of existing functional logic languages and recent developments, and combines the most important features of functional and logic languages. Thus, Curry can be the basis to combine the currently separated research eeorts of the functional and logic programming communities and to boost declarative programming in general. Moreover, since functions provide for more eecient evaluation strategies and are a declarative replacement of some impure features of Prolog (in particular, pruning operators), Curry can be also used as a declarative successor of Prolog. 1 Motivation During the last decade, many proposals have been made to combine the most important declarative programming paradigms (see 13] for a survey). Functional logic languages ooer features from functional programming (reduction of nested expressions, higher-order functions) and logic programming (logical variables, partial data structures, search for solutions). Compared to pure functional languages, functional logic languages have more expressive power due to the use of logical variables and built-in search mechanisms. Compared to pure logic languages, functional logic languages have more eecient evaluation mechanisms due to the (deterministic!) reduction of functional expressions. Thus, impure features of Prolog to restrict the search space, like the cut operator, can be avoided in functional logic languages. However, there is no obvious way to combine the search facilities of logic programming with eecient evaluation principles of functional programming. As a consequence, quite diierent methods to integrate functional and logic languages have been proposed in the past. The most promising operational principles are residuation and narrowing. Residuation is based on the idea to delay function calls until they are ready for deterministic evaluation. The residuation principle is used, for instance, in the languages Escher 19], Le Fun 2], Life 1], NUE-Prolog 27], and Oz 33]. Since the residuation principle evaluates function calls by deterministic reduction steps, nondeterministic search must be explicitly encoded by predicates

[1]  Laurent Fribourg,et al.  SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting , 1985, SLP.

[2]  P. Wadler How to Replace Failure by a List of Successes: A method for exception handling, backtracking, and pattern matching in lazy functional languages , 1985, FPCA.

[3]  Uday S. Reddy,et al.  Narrowing as the Operational Semantics of Functional Languages , 1985, SLP.

[4]  Lee Naish,et al.  Negation and Control in Prolog , 1986, Lecture Notes in Computer Science.

[5]  Rachid Echahed,et al.  Design and Implementation of a Generic, Logic and Functional Programming Language , 1986, ESOP.

[6]  Patrick Lincoln,et al.  Le Fun: Logic, Equations and Functions , 1987, SLP.

[7]  Dale A. Miller,et al.  AN OVERVIEW OF PROLOG , 1988 .

[8]  Seif Haridi,et al.  ANDORRA Prolog - An Integration of Prolog and Committed Choice Languages , 1988, FGCS.

[9]  J. Darlington,et al.  Narrowing and unification in functional programming mechanism for absolute set a bstraction , 1989 .

[10]  Hassan Aït-Kaci,et al.  An Overview of LIFE , 1990, East/West Database Workshop.

[11]  Robin Milner,et al.  Definition of standard ML , 1990 .

[12]  Rita Loogen,et al.  Lazy Narrowing in a Graph Machine , 1990, ALP.

[13]  Michael Hanus,et al.  Compiling Logic Programs with Equality , 1990, PLILP.

[14]  Corrado Moiso,et al.  Kernel-LEAF: A Logic plus Functional Language , 1991, J. Comput. Syst. Sci..

[15]  Tobias Nipkow,et al.  Higher-order critical pairs , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[16]  Lee Naish,et al.  Adding equations to NU-Prolog , 1991, PLILP.

[17]  Sergio Antoy Definitional Trees , 1992, ALP.

[18]  Juan José Moreno-Navarro,et al.  Logic Programming with Functions and Predicates: The Language BABEL , 1992, J. Log. Program..

[19]  Mario Rodríguez-Artalejo,et al.  On the Completeness of Narrowing as the Operational Semantics of Functional Logic Programming , 1992, CSL.

[20]  Michael Hanus,et al.  Improving Control of Logic Programs by Using Functional Logic Languages , 1992, PLILP.

[21]  S. Antoy Deenitional Trees , 1992 .

[22]  Juan José Moreno-Navarro,et al.  Implementing a Lazy Functional Logic Language with Disequality Constraints , 1992, JICSLP.

[23]  Werner Hans,et al.  On the Interaction of Lazy Evaluation and Backtracking , 1992, PLILP.

[24]  Werner Hans,et al.  Efficient Lazy Narrowing using Demandedness Analysis , 1993, PLILP.

[25]  Rita Loogen,et al.  A Demand Driven Computation Strategy for Lazy Narrowing , 1993, PLILP.

[26]  Gert Smolka,et al.  Encapsulated Search for Higher-order Concurrent Constraint Programming , 1994, ILPS.

[27]  Michael Hanus,et al.  The Integration of Functions into Logic Programming: From Theory to Practice , 1994, J. Log. Program..

[28]  Michael Hanus,et al.  Combining Lazy Narrowing and Simplification , 1994, PLILP.

[29]  Christian Prehofer,et al.  Higher-order narrowing , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[30]  John W. Lloyd,et al.  Combining Functional and Logic Programming Languages , 1994, ILPS.

[31]  Rachid Echahed,et al.  A needed narrowing strategy , 2000, JACM.

[32]  Gopalan Nadathur,et al.  Scoping Constructs in Logic Programming: Implementation Problems and their Solutions , 1995, J. Log. Program..

[33]  Michael Hanus,et al.  Analysis of Residuating Logic Programs , 1995, J. Log. Program..

[34]  Michael Hanus,et al.  Efficient Translation of Lazy Functional Logic Programs into Prolog , 1995, LOPSTR.

[35]  Lee Naish,et al.  Pruning in Logic Programming , 1995 .

[36]  Herbert Kuchen,et al.  Higher Order Babel: Language and Implementation , 1996, ELP.

[37]  Gert Smolka The Oz Programming Model , 1996 .