## The Integration of Functions into Logic Programming: From Theory to Practice (1994)

### Cached

### Download Links

Venue: | Journal of Logic Programming |

Citations: | 333 - 51 self |

### BibTeX

@ARTICLE{Hanus94theintegration,

author = {Michael Hanus},

title = {The Integration of Functions into Logic Programming: From Theory to Practice},

journal = {Journal of Logic Programming},

year = {1994},

pages = {583--628}

}

### Years of Citing Articles

### OpenURL

### Abstract

Abstract. Functional logic programming languages combine the most important declarative programming paradigms, and attempts to combine these paradigms have a long history. The declarative multi-paradigm language Curry is influenced by recent advances in the foundations and implementation of functional logic languages. The development of Curry is an international initiative intended to provide a common platform for the research, teaching, and application of integrated functional logic languages. This paper surveys the foundations of functional logic programming that are relevant for Curry, the main features of Curry, and extensions and applications of Curry and functional logic programming. 1

### Citations

1309 | Monads for Functional Programming
- Wadler
- 1995
(Show Context)
Citation Context ... last l = e iff ∃xs : xs ++[e] = l. 3 Based on this specification, one can define an operation and verify that this definition satisfies the given specification (e.g., by inductive proofs as shown in =-=[34]-=-). This is one of the situations where functional logic languages become handy. Similarly to logic languages, functional logic languages provide search for solutions for existentially quantified varia... |

940 |
Term Rewriting and All That
- Baader, Nipkow
- 1998
(Show Context)
Citation Context ... to functional programming, the left-hand side of a defining equation is unified with the subterm under evaluation. In order to provide more detailed definitions, some basic notions of term rewriting =-=[31,48]-=- are briefly recalled. Although the theoretical part uses notations from term rewriting, its mapping into the concrete programming language syntax should be obvious. Since we ignore polymorphic types ... |

751 | Rewrite systems
- Dershowitz, Jouannaud
- 1992
(Show Context)
Citation Context ... to functional programming, the left-hand side of a defining equation is unified with the subterm under evaluation. In order to provide more detailed definitions, some basic notions of term rewriting =-=[31,48]-=- are briefly recalled. Although the theoretical part uses notations from term rewriting, its mapping into the concrete programming language syntax should be obvious. Since we ignore polymorphic types ... |

358 |
Principal type-schemes for functional programs
- Damas, Milner
- 1982
(Show Context)
Citation Context ...imilar to the syntax of Haskell [117] and has been already introduced in an informal manner. Curry is a polymorphically typed language with a Hindley/Milner-like type system supporting type inference =-=[46]-=-. Since the type concept is fairly standard and orthogonal to the other issues of the language, it is not explicitly addressed in the following. Therefore, this section is devoted to discuss concepts ... |

290 | On completeness of narrowing strategies
- Echahed
- 1988
(Show Context)
Citation Context ...) were influenced by the resolution principle and required that the substitution used in a narrowing step must be a most general unifier of t|p and the left-hand side of the applied rule. As shown in =-=[19]-=-, this condition prevents the development of optimal evaluation strategies. Therefore, most recent narrowing strategies relax this traditional requirement but provide another constructive method to co... |

151 | Definitional trees
- Antoy
- 1992
(Show Context)
Citation Context ...✷ Since there are TRSs with rules that do not allow such a reasoning, needed narrowing is defined on the subclass of inductively sequential TRSs. This class can be characterized by definitional trees =-=[12]-=- that are also useful to formalize and implement various narrowing strategies. Since only the left-hand sides of rules are important for the applicability of needed narrowing, the following characteri... |

140 | A Unified Computation Model for Functional and Logic Programming
- Hanus
- 1997
(Show Context)
Citation Context ...d implementation of functional logic languages have shown reasonable principles that lead to the design of practically applicable programming languages. The declarative multiparadigm language Curry 1 =-=[69,92]-=- is based on these principles. It is developed by an international initiative of researchers in this area and intended to provide a common platform for the research, teaching, and application of integ... |

