The system dependence graph (SDG) is a widely used program representation for the static analysis of programs. In particular, it is the standard way to represent control and flow dependences between the statements of a program. It is at the core of program slicing, a technique that extracts the part of a program that can influence a given program point (the so-called slicing criterion). In this paper, we identify several program slicing situations (e.g., list comprehensions, try-catch and for) where the representation provided by the SDG is imprecise, and we present an alternative program representation, which is indeed an extension of the SDG, that solves these situations. We call this extension the expression dependence graph (EDG). The EDG redefines the SDG by increasing the granularity of its nodes to abstract syntax tree (AST) nodes. The implications of this change include an improvement in precision, the appearance of new kinds of dependences (besides control and flow dependences), and the possibility of selecting any (sub)expression as the slicing criterion.
Read full abstract