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.
Proceedings Types for Proofs and Programs, Revised Selected Papers
Types for Proofs and Programs是Types Project的年度会议,旨在发展基于类型论的形式推理和计算机编程技术。这是通过改进语言和计算机化的推理工具,并通过在几个领域应用该技术,如程序设计语言,认证软件,数学和数学教育的形式化分析。2009年的会议在法国奥苏瓦举行,我们感谢受邀演讲者Richard Garner、Peter Hancock和Pawestern Urzyczyn的精彩演讲。本卷包括不一定会在研讨会上发表的论文,由托尔斯滕·阿尔滕基希、汤姆·赫茨霍维茨、克里斯托夫·拉法利和艾伦·施密特在马蒂厄·索佐和马卡里乌斯·温泽尔的帮助下选出。
Non-Blocking Concurrent Imperative Programming with Session Types
Concurrent C 0是C家族中的一种命令式程序设计语言,具有会话类型的消息传递并发性。前面提出的语义实现了异步(非阻塞)输出;我们在这里扩展了非阻塞输入。一个关键的想法是通过将接收命令解释为对消息的请求来尽可能地推迟消息接收。我们将我们的想法实现为从阻塞中间语言到非阻塞语言的翻译。最后,我们评估了我们的技术与几个基准程序,并显示所获得的结果。虽然跨度的抽象度量总是减少(或保持不变),但只有少数例子获得了实际好处。