## Cost-Augmented Partial Evaluation of Functional Logic Programs (2004)

### Cached

### Download Links

- [www.dsic.upv.es]
- [www.dsic.upv.es]
- [users.dsic.upv.es]
- DBLP

### Other Repositories/Bibliography

Venue: | Higher-Order and Symbolic Computation |

Citations: | 4 - 2 self |

### BibTeX

@INPROCEEDINGS{Vidal04cost-augmentedpartial,

author = {German Vidal},

title = {Cost-Augmented Partial Evaluation of Functional Logic Programs},

booktitle = {Higher-Order and Symbolic Computation},

year = {2004},

pages = {1--2}

}

### OpenURL

### Abstract

We enhance the narrowing-driven partial evaluation scheme for lazy functional logic programs with the computation of symbolic costs. The enhanced scheme allows us to estimate the e#ects of the program transformer in a precise framework and, moreover, to quantify these e#ects. The considered costs are "symbolic " in the sense that they measure the number of basic operations performed during a computation rather than actual execution times. Our scheme may serve as a basis to develop speedup analyses and cost-guided transformers. A cost-augmented partial evaluator, which demonstrates the usefulness of our approach, has been implemented in the multi-paradigm language Curry.

### Citations

950 |
Term Rewriting and All That
- Baader, Nipkow
- 1998
(Show Context)
Citation Context ...:10; p.4sCost-Augmented Partial Evaluation of Functional Logic Programs 5 2. Functional Logic Programming For the sake of completeness, we recall in this section some basic notions of term rewriting (=-=Baader and Nipkow, 1998)-=- and functional logic programming (Hanus, 1994). 2.1. Preliminaries We consider a (many-sorted) signature Σ partitioned into a set C of constructors and a set F of (defined) functions or operations. ... |

642 |
Partial Evaluation and Automatic Program Generation
- Jones, Gomard, et al.
- 1993
(Show Context)
Citation Context ...or the partial evaluation of logic programs—also known as partial deduction (Lloyd and Shepherdson, 1991)—than to traditional partial evaluators for functional programs based on constant propagati=-=on (Jones et al., 1993). I-=-n narrowing-driven partial evaluation, the socalled static/dynamic distinction is hardly present. Indeed, the “known data” are presented in the form of a partially instantiated call. Another signi... |

570 | A Transformation System for Developing Recursive Programs
- M, Darlington
- 1977
(Show Context)
Citation Context ...e cost-augmented partial evaluator. 6.1. Deforestation In this section, we examine some typical benchmarks for deforestation (Wadler, 1990). Consider, for instance, the well-known “all ones” progr=-=am (Burstall and Darlington, 1977): allon-=-es x = case x of { Z → [] ; (S y) → 1 : allones y } length x = case x of { [] → Z ; (y:ys) → S (length ys) } where natural numbers are represented by terms built from Z (zero) and S (successor... |

401 | Deforestation: Transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...argument) becomes necessary. For this purpose, we introduce the case of case rule, which moves the outer case inside the branches of the inner one. Similar rules can be found, e.g., in deforestation (=-=Wadler, 1990)-=- and driving (Sørensen et al., 1996). The current costs remain unchanged, since no expression is reduced and the order of evaluation is not modified. Rigorously speaking, this rule can be expanded in... |

334 | Functional logic programming: From theory to Curry
- Hanus
- 2013
(Show Context)
Citation Context ...gic Programs 5 2. Functional Logic Programming For the sake of completeness, we recall in this section some basic notions of term rewriting (Baader and Nipkow, 1998) and functional logic programming (=-=Hanus, 1994). 2.-=-1. Preliminaries We consider a (many-sorted) signature Σ partitioned into a set C of constructors and a set F of (defined) functions or operations. We write c/n ∈ C and f/n ∈ F for n-ary construc... |

300 | Definitional interpreters for higher-order programming languages
- Reynolds
- 1972
(Show Context)
Citation Context ...rtial application) | apply(e1, e2) (application) p ::= c(x1, . . . , xn) (flat pattern) Figure 1. Syntax of Flat Programs The flat language is first-order, i.e., source programs are defunctionalized (=-=Reynolds, 1998-=-) by using the operators partcall and apply: partcall is used to denote partial function applications and apply makes the application of a function to an argument explicit (Warren, 1982). This strateg... |

291 | A needed narrowing strategy - Antoy, Echahed, et al. |

240 |
Partial evaluation in logic programming
- Lloyd, Shepherdson
- 1987
(Show Context)
Citation Context ...kell). In spite of this fact, narrowing-driven partial evaluation shares more similarities with unification-based methods for the partial evaluation of logic programs—also known as partial deduction=-= (Lloyd and Shepherdson, 1991)�-=-��than to traditional partial evaluators for functional programs based on constant propagation (Jones et al., 1993). In narrowing-driven partial evaluation, the socalled static/dynamic distinction is ... |

