Continuation equivalence: a correctness criterion for static optimizations of dynamic analyses

Dynamic analyses reason about a program's concrete heap and control flow and hence can report on actual program behavior with high or even perfect accuracy. But many dynamic analyses require extensive program instrumentation, often slowing down the analyzed program considerably. In the past, researchers have hence developed specialized static optimizations that can prove instrumentation for a special analysis unnecessary at many program locations: the analysis can safely omit monitoring these locations, as their monitoring would not change the analysis results. Arguing about the correctness of such optimizations is hard, however, and ad-hoc approaches have lead to mistakes in the past. In this paper we present a correctness criterion called Continuation Equivalence, which allows researchers to prove static optimizations of dynamic analyses correct more easily. The criterion demands that an optimization may alter instrumentation at a program site only if the altered instrumentation produces a dynamic analysis configuration equivalent to the configuration of the un-altered program with respect to all possible continuations of the control flow. In previous work, we have used a notion of continuationequivalent states to prove the correctness of static optimization for finite-state runtime monitors. With this work, we propose to generalize the idea to general dynamic analyses.

[1]  Matthew B. Dwyer,et al.  Residual dynamic typestate analysis exploiting static analysis: results to reformulate and reduce the cost of dynamic analysis , 2007, ASE.

[2]  Ondrej Lhoták,et al.  Efficient trace monitoring , 2006, OOPSLA '06.

[3]  Ondrej Lhoták,et al.  A Staged Static Program Analysis to Improve the Performance of Runtime Monitoring , 2007, ECOOP.

[4]  Oege de Moor,et al.  Making trace monitors feasible , 2007, OOPSLA.

[5]  Eric Bodden,et al.  Aspect-Oriented Race Detection in Java , 2010, IEEE Transactions on Software Engineering.

[6]  Mira Mezini,et al.  Complete and Platform-Independent Calling Context Profiling for the Java Virtual Machine , 2011, Bytecode@ETAPS.

[7]  Eran Yahav,et al.  Effective typestate verification in the presence of aliasing , 2006, TSEM.

[8]  Ondrej Lhoták,et al.  Typestate-like analysis of multiple interacting objects , 2008, OOPSLA.

[9]  Eric Bodden,et al.  Finding programming errors earlier by evaluating runtime monitors ahead-of-time , 2008, SIGSOFT '08/FSE-16.

[10]  Susan Horwitz,et al.  Using Static Analysis to Reduce Dynamic Analysis Overhead , 2005, Formal Methods Syst. Des..

[11]  Eric Bodden Efficient hybrid typestate analysis by determining continuation-equivalent states , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[12]  Eric Bodden Verifying finite-state properties of large-scale programs , 2009 .

[13]  Eric Bodden,et al.  Racer: effective race detection using aspectj , 2008, ISSTA '08.