Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

A Set-Based Context Model for Program Analysis

  • Conference paper
  • First Online:
Programming Languages and Systems (APLAS 2020)

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

Included in the following conference series:

  • 523 Accesses

Abstract

In program analysis, the design of context models is an understudied topic. This paper presents a study of context models for higher-order program analyses and develops new approaches. We develop a context model which equates control flows with the same set of call sites on the program stack, guaranteeing termination without the arbitrary cutoffs which cause imprecision in existing models. We then selectively polyinstantiate these contexts to avoid exponential growth.

We evaluate this model and existing models across multiple higher-order program analysis families. Existing demand-driven analyses cannot support the set model, so we construct a demand-driven analysis, Plume, which can. Our experiments demonstrate that the set-based model is tractable and expressive on representative functional programs for both forward- and demand-driven functional analyses.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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 EPUB and 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

Similar content being viewed by others

References

  1. Agesen, O.: The Cartesian product algorithm: simple and precise type inference of parametric polymorphism. In: ECOOP (1995)

    Google Scholar 

  2. Besson, F.: CPA beats \(\infty \)-CFA. In: Proceedings of the 11th International Workshop on Formal Techniques for Java-like Programs (2009)

    Google Scholar 

  3. Bravenboer, M., Smaragdakis, Y.: Strictly declarative specification of sophisticated points-to analyses. In: OOPSLA (2009)

    Google Scholar 

  4. Darais, D., Labich, N., Nguyen, P.C., Horn, D.V.: Abstracting definitional interpreters. CoRR (2017)

    Google Scholar 

  5. Duesterwald, E., Gupta, R., Soffa, M.L.: A practical framework for demand-driven interprocedural data flow analysis. TOPLAS 19(6), 992–1030 (1997)

    Article  Google Scholar 

  6. Facchinetti, L., Palmer, Z., Smith, S.: Higher-order demand-driven program analysis. TOPLAS 41, 1–53 (2019)

    Article  Google Scholar 

  7. Facchinetti, L., Palmer, Z., Smith, S.F.: Relative store fragments for singleton abstraction. In: Static Analysis (2017)

    Google Scholar 

  8. Fachinetti, L., Palmer, Z., Smith, S.F., Wu, K., Yorihiro, A.: Appendices to a set-based context model for program analysis (2020). https://www.cs.swarthmore.edu/~zpalmer/publications/supplemental/aplas2020-supplement.pdf

  9. Fähndrich, M., Rehof, J., Das, M.: Scalable context-sensitive flow analysis using instantiation constraints. In: PLDI (2000)

    Google Scholar 

  10. Germane, K., McCarthy, J., Adams, M.D., Might, M.: Demand control-flow analysis. In: Enea, C., Piskac, R. (eds.) VMCAI 2019. LNCS, vol. 11388, pp. 226–246. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-11245-5_11

    Chapter  Google Scholar 

  11. Gilray, T., Adams, M.D., Might, M.: Allocation characterizes polyvariance: a unified methodology for polyvariant control-flow analysis. In: ICFP (2016)

    Google Scholar 

  12. Gilray, T., Lyde, S., Adams, M.D., Might, M., Van Horn, D.: Pushdown control-flow analysis for free. In: POPL (2016)

    Google Scholar 

  13. Heintze, N., Tardieu, O.: Demand-driven pointer analysis. In: PLDI (2001)

    Google Scholar 

  14. Henglein, F.: Type inference with polymorphic recursion. TOPLAS 15(2), 253–289 (1993)

    Article  Google Scholar 

  15. Horwitz, S., Reps, T., Sagiv, M.: Demand interprocedural dataflow analysis. In: SIGSOFT (1995)

    Google Scholar 

  16. Jeon, M., Jeong, S., Oh, H.: Precise and scalable points-to analysis via data-driven context tunneling. Proc. ACM Program. Lang. 2(OOPSLA), 29 (2018)

    Article  Google Scholar 

  17. Jeong, S., Jeon, M., Cha, S., Oh, H.: Data-driven context-sensitivity for points-to analysis. Proc. ACM Program. Lang. 1(OOPSLA), 1–28 (2017)

    Article  Google Scholar 

  18. Johnson, J.I., Sergey, I., Earl, C., Might, M., Van Horn, D.: Pushdown flow analysis with abstract garbage collection. JFP 24(2–3), 218–283 (2014)

    MathSciNet  MATH  Google Scholar 

  19. Johnson, J.I., Van Horn, D.: Abstracting abstract control. In: DLS (2014)

    Google Scholar 

  20. Lhoták, O., Hendren, L.: Evaluating the benefits of context-sensitive points-to analysis using a BDD-based implementation. TOSEM 18(1), 31–353 (2008)

    Article  Google Scholar 

  21. Li, Y., Tan, T., Møller, A., Smaragdakis, Y.: Precision-guided context sensitivity for pointer analysis. Proc. ACM Program. Lang. 2(OOPSLA), 141:1–141:29 (2018)

    Google Scholar 

  22. Li, Y., Tan, T., Møller, A., Smaragdakis, Y.: Scalability-first pointer analysis with self-tuning context-sensitivity. In: Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2018 (2018)

    Google Scholar 

  23. Might, M.: Environment Analysis of Higher-order Languages. Ph.D. thesis (2007)

    Google Scholar 

  24. Might, M., Smaragdakis, Y., Van Horn, D.: Resolving and exploiting the k-CFA paradox: illuminating functional vs. object-oriented program analysis. In: PLDI (2010)

    Google Scholar 

  25. Milanova, A., Rountev, A., Ryder, B.G.: Parameterized object sensitivity for points-to analysis for Java. TOSEM 14(1), 1–41 (2005)

    Article  Google Scholar 

  26. Okhotin, A.: Conjunctive grammars. J. Autom. Lang. Comb. 6, 519–535 (2001)

    MathSciNet  MATH  Google Scholar 

  27. Rehof, J., Fähndrich, M.: Type-base flow analysis: from polymorphic subtyping to CFL-reachability. In: POPL (2001)

    Google Scholar 

  28. Reps, T.: Shape analysis as a generalized path problem. In: PEPM (1995)

    Google Scholar 

  29. Reps, T.: Undecidability of context-sensitive data-dependence analysis. TOPLAS 22(1), 162–186 (2000)

    Article  Google Scholar 

  30. Reps, T., Horwitz, S., Sagiv, M.: Precise interprocedural dataflow analysis via graph reachability. In: POPL (1995)

    Google Scholar 

  31. Reps, T.W.: Demand interprocedural program analysis using logic databases. In: Ramakrishnan, R. (ed.) Applications of Logic Databases. SECS, vol. 296, pp. 163–196. Springer, Boston (1995). https://doi.org/10.1007/978-1-4615-2207-2_8

    Chapter  Google Scholar 

  32. Saha, D., Ramakrishnan, C.R.: Incremental and demand-driven points-to analysis using logic programming. In: PPDP (2005)

    Google Scholar 

  33. Shivers, O.G.: Control-flow Analysis of Higher-order Languages. Ph.D. thesis, uMI Order No. GAX91-26964 (1991)

    Google Scholar 

  34. Späth, J., Ali, K., Bodden, E.: Context-, flow-, and field-sensitive data-flow analysis using synchronized pushdown systems. Proc. ACM Program. Lang. 3(POPL), 1–29 (2019)

    Article  Google Scholar 

  35. Späth, J., Do, L.N.Q., Ali, K., Bodden, E.: Boomerang: demand-driven flow- and context-sensitive pointer analysis for Java. In: ECOOP (2016)

    Google Scholar 

  36. Späth, J., Ali, K., Bodden, E.: Ideal: efficient and precise alias-aware data-flow analysis. PACMPL 1(OOPSLA), 1–27 (2017)

    Google Scholar 

  37. Tan, T., Li, Y., Xue, J.: Making k-object-sensitive pointer analysis more precise with still k-limiting. In: Rival, X. (ed.) SAS 2016. LNCS, vol. 9837, pp. 489–510. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53413-7_24

    Chapter  Google Scholar 

  38. Van Horn, D., Might, M.: Abstracting abstract machines. In: ICFP (2010)

    Google Scholar 

  39. Vardoulakis, D., Shivers, O.: CFA2: a context-free approach to control-flow analysis. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 570–589. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-11957-6_30

    Chapter  Google Scholar 

  40. Wright, A.K., Jagannathan, S.: Polymorphic splitting: an effective polyvariant flow analysis. TOPLAS 20(1), 166–207 (1998)

    Article  Google Scholar 

  41. Zhang, Q., Su, Z.: Context-sensitive data-dependence analysis via linear conjunctive language reachability. In: POPL (2017)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Zachary Palmer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Fachinetti, L., Palmer, Z., Smith, S.F., Wu, K., Yorihiro, A. (2020). A Set-Based Context Model for Program Analysis. In: Oliveira, B.C.d.S. (eds) Programming Languages and Systems. APLAS 2020. Lecture Notes in Computer Science(), vol 12470. Springer, Cham. https://doi.org/10.1007/978-3-030-64437-6_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-64437-6_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-64436-9

  • Online ISBN: 978-3-030-64437-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics