Tracking Borrows with Regular Expressions
This program is tentative and subject to change.
Safe systems languages such as Rust enforce an ownership discipline through types: every value has a unique owner, and the type system tracks borrows—references that provide temporary access to values without transferring their ownership. Borrow checking is a static analysis ensuring that no borrow outlives its owner and that no two mutable borrows are aliases, preventing dangling references and data races at compile time. Move, a smart contract language deployed on Sui and Aptos blockchains, adopts this model but restricts references to structured access paths rooted in local variables, eliminating the need for complex lifetime tracking mechanisms such as lifetime annotations. We present a novel type system for Move's borrow checker in which access paths are tracked by regular expressions. In this model, Brzozowski derivatives make it possible to express the reachability consequences of borrowing operations, Kleene star summarises borrow chains from function calls and loops, and the aliasing check reduces to the decidable regex emptiness. The design of the type system with regular expression-based borrow tracking extends naturally to vectors and enumeration types. The proposed design of a borrow checker has been implemented in the Move bytecode verifier for Sui blockchain, where it superseded the original borrow analyser while maintaining full backwards compatibility. We mechanised the type system in Lean with a machine-checked soundness proof and an executable algorithmic type checker tested against the production Move compiler. Notably, this 39,000-line metatheory was developed with an AI proof assistant in roughly one month, and we report on our experience of conducting this proof effort, which is among the largest AI-assisted PL metatheory mechanisations to date.
This program is tentative and subject to change.
Wed 7 OctDisplayed time zone: Pacific Time (US & Canada) change
10:30 - 12:00 | Ownership, Lifetimes and RegionsOOPSLA at Junior Ballroom 1&2 Chair(s): Jenna DiVincenzo (Wise) Purdue University | ||
10:30 18mTalk | Tracking Borrows with Regular Expressions OOPSLA Todd Nowacki Mysten Labs, Sam Blackshear Mysten Labs, John Mitchell Stanford University, Shaz Qadeer Microsoft, Ilya Sergey National University of Singapore DOI | ||
10:48 18mTalk | When Lifetimes Liberate: A Type System for Arenas with Higher-Order Reachability Tracking OOPSLA Siyuan He Purdue University, Songlin Jia Purdue University, Yuyan Bao Augusta University, Tiark Rompf Purdue University DOI | ||
11:06 18mTalk | Fully-Automatic Type Inference for Borrows with Lifetimes OOPSLA William Brandon Massachusetts Institute of Technology, Benjamin Driscoll Stanford University, Frank Dai Unaffiliated, Jonathan Ragan-Kelley Massachusetts Institute of Technology, Mae Milano Princeton University, Alex Aiken Stanford University DOI | ||
11:24 18mTalk | Scylla: Translating an Applicative Subset of C to Safe RustDistinguished Paper OOPSLA DOI | ||