Function types in complete type inference

被引:0
|
作者
Widera, M [1 ]
Beierle, C [1 ]
机构
[1] Fernuniv, Fachberich Informat, D-58084 Hagen, Germany
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We study type checking that is complete in the sense that it accepts every program whose subexpressions can all be executed without raising a type error at runtime. In a complete type checker for every function call (f a) of a function f with an argument expression a of type t(a) it is checked whether f is applicable to one of the possible values of a, i.e. whether <[t(a)]> boolean AND dom (f) not equal phi holds where <[t]> denotes the semantics of a type t. When approximating dom(f) by a type tin it turns out that the usual function type constructor is not appropriate for complete type checking: for a function type t(f) = t(in) --> t(out) of f the input type t(in) is usually not guaranteed to contain all values of dom(f) and the test for common elements can erroneously fail. We therefore introduce an alternative notion of function types, called I/O-representation, where the input types cover a superset of the domain of the denoted functions. We show that this notion of function types fits into the framework of complete type checking much better than the usual function type constructor. Moreover, we argue that complete type checking overcomes the disadvantages of soft-typing approaches by enabling the rejection of programs instead of just raising a warning.
引用
收藏
页码:111 / 122
页数:12
相关论文
共 50 条
  • [1] A COMPLETE TYPE INFERENCE ALGORITHM FOR SIMPLE INTERSECTION TYPES
    COPPO, M
    GIANNINI, P
    LECTURE NOTES IN COMPUTER SCIENCE, 1992, 581 : 102 - 123
  • [2] Type Inference for Correspondence Types
    Gordon, Andrew D.
    Huttel, Hans
    Hansen, Rene Rydhof
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2009, 242 (03) : 21 - 36
  • [3] Type inference with constrained types
    Odersky, M
    Sulzmann, M
    Wehr, M
    THEORY AND PRACTICE OF OBJECT SYSTEMS, 1999, 5 (01): : 35 - 55
  • [4] TYPE INFERENCE WITH PARTIAL TYPES
    THATTE, SR
    THEORETICAL COMPUTER SCIENCE, 1994, 124 (01) : 127 - 148
  • [5] TYPE INFERENCE WITH PARTIAL TYPES
    THATTE, S
    LECTURE NOTES IN COMPUTER SCIENCE, 1988, 317 : 615 - 629
  • [6] Type inference with constrained types
    Univ of South Australia
    Theor Pract Object Syst, 1 (35-55):
  • [7] Java']Java SAM Typed Closures: A Sound and Complete Type Inference System for Nominal Types
    Bellia, Marco
    Occhiuto, M. Eugenia
    FUNDAMENTA INFORMATICAE, 2013, 128 (1-2) : 17 - 33
  • [8] Complete and Decidable Type Inference for GADTs
    Schrijvers, Tom
    Jones, Simon Peyton
    Sulzmann, Martin
    Vytiniotis, Dimitrios
    ICFP'09: PROCEEDINGS OF THE 2009 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, 2009, : 341 - 352
  • [9] Complete and Decidable Type Inference for GADTs
    Schrijvers, Tom
    Jones, Simon Peyton
    Sulzmann, Martin
    ACM SIGPLAN NOTICES, 2009, 44 (8-9) : 341 - 352
  • [10] Type inference for nested self types
    Bono, V
    Tiuryn, J
    Urzyczyn, P
    TYPES FOR PROOFS AND PROGRAMS, 2004, 3085 : 99 - 114