arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2304.13627cs.PLcs.LO
收藏

具有正则递归类型的自动摊还资源分析

Automatic Amortized Resource Analysis with Regular Recursive Types

Jessie Grosen, David M. Kahn, Jan Hoffmann

AI总结:

本文针对复杂自定义数据结构上的资源界推断问题,为正则递归类型定义的代数数据结构统一构造资源多项式,并在FPC类型系统中集成AARA,借助自由半模与逻辑关系证明其可靠性。

摘要:

自动资源界分析的目标是静态推断程序求值过程中资源消耗的符号界。自动资源分析长期存在的一个挑战是推断作为复杂自定义数据结构函数的界。本文基于基于类型的自动摊还资源分析(AARA)来应对这一挑战。AARA以摊还分析中的势方法为基础,将界推断归约为带有附加线性约束求解的标准类型推断,即使在推导非线性界时也是如此。AARA的一个关键组成部分是资源函数,它为给定类型的值生成可能界的空间,同时具备必要的闭包性质。\n现有AARA工作已为列表的列表等许多数据结构定义了此类函数,但是否对任意数据结构都存在此类函数仍是一个开放问题。本工作对该问题给出肯定回答:为由正则递归类型定义的代数数据结构统一构造资源多项式。这些函数是此前提出的所有多项式资源函数的推广,可被视为给定递归类型之值上多项式的一般概念。面向FPC(一种具有递归类型的核心语言)的资源类型系统展示了如何将资源多项式与AARA集成,同时保留以往技术的全部优势。本文还提出了有助于陈述该类型系统规则并证明其可靠性的新技术。首先,多变量势注解以自由半模表述,显著抽象了注解呈现及其性质证明中的细节。其次,为资源类型赋予语义含义的逻辑关系,使得可通过对类型推导进行单次归纳来完成可靠性证明。

英文摘要:

The goal of automatic resource bound analysis is to statically infer symbolic bounds on the resource consumption of the evaluation of a program. A longstanding challenge for automatic resource analysis is the inference of bounds that are functions of complex custom data structures. This article builds on type-based automatic amortized resource analysis (AARA) to address this challenge. AARA is based on the potential method of amortized analysis and reduces bound inference to standard type inference with additional linear constraint solving, even when deriving non-linear bounds. A key component of AARA is resource functions that generate the space of possible bounds for values of a given type while enjoying necessary closure properties. Existing work on AARA defined such functions for many data structures such as lists of lists but the question of whether such functions exist for arbitrary data structures remained open. This work answers this questions positively by uniformly constructing resource polynomials for algebraic data structures defined by regular recursive types. These functions are a generalization of all previously proposed polynomial resource functions and can be seen as a general notion of polynomials for values of a given recursive type. A resource type system for FPC, a core language with recursive types, demonstrates how resource polynomials can be integrated with AARA while preserving all benefits of past techniques. The article also proposes the use of new techniques useful for stating the rules of this type system and proving it sound. First, multivariate potential annotations are stated in terms of free semimodules, substantially abstracting details of the presentation of annotations and the proofs of their properties. Second, a logical relation giving semantic meaning to resource types enables a proof of soundness by a single induction on typing derivations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