Free to Move: Reachability Types with Flow-Sensitive Effects for Safe Deallocation and Ownership Transfer

📅 2025-10-09
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the challenge of safe memory management in advanced impure functional languages, without relying on linear types or region systems. Our method introduces a flow-sensitive, effect-driven reachability type system, where polymorphic *use*/*kill* effects precisely model reference lifetimes, ownership transfer, and destructive updates—enabling explicit deallocation, move semantics, and contextual freshness. The system realizes Rust-style ownership control in higher-order impure functional languages while preserving expressiveness and practicality. We formalize a core calculus with a compositional operational semantics and rigorously prove type safety, progress, and effect safety. Notably, we establish use-after-free immunity for the first time without linearity constraints. Moreover, our approach uniformly supports diverse low-level resource idioms—including manual memory management, arena allocation, and borrow-checking patterns—within a single, unified type-theoretic framework.

Technology Category

Application Category

📝 Abstract
We present a flow-sensitive effect system for reachability types that supports explicit memory management, including Rust-style move semantics, in higher-order impure functional languages. Our system refines the existing reachability qualifier with polymorphic emph{use} and emph{kill} effects that record how references are read, written, transferred, and deallocated. The effect discipline tracks operations performed on each resource using qualifiers, enabling the type system to express ownership transfer, contextual freshness, and destructive updates without regions or linearity. We formalize the calculus, its typing and effect rules, and a compositional operational semantics that validates use-after-free safety. All metatheoretic results, including preservation, progress, and effect soundness, are mechanized. The system models idioms such as reference deallocation, move semantics, reference swapping, while exposing precise safety guarantee. Together, these contributions integrate reachability-based reasoning with explicit resource control, advancing the state of the art in safe manual memory management for higher-order functional languages.
Problem

Research questions and friction points this paper is trying to address.

Develops flow-sensitive effect system for explicit memory management
Enables safe manual memory deallocation and ownership transfer
Provides safety guarantees for higher-order functional languages
Innovation

Methods, ideas, or system contributions that make the work stand out.

Flow-sensitive effect system for reachability types
Polymorphic use and kill effects track operations
Ownership transfer without regions or linearity