{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/tracking-captured-variables-in-types","title":"Tracking Captured Variables in Types","arxiv_id":"2105.11896","date":"2021-05-25","proceeding":null,"authors":["Aleksander Boruch-Gruszecki","Jonathan Immanuel Brachthäuser","Edward Lee","Ondřej Lhoták","Martin Odersky"],"abstract":"Type systems usually characterize the shape of values but not their free variables. However, there are many desirable safety properties one could guarantee if one could track how references can escape. For example, one may implement algebraic effect handlers using capabilities -- a value which permits one to perform the effect -- safely if one can guarantee that the capability itself does not escape the scope bound by the effect handler. To this end, we study the $\\textrm{CF}_{<:}$ calculus, a conservative and lightweight extension of $\\textrm{System F}_{<:}$, to track how values and their references can be captured and escape. We show that existing terms in $\\textrm{System F}_{<:}$ embed naturally in our calculus, and that many natural problems can be expressed in a system that tracks variable references like we do in $\\textrm{CF}_{<:}$. We also give mechanized proofs of the soundness properties of $\\textrm{CF}_{<:}$ in Coq. The type system presented in $\\textrm{CF}_{<:}$ is powerful enough to reason about safety in the context of many natural extensions of $\\textrm{CF}_{<:}$ such as region-based memory-management, non-local returns, and effect handlers.","url_abs":"https://arxiv.org/abs/2105.11896v1","url_pdf":"https://arxiv.org/pdf/2105.11896v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"tracking-captured-variables-in-types","repo_url":"https://github.com/tiarkrompf/reachability","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}