## Forward Slicing by Conjunctive Partial Deduction and Argument Filtering (2005)

### Cached

### Download Links

- [www.dsic.upv.es]
- [www.dsic.upv.es]
- [users.dsic.upv.es]
- [www.stups.uni-duesseldorf.de]
- [www.stups.uni-duesseldorf.de]
- DBLP

### Other Repositories/Bibliography

Venue: | Proceedings ESOP 2005, LNCS 3444 |

Citations: | 6 - 3 self |

### BibTeX

@INPROCEEDINGS{Leuschel05forwardslicing,

author = {Michael Leuschel and Germán Vidal},

title = {Forward Slicing by Conjunctive Partial Deduction and Argument Filtering},

booktitle = {Proceedings ESOP 2005, LNCS 3444},

year = {2005},

pages = {61--76},

publisher = {Springer-Verlag}

}

### OpenURL

### Abstract

Abstract. Program slicing is a well-known methodology that aims at identifying the program statements that (potentially) affect the values computed at some point of interest. Within imperative programming, this technique has been successfully applied to debugging, specialization, reuse, maintenance, etc. Due to its declarative nature, adapting the slicing notions and techniques to a logic programming setting is not an easy task. In this work, we define the first, semantics-preserving, forward slicing technique for logic programs. Our approach relies on the application of a conjunctive partial deduction algorithm for a precise propagation of information between calls. We do not distinguish between static and dynamic slicing since partial deduction can naturally deal with both static and dynamic data. A slicing tool has been implemented in ecce, where a post-processing transformation to remove redundant arguments has been added. Experiments conducted on a wide variety of programs are encouraging and demonstrate the usefulness of our approach, both as a classical slicing method and as a technique for code size reduction. 1

### Citations

1275 | Program slicing - Weiser - 1984 |

825 | The program dependence graph and its use in optimization
- Ferrante, Ottenstein, et al.
- 1987
(Show Context)
Citation Context ...which are (potentially) related with the values computed at some program point and/or variable, referred to as a slicing criterion. Program slices are usually computed from a program dependence graph =-=[5]-=- that makes explicit both the data and control dependences for each operation in a program. Program dependences can ⋆ This work was partially funded by the IST programme of the European Commission, Fu... |

639 |
Partial Evaluation and Automatic Program Generation. Available online: http://www.itu.dk/people/sestoft/pebook
- Jones, Gomard, et al.
- 1993
(Show Context)
Citation Context ...hile Sect. 6 presents an extensive set of benchmarks. Finally, Sect. 7 compares some related works and concludes. More details and missing proofs can be found in [22]. 2 Background Partial evaluation =-=[13]-=- has been applied to many programming languages, including functional, imperative, object-oriented, logic, and functional logic programming languages. It aims at improving the overall performance of p... |

