Lune

ASE2023顶会

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Repairing Leaks in Resource Wrappers 引用了 Practical Inference of Nullability Types
  • Repairing Leaks in Resource Wrappers 引用了 Static Inference Meets Deep learning: A Hybrid Type Inference Approach for Python
  • Repairing Leaks in Resource Wrappers 引用了 TypeWriter: neural type prediction with search-based validation
  • Repairing Leaks in Resource Wrappers 引用了 Inference of Resource Management Specifications
  • LLM-Based Repair of Static Nullability Errors 引用了 A New Approach to Evaluating Nullability Inference Tools
  • LLM-Based Repair of Static Nullability Errors 引用了 Practical Inference of Nullability Types
  • LLM-Based Repair of Static Nullability Errors 引用了 TypeWriter: neural type prediction with search-based validation
  • A New Approach to Evaluating Nullability Inference Tools 引用了 Practical Inference of Nullability Types
  • A New Approach to Evaluating Nullability Inference Tools 引用了 Static Inference Meets Deep learning: A Hybrid Type Inference Approach for Python
  • Practical Inference of Nullability Types 引用了 Solver-based gradual type migration
  • Practical Inference of Nullability Types 引用了 TypeWriter: neural type prediction with search-based validation
  • Solver-based gradual type migration 引用了 TypeWriter: neural type prediction with search-based validation
  • Static Inference Meets Deep learning: A Hybrid Type Inference Approach for Python 引用了 TypeWriter: neural type prediction with search-based validation
  • Inference of Resource Management Specifications 引用了 Solver-based gradual type migration
  • Inference of Resource Management Specifications 引用了 Static Inference Meets Deep learning: A Hybrid Type Inference Approach for Python
  • Inference of Resource Management Specifications 引用了 TypeWriter: neural type prediction with search-based validation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. Practical Inference of Nullability TypesNima Karimipour, Justin Pham, Lazaro Clapp, Manu SridharanFSE 2023 · 6 次引用
  2. Inference of Resource Management SpecificationsNarges Shadab, Pritam M. Gharat, Shrey Tiwari, Michael D. Ernst 等OOPSLA 2023 · 2 次引用
  3. Repairing Leaks in Resource WrappersSanjay Malakar, Michael D. Ernst, Martin Kellogg, Manu SridharanASE 2025
  4. LLM-Based Repair of Static Nullability ErrorsNima Karimipour, Pascal Joos, Michael Pradel, Martin Kellogg 等ISSTA 2026
  5. A New Approach to Evaluating Nullability Inference ToolsNima Karimipour, Erfan Arvan, Martin Kellogg, Manu SridharanFSE 2025

它引用的 Paper7

  1. TypeWriter: neural type prediction with search-based validationMichael Pradel, Georgios Gousios, Jason Liu, Satish ChandraFSE 2020 · 102 次引用
  2. Static Inference Meets Deep learning: A Hybrid Type Inference Approach for PythonYun Peng, Cuiyun Gao, Zongjie Li, Bowei Gao 等ICSE 2022 · 48 次引用
  3. MLstruct: principal type inference in a Boolean algebra of structural typesLionel Parreaux, Chun Yin ChauOOPSLA 2022 · 31 次引用
  4. Continuous ComplianceMartin Kellogg, Martin Schäf, Serdar Tasiran, Michael D. ErnstASE 2020 · 16 次引用
  5. Solver-based gradual type migrationLuna Phipps-Costin, Carolyn Jane Anderson, Michael Greenberg, Arjun GuhaOOPSLA 2021 · 16 次引用

相关 Paper

  1. Relational nullable types with Boolean unificationMagnus Madsen, Jaco van de PolOOPSLA 2021 · 9 次引用
  2. Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 15 次引用
  3. Type Inference LogicsDenis Carnier, François Pottier, Steven KeuchelOOPSLA 2024 · 3 次引用
  4. A systematic approach to deriving incremental type checkersAndré Pacak, Sebastian Erdweg, Tamás SzabóOOPSLA 2020 · 16 次引用
  5. The Simple Essence of Overloading: Making Ad-Hoc Polymorphism More Algebraic with Flow-Based Variational Type-CheckingJirí Benes, Jonathan Immanuel BrachthäuserOOPSLA 2025
黄昏的海面,两侧是细线勾勒的悬崖