Compositional May-Must Program Analysis: Unleashing The Power of Alternation - Godefroid, Patrice; Nori, Aditya; Rajamani, Sriram and (Microsoft, 2009)
Program analysis tools typically compute two types of information: (1) may information is true of all program executions and is used to prove the absence of bugs in the program, and (2) must information is true of some program executions and is used to prove the existence of bugs in the program. In this paper, we propose a new algorithm, dubbed SMASH, which computes both may and must information compositionally. At each procedure boundary, may and must information is represented and stored as may and must summaries, respectively. Those summaries are computed in a demand-driven manner and possibly using summaries of the opposite type. We have implemented SMASH using predicate abstraction (as in SLAM) for the may part and using dynamic test generation (as in DART) for the must part. Results of experiments with 69 Microsoft Windows Vista device drivers show that SMASH can significantly outperform may-only, must-only and non compositional may-must algorithms. Indeed, intuitively, most complex code fragments in large programs are actually often either easy to prove irrelevant to the specific property of interest using may analysis or easy to traverse using directed testing. The fined-grained coupling and alternation of may (universal) and must (existential) summaries allow SMASH to easily navigate through these code fragments while traditional may-only, must-only or non-compositional may-must algorithms are stuck in their specific analyses.