Abstract
Abstract interpretation is a technique for developing static analyses. Yet, proving abstract interpreters sound is challenging for interesting analyses, because of the high proof complexity and proof effort. To reduce complexity and effort, we propose a framework for abstract interpreters that makes their soundness proof compositional. Key to our approach is to capture the similarities between concrete and abstract interpreters in a single shared interpreter, parameterized over an arrow-based interface. In our framework, a soundness proof is reduced to proving reusable soundness lemmas over the concrete and abstract instances of this interface; the soundness of the overall interpreters follows from a generic theorem.
To further reduce proof effort, we explore the relationship between soundness and parametricity. Parametricity not only provides us with useful guidelines for how to design non-leaky interfaces for shared interpreters, but also provides us soundness of shared pure functions as free theorems. We implemented our framework in Haskell and developed a k-CFA analysis for PCF and a tree-shape analysis for Stratego. We were able to prove both analyses sound compositionally with manageable complexity and effort, compared to a conventional soundness proof.
Supplemental Material
- Robert Atkey. 2012. Relational Parametricity for Higher Kinds. In Computer Science Logic (CSL’12) - 26th International Workshop/21st Annual Conference of the EACSL, CSL 2012, September 3-6, 2012, Fontainebleau, France. 46–61.Google Scholar
- Pavel Avgustinov, Elnar Hajiyev, Neil Ongkingco, Oege de Moor, Damien Sereni, Julian Tibble, and Mathieu Verbaere. 2007. Semantics of static pointcuts in aspectJ. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2007, Nice, France, January 17-19, 2007. 11–23. Google Scholar
Digital Library
- Anya Helene Bagge and Karl Trygve Kalleberg. 2006. DSAL= library+ notation: Program transformation for domain-specific aspect languages. In Proceedings of the Domain-Specific Aspect Languages Workshop.Google Scholar
- Martin Bravenboer, Arthur van Dam, Karina Olmos, and Eelco Visser. 2006. Program Transformation with Scoped Dynamic Rewrite Rules. Fundam. Inform. 69, 1-2 (2006), 123–178. Google Scholar
Digital Library
- Thierry Coquand and Christine Paulin-Mohring. 1990. Inductively defined types. In COLOG-88, Per Martin-Löf and Grigori Mints (Eds.). LNCS, Vol. 417. Springer, 50–66. Google Scholar
Digital Library
- P. Cousot. 1999. The Calculational Design of a Generic Abstract Interpreter. In Calculational System Design, M. Broy and R. Steinbrüggen (Eds.). NATO ASI Series F. IOS Press, Amsterdam.Google Scholar
- Patrick Cousot and Radhia Cousot. 1979. Systematic design of program analysis frameworks. In Proceedings of Symposium on Principles of Programming Languages (POPL). ACM, 269–282. Google Scholar
Digital Library
- Patrick Cousot and Radhia Cousot. 1992. Abstract Interpretation Frameworks. J. Log. Comput. 2, 4 (1992), 511–547.Google Scholar
Cross Ref
- Patrick Cousot, Radhia Cousot, Jérôme Feret, Laurent Mauborgne, Antoine Miné, David Monniaux, and Xavier Rival. 2006. Combination of Abstractions in the ASTRÉE Static Analyzer. In Advances in Computer Science - ASIAN 2006. Secure Software and Related Issues, 11th Asian Computing Science Conference, Tokyo, Japan, December 6-8, 2006, Revised Selected Papers. 272–300. Google Scholar
Digital Library
- David Darais, Nicholas Labich, Phuc C. Nguyen, and David Van Horn. 2017. Abstracting definitional interpreters (functional pearl). PACMPL 1, ICFP (2017), 12:1–12:25. Google Scholar
Digital Library
- David Darais, Matthew Might, and David Van Horn. 2015. Galois transformers and modular abstract interpreters: reusable metatheory for program analysis. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015. 552–571. Google Scholar
Digital Library
- David Charles Darais. 2017. Mechanizing Abstract Interpretation. Ph.D. Dissertation. University of Maryland, College Park, MD, USA.Google Scholar
- Maartje de Jonge and Eelco Visser. 2012. A Language Generic Solution for Name Binding Preservation in Refactorings. In Proceedings of the Twelfth Workshop on Language Descriptions, Tools, and Applications (LDTA ’12). ACM, New York, NY, USA, Article 2, 8 pages. Google Scholar
Digital Library
- Eelco Dolstra and Eelco Visser. 2002. Building Interpreters with Rewriting Strategies. Electronic Notes in Theoretical Computer Science 65, 3 (2002), 57–76.Google Scholar
Cross Ref
- Giorgios Rob Economopoulos and Bernd Fischer. 2011. Higher-order transformations with nested concrete syntax. In Language Descriptions, Tools and Applications, LDTA 2011, Saarbrücken, Germany, March 26-27, 2011. Proceeding, Claus Brabrand and Eric Van Wyk (Eds.). ACM, 4. Google Scholar
Digital Library
- Sebastian Erdweg, Tillmann Rendel, Christian Kästner, and Klaus Ostermann. 2011. SugarJ: Library-based Syntactic Language Extensibility. In Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA ’11). ACM, New York, NY, USA, 391–406. Google Scholar
Digital Library
- Neil Ghani, Patricia Johann, Fredrik Nordvall Forsberg, Federico Orsanigo, and Tim Revell. 2015. Bifibrational Functorial Semantics of Parametric Polymorphism. Electr. Notes Theor. Comput. Sci. 319 (2015), 165–181. Google Scholar
Digital Library
- Cordelia V Hall, Kevin Hammond, Simon L Peyton Jones, and Philip L Wadler. 1996. Type classes in Haskell. ACM Transactions on Programming Languages and Systems (TOPLAS) 18, 2 (1996), 109–138. Google Scholar
Digital Library
- Makoto Hamana and Marcelo P. Fiore. 2011. A foundation for GADTs and inductive families: dependent polynomial functor approach. In Proceedings of the seventh ACM SIGPLAN workshop on Generic programming, [email protected] 2011, Tokyo, Japan, September 19-21, 2011. 59–70. Google Scholar
Digital Library
- David Van Horn and Matthew Might. 2010. Abstracting abstract machines. In Proceeding of the 15th ACM SIGPLAN international conference on Functional programming, ICFP 2010, Baltimore, Maryland, USA, September 27-29, 2010. 51–62. Google Scholar
Digital Library
- John Hughes. 2000. Generalising monads to arrows. Sci. Comput. Program. 37, 1-3 (2000), 67–111. Google Scholar
Digital Library
- N Jones and Flemming Nielson. 1994. Abstract interpretation: a semantics-based tool for program analysis. Handbook of logic in computer science 4 (1994), 527–636.Google Scholar
- Sven Keidel and Sebastian Erdweg. 2017. Toward Abstract Interpretation of Program Transformations. In Proc. Meta. ACM, 1–5. Google Scholar
Digital Library
- Sheng Liang, Paul Hudak, and Mark P. Jones. 1995. Monad Transformers and Modular Interpreters. In Conference Record of POPL’95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, California, USA, January 23-25, 1995. 333–343. Google Scholar
Digital Library
- Saunders Mac Lane. 1978. Categories for the Working Mathematician. Springer New York.Google Scholar
- Jan Midtgaard. 2012. Control-flow analysis of functional programs. ACM Comput. Surv. 44, 3 (2012), 10:1–10:33. Google Scholar
Digital Library
- Eugenio Moggi. 1991. Notions of Computation and Monads. Inf. Comput. 93, 1 (1991), 55–92. Google Scholar
Digital Library
- Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. 1999. Principles of program analysis. Springer. Google Scholar
Digital Library
- Ross Paterson. 2001. A New Notation for Arrows. In Proceedings of International Conference on Functional Programming (ICFP). ACM, 229–240. Google Scholar
Digital Library
- Gordon D. Plotkin. 1977. LCF Considered as a Programming Language. Theor. Comput. Sci. 5, 3 (1977), 223–255.Google Scholar
Cross Ref
- Gordon D Plotkin. 1980. Lambda-definability in the full type hierarchy. To HB Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism (1980), 363–373.Google Scholar
- John C. Reynolds. 1983. Types, Abstraction and Parametric Polymorphism. In IFIP Congress. 513–523.Google Scholar
- John C. Reynolds. 1998. Definitional Interpreters for Higher-Order Programming Languages. Higher-Order and Symbolic Computation 11, 4 (1998), 363–397. Google Scholar
Digital Library
- Ilya Sergey, Dominique Devriese, Matthew Might, Jan Midtgaard, David Darais, Dave Clarke, and Frank Piessens. 2013. Monadic Abstract Interpreters. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’13). ACM, New York, NY, USA, 12. Google Scholar
Digital Library
- Olin Shivers. 1991. Control-flow analysis of higher-order languages. Ph.D. Dissertation. Carnegie Mellon University. Google Scholar
Digital Library
- Elmer van Chastelet, Eelco Visser, and Craig Anslow. 2015. Conf.Researchr.Org: towards a domain-specific content management system for managing large conference websites. In Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity, SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015. 50–51. Google Scholar
Digital Library
- Eelco Visser. 2007. WebDSL: A Case Study in Domain-Specific Language Engineering. In Generative and Transformational Techniques in Software Engineering II, International Summer School, GTTSE 2007 (Lecture Notes in Computer Science), Ralf Lämmel, Joost Visser, and Jo ao Saraiva (Eds.), Vol. 5235. Springer, Braga, Portugal, 291–373. Google Scholar
Digital Library
- Eelco Visser, Zine-El-Abidine Benaissa, and Andrew P. Tolmach. 1998. Building Program Optimizers with Rewriting Strategies. In Proceedings of the third ACM SIGPLAN International Conference on Functional Programming (ICFP ’98), Baltimore, Maryland, USA, September 27-29, 1998. 13–26. Google Scholar
Digital Library
- Philip Wadler. 1989. Theorems for Free!. In Proceedings of the fourth international conference on Functional programming languages and computer architecture, FPCA 1989, London, UK, September 11-13, 1989. ACM, 347–359. Google Scholar
Digital Library
- Philip Wadler. 1995. Monads for Functional Programming. In Advanced Functional Programming, First International Spring School on Advanced Functional Programming Techniques, Båstad, Sweden, May 24-30, 1995, Tutorial Text. 24–52. Google Scholar
Digital Library
Index Terms
Compositional soundness proofs of abstract interpreters
Recommendations
Soundness and Completeness Proofs by Coinductive Methods
We show how codatatypes can be employed to produce compact, high-level proofs of key results in logic: the soundness and completeness of proof systems for variations of first-order logic. For the classical completeness result, we first establish an ...
Automating Soundness Proofs
When developing a new language with semantics described by Structural Operational Semantics (SOS), one often wants an axiomatisation of this language (w.r.t. to some equivalence) as well. We describe a method for automating the straightforward soundness ...
Type soundness proofs with definitional interpreters
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesWhile type soundness proofs are taught in every graduate PL class, the gap between realistic languages and what is accessible to formal proofs is large. In the case of Scala, it has been shown that its formal model, the Dependent Object Types (DOT) ...






Comments