Static Type Analysis by Abstract Interpretation of Python Programs
Mon 16 Nov 2020 02:00 - 02:20 at SPLASH-I - S-4 Chair(s): Elisa Gonzalez Boix, Atsushi Igarashi
Python is an increasingly popular dynamic programming language, particularly used in the scientific community and well-known for its powerful and permissive high-level syntax. Our work aims at detecting statically and automatically type errors. As these type errors are exceptions that can be caught later on, we precisely track all exceptions (raised or caught). We designed a static analysis by abstract interpretation able to infer the possible types of variables, taking into account the full control-flow. It handles both typing paradigms used in Python, nominal and structural, supports Python’s object model, introspection operators allowing dynamic type testing, dynamic attribute addition, as well as exception handling. We present a flow- and context-sensitive analysis with special domains to support containers (such as lists) and infer type equalities (allowing it to express parametric polymorphism). The analysis is soundly derived by abstract interpretation from a concrete semantics of Python developed by Fromherz et al. Our analysis is designed in a modular way as a set of domains abstracting a concrete collecting semantics. It has been implemented into the MOPSA analysis framework, and leverages external type annotations from the Typeshed project to support the vast standard library. We show that it scales to benchmarks a few thousand lines long, and preliminary results show it is able to analyze a small real-life command-line utility called PathPicker. Compared to previous work, it is sound, while it keeps similar efficiency and precision.
Slides (talk.pdf) | 692KiB |
Sun 15 NovDisplayed time zone: Central Time (US & Canada) change
13:00 - 14:20 | S-4Research Papers at SPLASH-I +12h Chair(s): Karim Ali University of Alberta, Eli Tilevich Virginia Tech | ||
13:00 20mTalk | K-LLVM: A Relatively Complete Semantics of LLVM IR Research Papers Link to publication DOI Media Attached | ||
13:20 20mTalk | A Type-Directed Operational Semantics for a Calculus with a Merge Operator Research Papers Link to publication DOI Media Attached | ||
13:40 20mTalk | A big step from finite to infinite computationsSCICO Journal-First Research Papers Davide Ancona DIBRIS, University of Genova, Italy, Francesco Dagnino DIBRIS, University of Genova, Italy, Jurriaan Rot Radboud University Nijmegen, Elena Zucca University of Genova Link to publication DOI Media Attached | ||
14:00 20mTalk | Static Type Analysis by Abstract Interpretation of Python Programs Research Papers Raphaël Monat Sorbonne Université — LIP6, Abdelraouf Ouadjaout Sorbonne Université, Antoine Miné Sorbonne Université Link to publication DOI Media Attached File Attached |
Mon 16 NovDisplayed time zone: Central Time (US & Canada) change
01:00 - 02:20 | S-4Research Papers at SPLASH-I Chair(s): Elisa Gonzalez Boix Vrije Universiteit Brussel, Belgium, Atsushi Igarashi Kyoto University, Japan | ||
01:00 20mTalk | K-LLVM: A Relatively Complete Semantics of LLVM IR Research Papers Link to publication DOI Media Attached | ||
01:20 20mTalk | A Type-Directed Operational Semantics for a Calculus with a Merge Operator Research Papers Link to publication DOI Media Attached | ||
01:40 20mTalk | A big step from finite to infinite computationsSCICO Journal-First Research Papers Davide Ancona DIBRIS, University of Genova, Italy, Francesco Dagnino DIBRIS, University of Genova, Italy, Jurriaan Rot Radboud University Nijmegen, Elena Zucca University of Genova Link to publication DOI Media Attached | ||
02:00 20mTalk | Static Type Analysis by Abstract Interpretation of Python Programs Research Papers Raphaël Monat Sorbonne Université — LIP6, Abdelraouf Ouadjaout Sorbonne Université, Antoine Miné Sorbonne Université Link to publication DOI Media Attached File Attached |