Logical Types for Untyped Languages

被引:0
|
作者
Tobin-Hochstadt, Sam [1 ]
Felleisen, Matthias [1 ]
机构
[1] Northeastern Univ, Boston, MA 02115 USA
来源
ICFP 2010: PROCEEDINGS OF THE 2010 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING | 2010年
关键词
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 条
  • [41] PROCESS IN REALITY: A LOGICAL OFFERING
    Brenner, Joseph E.
    LOGIC AND LOGICAL PHILOSOPHY, 2005, 14 (02) : 165 - 202
  • [42] A logical approach to multicut problems
    Gottlob, Georg
    Lee, Stephanie Tien
    INFORMATION PROCESSING LETTERS, 2007, 103 (04) : 136 - 141
  • [43] Logical and illogical behavior in animals
    Yamazaki, Y
    JAPANESE PSYCHOLOGICAL RESEARCH, 2004, 46 (03) : 195 - 206
  • [44] Origins of Hierarchical Logical Reasoning
    Dedhe, Abhishek M.
    Clatterbuck, Hayley
    Piantadosi, Steven T.
    Cantlon, Jessica F.
    COGNITIVE SCIENCE, 2023, 47 (02)
  • [45] ILIKE LOGICAL LANGUAGE TRAINING
    Talmo, Tord
    Stay, John B.
    7TH INTERNATIONAL TECHNOLOGY, EDUCATION AND DEVELOPMENT CONFERENCE (INTED2013), 2013, : 4647 - 4650
  • [46] Logical resolving for security evaluation
    Zegzhda, PD
    Zegzhda, DP
    Kalinin, MO
    COMPUTER NETWORK SECURITY, 2003, 2776 : 147 - 156
  • [47] Vasiliev and the Foundations of Logical Laws
    Smirnova, Elena D.
    LOGICAL LEGACY OF NIKOLAI VASILIEV AND MODERN LOGIC, 2017, 387 : 127 - 133
  • [48] Logical perspectives on the foundations of probability
    Hosni, Hykel
    Landes, Jurgen
    OPEN MATHEMATICS, 2023, 21 (01):
  • [49] Solving Logical Puzzles in DisCoCirc
    Duneau, Tiffany
    JOURNAL OF COGNITIVE SCIENCE, 2021, 22 (03) : 355 - 389
  • [50] The Dual of a Logical Linear Programme
    H.P. Williams
    Journal of Global Optimization, 2000, 18 : 129 - 141