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

内涵数据类型细化

Intensional Datatype Refinement

Eddie Jones, Steven Ramsay

摘要:

模式匹配安全问题是验证给定的函数程序不会由于其函数定义中的非穷举模式而崩溃。我们提出了一个细化类型的系统,可以用来解决这个问题。该系统通过有限的结构子类型和环境级交集的形式,用代数数据库扩展ML风格的类型系统。我们描述了一个全自动的,健全的和完整的类型推断程序,在合理的假设下,该系统是最坏情况下的线性时间的程序大小。组合性对于获得这种复杂性保证是必不可少的。Haskell的一个原型实现能够在几百毫秒内分析Hackage数据库中的一些包。

英文摘要:

The pattern-match safety problem is to verify that a given functional program will never crash due to non-exhaustive patterns in its function definitions. We present a refinement type system that can be used to solve this problem. The system extends ML-style type systems with algebraic datatypes by a limited form of structural subtyping and environment-level intersection. We describe a fully automatic, sound and complete type inference procedure for this system which, under reasonable assumptions, is worst-case linear-time in the program size. Compositionality is essential to obtaining this complexity guarantee. A prototype implementation for Haskell is able to analyse a selection of packages from the Hackage database in a few hundred milliseconds.

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

↑