156 |
Logic Programming with Functions and Predicates: The language Babel
- Moreno-Navarro, Rodríguez-Artalejo
- 1992
(Show Context)
Citation Context ...ations and to deal with infinite data structures, demand-driven generation of the search space has been advocated by a number lazy narrowing strategies (Giovannetti et al., 1991; Loogen et al., 1993; =-=Moreno-Navarro and Rodríguez-Artalejo, 1992-=-). Due to its optimality properties w.r.t. the length of derivations and the number of computed solutions, needed narrowing (Antoy et al., 2000) is currently the best lazy narrowing strategy. 2.3. Nee... |

152 | Definitional trees
- Antoy
- 1992
(Show Context)
Citation Context ... the derivation is needed. An efficient implementation of needed narrowing exists for inductively sequential programs. For the sake of completeness, we give an intuitive account of this concept; see (=-=Antoy, 1992-=-) for a complete definition. A program is inductively sequential when all its functions are defined by rewrite rules that, recursively, make on their arguments a case distinction analogous to a data t... |

145 | Tutorial on specialisation of logic programs - Gallagher - 1993 |

141 | A unified computation model for functional and logic programming
- Hanus
- 1997
(Show Context)
Citation Context ...hmetic operators, common higher-order functions (like map or foldr), monadic input/output, etc. The basic operational semantics of Curry is based on a combination of needed narrowing and residuation (=-=Hanus, 1997-=-). The residuation principle is based on the idea of delaying function calls until they are ready for a deterministic evaluation. Residuation preserves the deterministic nature of functions and natura... |

