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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Deng, Haotian, He, Siyuan, Jia, Songlin, Bao, Yuyan, Rompf, Tiark
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918157944356864
author Deng, Haotian
He, Siyuan
Jia, Songlin
Bao, Yuyan
Rompf, Tiark
author_facet Deng, Haotian
He, Siyuan
Jia, Songlin
Bao, Yuyan
Rompf, Tiark
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2510_08939
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Free to Move: Reachability Types with Flow-Sensitive Effects for Safe Deallocation and Ownership Transfer
Deng, Haotian
He, Siyuan
Jia, Songlin
Bao, Yuyan
Rompf, Tiark
Programming Languages
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.
title Free to Move: Reachability Types with Flow-Sensitive Effects for Safe Deallocation and Ownership Transfer
topic Programming Languages
url https://arxiv.org/abs/2510.08939