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 条
  • [21] Abstract logical structuralism
    Marquis, Jean-Pierre
    ZAGADNIENIA FILOZOFICZNE W NAUCE-PHILOSOPHICAL PROBLEMS IN SCIENCE, 2020, (69): : 67 - 110
  • [22] Pragmatic phenomenological types
    Goranson, Ted
    Cardier, Beth
    Devlin, Keith
    PROGRESS IN BIOPHYSICS & MOLECULAR BIOLOGY, 2015, 119 (03): : 420 - 436
  • [23] Trivial Languages
    Bave, Arvid
    ACTA ANALYTICA-INTERNATIONAL PERIODICAL FOR PHILOSOPHY IN THE ANALYTICAL TRADITION, 2018, 33 (01): : 1 - 17
  • [24] A logical theory of interfaces and objects
    Alencar, PSC
    Cowan, DD
    Lucena, CJP
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2002, 28 (06) : 548 - 575
  • [25] Quantum Decoherence: A Logical Perspective
    Fortin, Sebastian
    Vanni, Leonardo
    FOUNDATIONS OF PHYSICS, 2014, 44 (12) : 1258 - 1268
  • [26] LUDWIG WITTGENSTEIN AND LOGICAL POSITIVISM
    Nikiforov, Alexander L.
    EPISTEMOLOGY & PHILOSOPHY OF SCIENCE-EPISTEMOLOGIYA I FILOSOFIYA NAUKI, 2021, 58 (01): : 22 - 30
  • [27] Colligation or the logical inference of interconnection
    Franksen, OI
    Falster, P
    MATHEMATICS AND COMPUTERS IN SIMULATION, 2000, 52 (01) : 1 - 9
  • [28] Logical characterizations of heap abstractions
    Yorsh, Greta
    Reps, Thomas
    Sagiv, Mooly
    Wilhelm, Reinhard
    ACM TRANSACTIONS ON COMPUTATIONAL LOGIC, 2007, 8 (01)
  • [29] A LOGICAL ANALYSIS OF RULE INCONSISTENCY
    Besnard, Philippe
    INTERNATIONAL JOURNAL OF SEMANTIC COMPUTING, 2011, 5 (03) : 271 - 280
  • [30] The dual of a logical linear programme
    Williams, HP
    JOURNAL OF GLOBAL OPTIMIZATION, 2000, 18 (02) : 129 - 141