A LOGIC-BASED APPROACH TO PROGRAM FLOW-ANALYSIS

Citation
M. Sagiv et al., A LOGIC-BASED APPROACH TO PROGRAM FLOW-ANALYSIS, Acta informatica, 35(6), 1998, pp. 457-504
Citations number
32
Categorie Soggetti
Computer Science Information Systems","Computer Science Information Systems
Journal title
ISSN journal
00015903
Volume
35
Issue
6
Year of publication
1998
Pages
457 - 504
Database
ISI
SICI code
0001-5903(1998)35:6<457:ALATPF>2.0.ZU;2-L
Abstract
A formalism is presented for tracking assertions which hold universall y, i.e., at the end of all the execution paths to a given program poin t, and assertions which hold existentialIy, i.e., at the end of some e xecution paths. In the formalism, the assertions which hold at a given execution path are uniformly defined by an entry environment which co ntains the assertions which hold when the execution of the program beg ins and an environment transformer for every program construct. The no vel aspect of our formalism is that Horn clauses are used to specify t he consistent environments and the meaning of program constructs. The best iterative algorithm (a notion defined by P. Cousot and R. Cousot) for tracking universal and existential assertions simultaneously is g iven. Conditions are presented under which the best iterative algorith m can be efficiently implemented. The formalism is applied to the poin ter equality problem in Pascal. It is shown that universal pointer equ alities may be used to reduce the number of superfluous existential eq ualities, and that existential equalities may be used to obtain more u niversal equalities. Recent empirical results indicate that tracking t he combination of may and must equalities leads to substantial improve ments in the result of the analysis. For programs without recursively defined records, the best iterative algorithm can be effectively imple mented. These results apply to multiple levels of pointers and can be extended to handle possibly recursive procedures. However, for program s with recursively defined data types further approximations are neces sary, e.g., by using a finite graph to model all the possible pointer equalities. For simplicity, this paper does not present an analysis al gorithm for this case.