Advertisement

Demand Control-Flow Analysis

  • Kimball GermaneEmail author
  • Jay McCarthy
  • Michael D. Adams
  • Matthew Might
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11388)

Abstract

Points-to analysis manifests in a functional setting as control-flow analysis. Despite the ubiquity of demand points-to analyses, there are no analogous demand control-flow analyses for functional languages in general. We present demand 0CFA, a demand control-flow analysis that offers clients in a functional setting the same pricing model that demand points-to analysis clients enjoy in an imperative setting. We establish demand 0CFA’s correctness via an intermediary exact semantics, demand evaluation, that can potentially support demand variants of more-precise analyses.

Notes

Acknowledgement

This material is partially based on research sponsored by DARPA under agreement number AFRL FA8750-15-2-0092 and by NSF under CAREER grant 1350344. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon.

References

  1. 1.
    Ashley, J.M., Dybvig, R.K.: A practical and flexible flow analysis for higher-order languages. ACM Trans. Program. Lang. Syst. 20, 845–868 (1998)CrossRefGoogle Scholar
  2. 2.
    Biswas, S.K.: A demand-driven set-based analysis. In: Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1997. ACM (1997)Google Scholar
  3. 3.
    Darais, D., Labich, N., Nguyen, P.C., Van Horn, D.: Abstracting definitional interpreters (functional pearl). Proc. ACM Program. Lang. 1(ICFP), 12 (2017)CrossRefGoogle Scholar
  4. 4.
    Duesterwald, E., Gupta, R., Soffa, M.L.: A practical framework for demand-driven interprocedural data flow analysis. ACM Trans. Program. Lang. Syst. (TOPLAS) 19(6), 992–1030 (1997)CrossRefGoogle Scholar
  5. 5.
    Earl, C., Might, M., Van Horn, D.: Pushdown control-flow analysis of higher-order programs. In: Workshop on Scheme and Functional Programming (2010)Google Scholar
  6. 6.
    Germane, K., Might, M.: Demand control-flow analysis. Technical report, January 2019. http://kimball.germane.net/germane-dcfa-techreport.pdf
  7. 7.
    Gilray, T., Lyde, S., Adams, M.D., Might, M., Van Horn, D.: Pushdown control-flow analysis for free. In: Proceedings of the 43rd Annual ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2016. ACM (2016)Google Scholar
  8. 8.
    Heintze, N., McAllester, D.: Linear-time subtransitive control flow analysis. In: Proceedings of the ACM SIGPLAN 1997 Conference on Programming Language Design and Implementation, PLDI 1997. ACM Press (1997)Google Scholar
  9. 9.
    Heintze, N., Tardieu, O.: Demand-driven pointer analysis. In: ACM SIGPLAN Notices, vol. 36, pp. 24–34. ACM (2001)Google Scholar
  10. 10.
    Johnson, J.I., Van Horn, D.: Abstracting abstract control. In: Proceedings of the 10th ACM Symposium on Dynamic Languages. ACM (2014)Google Scholar
  11. 11.
    Midtgaard, J., Jensen, T.: A calculational approach to control-flow analysis by abstract interpretation. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 347–362. Springer, Heidelberg (2008).  https://doi.org/10.1007/978-3-540-69166-2_23CrossRefzbMATHGoogle Scholar
  12. 12.
    Might, M., Smaragdakis, Y., Van Horn, D.: Resolving and exploiting the k-CFA paradox: illuminating functional vs. object-oriented program analysis. In: Proceedings of the 2010 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2010. ACM Press (2010)Google Scholar
  13. 13.
    Nielson, F., Nielson, H.R.: Infinitary control flow analysis: a collecting semantics for closure analysis. In: Proceedings of the 24th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 1997. ACM Press (1997)Google Scholar
  14. 14.
    Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999).  https://doi.org/10.1007/978-3-662-03811-6CrossRefzbMATHGoogle Scholar
  15. 15.
    Palmer, Z., Smith, S.F.: Higher-order demand-driven program analysis. In: 30th European Conference on Object-Oriented Programming (2016)Google Scholar
  16. 16.
    Palsberg, J.: Closure analysis in constraint form. ACM Trans. Program. Lang. Syst. 17(1), 47–62 (1995)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Shivers, O.: Control-flow analysis of higher-order languages. Ph.D. thesis, Carnegie Mellon University (1991)Google Scholar
  18. 18.
    Sridharan, M., Bodík, R.: Refinement-based context-sensitive points-to analysis for Java. In: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2006, pp. 387–400. ACM, New York (2006)Google Scholar
  19. 19.
    Sridharan, M., Gopan, D., Shan, L., Bodík, R.: Demand-driven points-to analysis for Java. In: Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2005, pp. 59–76. ACM, New York (2005)Google Scholar
  20. 20.
    Van Horn, D., Mairson, H.G.: Flow analysis, linearity, and PTIME. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 255–269. Springer, Heidelberg (2008).  https://doi.org/10.1007/978-3-540-69166-2_17CrossRefzbMATHGoogle Scholar
  21. 21.
    Van Horn, D., Might, M.: Abstracting abstract machines. In: Proceedings of the 15th ACM International Conference on Functional Programming, ICFP 2010, pp. 51–62. ACM, New York (2010)Google Scholar
  22. 22.
    Vardoulakis, D., Shivers, O.: CFA2: a context-free approach to control-flow analysis. Logical Methods Comput. Sci. (2011)Google Scholar
  23. 23.
    Wei, G., Decker, J., Rompf, T.: Refunctionalization of abstract abstract machines: bridging the gap between abstract machines and abstract definitional interpreters (functional pearl). Proc. ACM Program. Lang. 2(ICFP), 105:1–105:28 (2018)CrossRefGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Kimball Germane
    • 1
    Email author
  • Jay McCarthy
    • 2
  • Michael D. Adams
    • 3
  • Matthew Might
    • 4
  1. 1.Brigham Young UniversityProvoUSA
  2. 2.University of Massachusetts LowellLowellUSA
  3. 3.University of UtahSalt Lake CityUSA
  4. 4.University of AlabamaBirminghamUSA

Personalised recommendations