## Specialization of Functional Logic Programs

### Cached

### Download Links

Citations: | 2 - 2 self |

### BibTeX

@MISC{Alpuente_specializationof,

author = {María Alpuente and Moreno Falaschi and Germán Vidal},

title = {Specialization of Functional Logic Programs},

year = {}

}

### OpenURL

### Abstract

Languages that integrate functional and logic programming with a complete operational semantics are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction principle of functional languages and the resolution principle of logic languages. In this article, we present a partial evaluation scheme for functional logic languages based on an automatic unfolding algorithm which builds narrowing trees. The method is formalized within the theoretical framework established by Lloyd and Shepherdson for the partial deduction of logic programs, which we have generalized for dealing with functional computations. A generic specialization algorithm is proposed which does not depend on the eager or lazy nature of the narrower being used. To the best of our knowledge, this is the first generic algorithm for the specialization of functional logic programs. We study the semantic properties of the transformation and the conditions under which the technique terminates, is...

### Citations

1360 | A Structural Approach to Operational Semantics
- Plotkin
- 1981
(Show Context)
Citation Context ...g) be the narrowing strategy which assigns the occurrence u of the leftmost innermost subterm of g to the goal g. We formulate innermost conditional narrowing by means of a labelled transition system =-=[52] (Goal,Sub,❀ϕ◭ ) w-=-hose transition relation ❀ϕ◭ ⊆ Goal × Sub × Goal formalizes the computation steps. In the following, we will abbreviate ❀ϕ◭ to ❀◭. Definition 5.1 Let R be a CTRS. We define the inner... |

995 | Term rewriting and all that - Baader, Nipkow - 1998 |