104 |
Kernel Leaf: A Logic plus Functional Language
- Giovannetti, Levi, et al.
- 1991
(Show Context)
Citation Context ...ed as true. Furthermore, normal forms or values might not exist (note that we do not require terminating rewrite systems) so that reflexivity is not a feasible property of equational constraints (see =-=[60]-=- for a more detailed discussion on this topic). Strict equality can be defined as a binary operation by the following set of (inductively sequential) rewrite rules. The constant Success denotes a solv... |

96 |
An approach to declarative programming based on a rewriting logic
- González-Moreno, Hortalá-González, et al.
- 1999
(Show Context)
Citation Context ...e also capable of dealing with such nondeterministic operations. To provide a reasonable semantics for functional logic programs, constructor-based rules are sufficient but confluence is not required =-=[62]-=-. If operations are interpreted as mappings from values into sets of values (actually, due to the presence of recursive non-strict operations, algebraic structures with cones of partially ordered sets... |

92 |
SLOG: A logic programming language interpreter based on clausal superposition and rewriting
- Fribourg
- 1985
(Show Context)
Citation Context ...ages w.r.t. demand-driven evaluation strategies so that they became astandard feature of current functional logic languages, whereas older languages, like ALF [65], Babel [109], K-Leaf [60], or SLOG =-=[58]-=-, put confluence requirements on their programs. The following example discusses this in more detail. Example 6. Based on the binary operation “?” introduced above, one can define an operation insert ... |

88 |
Conditional rewrite rules: Confluence and termination
- Bergstra, Klop
- 1982
(Show Context)
Citation Context ...onfluence requirements where only restricted 9 The recursion in this intuitive definition of conditional rewriting can be avoided by an iterative definition using levels for rewriting conditions, see =-=[33]-=-.subsets of conditional rules can be transformed into unconditional ones (e.g., [33]). Actually, Antoy [14] has shown a systematic method to translate any conditional constructor-based TRS into an ov... |

80 | Narrowing-driven partial evaluation of functional logic programs
- Alpuente, Falaschi, et al.
- 1996
(Show Context)
Citation Context ...languages has many other facets that have been considered also for functional logic languages. For instance, partial evaluation is a powerful compile-time technique to optimize source-level programs. =-=[9]-=- contains a general framework for the partial evaluation of functional logic programs. It has been specialized to the case of needed narrowing in [10] where the superiority of needed narrowing has bee... |

61 | Optimal non-deterministic functional logic computations
- Antoy
(Show Context)
Citation Context ...alize and implement various narrowing strategies. Since only the left-hand sides of rules are important for the applicability of needed narrowing, the following characterization of definitional trees =-=[13]-=- considers patterns partially ordered by subsumption (the subsumption ordering on terms is defined by t ≤ σ(t) for a term t and substitution σ). A definitional tree of an operation f is a non-empty se... |

57 |
Compiling Logic Programs with Equality
- Hanus
- 1990
(Show Context)
Citation Context ... nondeterministic operations have advantages w.r.t. demand-driven evaluation strategies so that they became astandard feature of current functional logic languages, whereas older languages, like ALF =-=[65]-=-, Babel [109], K-Leaf [60], or SLOG [58], put confluence requirements on their programs. The following example discusses this in more detail. Example 6. Based on the binary operation “?” introduced ab... |

56 |
PAKCS: The Portland Aachen Kiel Curry System. Available at http: //www.informatik.uni-kiel.de/~pakcs
- Hanus, Antoy, et al.
- 2010
(Show Context)
Citation Context ...inor transformations). Thus, one obtains with a limited effort an implementation that can be used for larger applications with a comparable efficiency than other more low-level implementations (e.g., =-=[81,101]-=-). Despite these advantages, the transformation into Prolog has the drawback that one is fixed to Prolog’s backtracking strategy to implement nondeterministic search. This hampers the implementation o... |

