Separate abstract interpretation for control-flow analysis
Effect systems and abstract interpretation are two methods to perform static analysis of programs. We present a new technique that builds upon the type and effect information of module signatures to extend abstract interpretation in the context of separate compilation. We use control-flow analysis as an application of this idea to support our claim.
Control-flow analysis strives to determine at compile time which functions, in a given call environment, may be called by a particular application expression. This static control-flow analysis can be expressed using either a type and effect system or abstract interpretation. The type and effect approach supports separate compilation but, being structural, collapses all call environments together, thus limiting the precision of control-flow information. By contrast, the abstract interpretation approach fails to support separate compilation but, because of its more operational nature, can distinguish between call environments, thus performing a more precise analysis.
We present a new static control-flow analysis that combines both techniques in a single framework. This separate abstract interpretation is as effective as the abstract interpretation approach on closed expressions, but is also able to tackle expressions with free variables, using their types to approximate their abstract values. We prove that this separate abstract interpretation analysis is a conservative extension of abstract interpretation.
Unable to display preview. Download preview PDF.
- 1.Appel, A. W. Compiling with Continuations. Princeton University, 1992.Google Scholar
- 2.Cousot, P., and Cousot, R. Abstract Interpretation, a unified lattice model for static analysis of programs by construction of approximation of fixpoints. In ACM Symposium on Principles of Programming Languages. 1977.Google Scholar
- 3.Jouvelot, P., and Gifford, D. K. Algebraic Reconstruction of Types and Effects. In Proceedings of the 1991 ACM Conference on Principles of Programming Languages. ACM, New-York, 1991.Google Scholar
- 4.Lucassen, J. M., and Gifford, D. K. Polymorphic Effect Systems. In Proceedings of the 1988 ACM Conference on Principles of Programming Languages. ACM, New-York, 1988.Google Scholar
- 5.Plotkin, G. A structural approach to operational semantics. In Technical report DAIMI-FN-19. Aarhus University, 1981.Google Scholar
- 6.Shivers, O. Control-Flow Analysis of Higher-Order Languages. PhD thesis, CMU, May 1991.Google Scholar
- 7.Talpin, J. P., and Jouvelot, P. Polymorphic Type, Region and Effect Inference. Journal of Functional Programming, vol.2, no. 3, July 1992.Google Scholar
- 8.Tang, Y. M., and Jouvelot, P. Control-Flow Effects for Escape Analysis. WSA'92, Bordeaux, France, September 1992.Google Scholar