## Improving Offline NarrowingDriven Partial Evaluation using Size-Change Graphs (2007)

### Cached

### Download Links

Venue: | In Proc. of LOPSTR’06 |

Citations: | 5 - 4 self |

### BibTeX

@INPROCEEDINGS{Arroyo07improvingoffline,

author = {Gustavo Arroyo and J. Guadalupe Ramos and Josep Silva and Germán Vidal},

title = {Improving Offline NarrowingDriven Partial Evaluation using Size-Change Graphs},

booktitle = {In Proc. of LOPSTR’06},

year = {2007},

pages = {60--76},

publisher = {Springer LNCS}

}

### OpenURL

### Abstract

Abstract. An offline approach to narrowing-driven partial evaluation (a partial evaluation scheme for first-order functional and functional logic programs) has recently been introduced. In this approach, program annotations (i.e., the expressions that should be generalized at partial evaluation time to ensure termination) are based on a simple syntactic characterization of quasi-terminating programs. This work extends the previous offline scheme by introducing a new annotation strategy which is based on a combination of size-change graphs and binding-time analysis. Preliminary experiments point out that the number of program annotations is significantly reduced compared to the previous approach, which means that faster residual programs are often produced. 1

### Citations

951 |
Term rewriting and all that
- Baader, Nipkow
- 1998
(Show Context)
Citation Context ...aluation of our approach by using a prototype implementation of the offline partial evaluator. Finally, Sect. 7 concludes and points out some direction for future work. 2 Preliminaries Term rewriting =-=[4]-=- offers an appropriate framework to model the first-order component of many functional and functional logic programming languages. Therefore, we follow the standard framework of term rewriting for dev... |

642 |
Partial Evaluation and Automatic Program Generation
- Jones, Gomard, et al.
- 1993
(Show Context)
Citation Context ... that a static parameter is definitely known at specialization time (hence it is ground), while a dynamic parameter is possibly unknown at specialization time. The output of the BTA must be congruent =-=[16]-=-: the value of every static parameter is determined by the values of other static parameters (and thus ultimately by the available input). In the following, we will also require the component � of a r... |

453 | Termination of rewriting
- Dershowitz
- 1985
(Show Context)
Citation Context ...sis of functional or logic programs (and no previous work on quasi-termination of functional logic programs). The notion of quasi-termination was originally introduced in term rewriting by Dershowitz =-=[8]-=-, where a rewrite derivation is called quasi-terminating when it only contains finitely many different terms. Within logic programming, one of the first approaches is [7], where the authors introduce ... |

402 | Deforestation: Transforming programs to eliminate trees - Wadler - 1990 |

334 | Functional logic programming: From theory to Curry
- Hanus
- 2013
(Show Context)
Citation Context ...in that function calls may contain free variables. In order to evaluate such terms containing variables, narrowing nondeterministically instantiates the variables such that a rewrite step is possible =-=[11]-=-. Formally, t ❀p,R,σ t ′ is a narrowing step iff p is a nonvariable position of t and σ(t) →p,R t ′ (we sometimes omit p, R and/or σ when they are clear from the context). σ is very often the most gen... |

291 | A needed narrowing strategy
- Antoy, Echahed, et al.
(Show Context)
Citation Context ...nent of many functional and functional logic languages like Haskell [20] or Curry [12]. In NPE, some refinement of narrowing [22] is used to perform symbolic computations. Currently, needed narrowing =-=[3]-=-, a narrowing strategy which only selects a function call if its reduction is necessary to compute a value, is the strategy that presents better properties. In general, the narrowing space (i.e., the ... |

175 | The size-change principle for program termination
- Lee, Jones, et al.
- 2001
(Show Context)
Citation Context ...neralized at specialization time (which ensures the termination of the process). In this work, we improve on the simpler characterization of non-increasing rewrite systems by using size-change graphs =-=[17]-=- to approximate the changes in parameter sizes from one function call to another. In particular, we use the information in the size-change graphs to identify a particular form of quasi-termination, ca... |

156 |
Logic Programming with Functions and Predicates: The language Babel
- Moreno-Navarro, Rodríguez-Artalejo
- 1992
(Show Context)
Citation Context ...= id). In order to avoid unnecessary computations and to deal with infinite data structures, a demand-driven generation of the search space has been advocated by a number of lazy narrowing strategies =-=[9, 18, 19]-=-. Due to its optimality properties w.r.t. the length of derivations and the number of computed solutions, needed narrowing [3] is currently the best lazy narrowing strategy. We say that s ❀p,R,σ t is ... |

152 | Definitional trees
- Antoy
- 1992
(Show Context)
Citation Context ...stitution σ with t ′ = σ(t). A unifier of two terms s and t is a substitution σ with σ(s) = σ(t). In the following, we write on for the sequence of objects o1, . . . , on. Inductively sequential TRSs =-=[2]-=- are a subclass of left-linear constructor-based TRSs. Essentially, a TRS is inductively sequential when all its operations are defined by rewrite rules that, recursively, make on their arguments a ca... |

