Lune

PLDI2026Top-tier venue

Escape with Your Self: Sound and Expressive Bidirectional Typing with Avoidance for Reachability Types

Songlin Jia, Guannan Wei, Siyuan He, Yuyan Bao, Tiark Rompf

Abstract

Reasoning about programs in the presence of mutation and aliasing is notoriously difficult. Rust has popu-larized lifetime-based ownership tracking in systems programming, but its “shared XOR mutable” model is fundamentally at odds with higher-level functional programming. Reachability types offer an alternative: they enable safe sharing and escape of mutable data by tracking which resources each expression’s result can reach. To track internal reachability within complex object graphs, reachability types adopt self-references that let components refer to enclosing resources from inside, just like this pointers in OO languages. While natural for declaratively typing escaping data, self-references complicate subtyping and furthermore type inference: variance restricts where self-references may appear, yet useful type conversions must allow them to vary in controlled ways, which in turn imposes constraints on inference. As an undesirable result, prior works require programmers to insert term-level coercions for even just avoidance —avoiding ill-scoped names in types. With all prior works being declarative, we investigate algorithmic reachability types in this work. We introduce a refined subtyping relation that permits more flexible usages of self-references. We further develop a sound and decidable bidirectional typing algorithm, implemented and verified in Lean. The algorithm automatically avoids ill-scoped names in types, and infers qualifiers via a lightweight unification mechanism. As a step towards practical reachability programming, we show that the system is capable of tracking diverse reachability patterns without explicit coercions in complex Church-encoded datatypes.

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.

5 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

  • Greedy Implicit Bounded Quantification cites MLstruct: principal type inference in a Boolean algebra of structural types
  • Greedy Implicit Bounded Quantification cites Recursive Subtyping for All
  • Typestate via Revocable Capabilities cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • Typestate via Revocable Capabilities cites Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory
  • Typestate via Revocable Capabilities cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Typestate via Revocable Capabilities cites When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking
  • When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking cites Typestate via Revocable Capabilities
  • Type, Ability, and Effect Systems: Perspectives on Purity, Semantics, and Expressiveness cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • Type, Ability, and Effect Systems: Perspectives on Purity, Semantics, and Expressiveness cites Complete the Cycle: Reachability Types with Expressive Cyclic References
  • Type, Ability, and Effect Systems: Perspectives on Purity, Semantics, and Expressiveness cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Complete the Cycle: Reachability Types with Expressive Cyclic References cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • Complete the Cycle: Reachability Types with Expressive Cyclic References cites Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory
  • Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory cites Complete the Cycle: Reachability Types with Expressive Cyclic References
  • Complete the Cycle: Reachability Types with Expressive Cyclic References cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking cites Complete the Cycle: Reachability Types with Expressive Cyclic References
  • When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking cites Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory
  • When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Complete the Cycle: Reachability Types with Expressive Cyclic ReferencesHaotian Deng, Siyuan He, Songlin Jia, Yuyan Bao et al.OOPSLA 2025 · 3 citations
  2. Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational TheoryYuyan Bao, Songlin Jia, Guannan Wei, Oliver Bracevac et al.OOPSLA 2025 · 3 citations
  3. Typestate via Revocable CapabilitiesSonglin Jia, Craig Liu, Siyuan He, Haotian Deng et al.PLDI 2026
  4. Type, Ability, and Effect Systems: Perspectives on Purity, Semantics, and ExpressivenessYuyan Bao, Tiark RompfOOPSLA 2026
  5. When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability TrackingSiyuan He, Songlin Jia, Yuyan Bao, Tiark RompfOOPSLA 2026

Builds on11

  1. MLstruct: principal type inference in a Boolean algebra of structural typesLionel Parreaux, Chun Yin ChauOOPSLA 2022 · 31 citations
  2. Reachability types: tracking aliasing and separation in higher-order functional programsYuyan Bao, Guannan Wei, Oliver Bracevac, Yuxuan Jiang et al.OOPSLA 2021 · 19 citations
  3. Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic ProgramsGuannan Wei, Oliver Bracevac, Songlin Jia, Yuyan Bao et al.POPL 2024 · 12 citations
  4. Greedy Implicit Bounded QuantificationChen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraOOPSLA 2023 · 9 citations
  5. Recursive Subtyping for AllLitao Zhou, Yaoda Zhou, Bruno C. d. S. OliveiraPOPL 2023 · 8 citations

Related papers

  1. Flux: Liquid Types for RustNico Lehmann, Adam T. Geller, Niki Vazou, Ranjit JhalaPLDI 2023 · 29 citations
  2. Thrust: A Prophecy-Based Refinement Type System for RustHiromi Ogawa, Taro Sekiyama, Hiroshi UnnoPLDI 2025
  3. Reachability Types, Traces and Full AbstractionBenedict Bunting, Andrzej S. MurawskiLICS 2025 · 2 citations
  4. From Linearity to BorrowingAndrew Wagner, Olek Gierczak, Brianna Marshall, John M. Li et al.OOPSLA 2025 · 1 citation
  5. Solving constrained Horn clauses modulo algebraic data types and recursive functionsHari Govind V. K., Sharon Shoham, Arie GurfinkelPOPL 2022 · 26 citations
Dusk over the sea between two cliffs drawn in fine vertical lines