104 |
Kernel Leaf: A Logic plus Functional Language
- Giovannetti, Levi, et al.
- 1991
(Show Context)
Citation Context ... children. In order to avoid unnecessary computations and to deal with infinite data structures, demand-driven generation of the search space has been advocated by a number lazy narrowing strategies (=-=Giovannetti et al., 1991;-=- Loogen et al., 1993; Moreno-Navarro and Rodríguez-Artalejo, 1992). Due to its optimality properties w.r.t. the length of derivations and the number of computed solutions, needed narrowing (Antoy et ... |

95 | A Demand Driven Computation Strategy for Lazy Narrowing
- Loogen, López-Fraguas, et al.
- 1993
(Show Context)
Citation Context ...id unnecessary computations and to deal with infinite data structures, demand-driven generation of the search space has been advocated by a number lazy narrowing strategies (Giovannetti et al., 1991; =-=Loogen et al., 1993;-=- Moreno-Navarro and Rodríguez-Artalejo, 1992). Due to its optimality properties w.r.t. the length of derivations and the number of computed solutions, needed narrowing (Antoy et al., 2000) is current... |

88 |
Higher-order extensions to Prolog: are they needed
- Warren
- 1982
(Show Context)
Citation Context ...ctionalized (Reynolds, 1998) by using the operators partcall and apply: partcall is used to denote partial function applications and apply makes the application of a function to an argument explicit (=-=Warren, 1982)-=-. This strategy is followed by many language implementations, e.g., PAKCS (Hanus (ed.) et al., 2003) and Münster Curry (Lux, 2003). Example 2. Consider again the (inductively sequential) function app... |

84 |
Computations in orthogonal rewriting systems
- Huet, Lévy
- 1991
(Show Context)
Citation Context ...gramming. Following (Antoy et al., 2000), a narrowing step t � (p,R,σ) t ′ is called needed iff, for every substitution θ such that σ ≤ θ, p is the position of a needed redex of θ(t) in the=-= sense of (Huet and Lévy, 1992-=-). A narrowing derivation is called needed iff every step of the derivation is needed. An efficient implementation of needed narrowing exists for inductively sequential programs. For the sake of compl... |

82 | A transformation-based optimiser for Haskell - Jones, Santos - 1998 |

80 | Narrowing-driven partial evaluation of functional logic programs
- Alpuente, Falaschi, et al.
- 1996
(Show Context)
Citation Context ...4. Cost-Augmented Partial Evaluation Narrowing-driven partial evaluation was originally designed to use the standard semantics to perform computations at specialization time (Albert and Vidal, 2002a; =-=Alpuente et al., 1998). Within-=- this scheme, residual rules are constructed from partial computations as follows. Given an expression e and a (possibly incomplete) computation e ⇒ ∗ σ e ′ , we derive a residual rule—a resu... |

78 | A Positive Supercompiler
- Sørensen, Glück, et al.
- 1996
(Show Context)
Citation Context .... For this purpose, we introduce the case of case rule, which moves the outer case inside the branches of the inner one. Similar rules can be found, e.g., in deforestation (Wadler, 1990) and driving (=-=Sørensen et al., 1996-=-). The current costs remain unchanged, since no expression is reduced and the order of evaluation is not modified. Rigorously speaking, this rule can be expanded into four rules (with the different co... |

73 | An algorithm of generalization in positive supercompilation
- Sørensen, Glück
- 1995
(Show Context)
Citation Context ...vations, there exist a number of well-known techniques in the literature, e.g., depth-bounds, loop-checks, well-founded (or well-quasi) orderings; see, e.g., (Bruynooghe et al., 1992; Leuschel, 1998; =-=Sørensen and Glück, 1995-=-). For instance, an unfolding rule based on the use of the homeomorphic embedding ordering is used in the partial evaluator for Curry programs of Albert et al. (2002b). Function add exps is used to ad... |

63 | A general criterion for avoiding infinite unfolding during partial deduction - Bruynooghe, Schreye, et al. - 1992 |

61 | Improving Homeomorphic Embedding for Online Termination
- Leuschel
(Show Context)
Citation Context ...ess of RLNT derivations, there exist a number of well-known techniques in the literature, e.g., depth-bounds, loop-checks, well-founded (or well-quasi) orderings; see, e.g., (Bruynooghe et al., 1992; =-=Leuschel, 1998; -=-Sørensen and Glück, 1995). For instance, an unfolding rule based on the use of the homeomorphic embedding ordering is used in the partial evaluator for Curry programs of Albert et al. (2002b). Funct... |

39 | A Naïve Time Analysis and its Theory of Cost Equivalence
- Sands
- 1995
(Show Context)
Citation Context ...rn matchings, nondeterministic branching points, and higher-order applications. This contrasts with previous approaches where only the number of steps is considered, e.g., (Andersen and Gomard, 1992; =-=Sands, 1995).-=- − Our cost-augmented semantics covers the combination of needed narrowing and residuation, which forms the basis of the execution mechanism of modern functional logic languages like Curry (Hanus (e... |

35 | Specialization of Lazy Functional Logic Programs
- Alpuente, Falaschi, et al.
- 1997
(Show Context)
Citation Context ...set of expressions is a mapping which assigns to each expression a function call f(x1, . . . , xn) where x1, . . . , xn are the distinct variables of this expression and f is a fresh function symbol (=-=Alpuente et al., 1997-=-). Then, residual rules are renamed by recursively replacing each call in the given rule by a call to the corresponding renamed function (according to the independent renaming). Luckily, since the ori... |

33 | The Narrowing-Driven Approach to Functional Logic Program Specialization - Albert, Vidal |

33 |
Combining functional and logic programming languages
- Lloyd
- 1994
(Show Context)
Citation Context ...adigm Languages Functional logic languages have recently evolved to so called declarative multi-paradigm languages, e.g., Curry (Hanus (ed.), 2003), Toy (Hortalá-González and Ullán, 2001) and Esche=-=r (Lloyd, 1994-=-). In order to make things concrete, we consider in this work the language Curry, a modern multi-paradigm language which integrates features from logic programming (partial data structures, built-in s... |

21 | Specialization of Inductively Sequential Functional Logic Programs - Alpuente, Hanus, et al. - 1999 |

21 |
An Abstract Machine Based System for a Lazy Narrowing Calculus
- Hortalá-González, Ullán
(Show Context)
Citation Context ...nt t2 is evaluated. 2.4. Declarative Multi-Paradigm Languages Functional logic languages have recently evolved to so called declarative multi-paradigm languages, e.g., Curry (Hanus (ed.), 2003), Toy (=-=Hortalá-González and Ullán, 2001-=-) and Escher (Lloyd, 1994). In order to make things concrete, we consider in this work the language Curry, a modern multi-paradigm language which integrates features from logic programming (partial da... |

20 | Measuring the effectiveness of partial evaluation in functional logic languages - Albert, Antoy, et al. - 2001 |

15 | Operational Semantics for Functional Logic Languages - Albert, Hanus, et al. - 2002 |

15 | Using an Abstract Representation to Specialize Functional Logic Programs - Albert, Hanus, et al. - 1955 |

14 |
C.: Speedup Analysis in Partial Evaluation: Preliminary Results
- Andersen, Gomard
- 1992
(Show Context)
Citation Context ...ldings, applications, pattern matchings, nondeterministic branching points, and higher-order applications. This contrasts with previous approaches where only the number of steps is considered, e.g., (=-=Andersen and Gomard, 1992; -=-Sands, 1995). − Our cost-augmented semantics covers the combination of needed narrowing and residuation, which forms the basis of the execution mechanism of modern functional logic languages like Cu... |

12 | Cost-Augmented Narrowing-Driven Specialization - Vidal - 2002 |

9 | Symbolic Profiling of Multi-Paradigm Declarative Languages - Albert, Vidal - 2002 |

9 | Properties of Unfolding-based Meta-level Systems - Amtoft - 1991 |

6 | A Residualizing Semantics for the Partial Evaluation - Albert, Hanus, et al. - 2003 |

4 | On obtaining Knuth, Morris, and Pratt’s string matcher by partial evaluation - Ager, Danvy, et al. - 2002 |

1 | vidal.tex; 11/08/2003; 13:10; p.37 38 Germán Vidal - ACM - 1999 |

1 | 2003, ‘Münster Curry v0.9.1: User’s Guide - Lux |

1 | Symbolic Computation 11(4), 363–297. Reprinted from the proceedings - Higher-Order - 1972 |