Title
Logical types for untyped languages
Abstract
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.
Year
DOI
Venue
2010
10.1145/1863543.1863561
Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
Keywords
Field
DocType
data structure,propositional logic,logic,type system
Data structure,Programming language,Concurrency,Computer science,Erlang (programming language),Proof theory,Propositional calculus,Type theory,Theoretical computer science,Predicate (grammar),Formal methods
Conference
Volume
Issue
ISSN
45
9
0362-1340
Citations 
PageRank 
References 
41
1.53
17
Authors
2
Name
Order
Citations
PageRank
Sam Tobin-Hochstadt139124.82
Matthias Felleisen23001272.57