Dynamic dependence in term rewriting systems and its application to program slicing
Abstract
Program slicing is a useful technique for debugging, testing, and analyzing programs. A program slice consists of the parts of a program that (potentially) affect the values computed at some point of interest. With rare exceptions, program slices have hitherto been computed and defined in ad-hoc and language-specific ways. The principal contribution of this paper is to show that general and semantically well-founded notions of slicing and dependence can be derived in a simple, uniform way from term rewriting systems (TRSs). Our slicing technique is applicable to any language whose semantics is specified in TRS form. Moreover, we show that our method admits an efficient implementation. Viewed more abstractly, our techniques yield a method for automatically deriving certain minimal equational theorems on open terms as a consequence of deriving a single theorem about a closed term. Our techniques can thus be used to augment the capabilities of equational theorem proving systems. © 1998 Elsevier Science B.V. All rights reserved.