A Lambda Calculus for Transfinite Arrays: Unifying Arrays and Streams

10/10/2017
by   Artjoms Sinkarovs, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/01/2020

Multi-dimensional Arrays with Levels

We explore a data structure that generalises rectangular multi-dimension...
research
07/26/2019

Lazy Stream Programming in Prolog

In recent years, stream processing has become a prominent approach for i...
research
05/31/2019

Reference Capabilities for Safe Parallel Array Programming

The array is a fundamental data structure that provides an efficient way...
research
05/17/2022

Reasoning About Vectors using an SMT Theory of Sequences

Dynamic arrays, also referred to as vectors, are fundamental data struct...
research
07/18/2023

Stream Types

We propose a rich foundational theory of typed data streams and stream t...
research
04/12/2021

Getting to the Point. Index Sets and Parallelism-Preserving Autodiff for Pointful Array Programming

We present a novel programming language design that attempts to combine ...
research
02/20/2023

Control Flow Duplication for Columnar Arrays in a Dynamic Compiler

Columnar databases are an established way to speed up online analytical ...

Please sign up or login with your details

Forgot password? Click here to reset