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.
This work was partially funded by the IST programme of the European Commission, Future and Emerging Technologies under the IST-2001-38059 ASAP project and by the Spanish Ministerio de Educación y Ciencia (ref. TIN2004-00231).
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Advanced Specialization and Analysis for Pervasive Computing. EU IST FET Programme Project Number IST-2001-38059. http://www.asap.ecs.soton.ac.uk/
Albert, E., Vidal, G.: The Narrowing-Driven Approach to Functional Logic Program Specialization. New Generation Computing 2(1), 3–26 (2002)
De Schreye, D., Glück, R., Jørgensen, J., Leuschel, M., Martens, B., Sørensen, M.H.: Conjunctive partial deduction: Foundations, control, algorithms and experiments. The Journal of Logic Programming 41(2 & 3), 231–277 (1999)
de Waal, D.A., Gallagher, J.: The applicability of logic program analysis and transformation to theorem proving. In: Bundy, A. (ed.) Automated Deduction—CADE-12, pp. 207–221. Springer, Heidelberg (1994)
Ferrante, J., Ottenstein, K., Warren, J.: The Program Dependence Graph and Its Use in Optimization. ACM Transactions on Programming Languages and Systems 9(3), 319–349 (1987)
Field, J., Ramalingam, G., Tip, F.: Parametric Program Slicing. In: Conference Record of POPL 1995: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 379–392. ACM Press, New York (1995)
Gallagher, J.: A system for specialising logic programs. Technical Report TR-91-32, University of Bristol (November 1991)
Gallagher, J., de Waal, D.A.: Deletion of redundant unary type predicates from logic programs. In: Lau, K.-K., Clement, T. (eds.) Logic Program Synthesis and Transformation. Proc. of LOPSTR 1992, Manchester, UK, pp. 151–167 (1992)
Gallagher, J., Bruynooghe, M.: The Derivation of an Algorithm for Program Specialisation. New Generation Computing 9(3-4), 305–333 (1991)
Gyimóthy, T., Paakki, J.: Static Slicing of Logic Programs. In: Proc. of the 2nd Int’l Workshop on Automated and Algorithmic Debugging (AADEBUG 1995), pp. 87–103. IRISA-CNRS (1995)
Harman, M., Danicic, S.: Amorphous Program Slicing. In: Proc. of the 5th Int’l Workshop on Program Comprehension. IEEE Computer Society Press, Los Alamitos (1997)
Harman, M., Hierons, R.: An Overview of Program Slicing. Software Focus 2(3), 85–92 (2001)
Jones, N., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)
Jørgensen, J., Leuschel, M., Martens, B.: Conjunctive partial deduction in practice. In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 59–82. Springer, Heidelberg (1997)
Leuschel, M.: The DPPD Library of Benchmarks. Accessible from: http://www.ecs.soton.ac.uk/~mal/systems/dppd.html
Leuschel, M., Bruynooghe, M.: Logic program specialisation through partial deduction: Control issues. Theory and Practice of Logic Programming 2(4 & 5), 461–515 (2002)
Leuschel, M., Craig, S., Bruynooghe, M., Vanhoof, W.: Specializing interpreters using offline partial deduction. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic. LNCS, vol. 3049, pp. 341–376. Springer, Heidelberg (2004)
Leuschel, M., De Schreye, D.: Constrained Partial Deduction and the Preservation of Characteristic Trees. New Generation Computing 16(3), 283–342 (1998)
Leuschel, M., Martens, B., De Schreye, D.: Controlling generalisation and polyvariance in partial deduction of normal logic programs. ACM Transactions on Programming Languages and Systems 20(1), 208–258 (1998)
Leuschel, M., Massart, T.: Infinite state model checking by abstract interpretation and program specialisation. In: Bossi, A. (ed.) LOPSTR 1999. LNCS, vol. 1817, pp. 63–82. Springer, Heidelberg (2000)
Leuschel, M., Sørensen, M.H.: Redundant argument filtering of logic programs. In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 83–103. Springer, Heidelberg (1997)
Leuschel, M., Vidal, G.: Forward Slicing by Conjunctive Partial Deduction and Argument Filtering. Technical Report, DSSE, University of Southamtpon (December 2004)
Lloyd, J.W., Shepherdson, J.C.: Partial evaluation in logic programming. The Journal of Logic Programming 11(3& 4), 217–242 (1991)
Pettorossi, A., Proietti, M.: Transformation of Logic Programs: Foundations and Techniques. The Journal of Logic Programming 19,20, 261–320 (1994)
Reps, T., Turnidge, T.: Program Specialization via Program Slicing. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 409–429. Springer, Heidelberg (1996)
Glück, R., Sørensen, M.H.: A Roadmap to Metacomputation by Supercompilation. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 137–160. Springer, Heidelberg (1996)
Schoenig, S., Ducassé, M.: A Backward Slicing Algorithm for Prolog. In: Cousot, R., Schmidt, D.A. (eds.) SAS 1996. LNCS, vol. 1145, pp. 317–331. Springer, Heidelberg (1996)
Szilagyi, G., Gyimothy, T., Maluszynski, J.: Static and Dynamic Slicing of Constraint Logic Programs. J. Automated Software Engineering 9(1), 41–65 (2002)
Tip, F.: A Survey of Program Slicing Techniques. Journal of Programming Languages 3, 121–189 (1995)
Vasconcelos, W.: A Flexible Framework for Dynamic and Static Slicing of Logic Programs. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, pp. 259–274. Springer, Heidelberg (1999)
Vidal, G.: Forward slicing of multi-paradigm declarative programs based on partial evaluation. In: Leuschel, M. (ed.) LOPSTR 2002. LNCS, vol. 2664, pp. 219–237. Springer, Heidelberg (2003)
Weiser, M.: Program Slicing. IEEE Transactions on Software Engineering 10(4), 352–357 (1984)
Zhao, J., Cheng, J., Ushijima, K.: A Program Dependence Model for Concurrent Logic Programs and Its Applications. In: Proc. of IEEE Int’l Conf. on Software Maintenance (ICSM 2001), pp. 672–681. IEEE Press, Los Alamitos (2001)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Leuschel, M., Vidal, G. (2005). Forward Slicing by Conjunctive Partial Deduction and Argument Filtering. In: Sagiv, M. (eds) Programming Languages and Systems. ESOP 2005. Lecture Notes in Computer Science, vol 3444. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-31987-0_6
Download citation
DOI: https://doi.org/10.1007/978-3-540-31987-0_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-25435-5
Online ISBN: 978-3-540-31987-0
eBook Packages: Computer ScienceComputer Science (R0)