Refinement Type Refutations
Robin Webbers, Klaus von Gleissenthall, Ranjit Jhala
摘要
Refinement types combine SMT decidable constraints with a compositional, syntax-directed type system to provide a convenient way to statically and automatically check properties of programs. However, when type checking fails, programmers must use cryptic error messages that, at best, point out the code location where a subtyping constraint failed to determine the root cause of the failure. In this paper, we introduce refinement type refutations, a new approach to explaining why refinement type checking fails, which mirrors the compositional way in which refinement type checking is carried out. First, we show how to systematically transform standard bidirectional type checking rules to obtain refutations. Second, we extend the approach to account for global constraint-based refinement inference via the notion of a must-instantiation: a set of concrete inhabitants of the types of subterms that suffice to demonstrate why typing fails. Third, we implement our method in HayStack-an extension to LiqidHaskell which automatically finds type-refutations when refinement type checking fails, and helps users understand refutations via an interactive user-interface. Finally, we present an empirical evaluation of HayStack using the regression benchmark-set of LiqidHaskell, and the benchmark set of G2, a previous method that searches for (non-compositional) counterexample traces by symbolically executing Haskell source. We show that HayStack can find refutations for 99.7% of benchmarks, including those with complex typing constructs (e.g., abstract and bounded refinements, and reflection), and does so, an order of magnitude faster than G2.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Concurrent incorrectness separation logic 引用了 Incorrectness logic
- Usability Barriers for Liquid Types 引用了 Flux: Liquid Types for Rust
- A Complementary Approach to Incorrectness Typing 引用了 Concurrent incorrectness separation logic
- A Complementary Approach to Incorrectness Typing 引用了 Incorrectness logic
- A Complementary Approach to Incorrectness Typing 引用了 Finding real bugs in big programs with incorrectness logic
- Finding real bugs in big programs with incorrectness logic 引用了 Concurrent incorrectness separation logic
- Finding real bugs in big programs with incorrectness logic 引用了 Incorrectness logic
引用它的顶会 Paper2
它引用的 Paper8
- Incorrectness logicPeter W. O'HearnPOPL 2020 · 122 次引用
- Finding real bugs in big programs with incorrectness logicQuang Loc Le, Azalea Raad, Jules Villard, Josh Berdine 等OOPSLA 2022 · 52 次引用
- Flux: Liquid Types for RustNico Lehmann, Adam T. Geller, Niki Vazou, Ranjit JhalaPLDI 2023 · 29 次引用
- Concurrent incorrectness separation logicAzalea Raad, Josh Berdine, Derek Dreyer, Peter W. O'HearnPOPL 2022 · 24 次引用
- Type error feedback via analytic program repairGeorgios Sakkas, Madeline Endres, Benjamin Cosman, Westley Weimer 等PLDI 2020 · 24 次引用
相关 Paper
- Quotient Haskell: Lightweight Quotient Types for AllBrandon Hewer, Graham HuttonPOPL 2024 · 3 次引用
- PLEX: Normalization for Refinement TypesAlessio Ferrarini, Niki Vazou, Wouter SwierstraOOPSLA 2026
- Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 15 次引用
- Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 次引用
- Intensional datatype refinement: with application to scalable verification of pattern-match safetyEddie Jones, Steven J. RamsayPOPL 2021 · 3 次引用
