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

对 R 向量、数组和矩阵的依赖类型化

Dependently Typing R Vectors, Arrays, and Matrices

John Wrenn, Anjali Pal, Alexa VanHattum, Shriram Krishnamurthi

AI总结:

本研究探讨了R语言中向量、数组和矩阵操作的依赖类型化,通过LiquidHaskell规范其扩展的数学行为,为静态验证和依赖类型编程提供了挑战与机遇。

摘要:

R编程语言被广泛用于大规模数据分析。它包含特别丰富的内置支持来处理向量、数组和矩阵。这些操作在构成R存在理由的应用中尤为突出,使得其行为值得理解。此外,表面上是为了程序员方便,它们在R中的行为是对数学中相应操作的显著扩展,从而为规范和静态验证提供了一些挑战。我们报告了在静态类型化R语言这一方面的进展。在这种情况下,类型化的有趣方面是警告程序员违反边界,因此类型必须是依赖的。我们解释了R扩展标准数学行为的方式。然后,我们展示了如何在LiquidHaskell(Haskell的依赖类型扩展)中规范R的行为。在一般情况下,实际验证库和客户端代码目前超出了LiquidHaskell的能力范围;因此,这项工作既为类型化R提供了挑战和机遇,也为依赖类型编程语言的进展提供了挑战和机遇。

英文摘要:

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.

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

↑