An algorithm for computing slices for recursive program
Ryoichi Ueda, Lin Lian, Katsuro Inoue, Koji Torii · Systems and Computers in Japan · 1996
Abstract Program slicing is a useful technique for debugging, testing and program integration. Intuitively, by the slice of a program P is meant, for a pointnand a variablevinP, the set of statements and expressions inPthat affect the value ofvatn. To determine a slice, there must be a precise analysis of the dependencies among the statements in the program. It is difficult, on the other hand, to analyze the program containing recursions. This paper presents a static analysis for the dependencies in the program containing recursion, as well as the algorithm to determine the slice based on the result of the analysis. To cope with the recursive definition of the procedure, the proposed algorithm assumes the interprocedure information needed in the computation. This information is modified to the correct direction, and the process is iterated until the result converges. The program dependence graph is extended to hold the interprocedure information. Compared to the conventional algorithm, the proposed algorithm can analyze efficiently the program containing recursions, and can be used in the system to provide interactively the slice information.