Information and Media Technologies
Online ISSN : 1881-0896
ISSN-L : 1881-0896
Computing
A Sound Type System for Typing Runtime Errors
Akihisa YamadaKeiichirou KusakariToshiki SakabeMasahiko SakaiNaoki Nishida
著者情報
ジャーナル フリー

2012 年 7 巻 2 号 p. 667-675

詳細
抄録

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.

著者関連情報
© 2012 Information Processing Society of Japan
前の記事 次の記事
feedback
Top