Context Types: Bunched Modalities for Unifying Safety and Reachability
Zhe Zhou, Benjamin Delaware, Suresh Jagannathan
Key points
From the paper's conclusion- We then interpret our type system in this logic, establishing soundness with respect to a denotational semantics that unifies safety and reachability guarantees within a single typing judgement.
Abstract
Most type systems are designed to verify safety properties: the judgement $e : \tau$ holds if $e$ may evaluate to any value contained in the denotation of $\tau$, but nothing more. More recent type systems have considered the complementary class of reachability properties: in these systems, the typing judgment holds if $e$ must be able to evaluate to every value denoted by $\tau$, and possibly more. This paper introduces a refinement type system for higher-order functional programs where types can capture both safety and reachability properties. Simultaneously supporting both is challenging because each imposes different constraints on how variable bindings in a typing context are interpreted. We address this challenge by treating typing contexts as a kind of resource that mediates which capabilities are available when typing a program. We formalize this notion by developing a resource algebra of contextual capabilities and a bunched modal context logic over this algebra. We then interpret our type system in this logic, establishing soundness with respect to a denotational semantics that unifies safety and reachability guarantees within a single typing judgement.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Escape with Your Self: Sound and Expressive Bidirectional Typing with Avoidance for Reachability TypesProceedings of the ACM on Programming Languages · 2026
- A Calculus for BorrowabilityarXiv · 2026
- Type, Ability, and Effect Systems: Perspectives on Purity, Semantics, and ExpressivenessProceedings of the ACM on Programming Languages · 2026
- Compositional Symbolic Execution \`a la Carte (Extended Version)arXiv · 2026
- Fibered Separation Logic: Weakest Preconditions, Universal Constructions, and Local IndependencearXiv · 2026
- Don't exhaust, don't waste: Resource-aware soundness for big-step semanticsJournal of Functional Programming · 2026