55 | Compiling Multi-Paradigm Declarative Programs into Prolog
- Antoy, Hanus
- 2000
(Show Context)
Citation Context ...egies, concurrency, external operations etc (see [3] for details). The flat representation of programs and its operational semantics has been used for various language-oriented tools (e.g., compilers =-=[20,27]-=-, partial evaluators [4,5], trace-oriented debuggers [40], profilers [39]) and extended in various ways (e.g., higher-order functions [87], memoization [53], encapsulated search [38], computation cost... |

54 | Operational Semantics for Declarative Multi-Paradigm Languages
- Albert, Hanus, et al.
(Show Context)
Citation Context ... search for solutions for existentially quantified variables. In contrast to pure logic languages, they support equation solving over nested functional expressions so that an equation like xs ++[e] = =-=[1,2,3]-=- is solved by instantiating xs to the list [1,2] and e to the value 3. For instance, in Curry one can define the operation last as follows: last l | xs++[e] =:= l = e where xs,e free Here, the symbol ... |

53 | Constructor-based conditional narrowing
- Antoy
- 2001
(Show Context)
Citation Context ...riting can be avoided by an iterative definition using levels for rewriting conditions, see [33].subsets of conditional rules can be transformed into unconditional ones (e.g., [33]). Actually, Antoy =-=[14]-=- has shown a systematic method to translate any conditional constructor-based TRS into an overlapping inductively sequential TRS performing equivalent computations. For restricted subsets of condition... |

51 | High-level server side web scripting in Curry - Hanus - 1990 |

46 | Parallel Evaluation Strategies for Functional Logic Languages
- Antoy, Echahed, et al.
- 1997
(Show Context)
Citation Context ...ded narrowing to a weakly needed narrowing strategy. The basic idea is to generalize the notion of definitional trees to include or-branches which conceptually represent a union of definitional trees =-=[12,18,100]-=-. If such an or-branch is encountered during the evaluation of a narrowing step, weakly needed narrowing performs a nondeterministic guess and proceeds with the subtrees below the or-branches. Example... |

44 | R.: Le fun: Logic, equations, and functions
- Ait-Kaci, Lincoln, et al.
- 1987
(Show Context)
Citation Context ...ation, is based on the idea to delay or suspend function calls until they are ready for deterministic evaluation. The residuation principle is used, for instance, in the languages Escher [99], Le Fun =-=[2]-=-, Life [1], NUE-Prolog [110], and Oz [126]. Since the residuation principle evaluates function calls by deterministic reduction steps, nondeterministic search must be encoded by predicates [1,2,110] o... |

41 | Distributed programming in a multi-paradigm declarative language
- Hanus
- 1999
(Show Context)
Citation Context ...ng them is a nontrivial task. Since Curry has already features for concurrent programming via residuation, it provides a good basis that can be extended for distributed programming. For this purpose, =-=[70]-=- proposes port constraints. Conceptually, a port is a constraint between a multiset (of messages) and a list that is satisfied if all elements in the multiset occur in the list and vice versa. Clients... |

41 | A functional logic programming approach to graphical user interfaces
- Hanus
(Show Context)
Citation Context ... improved abstractions in application programs. Further design patterns and programming techniques are discussed in [21,22]. The combination of functional and logic language features are exploited in =-=[71]-=- for the high-level programming of GUIs. The hierarchical structure of a GUI (e.g., rows, columns, or matrices of primitive and combined widgets) is represented as a data term. This term contains call... |

39 | Functional logic design patterns
- Antoy, Hanus
(Show Context)
Citation Context ... demonstrate the feasibility and advantages of functional logic programming. A summary of design patterns exploiting combined functional and logic features for application programming can be found in =-=[21]-=-. These patterns are unique to functional logic programming and cannot be directly applied in other paradigms. For instance, the constraint constructor pattern exploits the fact that functional logic ... |

35 | An Overview of LIFE
- Aït-Kaci
- 1990
(Show Context)
Citation Context ... search for solutions for existentially quantified variables. In contrast to pure logic languages, they support equation solving over nested functional expressions so that an equation like xs ++[e] = =-=[1,2,3]-=- is solved by instantiating xs to the list [1,2] and e to the value 3. For instance, in Curry one can define the operation last as follows: last l | xs++[e] =:= l = e where xs,e free Here, the symbol ... |

30 |
Towards a Clean Amalgamation of Logic Programs with External Procedures
- Bonnier, Maluszynski
- 1988
(Show Context)
Citation Context ...aluation principle with synchronization on logic variables (sometimes also called declarative concurrency [128]) and a conceptually clean method to connect external operations to declarative programs =-=[35]-=- (note that narrowing requires operations to be explicitly defined by rewrite rules). Therefore, it is desirable to integrate both principles in a single framework. This has been proposed in [69] wher... |

30 | Efficient Translation of Lazy Functional Logic Programs into Prolog
- Hanus
- 1995
(Show Context)
Citation Context ...to exploit the implementation technology available for Prolog. Actually, there are various approaches to implement functional logic languages with demand-driven evaluation strategies in Prolog (e.g., =-=[11,20,44,68,96,100]-=-). A common idea is the translation of source operations into predicates that compute only the head normal form (i.e., a constructor-rooted term or a variable) of a call to this operation. Thus, an n-... |

30 | Type-oriented construction of web user interfaces
- Hanus
- 2006
(Show Context)
Citation Context ...rd matrix transposition, and squaresOfNine computes the list of 3 × 3 sub-matrices. Then, a SuDoku puzzle can be solved with these constraints by adding the usual domain and labeling constraints (see =-=[77]-=- for more details). 5.2 Functional Patterns We have discussed in Section 2.2 the fundamental requirement of functional languages for constructor-based rewrite systems. This requirement is the key for ... |

29 | Admissible graph rewriting and narrowing
- Echahed, Janodet
- 1998
(Show Context)
Citation Context ...lat programs. However, they can be used to translate extended classes of programs containing circular data structures and are convenient to express sharing without the use of complex graph structures =-=[49,64]-=-. Operationally, let bindings introduce new structures in memory that are updated after evaluation, which is essential for lazy computations [98]. Furthermore, let bindings are also useful to represen... |

28 | Evaluation strategies for functional logic programming
- Antoy
- 2005
(Show Context)
Citation Context ...related to this paper. [66] is a survey on the development and the implementation of various evaluation strategies for functional logic languages that have been explored until more than a decade ago. =-=[15]-=- contains a good survey on more recent evaluation strategies and classes of functional logic programs. The survey [119] is more specialized but reviews the efforts to integrate constraints into functi... |

24 | A higher order rewriting logic for functional logic programming
- González-Moreno, Hortalá-González, et al.
- 1997
(Show Context)
Citation Context ... languages with non-strict nondeterministic operations. It is a basis for the verification of functional logic programs [45] and has been extended in various directions, e.g., higher-order operations =-=[63]-=-, algebraic types [30], polymorphic types [61], failure [104], constraints [102] etc. An account on CRWL and its applications can be found in [119]. As discussed in [103], a disadvantage of CRWL is it... |

20 | F.: Encapsulating non-determinism in functional logic computations
- Braßel, Hanus, et al.
- 2004
(Show Context)
Citation Context ....g., compilers [20,27], partial evaluators [4,5], trace-oriented debuggers [40], profilers [39]) and extended in various ways (e.g., higher-order functions [87], memoization [53], encapsulated search =-=[38]-=-, computation costs [39]). Flat programs can be considered as a kernel language for functional logic programming since programs written in concrete functional logic languages like Curry with all its s... |

