arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1003.4799cs.LOcs.PL
收藏

Tom的类型系统

A Type System for Tom

Claude Kirchner, Pierre-Etienne Moreau, Cláudia Tavares

摘要:

用新的专用特性扩展给定的语言是一种通用的、非常常用的方法,可以使程序设计语言更好地适应问题。由于更接近应用程序,因此编程缺陷更少,维护更容易。当然,人们仍然希望对这类扩展语言进行程序分析,特别是类型检查和推理。在这种情况下,必须使扩展功能的类型与起始语言中的类型兼容。Tom程序设计语言是这种情况的一个典型例子,因为它由Java的扩展组成,该扩展添加了模式匹配,更具体地说是关联模式匹配和归约策略。本文提出了一个类型系统与子类型的汤姆,这是兼容Java的类型系统,并执行类型检查和类型推断。我们提出了一个算法,检查是否所有的模式的汤姆程序是良好的类型。此外,我们提出了一个算法的基础上的平等和子类型的约束,推断类型的变量发生在一个模式。这两种算法的例子和建议的类型系统是健全和完整的。

英文摘要:

Extending a given language with new dedicated features is a general and quite used approach to make the programming language more adapted to problems. Being closer to the application, this leads to less programming flaws and easier maintenance. But of course one would still like to perform program analysis on these kinds of extended languages, in particular type checking and inference. In this case one has to make the typing of the extended features compatible with the ones in the starting language. The Tom programming language is a typical example of such a situation as it consists of an extension of Java that adds pattern matching, more particularly associative pattern matching, and reduction strategies. This paper presents a type system with subtyping for Tom, that is compatible with Java's type system, and that performs both type checking and type inference. We propose an algorithm that checks if all patterns of a Tom program are well-typed. In addition, we propose an algorithm based on equality and subtyping constraints that infers types of variables occurring in a pattern. Both algorithms are exemplified and the proposed type system is showed to be sound and complete.

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

↑