Selectors Make Set-Based Analysis Too Hard
- 28 Downloads
A set-based program analysis establishes constraints between sets of abstract values for all expressions in a program. Solving the system of constraints produces a conservative approximation to the program's runtime flow of values.
Some practical set-based analyses use explicit selectors to extract the relevant values from an approximation set. For example, if the analysis needs to determine the possible return values of a procedure, it uses the appropriate selector to extract the relevant component from the abstract representation of the procedure.
In this paper, we show that this selector-based approach complicates the constraint solving phase of the analysis too much and thus fails to scale up to realistic programming languages. We demonstrate this claim with a full-fledged value flow analysis for case-lambda, a multi-branched version of lambda. We show how both the theoretical underpinnings and the practical implementation become too complex. In response, we present a variant of set-based closure analysis that computes equivalent results in a much more efficient manner.
Keywordsset-based analysis program analysis static debugging Scheme
Unable to display preview. Download preview PDF.
- 2.Aiken, A., Wimmers, E.L., and Lakshman, T.K. Soft typing with conditional types. In Proceeding of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '94), 1994, pp. 163–173.Google Scholar
- 3.Cormen, T.H., Leiserson, C.E., and Rivest, R.L. Introduction to Algorithms. MIT Press/McGraw-Hill, Cambridge, MA/New York, 1990.Google Scholar
- 4.Cousot, P. and Cousot, R. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 1977, pp. 238–252.Google Scholar
- 5.Dybvig, R.K. Chez Scheme User's Guide. Cadence Research Systems, 1998.Google Scholar
- 7.Dzeng, H. and Haynes, C.T. Type Reconstruction for variable-arity procedures. In Proceedings of the ACM Conference on Lisp and Functional Programming, 1994, pp. 239–249.Google Scholar
- 9.Flanagan, C. MrSpidey: Static Debugger Manual. Rice University, 1995.Google Scholar
- 10.Flanagan, C. Effective static debugging via componential set-based analysis. PhD thesis, Rice University, 1997.Google Scholar
- 11.Flanagan, C. and Felleisen, M. Componential set-based analysis. ACM Trans. on Programming Languages and Systems, 21(2) (1999) 369–415.Google Scholar
- 12.Flatt, M. MzScheme: Language Reference Manual. Rice University. 2000, Version 103.Google Scholar
- 13.Heintze, N. Set based program analysis. PhD thesis, Carnegie-Mellon Univ., Pittsburgh, Pa, 1992.Google Scholar
- 14.Heintze, N. Set-based analysis of ML programs. In Proceedings of the 1994 ACM Conference on LISP and Functional Programming, 1994, pp. 306–317.Google Scholar
- 15.Heintze, N. and McAllester, D. Linear-time subtransitive control flow analysis. In Proceedings of the 1997 ACM Conference on Programming Language Design and Implementation (PLDI '97), 1997a, pp. 261–272.Google Scholar
- 16.Heintze, N. and McAllester, D. On the cubic bottleneck in subtyping and flow analysis. In Proceedings of the IEEE Symposium on Logic in Computer Science (LICS '97), 1997b, pp. 342–351.Google Scholar
- 17.Kelsey, R., Clinger, W., and Rees, J. Revised5 report on the Algorithmic Language Scheme. Higher-Order and Symbolic Computation, 11(1) (1998) 7–105.Google Scholar
- 18.McAllester, D. and Heintze, N. On the complexity of set-based analysis. In 1997 International Conference on Functional Programming, 1997.Google Scholar
- 19.Palsberg, J. Closure analysis in constraint form. Proceedings of the ACM Transactions on Programming Languages and Systems, 17(1) (1995) 47–62.Google Scholar
- 20.Palsberg, J. and Schwartzbach, M.I. Object-Oriented Type Systems, Wiley Professional Computing. Chichester, Wiley, 1994.Google Scholar
- 21.Sestoft, P. Replacing Function Parameters by Global Variables. Master's thesis, DIKU, University of Copenhagen, 1988.Google Scholar
- 22.Shivers, O. The semantics of Scheme control-flow analysis. In Proceedings of the 1991 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, 1991, pp. 190–198.Google Scholar
- 23.Wand, M. and Williamson, G.B. A modular, extensible proof method for small-step flow analyses. In Programming Languages and Systems, 11th European Symposium on Programming, ESOP 2002, held as Part of the Joint European Conference on Theory and Practice of Software, ETAPS 2002, Proceedings, D. Le Métayer (Ed.), vol. 2305 of Lecture Notes in Computer Science, 2002, pp. 213–227.Google Scholar