arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1506.01949cs.PL
收藏

具有归纳类型的函数式语言的指称代价语义

Denotational cost semantics for functional languages with inductive types

Norman Danner, Daniel R. Licata, Ramyaa Ramyaa

摘要:

分析函数程序的渐近复杂性的一个主要方法是提取并求解一个以输入大小表示评估成本的递推公式。输入大小的相关概念通常特定于数据类型,其度量包括列表的长度,列表中的最大元素和树的高度。在这项工作中,我们给出了一个正式的帐户提取成本和大小递归高阶函数程序归纳datastries。我们的方法允许广泛的程序员指定的大小的概念,并确保提取的递归正确预测评估成本。为了从程序中提取递归,我们首先通过应用从源语言到复杂性语言的一元转换来明确成本,然后将数据类型值抽象为大小。大小抽象可以在语义上完成,在复杂性语言的模型中工作,或者在语法上通过向前序判断添加规则来完成。我们给出了几种不同的模型的复杂性语言,支持不同的概念的大小。此外,我们证明了一个逻辑关系的参数,递归提取的这个过程是评估成本的上限,证明是完全语法,因此适用于我们考虑的所有模型。

英文摘要:

A central method for analyzing the asymptotic complexity of a functional program is to extract and then solve a recurrence that expresses evaluation cost in terms of input size. The relevant notion of input size is often specific to a datatype, with measures including the length of a list, the maximum element in a list, and the height of a tree. In this work, we give a formal account of the extraction of cost and size recurrences from higher-order functional programs over inductive datatypes. Our approach allows a wide range of programmer-specified notions of size, and ensures that the extracted recurrences correctly predict evaluation cost. To extract a recurrence from a program, we first make costs explicit by applying a monadic translation from the source language to a complexity language, and then abstract datatype values as sizes. Size abstraction can be done semantically, working in models of the complexity language, or syntactically, by adding rules to a preorder judgement. We give several different models of the complexity language, which support different notions of size. Additionally, we prove by a logical relations argument that recurrences extracted by this process are upper bounds for evaluation cost; the proof is entirely syntactic and therefore applies to all of the models we consider.

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

↑