论文标题

表示摊销分析的表示复发提取

Denotational recurrence extraction for amortized analysis

论文作者

Cutler, Joseph W., Licata, Daniel R., Danner, Norman

论文摘要

分析功能程序时间复杂性的一种典型方法是提取以其输入的大小来表达程序的运行时间的复发,然后求解复发以获得BIG-O BOND。为了使复发提取为组成,还必须为辅助功能的输出的大小提取复发。先前的工作已经开发了用于使用逻辑关系来陈述一般复发提取翻译的形式正确性定理的技术:当操作成本受提取的成本界限时,程序是由复发界定的,并且根据提取的类型的诱导定义的价值界限,并根据提取的尺寸限制了输出值。这项先前的工作通过将复发视为lambda-calculus中的程序或其表示语义中的数学实体来支持高阶功能。在本文中,我们将这些技术扩展到支持摊销分析,其中将成本从程序的一部分重新排列到另一部分,以实现更精确的界限。我们提供了一种中间语言,可以根据银行的摊销分析方法来注释程序;该语言具有一个仿射类型系统,可确保信用不超过一次。我们将这种语言的复发提取翻译成复发语言,一种具有成本类型的简单型lambda-calculus,并声明并证明并证明表达了这种翻译正确性的边界逻辑关系。复发语言在预订方面具有典型的语义,我们使用这种语义来解决复发,例如分析二进制计数器和张开树。

A typical way of analyzing the time complexity of functional programs is to extract a recurrence expressing the running time of the program in terms of the size of its input, and then to solve the recurrence to obtain a big-O bound. For recurrence extraction to be compositional, it is also necessary to extract recurrences for the size of outputs of helper functions. Previous work has developed techniques for using logical relations to state a formal correctness theorem for a general recurrence extraction translation: a program is bounded by a recurrence when the operational cost is bounded by the extracted cost, and the output value is bounded, according to a value bounding relation defined by induction on types, by the extracted size. This previous work supports higher-order functions by viewing recurrences as programs in a lambda-calculus, or as mathematical entities in a denotational semantics thereof. In this paper, we extend these techniques to support amortized analysis, where costs are rearranged from one portion of a program to another to achieve more precise bounds. We give an intermediate language in which programs can be annotated according to the banker's method of amortized analysis; this language has an affine type system to ensure credits are not spent more than once. We give a recurrence extraction translation of this language into a recurrence language, a simply-typed lambda-calculus with a cost type, and state and prove a bounding logical relation expressing the correctness of this translation. The recurrence language has a denotational semantics in preorders, and we use this semantics to solve recurrences, e.g analyzing binary counters and splay trees.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源