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 条
  • [1] Logical Types for Untyped Languages
    Tobin-Hochstadt, Sam
    Felleisen, Matthias
    ACM SIGPLAN NOTICES, 2010, 45 (09) : 117 - 128
  • [2] Adding Types to Untyped Languages
    Felleisen, Matthias
    TLDI '10: PROCEEDINGS OF THE 2010 ACM SIGPLAN WORKSHOP ON TYPES IN LANGUAGE DESIGN AND IMPLEMENTATION, 2010, : 1 - 1
  • [3] Untyped Pluralism
    Florio, Salvatore
    MIND, 2014, 123 (490) : 317 - 337
  • [4] Logical Systems and Formal Languages ?Genuine Cognitive Artifacts?
    Ludmila Barta, Natividad
    DISPUTATIO-PHILOSOPHICAL RESEARCH BULLETIN, 2018, 7 (08):
  • [5] Fictionalism and Logical Difficulties in the Differentiation of Artificial and Natural Types of Intelligence
    Kulikov, Sergey Borisovich
    TOMSK STATE UNIVERSITY JOURNAL, 2019, (442): : 82 - 86
  • [6] Trace Types and Denotational Semantics for Sound Programmable Inference in Probabilistic Languages
    Lew, Alexander K.
    Cusumano-Towner, Marco F.
    Sherman, Benjamin
    Carbin, Michael
    Mansinghka, Vikash K.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (POPL):
  • [7] Representation and duality of the untyped λ-calculus in nominal lattice and topological semantics, with a proof of topological completeness
    Gabbay, Murdoch J.
    Gabbay, Michael
    ANNALS OF PURE AND APPLIED LOGIC, 2017, 168 (03) : 501 - 621
  • [8] Is humor logical?
    Tonoyan, Larisa G.
    TOMSK STATE UNIVERSITY JOURNAL, 2023, (497): : 47 - 56
  • [9] Logical Essence
    Leech, Jessica
    ARGUMENTA, 2022, 7 (02): : 415 - 437
  • [10] Stream Types
    Cutler, Joseph W.
    Watson, Christopher
    Nkurumeh, Emeka
    Hilliard, Phillip
    Goldstein, Harrison
    Stanford, Caleb
    Pierce, Benjamin C.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (PLDI):