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 条
  • [21] Type Checking and Inference Are Equivalent in Lambda Calculi with Existential Types
    Kato, Yuki
    Nakazawa, Koji
    FUNCTIONAL AND CONSTRAINT LOGIC PROGRAMMING, 2010, 5979 : 96 - 110
  • [22] Principality and type inference for intersection types using expansion variables
    Kfoury, AJ
    Wells, JB
    THEORETICAL COMPUTER SCIENCE, 2004, 311 (1-3) : 1 - 70
  • [23] MLstruct: Principal Type Inference in a Boolean Algebra of Structural Types
    Parreaux, Lionel
    Chau, Chun Yin
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (OOPSLA): : 449 - 478
  • [24] A computational complexity analysis of tunable type inference for Generic Universe Types
    Juma, Nahid
    Dietl, Werner
    Tripunitara, Mahesh
    THEORETICAL COMPUTER SCIENCE, 2020, 814 (814) : 189 - 209
  • [25] Flexible Types Robust type inference for first-class polymorphism
    Leijen, Daan
    ACM SIGPLAN NOTICES, 2009, 44 (01) : 66 - 77
  • [26] FreezeML Complete and Easy Type Inference for First-Class Polymorphism
    Emrich, Frank
    Lindley, Sam
    Stolarek, Jan
    Cheney, James
    Coates, Jonathan
    PROCEEDINGS OF THE 41ST ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '20), 2020, : 423 - 437
  • [27] Expansion: the Crucial Mechanism for Type Inference with Intersection Types: A Survey and Explanation
    Wells, Sebastien Carlier J. B.
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2005, 136 : 173 - 202
  • [28] Fuzzy optimal control using simple inference method and function type inference method
    Mitsuishi, T
    Wasaki, K
    Ohkubo, K
    Kawabe, J
    Shidama, Y
    PROCEEDINGS OF THE 2000 AMERICAN CONTROL CONFERENCE, VOLS 1-6, 2000, : 1944 - 1948
  • [29] Entity type inference based on path walking and inter-types relationships
    Gan, Yi
    Su, Zhihui
    Lu, Gaoyong
    Zhang, Pengju
    Cui, Aixiang
    Jiang, Jiawei
    Chen, Duanbing
    DATA & KNOWLEDGE ENGINEERING, 2024, 153
  • [30] An Existential Crisis Resolved Type Inference for First-Class Existential Types
    Eisenberg, Richard A.
    Duboc, Guillaume
    Weirich, Stephanie
    Lee, Daniel
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5