Logical Types for Untyped Languages

被引:0
|
作者
Tobin-Hochstadt, Sam [1 ]
Felleisen, Matthias [1 ]
机构
[1] Northeastern Univ, Boston, MA 02115 USA
关键词
Type systems; Untyped languages; Logic;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Programmers reason about their programs using a wide variety of formal and informal methods. Programmers in untyped languages such as Scheme or Erlang are able to use any such method to reason about the type behavior of their programs. Our type system for Scheme accommodates common reasoning methods by assigning variable occurrences a subtype of their declared type based on the predicates prior to the occurrence, a discipline dubbed occurrence typing. It thus enables programmers to enrich existing Scheme code with types, while requiring few changes to the code itself. Three years of practical experience has revealed serious shortcomings of our type system. In particular, it relied on a system of ad-hoc rules to relate combinations of predicates, it could not reason about subcomponents of data structures, and it could not follow sophisticated reasoning about the relationship among predicate tests, all of which are used in existing code. In this paper, we reformulate occurrence typing to eliminate these shortcomings. The new formulation derives propositional logic formulas that hold when an expression evaluates to true or false, respectively. A simple proof system is then used to determine types of variable occurrences from these propositions. Our implementation of this revised occurrence type system thus copes with many more untyped programming idioms than the original system.
引用
收藏
页码:117 / 128
页数:12
相关论文
共 50 条
  • [21] Untyped algorithmic equality for with surjective pairs Martin-Lof's logical framework
    Abel, Andreas
    Coquand, Thierry
    FUNDAMENTA INFORMATICAE, 2007, 77 (04) : 345 - 395
  • [22] Untyped algorithmic equality for Martin-Lof's logical framework with surjective pairs
    Abel, A
    Coquand, T
    TYPED LAMBDA CALCULI AND APPLICATIONS, PROCEEDINGS, 2005, 3461 : 23 - 38
  • [23] GENERALITY OF LOGICAL TYPES
    Halimi, Brice
    RUSSELL-THE JOURNAL OF THE BERTRAND RUSSELL STUDIES, 2011, 31 (01): : 85 - 107
  • [24] Languages and types
    Cho, IH
    Ernst, E
    Holzmüller, B
    Ibrahim, R
    Lorenz, DH
    Pavillet, G
    Smaragdakis, Y
    Virtanen, P
    OBJECT-ORIENTED TECHNOLOGY: ECOOP'98 WORKSHOP READER, 1998, 1543 : 28 - 36
  • [25] Untyped Aspect Calculus : Formal Theory of Aspect-Oriented Programming Languages
    Gopalani, Dinesh
    Govil, M. C.
    2010 IEEE 2ND INTERNATIONAL ADVANCE COMPUTING CONFERENCE, 2010, : 195 - 200
  • [26] ASYNCHRONOUS AUTOMATA WITH DELAYS, AND LOGICAL LANGUAGES
    GLEBSKII, YV
    GORDON, EI
    AUTOMATION AND REMOTE CONTROL, 1974, 35 (12) : 2002 - 2007
  • [27] Languages and logical definability in concurrency monoids
    Droste, M
    Kuske, D
    COMPUTER SCIENCE LOGIC, 1996, 1092 : 233 - 251
  • [28] Agile Logical Semantics for Natural Languages
    Manca, Vincenzo
    INFORMATION, 2024, 15 (01)
  • [29] A logical approach to locality in pictures languages
    Grandjean, Etienne
    Olive, Frederic
    JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 2016, 82 (06) : 959 - 1006
  • [30] A LOGICAL APPROACH OF PETRI NET LANGUAGES
    PARIGOT, M
    PELZ, E
    THEORETICAL COMPUTER SCIENCE, 1985, 39 (2-3) : 155 - 169