Dependently Typing R Vectors, Arrays, and Matrices

04/09/2023
by   John Wrenn, et al.
0

The R programming language is widely used in large-scale data analyses. It contains especially rich built-in support for dealing with vectors, arrays, and matrices. These operations feature prominently in the applications that form R's raison d'être, making their behavior worth understanding. Furthermore, ostensibly for programmer convenience, their behavior in R is a notable extension over the corresponding operations in mathematics, thereby offering some challenges for specification and static verification. We report on progress towards statically typing this aspect of the R language. The interesting aspects of typing, in this case, warn programmers about violating bounds, so the types must necessarily be dependent. We explain the ways in which R extends standard mathematical behavior. We then show how R's behavior can be specified in LiquidHaskell, a dependently-typed extension to Haskell. In the general case, actually verifying library and client code is currently beyond LiquidHaskell's reach; therefore, this work provides challenges and opportunities both for typing R and for progress in dependently-typed programming languages.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/24/2020

Retrofitting Parallelism onto OCaml

OCaml is an industrial-strength, multi-paradigm programming language, wi...
research
07/12/2021

Teaching Design by Contract using Snap!

With the progress in deductive program verification research, new tools ...
research
03/21/2023

ChatGPT for Programming Numerical Methods

ChatGPT is a large language model recently released by the OpenAI compan...
research
08/06/2021

The Specification Language Server Protocol: A Proposal for Standardised LSP Extensions

The Language Server Protocol (LSP) changed the field of Integrated Devel...
research
07/17/2018

Merlin: A Language Server for OCaml (Experience Report)

We report on the experience of developing Merlin, a language server for ...
research
01/18/2020

AI Data Wrangling with Associative Arrays

The AI revolution is data driven. AI "data wrangling" is the process by ...

Please sign up or login with your details

Forgot password? Click here to reset