633 | A survey of program slicing techniques
- Tip
- 1995
(Show Context)
Citation Context ...rd and forward slicing. Additionally, slices can be static or dynamic, depending on whether a concrete program’s input is provided or not. More detailed information on program slicing can be found in =-=[12, 29]-=-. Recently, Vidal [31] introduced a novel approach to forward slicing of lazy functional logic programs. This work exploits the similarities between slicing and partial evaluation—already noticed in [... |

239 |
Partial evaluation in logic programming
- Lloyd, Shepherdson
- 1991
(Show Context)
Citation Context ...et fully instantiated, the SLDNF-tree for P ∪ {G ′ } is usually infinite and ordinary evaluation will not terminate. A technique which solves this problem is known under the name of partial deduction =-=[23]-=-. Its general idea is to construct a finite number of finite, but possibly incomplete 3 SLDNF-trees and to extract from these trees a new program that allows any instance of the goal G ′ to be execute... |

145 | Tutorial on specialisation of logic programs
- Gallagher
- 1993
(Show Context)
Citation Context ...r example, can replace several conjunctions in C by a single less instantiated one. One useful foundation for the global control is based on so-called characteristic trees, used for example by the sp =-=[7]-=- and ecce [19] specialization systems. We describe them in more detail below, as they turn out to be important for slicing. Characteristic trees were introduced in partial deduction in order to captur... |

139 | Transformation of logic programs: Foundations and techniques
- Pettorossi, Proietti
- 1994
(Show Context)
Citation Context ...rogram that allows any instance of the goal G ′ to be executed. Conjunctive partial deduction (CPD) [3] is an extension of partial deduction that can achieve effects such as deforestation and tupling =-=[24]-=-. The essence of CPD can be seen in Fig. 1. The so-called global control of CPD generates a set C = {C1, . . . , Cn} of conjunctions whereas the local control generates for each conjunction a possibly... |

116 | An overview of Program Slicing
- Harman, Hierons
- 2001
(Show Context)
Citation Context ...terpreter for a simple language with constants, variables, and some predefined functions. First, we consider the following slicing criterion: slice1(X) :- int(minus(cst(4),plus(fun(one),cst(2))),[xx],=-=[11]-=-,X).sThe slice computed by ecce w.r.t. this slicing criterion is as follows: int(cst(X),_,_,X). int(plus(X,Y),Vars,Vals,Res) :int(X,Vars,Vals,RX), int(Y,Vars,Vals,RY), Res is RX+RY. int(minus(X,Y),Var... |

65 |
Tip: Parametric program slicing
- Field, Ramalingam, et al.
(Show Context)
Citation Context ...and dynamic backward slices. Similar techniques have also been defined for constraint logic programs [28] and concurrent logic programs [33]. Within imperative programming, Field, Ramalingam, and Tip =-=[6]-=- introduced a constrained slicing scheme in which source programs are translated to an intermediate graph representation. Similarly to our approach, constrained slicing generalizes the traditional not... |

63 |
The derivation of an algorithm for program specialisation
- Gallagher, Bruynooghe
- 1991
(Show Context)
Citation Context ...e logic programming setting. Second, we consider a polyvariant and polygenetic partial evaluation scheme: the conjunctive partial deduction algorithm of [3] with control based on characteristic trees =-=[9, 18, 19]-=-. Therefore, the computed slices are significantly more precise than those of the previous approach. Furthermore, since the basic partial deduction algorithm is kept unmodified, it can easily be imple... |

57 |
Controlling generalisation and polyvariance in partial deduction of normal logic programs
- Leuschel, Martens, et al.
- 1998
(Show Context)
Citation Context ...e logic programming setting. Second, we consider a polyvariant and polygenetic partial evaluation scheme: the conjunctive partial deduction algorithm of [3] with control based on characteristic trees =-=[9, 18, 19]-=-. Therefore, the computed slices are significantly more precise than those of the previous approach. Furthermore, since the basic partial deduction algorithm is kept unmodified, it can easily be imple... |

55 | Infinite state model checking by abstract interpretation and program specialization
- Leuschel, Massart
(Show Context)
Citation Context ...slicing-specific experiments. Table 2 contains the results of these experiments. The inter medium benchmark is the simple interpreter of Sect. 5. The ctl trace benchmark is the CTL model checker from =-=[20]-=-, extended to compute witness traces. It is sliced for a particular system and temporal logic formula to model check. The lambdaint benchmark is an interpreter for a simple functional language taken f... |

55 | Program Specialization via Program Slicing
- Reps, Turnidge
- 1996
(Show Context)
Citation Context ...]. Recently, Vidal [31] introduced a novel approach to forward slicing of lazy functional logic programs. This work exploits the similarities between slicing and partial evaluation—already noticed in =-=[25]-=-—to compute forward slices by a slight modification of an existing partial evaluation scheme [2]. The main requirement of [31] is that the underlying partial evaluation algorithm should be—in the term... |

53 | Logic program specialisation through partial deduction: Control issues. Theory and
- Leuschel, Bruynooghe
(Show Context)
Citation Context ...ution step with a specialized clause now corresponds to performing all the resolutions steps (using original program clauses) on the associated branch. Closedness can be ensured by various algorithms =-=[16]-=-. Usually, one starts off with an initial conjunction, unfolds it using some “unfolding rule” (a function mapping a program P and a goal G to an SLDNF-tree for P ∪ {G}) and then adds all uncovered 4 l... |

42 | Redundant argument filtering of logic programs
- Leuschel, Srensen
- 1996
(Show Context)
Citation Context ... algorithm is kept unmodified, it can easily be implemented on top of an existing partial deduction system (in our case, ecce [19]). Finally, we use the redundant argument filtering transformation of =-=[21]-=- to slice out unnecessary arguments of predicates (in addition to slicing out entire clauses). The combination of these two approaches, [31] and [21], together with a special-purpose slicing code gene... |

41 | Conjunctive Partial Deduction: Foundations, Control, Algorihtms, and Experiments
- Schreye, Glück, et al.
- 1999
(Show Context)
Citation Context ... [31] in several ways. First, we adapt it to the logic programming setting. Second, we consider a polyvariant and polygenetic partial evaluation scheme: the conjunctive partial deduction algorithm of =-=[3]-=- with control based on characteristic trees [9, 18, 19]. Therefore, the computed slices are significantly more precise than those of the previous approach. Furthermore, since the basic partial deducti... |

33 | The Narrowing-Driven Approach to Functional Logic Program Specialization
- Albert, Vidal
(Show Context)
Citation Context ...rograms. This work exploits the similarities between slicing and partial evaluation—already noticed in [25]—to compute forward slices by a slight modification of an existing partial evaluation scheme =-=[2]-=-. The main requirement of [31] is that the underlying partial evaluation algorithm should be—in the terminology of [26]—both monovariant and monogenetic in order to preserve the structure of the origi... |

33 | A Roadmap to Metacomputation by Supercompilation
- Glück, Sørensen
- 1996
(Show Context)
Citation Context ... forward slices by a slight modification of an existing partial evaluation scheme [2]. The main requirement of [31] is that the underlying partial evaluation algorithm should be—in the terminology of =-=[26]-=-—both monovariant and monogenetic in order to preserve the structure of the original program. Unfortunately, this requirement also restricts the precision of the computed slices. In this work, we exte... |

32 |
The applicability of logic program analysis and transformation to theorem proving
- Waal, Gallagher
- 1994
(Show Context)
Citation Context ...of concrete values, hence making it less suitable for dynamic slicing. However, for static slicing it may be able to remove certain clauses that a partial deduction approach cannot remove (see, e.g., =-=[4, 8]-=- where useless clauses are removed to complement partial deduction) and one should investigate this possibility further. One could also investigatesbetter global control, adapted for slicing (to avoid... |

31 | A Backward Slicing Algorithm for Prolog
- Schoenig, Ducasse
- 1145
(Show Context)
Citation Context ...2]—in the context of imperative programs—as a debugging technique. Despite its potential applications, we found very few approaches to slicing in logic programming (some notable exceptions are, e.g., =-=[10, 27, 28, 30, 33]-=-). Informally, a program slice consists of those program statements which are (potentially) related with the values computed at some program point and/or variable, referred to as a slicing criterion. ... |

27 | Conjunctive partial deduction in practice
- Jrgensen, Leuschel, et al.
- 1996
(Show Context)
Citation Context ...que is useful as an alternative way to specialize programs, especially for code size reduction. Finally, the use of the DPPD library allows comparison with other reference implementations (see, e.g., =-=[3, 14]-=- for comparisons with mixtus, sp and paddy). Table 1 (which is a summary of the full tables in [22]) shows the speedup of the ecce default specialization and of our slicing algorithm. Timings for SWI ... |

21 | Schreye. Constrained partial deduction and the preservation of characteristic trees
- Leuschel, De
- 1998
(Show Context)
Citation Context ...e logic programming setting. Second, we consider a polyvariant and polygenetic partial evaluation scheme: the conjunctive partial deduction algorithm of [3] with control based on characteristic trees =-=[9, 18, 19]-=-. Therefore, the computed slices are significantly more precise than those of the previous approach. Furthermore, since the basic partial deduction algorithm is kept unmodified, it can easily be imple... |

16 |
de Waal. Deletion of redundant unary type predicates from logic programs
- Gallagher, A
- 1993
(Show Context)
Citation Context ...of concrete values, hence making it less suitable for dynamic slicing. However, for static slicing it may be able to remove certain clauses that a partial deduction approach cannot remove (see, e.g., =-=[4, 8]-=- where useless clauses are removed to complement partial deduction) and one should investigate this possibility further. One could also investigatesbetter global control, adapted for slicing (to avoid... |

16 |
Static Slicing of Logic Programs
- Gyimóthy, Paakki
- 1995
(Show Context)
Citation Context ...2]—in the context of imperative programs—as a debugging technique. Despite its potential applications, we found very few approaches to slicing in logic programming (some notable exceptions are, e.g., =-=[10, 27, 28, 30, 33]-=-). Informally, a program slice consists of those program statements which are (potentially) related with the values computed at some program point and/or variable, referred to as a slicing criterion. ... |

10 |
Specializing interpreters using offline partial deduction
- Leuschel, Craig, et al.
- 2004
(Show Context)
Citation Context ...tended to compute witness traces. It is sliced for a particular system and temporal logic formula to model check. The lambdaint benchmark is an interpreter for a simple functional language taken from =-=[17]-=-. It is sliced for a particular functional program (computing the Fibonacci numbers). Finally, matlab is an interpreter for a subset of the Matlab language (the code can be found in [22]). The overall... |

9 |
Static and Dynamic Slicing of Constraint Logic Programs
- Szilagyi, Gyimothy, et al.
- 2002
(Show Context)
Citation Context ...2]—in the context of imperative programs—as a debugging technique. Despite its potential applications, we found very few approaches to slicing in logic programming (some notable exceptions are, e.g., =-=[10, 27, 28, 30, 33]-=-). Informally, a program slice consists of those program statements which are (potentially) related with the values computed at some program point and/or variable, referred to as a slicing criterion. ... |

