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 条
  • [31] A logical characterization of timed regular languages
    Bersani, Marcello M.
    Rossi, Matteo
    San Pietro, Pierluigi
    THEORETICAL COMPUTER SCIENCE, 2017, 658 : 46 - 59
  • [32] Logical reconstruction of RDF and ontology languages
    de Bruijn, J
    Franconi, E
    Tessaris, S
    PRINCIPLES AND PRACTICE OF SEMANTIC WEB REASONING, PROCEEDINGS, 2005, 3703 : 65 - 71
  • [33] LOGICAL STRUCTURES AND LANGUAGES IN THINKING PROCESSES
    RIMOLDI, HJA
    INTERNATIONAL JOURNAL OF PSYCHOLOGY, 1971, 6 (01) : 65 - 77
  • [34] PROPERTIES OF LANGUAGES OF THE LOGICAL SYSTEM SIMULATION
    VAGIS, AG
    DOPOVIDI AKADEMII NAUK UKRAINSKOI RSR SERIYA A-FIZIKO-MATEMATICHNI TA TECHNICHNI NAUKI, 1990, (06): : 66 - 68
  • [35] IMPLEMENTATION OF LOGICAL QUERY LANGUAGES FOR DATABASES
    ULLMAN, JD
    ACM TRANSACTIONS ON DATABASE SYSTEMS, 1985, 10 (03): : 289 - 321
  • [36] Several Types of Types in Programming Languages
    Martini, Simone
    HISTORY AND PHILOSOPHY OF COMPUTING, 2016, 487 : 216 - 227
  • [37] LOGICAL TYPES AND OSTENSIVE INSIGHT
    AHUMADA, JL
    INTERNATIONAL JOURNAL OF PSYCHO-ANALYSIS, 1991, 72 : 683 - 691
  • [38] Toulmin's Logical Types
    Botting, David
    ARGUMENTATION, 2017, 31 (02) : 433 - 449
  • [39] Logical semantics of types for concurrency
    Caires, Luis
    ALGEBRA AND COALGEBRA IN COMPUTER SCIENCE, PROCEEDINGS, 2007, 4624 : 16 - +
  • [40] LOGICAL FORM - TYPES OF EVIDENCE
    CARLSON, GN
    LINGUISTICS AND PHILOSOPHY, 1983, 6 (03) : 295 - 317