145 | Tutorial on specialisation of logic programs
- Gallagher
- 1993
(Show Context)
Citation Context ...act, this distinction can be applied to both online or offline partial evaluators. In some cases, the distinction is made explicit (e.g., in the online partial evaluation scheme for logic programs of =-=[13]-=-) and in some other cases it is left implicit. 2 The 2 For instance, many partial evaluators for functional programs (see, e.g., [22]) include an algorithm that iteratively (1) takes a function call, ... |

104 |
Kernel Leaf: A Logic plus Functional Language
- Giovannetti, Levi, et al.
- 1991
(Show Context)
Citation Context ...= id). In order to avoid unnecessary computations and to deal with infinite data structures, a demand-driven generation of the search space has been advocated by a number of lazy narrowing strategies =-=[9, 18, 19]-=-. Due to its optimality properties w.r.t. the length of derivations and the number of computed solutions, needed narrowing [3] is currently the best lazy narrowing strategy. We say that s ❀p,R,σ t is ... |

95 | A Demand Driven Computation Strategy for Lazy Narrowing
- Loogen, López-Fraguas, et al.
- 1993
(Show Context)
Citation Context ...= id). In order to avoid unnecessary computations and to deal with infinite data structures, a demand-driven generation of the search space has been advocated by a number of lazy narrowing strategies =-=[9, 18, 19]-=-. Due to its optimality properties w.r.t. the length of derivations and the number of computed solutions, needed narrowing [3] is currently the best lazy narrowing strategy. We say that s ❀p,R,σ t is ... |

