Pluggable Type Inference for Free
Martin Kellogg, Daniel Daskiewicz, Loi Ngo Duc Nguyen, Muyeed Ahmed, Michael D. Ernst
摘要
A pluggable type system extends a host programming language with type qualifiers. It lets programmers write types like unsigned int, secret string, and nonnull object. Typechecking with pluggable types detects and prevents more errors than the host type system. However, programmers must write type qualifiers; this is the biggest obstacle to use of pluggable types in practice. Type inference can solve this problem. Traditional approaches to type inference are type-system-specific: for each new pluggable type system, the type inference algorithm must be extended to build and then solve a system of constraints corresponding to the rules of the underlying type system. We propose a novel type inference algorithm that can infer type qualifiers for any pluggable type system with little to no new type-system-specific code-that is, “for free”. The key insight is that extant practical pluggable type systems are flow-sensitive and therefore already implement local type inference. Using this insight, we can derive a global inference algorithm by re-using existing implementations of local inference. Our algorithm runs iteratively in rounds. Each round uses the results of local type inference to produce summaries (specifications) for procedures and fields. These summaries enable improved inference throughout the program in subsequent rounds. The algorithm terminates when the inferred summaries reach a fixed point. In practice, many pluggable type systems are built on frameworks. By implementing our algorithm once, at the framework level, it can be reused by any typechecker built using that frame-work. Using that insight, we have implemented our algorithm for the open-source Checker Framework project, which is widely used in industry and on which dozens of specialized pluggable typecheckers have been built. In experiments with 11 distinct pluggable type systems and 12 projects, our algorithm reduced, by 45 % on average, the number of warnings that developers must resolve by writing annotations.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper5
- Practical Inference of Nullability TypesNima Karimipour, Justin Pham, Lazaro Clapp, Manu SridharanFSE 2023 · 被引用 6 次
- Inference of Resource Management SpecificationsNarges Shadab, Pritam M. Gharat, Shrey Tiwari, Michael D. Ernst 等OOPSLA 2023 · 被引用 2 次
- Repairing Leaks in Resource WrappersSanjay Malakar, Michael D. Ernst, Martin Kellogg, Manu SridharanASE 2025
- LLM-Based Repair of Static Nullability ErrorsNima Karimipour, Pascal Joos, Michael Pradel, Martin Kellogg 等ISSTA 2026
- A New Approach to Evaluating Nullability Inference ToolsNima Karimipour, Erfan Arvan, Martin Kellogg, Manu SridharanFSE 2025
它引用的顶会 Paper7
- TypeWriter: neural type prediction with search-based validationMichael Pradel, Georgios Gousios, Jason Liu, Satish ChandraFSE 2020 · 被引用 102 次
- Static Inference Meets Deep learning: A Hybrid Type Inference Approach for PythonYun Peng, Cuiyun Gao, Zongjie Li, Bowei Gao 等ICSE 2022 · 被引用 48 次
- MLstruct: principal type inference in a Boolean algebra of structural typesLionel Parreaux, Chun Yin ChauOOPSLA 2022 · 被引用 31 次
- Continuous ComplianceMartin Kellogg, Martin Schäf, Serdar Tasiran, Michael D. ErnstASE 2020 · 被引用 16 次
- Solver-based gradual type migrationLuna Phipps-Costin, Carolyn Jane Anderson, Michael Greenberg, Arjun GuhaOOPSLA 2021 · 被引用 16 次
相关 Paper
- Relational nullable types with Boolean unificationMagnus Madsen, Jaco van de PolOOPSLA 2021 · 被引用 9 次
- Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 被引用 15 次
- Type Inference LogicsDenis Carnier, François Pottier, Steven KeuchelOOPSLA 2024 · 被引用 3 次
- A systematic approach to deriving incremental type checkersAndré Pacak, Sebastian Erdweg, Tamás SzabóOOPSLA 2020 · 被引用 16 次
- The Simple Essence of Overloading: Making Ad-Hoc Polymorphism More Algebraic with Flow-Based Variational Type-CheckingJirí Benes, Jonathan Immanuel BrachthäuserOOPSLA 2025
