Type Universes as Allocation Effects

Paulette Koronkevich, William J. Bowman
{"title":"Type Universes as Allocation Effects","authors":"Paulette Koronkevich, William J. Bowman","doi":"arxiv-2407.06473","DOIUrl":null,"url":null,"abstract":"In this paper, we explore a connection between type universes and memory\nallocation. Type universe hierarchies are used in dependent type theories to\nensure consistency, by forbidding a type from quantifying over all types.\nInstead, the types of types (universes) form a hierarchy, and a type can only\nquantify over types in other universes (with some exceptions), restricting\ncyclic reasoning in proofs. We present a perspective where universes also\ndescribe \\emph{where} values are allocated in the heap, and the choice of\nuniverse algebra imposes a structure on the heap overall. The resulting type\nsystem provides a simple declarative system for reasoning about and restricting\nmemory allocation, without reasoning about reads or writes. We present a\ntheoretical framework for equipping a type system with higher-order references\nrestricted by a universe hierarchy, and conjecture that many existing universe\nalgebras give rise to interesting systems for reasoning about allocation. We\npresent 3 instantiations of this approach to enable reasoning about allocation\nin the simply typed $\\lambda$-calculus: (1) the standard ramified universe\nhierarchy, which we prove guarantees termination of the language extended with\nhigher-order references by restricting cycles in the heap; (2) an extension\nwith an \\emph{impredicative} base universe, which we conjecture enables\nfull-ground references (with terminating computation but cyclic ground data\nstructures); (3) an extension with \\emph{universe polymorphism}, which divides\nthe heap into fine-grained regions.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-07-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2407.06473","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

In this paper, we explore a connection between type universes and memory allocation. Type universe hierarchies are used in dependent type theories to ensure consistency, by forbidding a type from quantifying over all types. Instead, the types of types (universes) form a hierarchy, and a type can only quantify over types in other universes (with some exceptions), restricting cyclic reasoning in proofs. We present a perspective where universes also describe \emph{where} values are allocated in the heap, and the choice of universe algebra imposes a structure on the heap overall. The resulting type system provides a simple declarative system for reasoning about and restricting memory allocation, without reasoning about reads or writes. We present a theoretical framework for equipping a type system with higher-order references restricted by a universe hierarchy, and conjecture that many existing universe algebras give rise to interesting systems for reasoning about allocation. We present 3 instantiations of this approach to enable reasoning about allocation in the simply typed $\lambda$-calculus: (1) the standard ramified universe hierarchy, which we prove guarantees termination of the language extended with higher-order references by restricting cycles in the heap; (2) an extension with an \emph{impredicative} base universe, which we conjecture enables full-ground references (with terminating computation but cyclic ground data structures); (3) an extension with \emph{universe polymorphism}, which divides the heap into fine-grained regions.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
作为分配效应的类型宇宙
在本文中,我们探讨了类型宇宙与内存分配之间的联系。相反,类型的类型(宇宙)形成了一个层次结构,一个类型只能对其他宇宙中的类型进行量化(有一些例外),从而限制了证明中的循环推理。我们提出了一种视角,即宇宙也描述了在堆中分配值的处(emph{where}),宇宙代数的选择在整体上对堆施加了一种结构。由此产生的类型系统为推理和限制内存分配提供了一个简单的声明式系统,而无需推理读取或写入。我们提出了一个理论框架,用于为类型系统配备受宇宙层次结构限制的高阶引用,并猜想许多现有的宇宙代数会产生有趣的分配推理系统。我们将介绍这种方法的三个实例,以便在简单类型的$\lambda$算式中对分配进行推理:(1)标准的ramified universehierarchy,通过限制堆中的循环,我们证明它可以保证扩展了高阶引用的语言的终止;(2)具有\emph{impredicative}基础宇宙的扩展,我们猜想它可以实现全地引用(具有终止计算但循环地数据结构);(3)具有\emph{universe polymorphism}的扩展,它将堆划分为细粒度的区域。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Memory Consistency and Program Transformations No Saved Kaleidosope: an 100% Jitted Neural Network Coding Language with Pythonic Syntax Towards Quantum Multiparty Session Types The Incredible Shrinking Context... in a decompiler near you Scheme Pearl: Quantum Continuations
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1