Abstract
Slicing is a program analysis technique originally developed by Weiser for imperative languages. Weiser showed that slicing is a natural tool for debugging, but it has other numerous applications (program integration, program optimization, etc.)
In this article we describe a backward slicing algorithm for Prolog which produces executable slices. The proposed algorithm is applicable at least to pure Prolog extended by some simple built-in predicates that handle the explicit unification=/2 and arithmetic.
To our knowledge, this algorithm is the first one to be proposed for Prolog. Because of the indeterminism and lack of explicit control flow of Prolog, existing algorithms cannot be trivially adapted. The two main contributions of this paper are a general definition of slicing adapted to Prolog and a slicing algorithm that produces executable programs.
Preview
Unable to display preview. Download preview PDF.
References
J. Boye, J. Paakki, and J. Małuszyński. Synthesis of directionality information for functional logic programs. In Third International Workshop WSA'93, Proceeding Static Analysis, Padova, Italy, volume 724 of LNCS, pages 165–177. Springer-Verlag, September 1993.
S. K. Debray. Static inference of modes and data dependencies in logic programs. ACM Transactions on Programming Languages and Systems, 11(3):418–450, July 1989.
P. Deransart and J. Małuszyński. A grammatical view of logic programming. MIT Press, 1993. ISBN 0-262-04140-5.
M. Ducassé and J. Noyé. Logic programming environments: Dynamic program analysis and debugging. The Journal of Logic Programming, 19/20:351–384, May/July 1994.
M. Ducassé. An extendable trace analyser to support automated debugging. PhD thesis, University of Rennes I, France, June 1992. European Doctorate.
M. Ducassé, editor. Second international workshop on automated and algorithmic debugging, http://www.irisa.fr/manifestations/AADEBUG95/, May 1995.
T. Gyimóthy and J. Paakki. Static slicing of logic programs. In Ducassé [Du95].
R. Gupta and M.-L. Soffa. Hybrid slicing: an approach for refining static slices using dynamic information. In 3rd ACM Symposium on Foundation of Software Engineering. University of Pittsburgh, ACM, October 10–13 1995.
T. Hoffner, M. Kamkar, and P. Fritzson. Evaluation of program slicing tools. In Ducassé [Du95].
S. Horwitz, J. Prins, and T. Reps. On the adequacy of program dependence graphs for representing programs. In Conference record of the 15th ACM Symposium on Principles of Programming Languages (POPL'88), pages 146–157, San Diego, CA USA, 1988.
S. Horwitz and T. Reps. The use of program dependence graphs in software engineering. In 14th International Conference on Software Engineering (Melbourne Australia), pages 392–411, may 1992.
S. Horwitz, T. Reps, and D. Binkley. Interprocedural slicing using dependence graphs. ACM Transactions on Programming Languages and Systems, TOPLAS, 12(1):26–60, [1] 1990.
B. Korel. Identifying faulty modifications in software maintenance. In P. A. Fritzson, editor, First International Workshop On Automated Algorithmic Debugging, volume 749 of LNCS, Linkoeping, Sweden, May 1993. Springer-Verlag.
H. K. N. Leung and H. K. Reghbati. Comments on program slicing. IEEE Transaction on Software Engineering SE-13(12):1370–1371, December 1987.
J. R. Lyle. Evaluating Variations on Program Slicing for Debugging. PhD thesis, University of Maryland, 1984.
E. Y. Shapiro. Algorithmic Program Debugging. MIT Press, Cambridge, MA, 1983. ISBN 0-262-19218-7.
L. Sterling and E. Shapiro. The art of Prolog, 2nd edition. Advanced Programming Techniques. The MIT Press, 1994.
F. Tip. A survey of program slicing techniques. Journal of Programming Languages, 3(3):121–189, September 1995.
W. W. Vasconcelos. A method for extracting Prolog programming techniques. Technical Report 27, Dept. Artificial Intelligence, University of Edinburgh, 80 South Bridge, Edinburgh EH1 1HN, Scotland, Great Britain, 1994.
M. Weiser. Programmers use slices when debugging. Communications of the ACM, 25(7):446–452, July 1982.
M. Weiser. Program slicing. IEEE Transactions on Software Engineering, SE-10(4):352–357, July 1984.
J. Zhao, J. Cheng, and K Ushijima. Literal dependence net and its use in concurrent logic programming environment. In Workshop on Parallel Logic Programming, pages 127–141, December 1994.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Schoenig, S., Ducassé, M. (1996). A backward slicing algorithm for Prolog. In: Cousot, R., Schmidt, D.A. (eds) Static Analysis. SAS 1996. Lecture Notes in Computer Science, vol 1145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61739-6_50
Download citation
DOI: https://doi.org/10.1007/3-540-61739-6_50
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61739-6
Online ISBN: 978-3-540-70674-8
eBook Packages: Springer Book Archive