814 | The semantics of constraint logic programs
- Jaffar, Maher, et al.
- 1998
(Show Context)
Citation Context ...e by using enviroments of positive and negative bindings (bindings which do not hold) [63, 25]. We think that we can strengthen this effect in the setting of (equational) constraint logic programming =-=[1, 35]-=- by using some kind of narrowing procedure with disunification, such as the ones defined in [2, 19, 53], in order to propagate (negative) bindings which can be gathered during transformation as (diseq... |

778 | Rewrite systems
- Dershowitz, Jouannaud
- 1990
(Show Context)
Citation Context ...ut the direction of future research. Proofs of selected theorems are given in the Appendix. 2 Preliminaries We briefly recall some known results about rewrite systems and functional logic programming =-=[16, 31, 32, 40]-=-. The definitions below are given in the one-sorted case. The extension to manysorted signatures is straightforward [51]. Throughout this paper, V will denote a countably infinite set of variables and... |

662 |
Partial Evaluation and Automatic Program Generation
- Jones, Gomard, et al.
- 1993
(Show Context)
Citation Context ...not only constant values. Thus the mechanism of PE for logic programs results in general more powerful than for functional programs. Partial evaluation has been extensively studied both in functional =-=[13, 37, 57] and-=- in logic programming [22, 42, 46]. ∗ This work has been partially supported by CICYT under grant TIC 95-0433-C03-03. § DSIC, Universidad Politécnica de Valencia, Camino de Vera s/n, Apdo. 22012, ... |

658 |
Fast pattern matching in strings
- Knuth, Morris, et al.
- 1977
(Show Context)
Citation Context ...method passes the so-called Knuth-Morris-Pratt test [26, 36], i.e. specializing a naïve pattern matcher w.r.t. a fixed pattern obtains the efficiency of the Knuth, Morris and Pratt matching algorithm=-= [41]-=-. This seems to contradict the conjecture in [26] that call-by-value transformers cannot propagate information in a way similar to that in supercompilation [63]. The relation between our method and su... |

596 | A transformation system for developing recursive programs
- Burstall, Darlington
- 1977
(Show Context)
Citation Context ...peedup for a large class of programs [60]. Two basic transformation techniques used in partial evaluation are the folding and unfolding transformations, first introduced by Burstall and Darlington in =-=[11]-=- for functional programs. Unfolding is essentially the replacement of a call by its body, with appropriate substitutions. Folding is the inverse transformation, the replacement of some piece of code b... |

580 | Term Rewriting Systems
- Klop
- 1992
(Show Context)
Citation Context ...ut the direction of future research. Proofs of selected theorems are given in the Appendix. 2 Preliminaries We briefly recall some known results about rewrite systems and functional logic programming =-=[16, 31, 32, 40]-=-. The definitions below are given in the one-sorted case. The extension to manysorted signatures is straightforward [51]. Throughout this paper, V will denote a countably infinite set of variables and... |

466 | Termination of rewriting
- Dershowitz
- 1987
(Show Context)
Citation Context ...notion of orderings in which a term that is “syntactically simpler” than another is smaller than the other. The next definition extends the homeomorphic embedding (“syntactically simpler”) rel=-=ation � [15] to nongro-=-und terms. Definition 4.1 (homeomorphic embedding relation) [59] The homeomorphic embedding relation � on terms in τ(Σ ∪ V) is defined as the smallest relation satisfying x � y for all x,y ∈... |

421 | Deforestation: transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...ven in terms of a rewriting interpreter (with the inside-out order of evaluation), but driving is embedded into the supercompiler – an outside-in metaevaluator over Refal which subsumes deforestatio=-=n [65]-=-, PE and other standard transformations of functional programming languages [60]. For example, supercompilation is able to support certain forms of theorem proving, program synthesis and program inver... |

348 | The Integration of Functions into Logic Programming: From Theory to Practice
- Hanus
- 1994
(Show Context)
Citation Context ...i Matematica e Informatica, Università di Udine, Via delle Scienze 206, 33100 Udine, Italy. 31sIn this paper, we show that, in the context of languages that integrate functional and logic programming=-= [31]-=-, execution and specialization can be based on the unique computation mechanism of narrowing. This unified view of execution and transformation allows us to develop a simple and powerful framework for... |

302 | An implementation of narrowing strategies
- Antoy, Hanus, et al.
- 2001
(Show Context)
Citation Context ...t property of a narrowing strategy ϕ is completeness, meaning that the narrowing constrained by ϕ is still complete. A survey of results about the completeness of narrowing strategies can be found i=-=n [12, 18, 51]-=-. In the case of a confluent and decreasing CTRS R, we can further improve narrowing without losing completeness by normalizing the goal before a narrowing step is applied [34]. A normalizing 35scondi... |

243 |
Partial evaluation in logic programming
- Lloyd, Shepherdson
- 1987
(Show Context)
Citation Context ...hanism of PE for logic programs results in general more powerful than for functional programs. Partial evaluation has been extensively studied both in functional [13, 37, 57] and in logic programming =-=[22, 42, 46]. ∗-=- This work has been partially supported by CICYT under grant TIC 95-0433-C03-03. § DSIC, Universidad Politécnica de Valencia, Camino de Vera s/n, Apdo. 22012, 46071 Valencia, Spain. ¶ Dipartimento ... |

239 | Tutorial notes on partial evaluation - Consel, Danvy - 1993 |

227 |
Unification revisited
- Lassez, Maher, et al.
- 1987
(Show Context)
Citation Context ...of equations E is unifiable, if there exists ϑ ∈ Sub such that for all s = t in E. sϑ ≡ tϑ. ϑ is called a unifier of E. We let mgu(E) denote the most general unifier of the equation set E (see=-=, e.g., [43]). An -=-equational Horn theory E consists of a finite set of equational Horn clauses of the form (λ = ρ) ⇐ C. The condition C is a (possibly empty) sequence e1,...,en, n ≥ 0, of equations. Variables in ... |

222 |
Unfold/Fold Transformations of Logic Programs
- Tamaki, Sato
- 1984
(Show Context)
Citation Context ...alent function call. For functional programs, folding and unfolding steps involve only pattern matching. The fold/unfold transformation approach was first adapted to logic programs by Tamaki and Sato =-=[61]-=- by replacing matching with unification in the transformation rules. Because of the unification mechanism, partial evaluation of logic programs is also able to propagate syntactic information on the p... |

177 | Partial evaluation of computation process - an approach to a compilercompiler - Futamura - 1971 |

176 | The concept of a supercompiler - Turchin - 1986 |

169 | Canonical Forms and Unification - Hullot - 1980 |

159 | Logic programming with functions and predicates: The language BABEL - Moreno-Navarro, Rodr¶guez-Artalejo - 1992 |

151 | Tutorial on Specialisation of Logic Programs
- Gallagher
- 1993
(Show Context)
Citation Context ...hanism of PE for logic programs results in general more powerful than for functional programs. Partial evaluation has been extensively studied both in functional [13, 37, 57] and in logic programming =-=[22, 42, 46]. ∗-=- This work has been partially supported by CICYT under grant TIC 95-0433-C03-03. § DSIC, Universidad Politécnica de Valencia, Camino de Vera s/n, Apdo. 22012, 46071 Valencia, Spain. ¶ Dipartimento ... |

140 | Transformation of logic programs: Foundations and techniques - Pettorossi, Proietti - 1994 |

118 | The s-semantics approach: Theory and applications
- Bossi, Gabbrielli, et al.
- 1994
(Show Context)
Citation Context ...subject of further work. Our results are also relevant for the definition of a compositional semantics for functional logic programming which is useful for modular program analysis and transformation =-=[9]-=-. To achieve such a goal, we intend to study how to define an unfolding semantics using partial evaluation with an unfolding strategy which stops derivations that reach open function symbols (i.e. sym... |

118 | Amalgamating language and meta-language in logic programming - Bowen, Kowalski - 1982 |

114 |
Narrowing as the Operational Semantics of Functional Languages
- Reddy
- 1985
(Show Context)
Citation Context ...his is the first formal approach to partial evaluation of functional logic programs. 1 Introduction Narrowing is the computation mechanism of languages that integrate functional and logic programming =-=[54]-=-. Narrowing solves equations by computing unifiers w.r.t. an equational theory usually described by means of a (conditional) term rewriting system. Function definition and evaluation are thus embedded... |

92 |
SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting
- Fribourg
- 1985
(Show Context)
Citation Context ...narrowing strategy (or position constraint) is any well-defined criterion which obtains a smaller search space by permitting narrowing to reduce only some chosen positions, e.g. basic [33], innermost =-=[20], innerm-=-ost basic [32] or lazy narrowing [54]. Formally, a narrowing strategy ϕ is a mapping that assigns to every goal g (different from ⊤) a subset ϕ(g) of Ō(g) such that for all u ∈ ϕ(g) the goal g... |

76 | An algorithm of generalization in positive supercompilation
- Sørensen, Glück
- 1995
(Show Context)
Citation Context ...cture. The driving process does not always terminate, and it does not preserve the semantics, as it can extend the domain of functions [60]. Techniques to ensure termination of driving are studied in =-=[59, 64]-=-. The idea of [64] is to supervise the construction of the tree and, at certain moments, loop back, i.e. fold a configuration to one of the previous states, and in this way construct a finite graph. T... |

76 | Automated theorem-proving for theories with simplifiers, commutativity and associativity - Slagle - 1974 |

74 | Towards an Automated Tupling Strategy - Chin - 1993 |

64 |
A general criterion for avoiding infinite unfolding during partial deduction
- Bruynooghe, Schreye, et al.
- 1992
(Show Context)
Citation Context ...ed simultaneously. As for local termination, depth-bounds, loop-checks and well-founded orderings are some commonly used tools for controlling the unfolding during the construction of the search tree =-=[10]-=-. We will not address the details of local control in this section. We abstract from this problem by assuming that some suitable unfolding strategy is at our disposal which decides which terms to unfo... |

64 | Ensuring global termination of partial deduction while allowing flexible polyvariance - Martens, Gallagher - 1995 |

63 | Occam's razor in metacomputation: the notion of a perfect process tree
- Glück, Klimov
- 1993
(Show Context)
Citation Context ...ndancies coming from nested loops, repeated variables, etc. Recent work by Glück and Klimov has expressed the essentials of driving in the context of a more traditional functional language with lists=-= [25]. -=-In [36], Jones put Turchin’s driving methodology on a solid semantic foundation which is not tied to any particular programming language or data structure. The driving process does not always termin... |

57 |
Compiling Logic Programs with Equality
- Hanus
- 1990
(Show Context)
Citation Context ...ormed by innermost conditional rewriting (i.e., a rewrite rule is applied to a term only if each of its subterms is in normal form). This simplifies our proofs and can also be efficiently implemented =-=[27, 28]-=-. In order to ensure that the normal form of a goal uniquely exists and can be computed by any strategy of rewriting, we require programs to be decreasing as well. Normalizing innermost narrowing is t... |

57 |
Partial evaluation as a means for inferencing data structures in an applicative language: A theory and implementation i the case of Prolog
- Komorowski
- 1982
(Show Context)
Citation Context ...hanism of PE for logic programs results in general more powerful than for functional programs. Partial evaluation has been extensively studied both in functional [13, 37, 57] and in logic programming =-=[22, 42, 46]. ∗-=- This work has been partially supported by CICYT under grant TIC 95-0433-C03-03. § DSIC, Universidad Politécnica de Valencia, Camino de Vera s/n, Apdo. 22012, 46071 Valencia, Spain. ¶ Dipartimento ... |

56 |
Foundations of Equational Logic Programming
- Hölldobler
- 1989
(Show Context)
Citation Context ...ut the direction of future research. Proofs of selected theorems are given in the Appendix. 2 Preliminaries We briefly recall some known results about rewrite systems and functional logic programming =-=[16, 31, 32, 40]-=-. The definitions below are given in the one-sorted case. The extension to manysorted signatures is straightforward [51]. Throughout this paper, V will denote a countably infinite set of variables and... |

53 | Curry: A Truly Functional Logic Language - Hanus, Kuchen, et al. - 1995 |

51 | The ecce partial deduction system and the dppd library of benchmarks. Obtainable via http://www.ecs.soton.ac.uk/~mal - Leuschel |

49 | Loop checking in partial deduction - Bol - 1993 |

49 | Global control for partial deduction through characteristic atoms and global trees - Leuschel, Martens - 1996 |

48 | Static and dynamic semantics processing - Consel, Danvy - 1991 |

46 | Algebraic properties of idempotent substitutions - Palamidessi - 1990 |

45 | Partial Deduction and Driving are Equivalent, in
- Glück, Sørensen
- 1994
(Show Context)
Citation Context ...e introduce an appropriate abstract operator which guarantees termination and allows us to tune the specialization of the method. We prove that our method passes the so-called Knuth-Morris-Pratt test =-=[26, 36],-=- i.e. specializing a naïve pattern matcher w.r.t. a fixed pattern obtains the efficiency of the Knuth, Morris and Pratt matching algorithm [41]. This seems to contradict the conjecture in [26] that c... |

45 | Completeness Results for Basic Narrowing - Middeldorp, Hamoen - 1994 |

44 |
Design and Implementation of a Generic, Logic and Functional Programming Language
- Bert, Echahed
- 1986
(Show Context)
Citation Context ...they are usual when using types and each function is defined for all constructors of their argument types. Examples of functional logic languages following the CB-CD discipline are: SLOG [20] and LPG =-=[5, 6]. L-=-et ϕ◭(g) be the narrowing strategy which assigns the occurrence u of the leftmost innermost subterm of g to the goal g. We formulate innermost conditional narrowing by means of a labelled transitio... |

44 |
The algorithm of generalization in the supercompiler
- Turchin
- 1988
(Show Context)
Citation Context ...cture. The driving process does not always terminate, and it does not preserve the semantics, as it can extend the domain of functions [60]. Techniques to ensure termination of driving are studied in =-=[59, 64]-=-. The idea of [64] is to supervise the construction of the tree and, at certain moments, loop back, i.e. fold a configuration to one of the previous states, and in this way construct a finite graph. T... |

39 | Lazy Narrowing: Strong Completeness and Eager Variable Elimination, Theoretical Computer Science 167(1,2 - Middeldorp, Okui, et al. - 1996 |

36 | Specialization of Lazy Functional Logic Programs - Alpuente, Falaschi, et al. - 1997 |

36 | Foundations of Equational Logic Programming, volume 353 - Hölldobler - 1989 |

35 |
Narrowing vs. SLD-resolution
- Bosco, Giovannetti, et al.
- 1988
(Show Context)
Citation Context ...g point of view. Many equational theories which occur in practice follow this discipline, e.g. in the specification of abstract data types. A function symbol is completely-defined (everywhere defined =-=[8]-=-) if it does not occur in any ground term in normal form, that is to say functions are reducible on all ground terms of an appropriate sort. R is said to be completely-defined (CD) if each defined fun... |

34 | A self-applicable partial evaluator for term rewriting systems - Bondorf - 1989 |