A Type System for Tom

C. Kirchner, Pierre-Etienne Moreau, Cláudia Tavares
{"title":"A Type System for Tom","authors":"C. Kirchner, Pierre-Etienne Moreau, Cláudia Tavares","doi":"10.4204/EPTCS.21.5","DOIUrl":null,"url":null,"abstract":"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. \nThe 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. \nThis 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.","PeriodicalId":372177,"journal":{"name":"International Workshop on Rule-Based Programming","volume":"57 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-06-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"8","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Workshop on Rule-Based Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4204/EPTCS.21.5","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 8

Abstract

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.
汤姆的打字系统
用新的专用特性扩展给定语言是一种常用的方法,可以使编程语言更适应问题。更接近应用程序,这将导致更少的编程缺陷和更容易的维护。但是当然,人们仍然希望对这些类型的扩展语言执行程序分析,特别是类型检查和推断。在这种情况下,必须使扩展特性的类型与起始语言中的类型兼容。Tom编程语言是这种情况的典型示例,因为它包含了Java的扩展,该扩展添加了模式匹配,特别是关联模式匹配和约简策略。本文为Tom提供了一个具有子类型的类型系统,它与Java的类型系统兼容,并执行类型检查和类型推断。我们提出了一种算法来检查Tom程序的所有模式是否都是类型良好的。此外,我们提出了一种基于等式和子类型约束的算法,用于推断模式中出现的变量类型。两种算法的实例表明,所提出的类型系统是健全和完整的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信