arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1703.08683cs.PLcs.LO
收藏

实用类型系统:一种实用程序设计的定理证明方法

Applied Type System: An Approach to Practical Programming with Theorem-Proving

Hongwei Xi

摘要:

纯类型系统(PTS)框架提供了一种简单而通用的方法来设计和形式化类型系统。然而,在存在依赖类型的情况下,通常存在某些尖锐的问题,这些问题使得PTS难以直接适应许多常见的现实编程特征,诸如一般递归、递归类型、效果(例如,在本文中,应用类型系统(ATS)被提出作为一个框架,设计和形式化类型系统,以支持实际的编程与高级类型(包括依赖类型)。特别是,它表明,ATS可以很容易地容纳被称为编程与定理证明(PwTP),其中程序和证明构造在一个语法交织的方式,产生一个实用的方法来内在化的约束解决需要在类型检查的范式。ATS的关键显著特征在于静态和动态之间的完全分离,静态是类型的形成和推理,动态是程序的构建和评估。通过这种分离,程序不再可能出现在PTS中允许的类型中。本文不仅包含了ATS的形式化开发,而且还包含了一些取自ats-lang.org的例子,这是一种程序设计语言,其类型系统植根于ATS,以支持采用ATS作为框架来制定用于实际编程的高级类型系统。

英文摘要:

The framework Pure Type System (PTS) offers a simple and general approach to designing and formalizing type systems. However, in the presence of dependent types, there often exist certain acute problems that make it difficult for PTS to directly accommodate many common realistic programming features such as general recursion, recursive types, effects (e.g., exceptions, references, input/output), etc. In this paper, Applied Type System (ATS) is presented as a framework for designing and formalizing type systems in support of practical programming with advanced types (including dependent types). In particular, it is demonstrated that ATS can readily accommodate a paradigm referred to as programming with theorem-proving (PwTP) in which programs and proofs are constructed in a syntactically intertwined manner, yielding a practical approach to internalizing constraint-solving needed during type-checking. The key salient feature of ATS lies in a complete separation between statics, where types are formed and reasoned about, and dynamics, where programs are constructed and evaluated. With this separation, it is no longer possible for a program to occur in a type as is otherwise allowed in PTS. The paper contains not only a formal development of ATS but also some examples taken from ats-lang.org, a programming language with a type system rooted in ATS, in support of employing ATS as a framework to formulate advanced type systems for practical programming.

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

↑