Results 1 - 10
of
13
A Calculus for Overload Functions with Subtyping
-
, 1992
"... We present a simple extension of typed -calculus where functions can be overloaded by putting different "branches of code" together. When the function is applied, the branch to execute is chosen according to a particular selection rule which depends on the type of the argument. The crucial featu ..."
Abstract
-
Cited by 131 (28 self)
- Add to MetaCart
We present a simple extension of typed -calculus where functions can be overloaded by putting different "branches of code" together. When the function is applied, the branch to execute is chosen according to a particular selection rule which depends on the type of the argument. The crucial feature of the present approach is that the branch selection depends on the "run-time type" of the argument, which may differ from its compile-time type, because of the existence of a subtyping relation among types. Hence overloading cannot be eliminated by a static analysis of code, but is an essential feature to be dealt with during computation. We obtain in this way a type-dependent calculus, which differs from the various -calculi where types do not play any role during computation. We prove Confluence and a generalized Subject-Reduction theorem for this calculus. We prove Strong Normalization for a "stratified" subcalculus. The definition of this calculus is guided by the understand...
Inheritance As Implicit Coercion
- Information and Computation
, 1991
"... . We present a method for providing semantic interpretations for languages with a type system featuring inheritance polymorphism. Our approach is illustrated on an extension of the language Fun of Cardelli and Wegner, which we interpret via a translation into an extended polymorphic lambda calculus. ..."
Abstract
-
Cited by 103 (3 self)
- Add to MetaCart
. We present a method for providing semantic interpretations for languages with a type system featuring inheritance polymorphism. Our approach is illustrated on an extension of the language Fun of Cardelli and Wegner, which we interpret via a translation into an extended polymorphic lambda calculus. Our goal is to interpret inheritances in Fun via coercion functions which are definable in the target of the translation. Existing techniques in the theory of semantic domains can be then used to interpret the extended polymorphic lambda calculus, thus providing many models for the original language. This technique makes it possible to model a rich type discipline which includes parametric polymorphism and recursive types as well as inheritance. A central difficulty in providing interpretations for explicit type disciplines featuring inheritance in the sense discussed in this paper arises from the fact that programs can type-check in more than one way. Since interpretations follow the type...
Coherence for Qualified Types
, 1993
"... The meaning of programs in a language with implicit overloading can be described by translating them into a second language that makes the use of overloading explicit. A single program may have many distinct translations and it is important to show that any two translations are semantically equivale ..."
Abstract
-
Cited by 82 (9 self)
- Add to MetaCart
The meaning of programs in a language with implicit overloading can be described by translating them into a second language that makes the use of overloading explicit. A single program may have many distinct translations and it is important to show that any two translations are semantically equivalent to ensure that the meaning of the original program is well-defined. This property is commonly known as coherence. This paper deals with an implicitly typed language that includes support for parametric polymorphism and overloading based on a system of qualified types. Typical applications include Haskell type classes, extensible records and subtyping. In the general case, it is possible to find examples for which the coherence property does not hold. Extending the development of a type inference algorithm for this language to include the calculation of translations, we give a simple syntactic condition on the principal type scheme of a term that is sufficient to guarantee coherence for a large class of programs. One of the most interesting aspects of this work is the use of terms in the target language to provide a semantic interpretation for the ordering relation between types that is used to establish the existence of principal types. On a practical level, our results explain the importance of unambiguous type schemes in Haskell.
A semantic basis for Quest
- JOURNAL OF FUNCTIONAL PROGRAMMING
, 1991
"... Quest is a programming language based on impredicative type quantifiers and subtyping within a three-level structure of kinds, types and type operators, and values. The semantics of Quest is rather challenging. In particular, difficulties arise when we try to model simultaneously features such as c ..."
Abstract
-
Cited by 63 (13 self)
- Add to MetaCart
Quest is a programming language based on impredicative type quantifiers and subtyping within a three-level structure of kinds, types and type operators, and values. The semantics of Quest is rather challenging. In particular, difficulties arise when we try to model simultaneously features such as contravariant function spaces, record types, subtyping, recursive types, and fixpoints. In this paper we describe in detail the type inference rules for Quest, and we give them meaning using a partial equivalence relation model of types. Subtyping is interpreted as in previous work by Bruce and Longo, but the interpretation of some aspects, namely subsumption, power kinds, and record subtyping, is novel. The latter is based on a new encoding of record types. We concentrate on modeling quantifiers and subtyping; recursion is the subject of current work.
Coinductive Axiomatization of Recursive Type Equality and Subtyping
, 1998
"... e present new sound and complete axiomatizations of type equality and subtype inequality for a first-order type language with regular recursive types. The rules are motivated by coinductive characterizations of type containment and type equality via simulation and bisimulation, respectively. The mai ..."
Abstract
-
Cited by 57 (1 self)
- Add to MetaCart
e present new sound and complete axiomatizations of type equality and subtype inequality for a first-order type language with regular recursive types. The rules are motivated by coinductive characterizations of type containment and type equality via simulation and bisimulation, respectively. The main novelty of the axiomatization is the fixpoint rule (or coinduction principle), which has the form A; P ` P A ` P (Fix) where P is either a type equality = 0 or type containment 0 and the proof of the premise must be contractive in a formal sense. In particular, a proof of A; P ` P using the assumption axiom is not contractive. The fixpoint rule embodies a finitary coinduction principle and thus allows us to capture a coinductive relation in the fundamentally inductive framework of inference systems. The new axiomatizations are more concise than previous axiomatizations, particularly so for type containment since no separate axiomatization of type equality is required, as in A...
Divergence of F≤ Type Checking
"... System F≤ is an extension of second-order typed lambda calculus, where a subtype hierarchy among types is defined, and bounded second-order lambda abstraction is allowed. This language is a basis for much of the current research on integration of typed functional languages with subtypes and inherita ..."
Abstract
-
Cited by 14 (4 self)
- Add to MetaCart
System F≤ is an extension of second-order typed lambda calculus, where a subtype hierarchy among types is defined, and bounded second-order lambda abstraction is allowed. This language is a basis for much of the current research on integration of typed functional languages with subtypes and inheritance. An algorithm to perform type checking for F≤ expressions has been known since the language Fun was defined. The algorithm has been proved complete, by the author and P.-L. Curien, which means that it is a semi-decision procedure for the type-checking problem. In this paper we show that this algorithm is not a decision procedure, by exhibiting a term which makes it diverge. This result was the basis of Pierce's proof of undecidability of typing for F≤. We study the behavior of the algorithm to show that our diverging judgement is in some sense contained in any judgement which makes the algorithm diverge. On the basis of this result, and of other results in the paper, we claim that the c...
Completely Bounded Quantification is Decidable
- In ACM SIGPLAN Workshop on ML and its Applications
, 1992
"... This paper proves the decidability of subtyping for F when the bounds on polymorphic types do not contain Top (i.e., in all types of the form 8ff!:ø 1 :ø 2 , ø 1 does not contain Top). This general restriction is subsequently relaxed to allow unbounded quantification. 1 Introduction F [CW85,CG] is ..."
Abstract
-
Cited by 13 (3 self)
- Add to MetaCart
This paper proves the decidability of subtyping for F when the bounds on polymorphic types do not contain Top (i.e., in all types of the form 8ff!:ø 1 :ø 2 , ø 1 does not contain Top). This general restriction is subsequently relaxed to allow unbounded quantification. 1 Introduction F [CW85,CG] is a typed -calculus with subtyping and bounded second-order polymorphism. The importance of F in programming language design is that it provides a simple context for studying the typing problems that arise when subtyping and bounded quantification are added to polymorphic languages such as ML. Curien and Ghelli [CG] recently developed a subtyping algorithm for F and proved its partial correctness. Subsequently, Ghelli [Ghe90] presented a termination proof for this algorithm. A mistake was discovered in this termination proof, following which Pierce [Pie92] presented a proof showing that the subtyping problem for general F types is undecidable. This paper shows how one can make the subtyping p...
Foundations for the Implementation of Higher-Order Subtyping
, 1997
"... We show how to implement a calculus with higher-order subtyping and subkinding by replacing uses of implicit subsumption with explicit coercions. To ensure this can be done, a polymorphic function is adjusted to take, as an additional argument, a proof that its type constructor argument has the desi ..."
Abstract
-
Cited by 12 (6 self)
- Add to MetaCart
We show how to implement a calculus with higher-order subtyping and subkinding by replacing uses of implicit subsumption with explicit coercions. To ensure this can be done, a polymorphic function is adjusted to take, as an additional argument, a proof that its type constructor argument has the desired kind. Such a proof is extracted from the derivation of a kinding judgement and may in turn require proof coercions, which are extracted from subkinding judgements. This technique is formalized as a type-directed translation from a calculus of higher-order subtyping to a subtyping-free calculus. This translation generalizes an existing result for second-order subtyping calculi (such as F ). We also discuss two interpretations of subtyping, one that views it as type inclusion and another that views it as the existence of a well-behaved coercion, and we show, by a type-theoretic construction, that our translation is the minimum consequence of shifting from the inclusion interpretation to th...
ML typing, explicit polymorphism and qualified types
- In TACS '94: Conference on theoretical aspects of computer software
, 1994
"... Abstract. The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as core-ML, whose evaluation could be guaranteed not to “go wrong”. In subsequent work, the terms of core-ML have also been viewed as a ‘convenient shorth ..."
Abstract
-
Cited by 10 (1 self)
- Add to MetaCart
Abstract. The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as core-ML, whose evaluation could be guaranteed not to “go wrong”. In subsequent work, the terms of core-ML have also been viewed as a ‘convenient shorthand ’ for programs in typed languages. Notable examples include studies of ML polymorphism and investigations of overloading, motivated by the use of type classes in Haskell. In this paper, we show how qualified types, originally developed to study type class overloading, can be used to explore the relationship between core-ML programs and their translations in an explicitly typed language. Viewing these two distinct applications as instances of a single framework has obvious advantages; many of the results that have been established for one can also be applied to the other. We concentrate particularly on the issue of coherence, establishing sufficient conditions to guarantee that all possible translations of a given core-ML term are equivalent. One of the key features of this work is the use of conversions, similar to Mitchell’s retyping functions, to provide an interpretation of the ordering between type schemes in the target language. 1
Subtyping F-bounded types
- In ANSA Workshop on F-bounded quantification
, 1992
"... We look at the subtyping problem for polymorphic types with F-bounded quantification i.e. polymorphic types where a bound can be imposed on the type argument (by the subtype relation) , and the bound is permitted to refer to the variable itself. We look at different possibilities for the rule and c ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
We look at the subtyping problem for polymorphic types with F-bounded quantification i.e. polymorphic types where a bound can be imposed on the type argument (by the subtype relation) , and the bound is permitted to refer to the variable itself. We look at different possibilities for the rule and compare them. Introduction Bounded quantification is a notion that combines the ideas of subtyping and polymorphism. It was first introduced by Cardelli and Wegner [CW85] in their language Fun. With bounded quantification, one can express a term that is polymorphic over all the subtypes of a given type. We use the notation "t !:T:e" for such a term. The "bound" T , in essence, specifies the assumptions that have been made about the type t in the code e. We write the type of this term as "8t !:T:T e " where T e is the type of the expression e. Canning etal [CCH + 89] have shown that in the bounded polymorphic type 8t !:F:T , it is useful to be able to allow F to refer to the type variable ...