20 | A Semantics for Tracing Declarative Multi-Paradigm Programs - Braßel, Hanus, et al. - 2004 |

19 | Declarative Programming with Function Patterns
- Antoy, Hanus
- 2005
(Show Context)
Citation Context ...of rules: last [x] = x last [x1,x] = x last [x1,x2,x] = x ... Hence, the expression last [failed,3] reduces to 3 w.r.t. these rules. In order to provide a constructive implementation of this concept, =-=[23]-=- proposes a specific demand-driven unification procedure for functional pattern unification that can be implemented similarly to strict equality. Functional patterns are a powerful concept to express ... |

18 | Partial Evaluation of Multi-Paradigm Declarative Languages: Foundations, Control, Algorithms and Efficiency
- Albert
- 1998
(Show Context)
Citation Context ... operations etc (see [3] for details). The flat representation of programs and its operational semantics has been used for various language-oriented tools (e.g., compilers [20,27], partial evaluators =-=[4,5]-=-, trace-oriented debuggers [40], profilers [39]) and extended in various ways (e.g., higher-order functions [87], memoization [53], encapsulated search [38], computation costs [39]). Flat programs can... |

18 | A Virtual Machine for Functional Logic Computations
- Antoy, Hanus, et al.
- 2005
(Show Context)
Citation Context ...gth of derivations and number of computed solutions and always computes a value if it exists (in case of nondeterministic choices only if the underlying implementation is fair w.r.t. such choices, as =-=[26,27,88]-=-). Therefore, the programmer can concentrate on the declarative meaning of programs and needs less attention to the consequences of the particular evaluation strategy (see [73] for a more detailed dis... |

18 | Implementation of Narrowing: The Prolog-Based Approach
- Cheong, Fribourg
(Show Context)
Citation Context ...to exploit the implementation technology available for Prolog. Actually, there are various approaches to implement functional logic languages with demand-driven evaluation strategies in Prolog (e.g., =-=[11,20,44,68,96,100]-=-). A common idea is the translation of source operations into predicates that compute only the head normal form (i.e., a constructor-rooted term or a variable) of a call to this operation. Thus, an n-... |

17 | On a tighter integration of functional and logic programming
- Brassel, Huch
- 2007
(Show Context)
Citation Context ...x = x} in leq x (S O) can be transformed into let {x = genNat} in leq x (S O) without changing the computed results. These equivalences have been used in implementations of functional logic languages =-=[41,42]-=-. Further details can be found in [24].3 Language Concepts: Curry After the review of recent results and techniques for functional logic programming, this section shows how they influenced the design... |

