Lune

OOPSLA2020顶会

Precise inference of expressive units of measurement types

Tongtong Xiang, Jeff Y. Luo, Werner Dietl

摘要

Ensuring computations are unit-wise consistent is an important task in software development. Numeric computations are usually performed with primitive types instead of abstract data types, which results in very weak static guarantees about correct usage and conversion of units. This paper presents PUnits, a pluggable type system for expressive units of measurement types and a precise, whole-program inference approach for these types. PUnits can be used in three modes: (1) modularly check the correctness of a program, (2) ensure a possible unit typing exists, and (3) annotate a program with units. Annotation mode allows human inspection and is essential since having a valid typing does not guarantee that the inferred specification expresses design intent. PUnits is the first units type system with this capability. Compared to prior work, PUnits strikes a novel balance between expressiveness, inference complexity, and annotation effort. We implement PUnits for Java and evaluate it by specifying the correct usage of frequently used JDK methods. We analyze 234k lines of code from eight open-source scientific computing projects with PUnits. We compare PUnits against an encapsulation-based units API (the javax.measure package) and discovered unit errors that the API failed to find. PUnits infers 90 scientific units for five of the projects and generates well-specified applications. The experiments show that PUnits is an effective, sound, and scalable alternative to using encapsulation-based units APIs, enabling Java developers to reap the performance benefits of using primitive types instead of abstract data types for unit-wise consistent scientific computations.

问 Lune

几分钟看清这篇 Paper 的位置,不用再花一下午。

Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

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

可以从这些问题问起

Lune 可以查阅

摘要 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Practical Inference of Nullability Types 引用了 Pluggable Type Inference for Free
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper3

  1. Scalability and precision by combining expressive type systems and deductive verificationFlorian Lanzinger, Alexander Weigl, Mattias Ulbrich, Werner DietlOOPSLA 2021 · 6 次引用
  2. Practical Inference of Nullability TypesNima Karimipour, Justin Pham, Lazaro Clapp, Manu SridharanFSE 2023 · 6 次引用
  3. Pluggable Type Inference for FreeMartin Kellogg, Daniel Daskiewicz, Loi Ngo Duc Nguyen, Muyeed Ahmed 等ASE 2023 · 4 次引用

相关 Paper

  1. Verifying the Option Type with Rely-Guarantee ReasoningJames Yoo, Michael D. Ernst, René JustASE 2024
  2. Understanding and Detecting Annotation-Induced Faults of Static AnalyzersHuaien Zhang, Yu Pei, Shuyun Liang, Shin Hwei TanFSE 2024 · 4 次引用
  3. Usability-Oriented Design of Liquid Types for JavaCatarina Gamboa, Paulo Canelas, Christopher Steven Timperley, Alcides FonsecaICSE 2023 · 9 次引用
  4. SA4U: Practical Static Analysis for Unit Type Error DetectionMax Taylor, Johnathon Aurand, Feng Qin, Xiaorui Wang 等ASE 2022 · 5 次引用
  5. MixedSAND: Semantic Annotation of Mixed-unit Numeric DataAmir Behrad Khorram Nazari, Davood Rafiei, Mario A. NascimentoWWW 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