Skip to main content

A Systematic Approach to Abstract Interpretation of Program Transformations

  • Conference paper
  • First Online:
Verification, Model Checking, and Abstract Interpretation (VMCAI 2020)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11990))

Abstract

Abstract interpretation is a technique to define sound static analyses. While abstract interpretation is generally well-understood, the analysis of program transformations has not seen much attention. The main challenge in developing an abstract interpreter for program transformations is designing good abstractions that capture relevant information about the generated code. However, a complete abstract interpreter must handle many other aspects of the transformation language, such as backtracking and generic traversals, as well as analysis-specific concerns, such as interprocedurality and fixpoints. This deflects attention.

We propose a systematic approach to design and implement abstract interpreters for program transformations that isolates the abstraction for generated code from other analysis aspects. Using our approach, analysis developers can focus on the design of abstractions for generated code, while the rest of the analysis definition can be reused. We show that our approach is feasible and useful by developing three novel inter-procedural analyses for the Stratego transformation language: a singleton analysis for constant propagation, a sort analysis for type checking, and a locally-illsorted sort analysis that can additionally validate type changing generic traversals.

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 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.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

Notes

  1. 1.

    https://gitlab.rlp.net/plmz/sturdy/tree/master/stratego.

  2. 2.

    https://gitlab.rlp.net/plmz/sturdy/blob/master/stratego/src/GenericInterpreter.hs.

