Lune

POPL2025Top-tier venue

Generic Refinement Types

Nico Lehmann, Cole Kurashige, Nikhil Akiti, Niroop Krishnakumar, Ranjit Jhala

Abstract

We present Generic Refinement Types : a way to write modular higher-order specifications that abstract invariants over function contracts, while preserving automatic SMT-decidable verification. We show how generic refinements let us write a variety of modular higher-order specifications, including specifications for Rust’s traits which abstract over the concrete refinements that hold for different trait implementations. We formalize generic refinements in a core calculus and show how to synthesize the generic instantiations algorithmically at usage sites via a combination of syntactic unification and constraint solving. We give semantics to generic refinements via the intuition that they correspond to ghost parameters , and we formalize this intuition via a type-preserving translation into the polymorphic contract calculus to establish the soundness of generic refinements. Finally, we evaluate generic refinements by implementing them in F luk and using it for two case studies. First, we show how generic refinements let us write modular specifications for Rust’s vector indexing API that lets us statically verify the bounds safety of a variety of vector-manipulating benchmarks from the literature. Second, we use generic refinements to refine Rust’s diesel ORM library to track the semantics of the database queries issued by client applications, and hence, statically enforce data-dependent access-control policies in several database-backed web applications.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Usability Barriers for Liquid Types cites STORM: Refinement Types for Secure Web Applications
  • Usability Barriers for Liquid Types cites Flux: Liquid Types for Rust
  • First-Class Refinement Types for Scala cites Flux: Liquid Types for Rust
  • First-Class Refinement Types for Scala cites Usability Barriers for Liquid Types
  • First-Class Refinement Types for Scala cites Verus: Verifying Rust Programs using Linear Ghost Types
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Usability Barriers for Liquid TypesCatarina Gamboa, Abigail Reese, Alcides Fonseca, Jonathan AldrichPLDI 2025 · 4 citations
  2. First-Class Refinement Types for ScalaMatt Bovel, Viktor Kunčak, Martin OderskyOOPSLA 2026

Builds on3

  1. Verus: Verifying Rust Programs using Linear Ghost TypesAndrea Lattuada, Travis Hance, Chanhee Cho, Matthias Brun et al.OOPSLA 2023 · 86 citations
  2. Flux: Liquid Types for RustNico Lehmann, Adam T. Geller, Niki Vazou, Ranjit JhalaPLDI 2023 · 29 citations
  3. STORM: Refinement Types for Secure Web ApplicationsNico Lehmann, Rose Kunkel, Jordan Brown, Jean Yang et al.OSDI 2021 · 21 citations

Related papers

  1. A Refinement Methodology for Distributed Programs in RustAurel Bílý, João C. Pereira, Peter MüllerOOPSLA 2025
  2. RefinedRust: A Type System for High-Assurance Verification of Rust ProgramsLennard Gäher, Michael Sammler, Ralf Jung, Robbert Krebbers et al.PLDI 2024 · 29 citations
  3. Modular specification and verification of closures in RustFabian Wolff, Aurel Bílý, Christoph Matheja, Peter Müller et al.OOPSLA 2021 · 23 citations
  4. Nola: Later-Free Ghost State for Verifying Termination in IrisYusuke Matsushita, Takeshi TsukadaPLDI 2025 · 2 citations
  5. Crabtree: Rust API Test Synthesis Guided by Coverage and TypeYoshiki Takashima, Chanhee Cho, Ruben Martins, Limin Jia et al.OOPSLA 2024 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines