A Family of Abstract Interpretations for Static Analysis of Concurrent Higher-Order Programs

  • Matthew Might
  • David Van Horn
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6887)

Abstract

We develop a framework for computing two foundational analyses for concurrent higher-order programs: (control-)flow analysis (CFA) and may-happen-in-parallel analysis (MHP). We pay special attention to the unique challenges posed by the unrestricted mixture of first-class continuations and dynamically spawned threads. To set the stage, we formulate a concrete model of concurrent higher-order programs: the P(CEK*)S machine. We find that the systematic abstract interpretation of this machine is capable of computing both flow and MHP analyses. Yet, a closer examination finds that the precision for MHP is poor. As a remedy, we adapt a shape analytic technique—singleton abstraction—to dynamically spawned threads (as opposed to objects in the heap). We then show that if MHP analysis is not of interest, we can substantially accelerate the computation of flow analysis alone by collapsing thread interleavings with a second layer of abstraction.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Balakrishnan, G., Reps, T.: Recency-abstraction for heap-allocated storage. In: Yi, K. (ed.) SAS 2006. LNCS, vol. 4134, pp. 221–239. Springer, Heidelberg (2006), http://dx.doi.org/10.1007/11823230_15, doi:10.1007/11823230_15CrossRefGoogle Scholar
  2. 2.
    Chase, D.R., Wegman, M., Zadeck, F.K.: Analysis of pointers and structures. In: PLDI 1990: Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementationm, PLDI 1990, pp. 296–310. ACM, New York (1990)CrossRefGoogle Scholar
  3. 3.
    Cousot, P., 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 ACM Symposium on Principles of Programming Languages, pp. 238–252. ACM Press, New York (1977)Google Scholar
  4. 4.
    Cousot, P., Cousot, R.: Systematic design of program analysis frameworks. In: POPL 1979: Proceedings of the 6th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1979, pp. 269–282. ACM Press, New York (1979)Google Scholar
  5. 5.
    Feeley, M.: An Efficient and General Implementation of Futures on Large Scale Shared-Memory Multiprocessors. PhD thesis, Brandeis University (April 1993)Google Scholar
  6. 6.
    Felleisen, M., Friedman, D.P.: Control operators, the SECD-machine, and the lambda-calculus. In: 3rd Working Conference on the Formal Description of Programming Concepts (August 1986)Google Scholar
  7. 7.
    Flanagan, C., Felleisen, M.: The semantics of future and its use in program optimization. In: POPL 1995: Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 209–220. ACM, New York (1995)Google Scholar
  8. 8.
    Flanagan, C., Felleisen, M.: The semantics of future and an application. Journal of Functional Programming 9(01), 1–31 (1999)Google Scholar
  9. 9.
    Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: PLDI 1993: Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation, pp. 237–247. ACM, New York (1993)CrossRefGoogle Scholar
  10. 10.
    Hudak, P.: A semantic model of reference counting and its abstraction. In: LFP 1986: Proceedings of the 1986 ACM Conference on LISP and Functional Programming, pp. 351–363. ACM, New York (1986)CrossRefGoogle Scholar
  11. 11.
    Jagannathan, S., Thiemann, P., Weeks, S., Wright, A.: Single and loving it: must-alias analysis for higher-order languages. In: POPL 1998: Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1998, pp. 329–341. ACM, New York (1998)Google Scholar
  12. 12.
    Jones, N.D.: Flow analysis of lambda expressions (preliminary version). In: Proceedings of the 8th Colloquium on Automata, Languages and Programming, pp. 114–128. Springer, London (1981)Google Scholar
  13. 13.
    Might, M.: Shape analysis in the absence of pointers and structure. In: Barthe, G., Hermenegildo, M. (eds.) VMCAI 2010. LNCS, vol. 5944, pp. 263–278. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  14. 14.
    Might, M., Shivers, O.: Exploiting reachability and cardinality in higher-order flow analysis. Journal of Functional Programming 18(Special Double Issue 5-6), 821–864 (2008)Google Scholar
  15. 15.
    Might, M., Smaragdakis, Y., Van Horn, D.: Resolving and exploiting the k-CFA paradox: illuminating functional vs. object-oriented program analysis. In: PLDI 2010: Proceedings of the 2010 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 305–315. ACM, New York (2010)Google Scholar
  16. 16.
    Navabi, A., Jagannathan, S.: Exceptionally safe futures. In: Field, J., Vasconcelos, V. (eds.) COORDINATION 2009. LNCS, vol. 5521, pp. 47–65. Springer, Heidelberg (2009)Google Scholar
  17. 17.
    Palsberg, J.: Closure analysis in constraint form. ACM Transactions on Programming Languages and Systems 17(1), 47–62 (1995)Google Scholar
  18. 18.
    Queinnec, C.: Continuations and web servers. Higher-Order and Symbolic Computation 17(4), 277–295 (2004)Google Scholar
  19. 19.
    Sagiv, M., Reps, T., Wilhelm, R.: Parametric shape analysis via 3-valued logic. ACM Transactions on Programming Languages and Systems 24(3), 217–298 (2002)CrossRefGoogle Scholar
  20. 20.
    Shivers, O.: Control flow analysis in Scheme. In: PLDI 1988: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, pp. 164–174. ACM, New York (1988)CrossRefGoogle Scholar
  21. 21.
    Shivers, O.G.: Control-Flow Analysis of Higher-Order Languages PhD thesis, Carnegie Mellon University, Pittsburgh, PA, USA (1991)Google Scholar
  22. 22.
    Van Horn, D., Mairson, H.G.: Deciding kCFA is complete for EXPTIME. In: ICFP 2008: Proceeding of the 13th ACM SIGPLAN International Conference on Functional Programming, pp. 275–282. ACM, New York (2008)Google Scholar
  23. 23.
    Van Horn, D., Might, M.: Abstracting abstract machines. In: ICFP 2010: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, pp. 51–62. ACM, New York (2010)Google Scholar
  24. 24.
    Yahav, E.: Verifying safety properties of concurrent java programs using 3-valued logic. In: Proceedings of the 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2001, pp. 27–40. ACM Press, New York (2001)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Matthew Might
    • 1
  • David Van Horn
    • 2
  1. 1.University of UtahUSA
  2. 2.Northeastern UniversityUSA

Personalised recommendations