15 |
Using an Abstract Representation to Specialize Functional Logic Programs
- Albert, Hanus, et al.
- 1955
(Show Context)
Citation Context ... operations etc (see [3] for details). The flat representation of programs and its operational semantics has been used for various language-oriented tools (e.g., compilers [20,27], partial evaluators =-=[4,5]-=-, trace-oriented debuggers [40], profilers [39]) and extended in various ways (e.g., higher-order functions [87], memoization [53], encapsulated search [38], computation costs [39]). Flat programs can... |

15 |
A functional logic database library
- Fischer
- 2005
(Show Context)
Citation Context ...or distributed programming. Other aspects, which are not discussed below, are default rules [108], failure [104,120], inductive programming [56], tabling and memoization [16,53], connecting databases =-=[57,75]-=-, or proof tools for the verification of functional logic programs [45].5.1 Constraints The integration of constraints has been already mentioned. Curry provides equational constraints that are solve... |

14 |
Non-Determinism and Lazy Evaluation in Logic Programming
- Antoy
- 1991
(Show Context)
Citation Context ...to exploit the implementation technology available for Prolog. Actually, there are various approaches to implement functional logic languages with demand-driven evaluation strategies in Prolog (e.g., =-=[11,20,44,68,96,100]-=-). A common idea is the translation of source operations into predicates that compute only the head normal form (i.e., a constructor-rooted term or a variable) of a call to this operation. Thus, an n-... |