7 | Forward Slicing of Multi-Paradigm Declarative Programs Based on Partial Evaluation
- Vidal
- 2003
(Show Context)
Citation Context ...ditionally, slices can be static or dynamic, depending on whether a concrete program’s input is provided or not. More detailed information on program slicing can be found in [12, 29]. Recently, Vidal =-=[31]-=- introduced a novel approach to forward slicing of lazy functional logic programs. This work exploits the similarities between slicing and partial evaluation—already noticed in [25]—to compute forward... |

4 | A ¯exible framework for dynamic and static slicing of logic programs
- Vasconcelos
- 1999
(Show Context)
Citation Context |

2 | A Program Dependence Model for Concurrent Logic Programs and Its Applications
- Zhao, Cheng, et al.
- 2001
(Show Context)
Citation Context |

1 |
The DPPD Library of Benchmarks. Accessible from URL: http://www.ecs.soton.ac.uk/~mal/systems/dppd.html
- Leuschel
(Show Context)
Citation Context ...he specialized/sliced and original programs respectively. DPPD. We first compared the slicing tool with the default conjunctive specialization of ecce on the DPPD library of specialization benchmarks =-=[15]-=-. In a sense these are not typical slicing scenarios, but nonetheless give an indication of the behavior of the slicing algorithm. The experiments also allow us to evaluate to what extent our techniqu... |