资源受限类型论:通过分级模态实现组合成本分析
Resource-Bounded Type Theory: Compositional Cost Analysis via Graded Modalities
AI总结:
本文提出了一种资源受限类型论框架,通过分级模态实现组合成本分析,并证明了无递归单纯类型片段的语法成本正确性定理。
摘要:
我们提出了一种组合框架,用于在类型程序中认证资源界限。术语被类型化为合成的界限,这些界限来自一个抽象资源格,使时间、内存、气体和领域特定成本能够得到统一处理。我们引入了一个分级可行性模态,带有共单位和单调性定律。我们的主要结果是对于无递归的单纯类型片段的语法成本正确性定理:如果一个闭合项在给定预算下合成界限为b,则其操作成本被限制在b以内。我们提供了一个在拓扑中基于格的预层范畴内的语法项模型——其中资源界限索引一个成本分层的可定义值家族——并以自然变换的形式提供成本提取。我们通过再现实化证明了规范形式,并建立了语法模型的初始性:它唯一嵌入到所有资源受限模型中。一个案例研究展示了使用Lean的原生递归进行二分查找的组合推理,并通过单独的界限证明实现。
英文摘要:
We present a compositional framework for certifying resource bounds in typed programs. Terms are typed with synthesized bounds drawn from an abstract resource lattice, enabling uniform treatment of time, memory, gas, and domain-specific costs. We introduce a graded feasibility modality with co-unit and monotonicity laws. Our main result is a syntactic cost soundness theorem for the recursion-free simply-typed fragment: if a closed term has synthesized bound b under a given budget, its operational cost is bounded by b. We provide a syntactic term model in the topos of presheaves over the lattice -- where resource bounds index a cost-stratified family of definable values -- with cost extraction as a natural transformation. We prove canonical forms via reification and establish initiality of the syntactic model: it embeds uniquely into all resource-bounded models. A case study demonstrates compositional reasoning for binary search using Lean's native recursion with separate bound proofs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。