Litcius/Paper detail

Towards size-dependent types for array programming

Troels Henriksen, Martin Elsman

202114 citationsDOI

Abstract

We present a type system for expressing size constraints on array types in an ML-style type system. The goal is to detect shape mismatches at compile-time, while being simpler than full dependent types. The main restrictions is that the only terms that can occur in types are array sizes, and syntactically they must be variables or constants. For those programs where this is not sufficient, we support a form of existential types, with the type system automatically managing the requisite book-keeping. We formalise a large subset of the type system in a small core language, which we prove sound. We also present an integration of the type system in the high-performance parallel functional language Futhark, and show on a collection of 44 representative programs that the restrictions in the type system are not too problematic in practice.

Topics & Concepts

Computer scienceCompilerType (biology)Programming languageCompile timeData typeFunctional programmingTheoretical computer scienceEcologyBiologyLogic, programming, and type systemsParallel Computing and Optimization TechniquesSoftware Engineering Research