Skip to main content

The Complexity of Andersen’s Analysis in Practice

  • Conference paper
Static Analysis (SAS 2009)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5673))

Included in the following conference series:

Abstract

While the tightest proven worst-case complexity for Andersen’s points-to analysis is nearly cubic, the analysis seems to scale better on real-world codes. We examine algorithmic factors that help account for this gap. In particular, we show that a simple algorithm can compute Andersen’s analysis in worst-case quadratic time as long as the input program is k-sparse, i.e. it has at most k statements dereferencing each variable and a sparse flow graph. We then argue that for strongly-typed languages like Java, typical structure makes programs likely to be k-sparse, and we give empirical measurements across a suite of Java programs that confirm this hypothesis. We also discuss how various standard implementation techniques yield further constant-factor speedups.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, University of Copenhagen, DIKU (1994)

    Google Scholar 

  2. Apache Ant, http://ant.apache.org

  3. Berndl, M., Lhoták, O., Qian, F., Hendren, L., Umanee, N.: Points-to analysis using BDDs. In: Conference on Programming Language Design and Implementation (PLDI) (June 2003)

    Google Scholar 

  4. Blackburn, S.M., Garner, R., Hoffman, C., Khan, A.M., McKinley, K.S., Bentzur, R., Diwan, A., Feinberg, D., Frampton, D., Guyer, S.Z., Hirzel, M., Hosking, A., Jump, M., Lee, H., Moss, J.E.B., Phansalkar, A., Stefanović, D., VanDrunen, T., von Dincklage, D., Wiedermann, B.: The DaCapo benchmarks: Java benchmarking development and analysis. In: Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (2006)

    Google Scholar 

  5. Chaudhuri, S.: Subcubic algorithms for recursive state machines. In: POPL 2008: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 159–169. ACM, New York (2008)

    Google Scholar 

  6. Fändrich, M., Foster, J.S., Su, Z., Aiken, A.: Partial online cycle elimination in inclusion constraint graphs. In: Conference on Programming Language Design and Implementation (PLDI), Montreal, Canada (June 1998)

    Google Scholar 

  7. Fecht, C., Seidl, H.: Propagating differences: an efficient new fixpoint algorithm for distributive constraint systems. Nordic J. of Computing 5(4), 304–329 (1998)

    MathSciNet  MATH  Google Scholar 

  8. Goldsmith, S.F., Aiken, A.S., Wilkerson, D.S.: Measuring empirical computational complexity. In: ESEC-FSE 2007: Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering, pp. 395–404. ACM Press, New York (2007)

    Google Scholar 

  9. Hardekopf, B., Lin, C.: The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code. In: PLDI, pp. 290–299 (2007)

    Google Scholar 

  10. Heintze, N., McAllester, D.: Linear-time subtransitive control flow analysis. SIGPLAN Not. 32(5), 261–272 (1997)

    Article  Google Scholar 

  11. Heintze, N., McAllester, D.: On the cubic bottleneck in subtyping and flow analysis. In: LICS 1997: Proceedings of the 12th Annual IEEE Symposium on Logic in Computer Science, Washington, DC, USA, 1997, p. 342. IEEE Computer Society, Los Alamitos (1997)

    Google Scholar 

  12. Heintze, N., Tardieu, O.: Demand-driven pointer analysis. In: Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah (June 2001)

    Google Scholar 

  13. Heintze, N., Tardieu, O.: Ultra-fast aliasing analysis using CLA: A million lines of C code in a second. In: Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah (June 2001)

    Google Scholar 

  14. Kodumal, J., Aiken, A.: Banshee: A scalable constraint-based analysis toolkit. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 218–234. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  15. Lhoták, O.: Spark: A flexible points-to analysis framework for Java. Master’s thesis, McGill University (December 2002)

    Google Scholar 

  16. Lhoták, O., Hendren, L.: Scaling Java points-to analysis using Spark. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 153–169. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  17. Lhoták, O., Hendren, L.: Context-sensitive points-to analysis: Is it worth it? In: Mycroft, A., Zeller, A. (eds.) CC 2006. LNCS, vol. 3923, pp. 47–64. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  18. Milanova, A., Rountev, A., Ryder, B.G.: Parameterized object sensitivity for points-to analysis for java. ACM Trans. Softw. Eng. Methodol. 14(1), 1–41 (2005)

    Article  Google Scholar 

  19. Pearce, D.J.: Some directed graph algorithms and their application to pointer analysis. PhD thesis, Imperial College of Science, Technology and Medicine, University of London (2005)

    Google Scholar 

  20. Pearce, D.J., Kelly, P.H.J., Hankin, C.: Online cycle detection and difference propagation for pointer analysis. In: Proceedings of the third international IEEE Workshop on Source Code Analysis and Manipulation (2003)

    Google Scholar 

  21. Reps, T.: Program analysis via graph reachability. Information and Software Technology 40(11-12), 701–726 (1998)

    Article  Google Scholar 

  22. Rountev, A., Milanova, A., Ryder, B.G.: Points-to analysis for Java using annotated constraints. In: Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Tampa Bay, Florida (October 2001)

    Google Scholar 

  23. Shivers, O.: Control flow analysis in scheme. In: Conference on Programming Language Design and Implementation (PLDI) (1988)

    Google Scholar 

  24. Sridharan, M., Bodík, R.: Refinement-based context-sensitive points-to analysis for Java. In: Conference on Programming Language Design and Implementation (PLDI) (2006)

    Google Scholar 

  25. Sridharan, M., Gopan, D., Shan, L., Bodík, R.: Demand-driven points-to analysis for Java. In: Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (2005)

    Google Scholar 

  26. Steensgaard, B.: Points-to analysis in almost linear time. In: ACM Symposium on Principles of Programming Languages (POPL) (1996)

    Google Scholar 

  27. Su, Z., Fähndrich, M., Aiken, A.: Projection merging: Reducing redundancies in inclusion constraint graphs. In: ACM Symposium on Principles of Programming Languages (POPL), Boston, Massachusetts, January 2000, pp. 81–95 (2000)

    Google Scholar 

  28. T.J. Watson Libraries for Analysis (WALA), http://wala.sf.net

  29. Whaley, J., Lam, M.S.: Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In: Conference on Programming Language Design and Implementation (PLDI) (2004)

    Google Scholar 

  30. Zhu, J., Calman, S.: Symbolic pointer analysis revisited. In: Conference on Programming Language Design and Implementation (PLDI) (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sridharan, M., Fink, S.J. (2009). The Complexity of Andersen’s Analysis in Practice. In: Palsberg, J., Su, Z. (eds) Static Analysis. SAS 2009. Lecture Notes in Computer Science, vol 5673. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03237-0_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03237-0_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03236-3

  • Online ISBN: 978-3-642-03237-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics