首页    期刊浏览 2024年09月20日 星期五
登录注册

文章基本信息

  • 标题:A Sound Type System for Typing Runtime Errors
  • 本地全文:下载
  • 作者:Akihisa Yamada ; Keiichirou Kusakari ; Toshiki Sakabe
  • 期刊名称:Information and Media Technologies
  • 电子版ISSN:1881-0896
  • 出版年度:2012
  • 卷号:7
  • 期号:2
  • 页码:667-675
  • DOI:10.11185/imt.7.667
  • 出版社:Information and Media Technologies Editorial Board
  • 摘要:Dynamically typed languages such as Scheme are widely adopted because of their rich expressiveness. However, there is the drawback that dynamic typing cannot detect runtime errors at compile time. In this paper, we propose a type system which enables static detection of runtime errors. The key idea of our approach is to introduce a special type, called the error type, for expressions that cause runtime errors. The proposed type system brings out the benefit of the error type with set-theoretic union, intersection and complement types, recursive types, parametric polymorphism and subtyping. While existing type systems usually ensure that evaluation never causes runtime errors for typed expressions, our system ensures that evaluation always causes runtime errors for expressions typed with the error type. Likewise, our system also ensures that evaluation never causes errors for expressions typed with any type that does not contain the error type. Under the usual definition of subtyping, it is difficult to syntactically prove the soundness of our type system. We redefine subtyping by introducing the notion of intransitive subtyping, and syntactically prove the soundness under the new definition.
  • 关键词:type systems;dynamically typed languages
国家哲学社会科学文献中心版权所有