TL;DR: A λ-calculus-based model for type systems that allows us to explore the interaction among the concepts of type, data abstraction, and polymorphism in a simple setting, unencumbered by complexities of production programming languages is developed.
Abstract: Our objective is to understand the notion of type in programming languages, present a model of typed, polymorphic programming languages that reflects recent research in type theory, and examine the relevance of recent research to the design of practical programming languages.Object-oriented languages provide both a framework and a motivation for exploring the interaction among the concepts of type, data abstraction, and polymorphism, since they extend the notion of type to data abstraction and since type inheritance is an important form of polymorphism. We develop a l-calculus-based model for type systems that allows us to explore these interactions in a simple setting, unencumbered by complexities of production programming languages.The evolution of languages from untyped universes to monomorphic and then polymorphic type systems is reviewed. Mechanisms for polymorphism such as overloading, coercion, subtyping, and parameterization are examined. A unifying framework for polymorphic type systems is developed in terms of the typed l-calculus augmented to include binding of types by quantification as well as binding of values by abstraction.The typed l-calculus is augmented by universal quantification to model generic functions with type parameters, existential quantification and packaging (information hiding) to model abstract data types, and bounded quantification to model subtypes and type inheritance. In this way we obtain a simple and precise characterization of a powerful type system that includes abstract data types, parametric polymorphism, and multiple inheritance in a single consistent framework. The mechanisms for type checking for the augmented l-calculus are discussed.The augmented typed l-calculus is used as a programming language for a variety of illustrative examples. We christen this language Fun because fun instead of l is the functional abstraction keyword and because it is pleasant to deal with.Fun is mathematically simple and can serve as a basis for the design and implementation of real programming languages with type facilities that are more powerful and expressive than those of existing programming languages. In particular, it provides a basis for the design of strongly typed object-oriented languages.
TL;DR: A reduction from the halting problem for two-counter Turing machines is used to show that the subtyping and typing relations of F?
Abstract: F? is a typed ?-calculus with subtyping and bounded second-order polymorphism. First introduced by Cardelli and Wegner, it has been widely studied as a core calculus for type systems with subtyping. We use a reduction from the halting problem for two-counter Turing machines to show that the subtyping and typing relations of F? are undecidable.
TL;DR: The authors give a formal semantics for the language Bounded Fun, which supports both parametric and subtype polymorphism and shows how to use partial equivalence relations to model inheritance in this language, which support the notion of subtype and record types.
Abstract: The authors give a formal semantics for the language Bounded Fun, which supports both parametric and subtype polymorphism. They show how to use partial equivalence relations to model inheritance in this language, which supports the notion of subtype and record types. A generalization of partial equivalence relations, known as omega -sets, is used in combination with modest sets to provide the first known model of Bounded Fun (with explicit polymorphism). Connections with previous work on the semantics of explicit parametric polymorphism is established by noting that the semantics of polymorphic types presented here (using dependent products) is isomorphic to that given by the intersection interpretation of polymorphism. >
TL;DR: In this paper, a simple collection of operations for creating and manipulating record structures, where records are intended as finite associations of values to labels, are defined, and a second-order type system over these operations supports both subtyping and polymorphism.
Abstract: We define a simple collection of operations for creating and manipulating record structures, where records are intended as finite associations of values to labels A second-order type system over these operations supports both subtyping and polymorphism We provide typechecking algorithms and limited semantic modelsOur approach unifies and extends previous notions of records, bounded quantification, record extension, and parametrization by row-variables The general aim is to provide foundations for concepts found in object-oriented languages, within a framework based on typed lambda-calculus
TL;DR: A normalizing rewriting system on proofs is defined, which transforms different proofs of the same typing judgement into a unique normal proof, with the further property that all the normal proofs assigning different types to a given term in a given environment differ only by a final application of the subsumption rule.
Abstract: A subtyping relation ≤ between types is often accompanied by a typing rule, called subsumption: if a term a has type T and T≤U, then a has type U. In presence of subsumption, a well-typed term does not codify its proof of well typing. Since a semantic interpretation is most naturally defined by induction on the structure of typing proofs, a problem of coherence arises: different typing proofs of the same term must have related meanings. We propose a proof-theoretical, rewriting approach to this problem. We focus on F≤, a second-order lambda calculus with bounded quantification, which is rich enough to make the problem interesting. We define a normalizing rewriting system on proofs, which transforms different proofs of the same typing judgement into a unique normal proof, with the further property that all the normal proofs assigning different types to a given term in a given environment differ only by a final application of the subsumption rule. This rewriting system is not defined on the proofs themselves but on the terms of an auxiliary type system, in which the terms carry complete information about their typing proof. This technique gives us three different results:— Any semantic interpretation is coherent if and only if our rewriting rules are satisfied as equations.— We obtain a proof of the existence of a minimum type for each term in a given environment.— From an analysis of the shape of normal form proofs, we obtain a deterministic typechecking algorithm, which is sound and complete by construction.