## Enhancing Partial Deduction via Unfold/Fold Rules (1996)

Venue: | Proc. LoPSTr '96 |

Citations: | 7 - 4 self |

### BibTeX

@INPROCEEDINGS{Pettorossi96enhancingpartial,

author = {Alberto Pettorossi and Maurizio Proietti and Sophie Renault},

title = {Enhancing Partial Deduction via Unfold/Fold Rules},

booktitle = {Proc. LoPSTr '96},

year = {1996},

pages = {147--168},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

We show that sometimes partial deduction produces poor program specializations because of its limited ability in (i) dealing with conjunctions of recursively defined predicates, (ii) combining partial evaluations of alternative computations, and (iii) taking into account unification failures. We propose to extend the standard partial deduction technique by using versions of the definition rule and the folding rule which allow us to specialize predicates defined by disjunctions of conjunctions of goals. We also consider a case split rule to take into account unification failures. Moreover, in order to perform program specialization via partial deduction in an automatic way, we propose a transformation strategy which takes as parameters suitable substrategies for directing the application of every transformation rule. Finally, we show through two examples that our partial deduction technique is superior to standard partial deduction. The first example refers to the automatic derivation...

### Citations

642 |
Partial Evaluation and Automatic Program Generation
- Jones, Gomard, et al.
- 1993
(Show Context)
Citation Context ... by the KMP algorithm. Thus, we say that standard partial deduction does not pass the strong KMP test. This limitation also applies to the automatic derivations based on partial evaluation techniques =-=[9]-=- of specialized KMP matching programs both in functional and logic languages, which have been published in the literature. Also Gluck and Klimov in [8], who apply the supercompilation technique, consi... |

571 | A transformation system for developing recursive programs
- Burstall, Darlington
- 1977
(Show Context)
Citation Context ...compare our techniques with related proposals reported in the literature. 2 Partial Deduction and Unfold/Fold Transformations We recall first how to recast in the unfold/fold transformation framework =-=[2, 15, 25]-=- the standard techniques for partial deduction of definite programs, as they have been formalized by Lloyd and Shepherdson [6, 13]. 2.1 Transformation Rules and Strategy for Standard Partial Deduction... |

240 |
Partial evaluation in logic programming
- Lloyd, Shepherdson
- 1987
(Show Context)
Citation Context ...ry efficient specialized programs. In practice, however, some efficiency improvements in the specialized programs cannot be realized, because partial deduction, as formalized by Lloyd and Shepherdson =-=[13]-=-, here also called standard partial deduction, is not capable to perform specializations w.r.t. a conjunction of two or more atoms at the same time. Moreover, standard partial deduction cannot combine... |

212 |
Unfold/fold transformation of logic programs
- Tamaki, Sato
- 1984
(Show Context)
Citation Context ...compare our techniques with related proposals reported in the literature. 2 Partial Deduction and Unfold/Fold Transformations We recall first how to recast in the unfold/fold transformation framework =-=[2, 15, 25]-=- the standard techniques for partial deduction of definite programs, as they have been formalized by Lloyd and Shepherdson [6, 13]. 2.1 Transformation Rules and Strategy for Standard Partial Deduction... |

169 | The concept of a supercompiler
- Turchin
- 1986
(Show Context)
Citation Context ...ts are possible and there is a fully automatic derivation of a specialized version of a multi-pattern matching program. A transformation technique which is closely related to ours is supercompilation =-=[8, 26]-=-. Also by this technique it is possible to achieve program specialization and the elimination of intermediate data structures. One major difference with our work is that supercompilation basically dea... |

138 | Transformation of logic programs: Foundations and techniques
- Pettorossi, Proietti
- 1994
(Show Context)
Citation Context ...compare our techniques with related proposals reported in the literature. 2 Partial Deduction and Unfold/Fold Transformations We recall first how to recast in the unfold/fold transformation framework =-=[2, 15, 25]-=- the standard techniques for partial deduction of definite programs, as they have been formalized by Lloyd and Shepherdson [6, 13]. 2.1 Transformation Rules and Strategy for Standard Partial Deduction... |

103 | Mixtus: an automatic partial evaluator for full prolog
- Sahlin
- 1993
(Show Context)
Citation Context ... Deduction It is well known that partial deduction can be seen as a particular instance of the unfold/fold transformation methodology where the following three rules are available (see, for instance, =-=[17, 20]-=-) for transforming a given program P into a new one. -- Atomic Definition. It consists in adding to P a clause, called a definition clause, of the form newp(X 1 ; : : : ; Xm ) / A, where newp is a new... |

67 |
Logic Programming: Systematic Program Development
- Deville
- 1990
(Show Context)
Citation Context ...he inequalities which have been introduced by the application of the case split rule. This can be done by replacing inequalities in favour of cuts as specified by the following rule: Cut Introduction =-=[4]-=-. It consists in replacing the two clauses: (H / Body 1 ) fX=ug and H / X 6= u; Body 2 by the new clauses: (H / !; Body 1 ) fX=ug and H / Body 2 where obviously, the resulting program requires a Prolo... |

63 | Occam’s Razor in Metacomputation: the Notion of a Perfect Process Tree
- Glück, Klimov
- 1993
(Show Context)
Citation Context ...rivations based on partial evaluation techniques [9] of specialized KMP matching programs both in functional and logic languages, which have been published in the literature. Also Gluck and Klimov in =-=[8]-=-, who apply the supercompilation technique, consider an initial program which is similar to the one presented in Figure 2(A). The inability of standard partial deduction to pass the strong KMP test is... |

48 | Global control for partial deduction through characteristic atoms and global trees
- Leuschel, Martens
- 1996
(Show Context)
Citation Context ... rules. Thus, in particular, any unfolding strategy and any strategy for the definition rule, also called the generalization strategy, already developed for program specialization (see, for instance, =-=[6, 11, 20]-=-) may be adapted to our strategy. The particular unfolding strategy we apply is different from the one in [16] and it works both for the derivation of a program which behaves like the deterministic fi... |

43 |
Unfold/fold transformation of stratified programs
- Seki
- 1991
(Show Context)
Citation Context ...ion clause is not allowed. These rules are instances of Tamaki and Sato's transformation rules and in the case of definite programs, they preserve the success set and the finite failure set semantics =-=[22, 25]-=-. In order to perform partial deduction of a given program whereby getting a specialized program, these three rules have to be applied according to a suitable strategy. We now present one such strateg... |

42 | Redundant argument filtering of logic programs
- Leuschel, Srensen
- 1996
(Show Context)
Citation Context ...ed definition and folding rules allow us to achieve the effects of other transformation strategies, such as conjunctive partial deduction [10] for combining recursive computations,sargument filtering =-=[12]-=- for eliminating unnecessary arguments, and renaming [6] for structure specialization. Moreover, the combination of the case split rule which realizes a form of reasoning by cases, and the folding rul... |

36 |
Logimix: A self-applicable partial evaluator for Prolog
- Mogensen, Bondorf
- 1993
(Show Context)
Citation Context ...e'. Similarly to the KMP example, also the published derivations by partial deduction of specialized parsers from general parsers, use rather clever deterministic initial programs (see, for instance, =-=[14]). A-=-cknowledgments We would like to thank D. De Schreye, J. Gallagher, R. Gluck, M. Leuschel, B. Martens, M. H. S��rensen for stimulating discussions about logic program specialization. Experiments do... |

36 |
Unfolding-definition-folding, in this order, for avoiding unnecessary variables in logic programs. Theoretical Computer Science 142
- Proietti, Pettorossi
- 1995
(Show Context)
Citation Context ...n [6] (see Figure 1). It may also be used for deriving deterministic programs from nondeterministic ones and for avoiding intermediate data structures through the elimination of unnecessary variables =-=[19]-=-. A proposal for integrating partial deduction and the elimination of unnecessary variables has been presented in [10]. Indeed, that work which introduces the conjunctive partial deduction technique, ... |

30 |
de Waal. A conceptual embedding of folding into partial deduction: Towards a maximal integration
- Leuschel, Schreye, et al.
- 1996
(Show Context)
Citation Context ... be clear also from the examples given in Section 4 our enhanced definition and folding rules allow us to achieve the effects of other transformation strategies, such as conjunctive partial deduction =-=[10]-=- for combining recursive computations,sargument filtering [12] for eliminating unnecessary arguments, and renaming [6] for structure specialization. Moreover, the combination of the case split rule wh... |

25 | Reducing nondeterminism while specializing logic programs
- Pettorossi, Proietti, et al.
- 1997
(Show Context)
Citation Context ...ization strategy, already developed for program specialization (see, for instance, [6, 11, 20]) may be adapted to our strategy. The particular unfolding strategy we apply is different from the one in =-=[16]-=- and it works both for the derivation of a program which behaves like the deterministic finite automaton generated by the KMP string matching algorithm, and for the derivation of regular expression pa... |

24 |
Preserving universal termination through unfold/fold
- Bossi, Cocco
- 1994
(Show Context)
Citation Context ...roduced, is left for future studies. However, we believe that one can provide versions of our rules which preserve such properties, by extending the approaches proposed for Tamaki and Sato's rules in =-=[1, 3, 18]-=-. Finally, notice that for an efficient evaluation of the specialized programs, one may remove during a post-processing phase the inequalities which have been introduced by the application of the case... |

22 |
Semantics Preserving Transformation Rules for Prolog
- Proietti, Pettorossi
- 1991
(Show Context)
Citation Context ...roduced, is left for future studies. However, we believe that one can provide versions of our rules which preserve such properties, by extending the approaches proposed for Tamaki and Sato's rules in =-=[1, 3, 18]-=-. Finally, notice that for an efficient evaluation of the specialized programs, one may remove during a post-processing phase the inequalities which have been introduced by the application of the case... |

21 |
Tutorial on Specialization of Logic Programs
- Gallagher
- 1993
(Show Context)
Citation Context ...l first how to recast in the unfold/fold transformation framework [2, 15, 25] the standard techniques for partial deduction of definite programs, as they have been formalized by Lloyd and Shepherdson =-=[6, 13]-=-. 2.1 Transformation Rules and Strategy for Standard Partial Deduction It is well known that partial deduction can be seen as a particular instance of the unfold/fold transformation methodology where ... |

21 |
Partial Evaluation of Pattern Matching in Constraint Logic Programming Languages
- Smith
- 1991
(Show Context)
Citation Context ... the predicate match are lists. We do not use any type information at all. Moreover, the derivation in [21] is not guided by an automatic strategy. Very simple initial programs are considered also in =-=[23]-=-, but in that paper the derivation requires a preliminary transformation into the so called `failure continuation passing style'. Similarly to the KMP example, also the published derivations by partia... |

20 |
Towards unifying partial evaluation, deforestation, supercompilation, and GPC
- S��rensen, Gluck, et al.
- 1994
(Show Context)
Citation Context ...e that it takes as parameters subsidiary strategies for directing the unfolding steps and the atomic definition steps. 2.2 Partial Deduction and the KMP Test The success w.r.t. the so called KMP test =-=[24]-=- is regarded as a significant achievement of partial deduction, and indeed it is possible to derive a program which behaves like the deterministic finite automaton generated by the Knuth-MorrisPratt s... |

17 | Unfold/fold transformations for definite clause programs
- Gergatsoulis, Katzouraki
- 1994
(Show Context)
Citation Context ...sjunctive partial deduction, then they are totally correct w.r.t. the least Herbrand model semantics, that is, M (P 2 ) = M (P 1 [D), because each clause is unfolded at least once before folding (see =-=[7]-=- for a similar condition). As a consequence of the total correctness w.r.t. the least Herbrand model semantics, the success set semantics is preserved when we transform programs according to our strat... |

17 |
Online Partial Deduction of Large Programs
- Prestwich
- 1993
(Show Context)
Citation Context ... Deduction It is well known that partial deduction can be seen as a particular instance of the unfold/fold transformation methodology where the following three rules are available (see, for instance, =-=[17, 20]-=-) for transforming a given program P into a new one. -- Atomic Definition. It consists in adding to P a clause, called a definition clause, of the form newp(X 1 ; : : : ; Xm ) / A, where newp is a new... |

12 |
An algorithm for partial evaluation with constraints
- Fujita
- 1987
(Show Context)
Citation Context ... finite automaton generated by the Knuth-MorrisPratt string matching algorithm by applying the standard strategy for partial deduction to a general string matching program like the one of Figure 2(A) =-=[5, 6]-=-. - (A) (B) by standard partial deduction match(P; S) / match1(P; S; P; S) match1([ ]; X;Y; Z) / match1([AjPs]; [AjSs]; P; S) / match1(Ps; Ss ; P; S) match1([AjPs]; [BjSs]; P; [CjS]) / A 6= B; match1(... |

11 | A transformation system for definite programs based on termination analysis
- Cook, Gallagher
- 1994
(Show Context)
Citation Context ...roduced, is left for future studies. However, we believe that one can provide versions of our rules which preserve such properties, by extending the approaches proposed for Tamaki and Sato's rules in =-=[1, 3, 18]-=-. Finally, notice that for an efficient evaluation of the specialized programs, one may remove during a post-processing phase the inequalities which have been introduced by the application of the case... |

2 |
Examples of logic program transformation and synthesis. Case studies of transformation and synthesis of logic programs done up to Feb
- Sato, Tamaki
- 1985
(Show Context)
Citation Context ...ss powerful than ours because we use an initial program which is very simple (see clause 1 in Section 4.1), instead of the initial program of Figure 2(A). A relevant exception is the one presented in =-=[21]-=-. In that paper the authors use the unfolding and folding rules together with a case split rule based on type information, in the sense that they assume that the arguments of the predicate match are l... |