84 |
Computations in orthogonal rewriting systems
- Huet, Lévy
- 1991
(Show Context)
Citation Context ...solutions, needed narrowing [3] is currently the best lazy narrowing strategy. We say that s ❀p,R,σ t is a needed narrowing step iff σ(s) →p,R t is a needed rewrite step in the sense of Huet and Lévy =-=[15]-=-, i.e., in every computation from σ(s) to a normal form, either σ(s)|p or one of its descendants must be reduced. Here, we are interested in a particular needed narrowing strategy, denoted by λ in [3,... |

80 | Narrowing-driven partial evaluation of functional logic programs
- Alpuente, Falaschi, et al.
- 1996
(Show Context)
Citation Context ...ening a nested function call is basically equivalent to splitting a conjunction (in both cases some information is lost). A similar relation between term generalisation and CPD is also pointed out in =-=[2, 23]-=-. We skip the details of the extraction of residual programs from generalising needed narrowing trees since it is orthogonal to the topic of this paper (a more detailed description can be found in [29... |

72 | Automated Theorem-Proving for Theories with Simpli ers - Slagle - 1974 |

42 |
Finiteness analysis
- Holst
- 1991
(Show Context)
Citation Context ...was later adapted to term rewriting in [23]. Quasi-termination was soon recognized as an essential property to guarantee the termination of partial evaluation (see, e.g., the pioneering work of Holst =-=[14]-=-). Finally, regarding the use of quasi-termination analysis for ensuring the termination of offline partial evaluation, there are a few related approaches. In particular, we share many similarities wi... |

42 |
Proving Termination of Logic Programs by Exploiting Term Properties
- Bossi, Cocco, et al.
(Show Context)
Citation Context ... the component � of a reduction pair (�, ≻) to be bounded, i.e., the set {s | t � s} must contain a finite number of nonvariant terms for any term t. Some closely related notions are that of rigidity =-=[7]-=- and instantiated enough [25], both defined w.r.t. a so called norm. These notions are used in many termination analyses for logic programs (e.g., [9, 14, 25]). The following theorem states sufficient... |

33 | The Narrowing-Driven Approach to Functional Logic Program Specialization
- Albert, Vidal
(Show Context)
Citation Context ...uced. 1 Introduction Narrowing [22] extends the reduction principle of functional languages by replacing matching with unification (as in logic programming). Narrowing-driven partial evaluation (NPE) =-=[1]-=- is a powerful specialization technique for the firstorder component of many functional and functional logic languages like Haskell [20] or Curry [12]. In NPE, some refinement of narrowing [22] is use... |

31 | A Practical Partial Evaluation Scheme for Multi-Paradigm Declarative Languages - Albert, Hanus, et al. - 2002 |

26 | The size-change principle and dependency pairs for termination of term rewriting
- Thiemann, Giesl
(Show Context)
Citation Context ...ork has been extended in [24]. As for size-change analysis, this approach was originally introduced in [17] in the context of functional programming. The scheme was later adapted to term rewriting in =-=[23]-=-. Quasi-termination was soon recognized as an essential property to guarantee the termination of partial evaluation (see, e.g., the pioneering work of Holst [14]). Finally, regarding the use of quasi-... |

23 |
Constraint-based Partial Evaluation of Rewritingbased Functional Logic Programs
- Lafave, Gallagher
- 1997
(Show Context)
Citation Context ...ening a nested function call is basically equivalent to splitting a conjunction (in both cases some information is lost). A similar relation between term generalisation and CPD is also pointed out in =-=[2, 23]-=-. We skip the details of the extraction of residual programs from generalising needed narrowing trees since it is orthogonal to the topic of this paper (a more detailed description can be found in [29... |

19 | Schreye. Termination Proofs for Logic Programs with Tabling
- Verbaeten, Sagonas, et al.
(Show Context)
Citation Context ...gramming, one of the first approaches is [7], where the authors introduce the notion of quasi-acceptability, a sufficient and necessary condition for quasi-termination. This work has been extended in =-=[24]-=-. As for size-change analysis, this approach was originally introduced in [17] in the context of functional programming. The scheme was later adapted to term rewriting in [23]. Quasi-termination was s... |

18 | Termination analysis for tabled logic programming
- Decorte, Schreye, et al.
- 1998
(Show Context)
Citation Context ... term rewriting by Dershowitz [8], where a rewrite derivation is called quasi-terminating when it only contains finitely many different terms. Within logic programming, one of the first approaches is =-=[7]-=-, where the authors introduce the notion of quasi-acceptability, a sufficient and necessary condition for quasi-termination. This work has been extended in [24]. As for size-change analysis, this appr... |

14 | Termination analysis and specialization-point insertion in offline partial evaluation
- Glenstrup, Jones
- 2005
(Show Context)
Citation Context ... analysis for ensuring the termination of offline partial evaluation, there are a few related approaches. In particular, we share many similarities with the approach introduced by Glenstrup and Jones =-=[10]-=-, where a quasi-termination analysis based on size-change graphs is used to ensure the termination of an offline partial evaluator for firstorder functional programs. However, transferring Glenstrup a... |

13 |
An Integrated Functional Logic Language. Available at: http://www.informatik.uni-kiel.de/~curry
- Curry
- 2000
(Show Context)
Citation Context ...amming). Narrowing-driven partial evaluation (NPE) [1] is a powerful specialization technique for the firstorder component of many functional and functional logic languages like Haskell [20] or Curry =-=[12]-=-. In NPE, some refinement of narrowing [22] is used to perform symbolic computations. Currently, needed narrowing [3], a narrowing strategy which only selects a function call if its reduction is neces... |

13 | Combining norms to prove termination
- GENAIM, CODISH, et al.
(Show Context)
Citation Context ...Some closely related notions are that of rigidity [7] and instantiated enough [25], both defined w.r.t. a so called norm. These notions are used in many termination analyses for logic programs (e.g., =-=[9, 14, 25]-=-). The following theorem states sufficient conditions to ensure PE-termination. The proof of correctness is based on Ramsey’s Theorem (see [5]). evaluations, and (3) extracts from the partially evalua... |

12 | Fast Narrowing-Driven Partial Evaluation for Inductively Sequential Systems
- Ramos, Silva, et al.
- 2005
(Show Context)
Citation Context ...aming) in a computation can be avoided by inserting a call to some previously encountered variant (a technique known as specialization-point insertion in the partial evaluation literature). Recently, =-=[21]-=- identified a class of quasi-terminating rewrite systems (w.r.t. needed narrowing) that are called non-increasing. This characterization is purely ⋆ This work has been partially supported by the EU (F... |

12 | Transformation by interpreter specialisation - Jones |

8 | Better consumers for program specializations
- Chin, Khoo
- 1996
(Show Context)
Citation Context ...s � t iff Var(t) ⊆ Var(s) and for all x ∈ Var(t), dv(t, x) � dv(s, x); – s ≻ t iff Var(t) ⊆ Var(s) and for all x ∈ Var(t), dv(t, x) < dv(s, x). where the depth of a variable x in a constructor term t =-=[5]-=-, dv(t, x), is defined as follows: dv(c(tn), x) = 1 + max(dv(tn, x)) if x ∈ Var(c(tn)) dv(c(tn), x) = −1 if x �∈ Var(c(tn)) dv(y, x) = 0 if x = y dv(y, x) = −1 if x �= y dv(t, x) = −1 if t is not a co... |

8 |
Codish and Cohavit Taboch. A semantics basis for termination analysis of logic programs
- Michael
- 1999
(Show Context)
Citation Context ...Some closely related notions are that of rigidity [7] and instantiated enough [25], both defined w.r.t. a so called norm. These notions are used in many termination analyses for logic programs (e.g., =-=[9, 14, 25]-=-). The following theorem states sufficient conditions to ensure PE-termination. The proof of correctness is based on Ramsey’s Theorem (see [5]). evaluations, and (3) extracts from the partially evalua... |

5 | Partial Evaluation Termination Analysis and Specialization-Point Insertion - Jones, Glenstrup - 2005 |

4 |
and Yehoshua Sagiv. Automatic termination analysis of logic programs
- Lindenstrauss
- 1997
(Show Context)
Citation Context ...ion pair (�, ≻) to be bounded, i.e., the set {s | t � s} must contain a finite number of nonvariant terms for any term t. Some closely related notions are that of rigidity [7] and instantiated enough =-=[25]-=-, both defined w.r.t. a so called norm. These notions are used in many termination analyses for logic programs (e.g., [9, 14, 25]). The following theorem states sufficient conditions to ensure PE-term... |

2 | De nitional trees - Antoy - 1992 |