Type systems based on the concept of intersection types 3, 4, 5] have been extensively studied in recent years, both as tools for the analysis of the pure-calculus and, more recently, as the basis for practical programming languages such as Forsythe 16]. The dual construction, union types, also appears to be of potential practical interest. For example, by expressing more reened types for functions, union types allow a restricted form of abstract interpretation to be performed during typechecking. This report summarizes the results of a preliminary investigation of a simple typed-calculus with intersection and union types. Section 1 introduces the concrete syntax and typing rules of the language. Section 2 presents a number of small programs illustrating various aspects of the language and indicating some of its expressive power. Section 3 gives a semantics in the form of rules for equality between typed terms and exhibits a PER model validating these rules. Section 4 discusses the decidability of typechecking. Section 5 relates this work to some other recent investigations of similar formulations of union types. Section 6 describes planned future work. N.b. This report describes work in a preliminary stage of development. It is likely that further investigation of both semantic considerations (e.g. the validity of deMorgan's laws and the general categorical characterization of union types) and algorithmic issues (e.g. the correctness and eeciency of the typechecking procedure proposed here) will lead to substantial changes in the formulation of the language and its interpretation. 1 Syntax 1.1 Notational Conventions This section introduces the notational conventions used in the rest of the report and deenes the concrete syntax of a simple typed-calculus _ (\lambda union") with intersection and union types. b range over terms; x ranges over a set Var of variables.
[1]
Daniel Leivant.
Discrete polymorphism
,
1990,
LISP and Functional Programming.
[2]
John C. Reynolds,et al.
Preliminary design of the programming language Forsythe
,
1988
.
[3]
Benjamin C. Pierce,et al.
A decision procedure for the subtype relation on intersection types with bounded variables
,
1989
.
[4]
Giuseppe Rosolini,et al.
Extensional PERs
,
1992,
Inf. Comput..
[5]
G.D. Plotkin,et al.
LCF Considered as a Programming Language
,
1977,
Theor. Comput. Sci..
[6]
Kim B. Bruce,et al.
A modest model of records, inheritance and bounded quantification
,
1988,
[1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.
[7]
Mario Coppo,et al.
Principal type-schemes and lambda-calculus semantics
,
1980
.
[8]
F. Cardone,et al.
Two extensions of Curry's type inference system
,
1990
.
[9]
Mariangiola Dezani-Ciancaglini,et al.
An extension of the basic functionality theory for the λ-calculus
,
1980,
Notre Dame J. Formal Log..