Abstract

We analyze the computational complexity of k CFA, a hierarchy of control flow analyses that determine which functions may be applied at a given call-site. This hierarchy specifies related decision problems, quite apart from any algorithms that may implement their solutions. We identify a simple decision problem answered by this analysis and prove that in the 0CFA case, the problem is complete for polynomial time. The proof is based on a nonstandard, symmetric implementation of Boolean logic within multiplicative linear logic (MLL). We also identify a simpler version of 0CFA related to η-expansion, and prove that it is complete for logarithmic space, using arguments based on computing paths and permutations. For any fixed k >0, it is known that k CFA (and the analogous decision problem) can be computed in time exponential in the program size. For k =1, we show that the decision problem is NP-hard, and sketch why this remains true for larger fixed values of k . The proof technique depends on using the approximation of CFA as an essentially nondeterministic computing mechanism, as distinct from the exactness of normalization. When k = n , so that the "depth" of the control flow analysis grows linearly in the program length, we show that the decision problem is complete for exponential time. In addition, we sketch how the analysis presented here may be extended naturally to languages with control operators. All of the insights presented give clear examples of how straightforward observations about linearity, and linear logic, may in turn be used to give a greater understanding of functional programming and program analysis.

Highlights

  • We investigate the precision of static, compile-time analysis, and the necessary analytic tradeoff with the computational resources that go into the analysis.Control flow analysis provides a fundamental and ubiquitous static analysis of higher-order programs. Heintze and McAllester (1997b) point out that “some form of CFA is used in most forms of analyses for higher-order languages.” Control flow analysis answers the following basic questions (Palsberg 1995): 1. For every application, which abstractions can be applied?2

  • When k = n, so that the “depth” of the control flow analysis grows linearly in the program length, we show that the decision problem is complete for exponential time

  • Technical contributions: We identify a simple decision problem answered by control flow analysis and prove that in the 0CFA case, the problem is complete for polynomial time

Read more

Summary

Introduction

We investigate the precision of static, compile-time analysis, and the necessary analytic tradeoff with the computational resources that go into the analysis. Asking whether “true” can flow out of the call site becomes a way of asking if the Boolean function is satisfiable No such “pseudo parallelism” would be possible in an exact normalization—it is the existence of approximation that mashes these distinct closures together. Despite being the fundamental analysis of higher-order programs, despite being the subject of investigation for over twentyfive years (Jones 1981), and the great deal of expended “effort deriving clever ways to tame the cost”, there has remained a poverty of analytic knowledge on the complexity of control flow analysis and the kCFA hierarchy, the essence of how this hierarchy is computed, and where the sources of approximation occur that make the analysis work. This paper is intended to repair such lacunae in our understanding of program analysis

Preliminaries
The 0CFA decision problem
The kCFA decision problem
LOGSPACE and η-expansion
Atomic versus non-atomic axioms
Normalization and 0CFA for linear programs in
Languages with first-class control
Related work
Conclusions and perspective
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.