References

  1. Al-Sibahi, A.S., Jensen, T.P., Dimovski, A.S., Wasowski, A.: Verification of high-level transformations with inductive refinement types. CoRR (2018)

    Google Scholar 

  2. Balland, E., Brauner, P., Kopetz, R., Moreau, P.-E., Reilles, A.: Tom: piggybacking rewriting on Java. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 36–47. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73449-9_5

    Chapter  Google Scholar 

  3. Callahan, D., Cooper, K.D., Kennedy, K., Torczon, L.: Interprocedural constant propagation. In: Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction, Palo Alto, California, USA, 25–27 June 1986, pp. 152–161 (1986)

    Google Scholar 

  4. Chen, Y.-F.R., Gansner, E.R., Koutsofios, E.: A C++ data model supporting reachability analysis and dead code detection. In: Jazayeri, M., Schauer, H. (eds.) ESEC/SIGSOFT FSE-1997. LNCS, vol. 1301, pp. 414–431. Springer, Heidelberg (1997). https://doi.org/10.1007/3-540-63531-9_28

    Chapter  Google Scholar 

  5. Clavel, M., et al.: Maude: specification and programming in rewriting logic. Theor. Comput. Sci. 285(2), 187–243 (2002)

    Article  MathSciNet  Google Scholar 

  6. 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, Los Angeles, California, USA, January 1977, pp. 238–252 (1977)

    Google Scholar 

  7. Cousot, P., Cousot, R.: Comparing the Galois connection and widening/narrowing approaches to abstract interpretation. In: Bruynooghe, M., Wirsing, M. (eds.) PLILP 1992. LNCS, vol. 631, pp. 269–295. Springer, Heidelberg (1992). https://doi.org/10.1007/3-540-55844-6_142

    Chapter  MATH  Google Scholar 

  8. Cousot, P., Cousot, R.: Formal language, grammar and set-constraint-based program analysis by abstract interpretation. In: Proceedings of the Seventh International Conference on Functional Programming Languages and Computer Architecture, FPCA 1995, La Jolla, California, USA, 25–28 June 1995, pp. 170–181 (1995)

    Google Scholar 

  9. Erdweg, S., Rendel, T., Kästner, C., Ostermann, K.: SugarJ: library-based syntactic language extensibility. In: Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2011, part of SPLASH 2011, Portland, OR, USA, 22–27 October 2011, pp. 391–406 (2011)

    Google Scholar 

  10. Erdweg, S., Vergu, V., Mezini, M., Visser, E.: Modular specification and dynamic enforcement of syntactic language constraints. In: Proceedings of International Conference on Modularity (AOSD), pp. 241–252. ACM (2014)

    Google Scholar 

  11. Hughes, J.: Generalising monads to arrows. Sci. Comput. Program. 37(1–3), 67–111 (2000)

    Article  MathSciNet  Google Scholar 

  12. Keidel, S., Erdweg, S.: Compositional soundness proofs of abstract interpreters. PACMPL 3(OOPSLA), 176:1–176:28 (2019). https://dblp.uni-trier.de/rec/bibtex/journals/pacmpl/KeidelE19

  13. Keidel, S., Poulsen, C.B., Erdweg, S.: Compositional soundness proofs of abstract interpreters. PACMPL 2(ICFP), 72:1–72:26 (2018)

    Google Scholar 

  14. Klint, P., van der Storm, T., Vinju, J.J.: RASCAL: a domain specific language for source code analysis and manipulation. In: Ninth IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2009, Edmonton, Alberta, Canada, 20–21 September 2009, pp. 168–177 (2009)

    Google Scholar 

  15. Lämmel, R.: Typed generic traversal with term rewriting strategies. Log. Algebr. Program. 54(1–2), 1–64 (2003)

    MathSciNet  MATH  Google Scholar 

  16. Leroy, X., et al.: The CompCert C verified compiler. Documentation and user’s manual. INRIA Paris-Rocquencourt 53 (2012)

    Google Scholar 

  17. Matthews, J., Findler, R.B., Flatt, M., Felleisen, M.: A visual environment for developing context-sensitive term rewriting systems. In: van Oostrom, V. (ed.) RTA 2004. LNCS, vol. 3091, pp. 301–311. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-25979-4_21

    Chapter  Google Scholar 

  18. Paterson, R.: A new notation for arrows. In: Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming (ICFP 2001), Firenze, Florence, Italy, 3–5 September 2001, pp. 229–240 (2001)

    Google Scholar 

  19. Jones, S.P., Lämmel, R.: Scrap your boilerplate. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 357–357. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-40018-9_23

    Chapter  Google Scholar 

  20. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  21. Sălcianu, A., Rinard, M.: Purity and side effect analysis for Java programs. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 199–215. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-30579-8_14

    Chapter  Google Scholar 

  22. Sewell, P., et al.: Ott: effective tool support for the working semanticist. Funct. Program. 20(1), 71–122 (2010)

    Article  Google Scholar 

  23. Visser, E., Benaissa, Z.: A core language for rewriting. Electr. Notes Theor. Comput. Sci. 15, 422–441 (1998)

    Article  Google Scholar 

  24. Visser, E., Benaissa, Z., Tolmach, A.P.: Building program optimizers with rewriting strategies. In: Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming (ICFP 1998), Baltimore, Maryland, USA, 27–29 September 1998, pp. 13–26 (1998)

    Google Scholar 

  25. Xie, Y., Chou, A., Engler, D.R.: ARCHER: using symbolic, path-sensitive analysis to detect memory access errors. In: Proceedings of the 11th ACM SIGSOFT Symposium on Foundations of Software Engineering 2003 held jointly with 9th European Software Engineering Conference, ESEC/FSE 2003, Helsinki, Finland, 1–5 September 2003, pp. 327–336 (2003)

    Google Scholar 

Download references

Acknowledgements

This research was supported by DFG grant “Evolute”. We thank André Pacak and Tamás Szabó who provided helpful feedback on the introduction.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sven Keidel .

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

Keidel, S., Erdweg, S. (2020). A Systematic Approach to Abstract Interpretation of Program Transformations. In: Beyer, D., Zufferey, D. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2020. Lecture Notes in Computer Science(), vol 11990. Springer, Cham. https://doi.org/10.1007/978-3-030-39322-9_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-39322-9_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-39321-2

  • Online ISBN: 978-3-030-39322-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics