超限数组的λ演算:数组与流的统一
A Lambda Calculus for Transfinite Arrays: Unifying Arrays and Streams
摘要:
数组程序设计语言允许简洁和通用的公式化的数值算法,从而提供了一个巨大的潜力,如融合,并行化等程序优化的限制,这些语言通常有一个是,在每个数组中的元素的数量是有限的。这意味着在这种语言中实现流算法需要新类型的数据结构,其操作不能立即与现有的数组操作或编译器优化兼容。在本文中,我们提出了一个设计的函数语言,原生支持无限数组。我们使用序数来引入形状和指数的无穷大概念。通过这样做,我们获得了一个演算,自然扩展现有的数组演算,并在同一时间,允许递归规范,因为它们是在流和列表为基础的设置。此外,可以被认为是$n$ -fold cons操作符的主要语言构造引起了在数据中表达超限递归,列表或流通常不支持这种递归。这使得有可能把拟议的演算作为一个统一的理论数组,列表和流。我们给出了一个操作语义的建议语言,讨论了我们所做的设计选择,并证明了它的可表达性与几个例子。我们还表明,所提出的形式主义保留了一些众所周知的普遍平等从数组/列表/流理论,并讨论实现相关的挑战。
英文摘要:
Array programming languages allow for concise and generic formulations of numerical algorithms, thereby providing a huge potential for program optimisation such as fusion, parallelisation, etc. One of the restrictions that these languages typically have is that the number of elements in every array has to be finite. This means that implementing streaming algorithms in such languages requires new types of data structures, with operations that are not immediately compatible with existing array operations or compiler optimisations. In this paper, we propose a design for a functional language that natively supports infinite arrays. We use ordinal numbers to introduce the notion of infinity in shapes and indices. By doing so, we obtain a calculus that naturally extends existing array calculi and, at the same time, allows for recursive specifications as they are found in stream- and list-based settings. Furthermore, the main language construct that can be thought of as an $n$-fold cons operator gives rise to expressing transfinite recursion in data, something that lists or streams usually do not support. This makes it possible to treat the proposed calculus as a unifying theory of arrays, lists and streams. We give an operational semantics of the proposed language, discuss design choices that we have made, and demonstrate its expressibility with several examples. We also demonstrate that the proposed formalism preserves a number of well-known universal equalities from array/list/stream theories, and discuss implementation-related challenges.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。