14 | To the Gates of HAL: A HAL Tutorial
- Banda, Demoen, et al.
- 2002
(Show Context)
Citation Context ...th partially instantiated structures, so that some programming techniques for functional logic programming [21,71,72] cannot be applied in Mercury. This condition has been relaxed in the language HAL =-=[59]-=-. However, both languages are based on a strict operational semantics that does not support optimal evaluations. Although many encouraging results have been obtained in recent years, the development o... |

14 |
Polymorphic types in functional logic programming
- González-Moreno, Hortalá-González, et al.
- 2001
(Show Context)
Citation Context ...erations. It is a basis for the verification of functional logic programs [45] and has been extended in various directions, e.g., higher-order operations [63], algebraic types [30], polymorphic types =-=[61]-=-, failure [104], constraints [102] etc. An account on CRWL and its applications can be found in [119]. As discussed in [103], a disadvantage of CRWL is its high level of abstraction: CRWL relates expr... |

14 | Dynamic Predicates in Functional Logic Programs
- Hanus
(Show Context)
Citation Context ...or distributed programming. Other aspects, which are not discussed below, are default rules [108], failure [104,120], inductive programming [56], tabling and memoization [16,53], connecting databases =-=[57,75]-=-, or proof tools for the verification of functional logic programs [45].5.1 Constraints The integration of constraints has been already mentioned. Curry provides equational constraints that are solve... |

14 |
Analyses of Unsatisfiability for Equational Logic Programming
- Alpuente, Falaschi, et al.
- 1995
(Show Context)
Citation Context ...e compatibility of different implementations, standard interfaces to external operations. Analysis and transformation: Only a few approaches exist for the analysis of functional logic programs (e.g., =-=[7,8,37,67,79,90,91,132]-=-) so that this area deserves more studies, like termination analyses, abstract interpretation frameworks, analysis of particular properties (e.g., determinism, suspension, modes). Similarly, more powe... |

14 |
The Kiel Curry System KiCS
- Braßel, Huch
- 2009
(Show Context)
Citation Context ...x = x} in leq x (S O) can be transformed into let {x = genNat} in leq x (S O) without changing the computed results. These equivalences have been used in implementations of functional logic languages =-=[41,42]-=-. Further details can be found in [24].3 Language Concepts: Curry After the review of recent results and techniques for functional logic programming, this section shows how they influenced the design... |

13 | A Debugging Scheme for Functional Logic Programs - Alpuente, Correa, et al. - 2002 |

13 | Observing Functional Logic Computations
- Braßel, Chitil, et al.
- 2004
(Show Context)
Citation Context ...often not helpful, the objective of debugging tools is usually a representation of operational aspects that are more oriented towards the program text rather than execution steps. For instance, COOSy =-=[36]-=- is a tool to observe the evaluation of individual expressions, operations, or logic variables in a program. It records the observable events during run time and presents the corresponding results (co... |

13 | Refining weakly outermost-needed rewriting and narrowing
- Escobar
- 2003
(Show Context)
Citation Context ... more than one inductive position (e.g., in operations like “=:=” and “&” defined above). This is exploited to implement needed narrowing in a way that reduces the number of nondeterministic choices. =-=[50,51]-=- proposes natural narrowing as a refinement of weakly needed narrowing by incorporating a better treatment of demandedness properties. Since the formal reasoning about sophisticated narrowing strategi... |

12 | Conditional Narrowing without Conditions
- Antoy, Braßel, et al.
(Show Context)
Citation Context ...orming equivalent computations. For restricted subsets of conditional rules, other transformations that allow the application of more sophisticated narrowing strategies are possible. For instance, in =-=[17]-=- it is shown how to transform any weakly orthogonal conditional TRS into an unconditional TRS so that the weakly needed and parallel narrowing strategies are sound and complete on the transformed prog... |