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 条
  • [31] Quantum Decoherence: A Logical Perspective
    Sebastian Fortin
    Leonardo Vanni
    Foundations of Physics, 2014, 44 : 1258 - 1268
  • [32] The Logical Relevance of Poetry in Alfarabi
    Yildiz, Omer
    Dogramaci, Halil Ibrahim
    BEYTULHIKME-AN INTERNATIONAL JOURNAL OF PHILOSOPHY, 2023, 13 (02): : 62 - 84
  • [33] Logical Form through Abstraction
    Gendler Szabo, Zoltan
    DISPUTATIO-INTERNATIONAL JOURNAL OF PHILOSOPHY, 2020, 12 (58): : 251 - 263
  • [34] Students’ understandings of logical implication
    Hoyles C.
    Küchemann D.
    Educational Studies in Mathematics, 2002, 51 (3) : 193 - 223
  • [35] The Logical Construction of Linguistic Expressions
    Yilmaz, Caglayan
    SELCUK UNIVERSITESI EDEBIYAT FAKULTESI DERGISI-SELCUK UNIVERSITY JOURNAL OF FACULTY OF LETTERS, 2023, 50
  • [36] Logical, normativita a konativne Fakty
    Gaher, Frantisek
    ORGANON F, 2017, 24 : 27 - 49
  • [37] LOGICAL THINKING IN THE EDUCATIONAL CONTEXT
    Luna-Guevara, Jose Roque
    Silva, Fernando David Munoz
    Lopez-Regalado, Oscar
    ASEAN JOURNAL OF PSYCHIATRY, 2021, 22 (10):
  • [38] Logical Oddities in Protagorean Relativism
    Keeling, Evan
    RHIZOMATA-A JOURNAL FOR ANCIENT PHILOSOPHY AND SCIENCE, 2022, 10 (02): : 215 - 237
  • [39] Logical Problems in Analysis of Analogy
    Wolenski, Jan
    PHILOSOPHIES, 2019, 4 (02)
  • [40] A Logical Characterisation of Static Equivalence
    Huttel, Hans
    Pedersen, Michael D.
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2007, 173 : 139 - 157