Results 1  10
of
11
Type Inference with Polymorphic Recursion
 Transactions on Programming Languages and Systems
, 1991
"... The DamasMilner Calculus is the typed Acalculus underlying the type system for ML and several other strongly typed polymorphic functional languages such as Mirandal and Haskell. Mycroft has extended its problematic monomorphic typing rule for recursive definitions with a polymorphic typing rule. H ..."
Abstract

Cited by 135 (0 self)
 Add to MetaCart
The DamasMilner Calculus is the typed Acalculus underlying the type system for ML and several other strongly typed polymorphic functional languages such as Mirandal and Haskell. Mycroft has extended its problematic monomorphic typing rule for recursive definitions with a polymorphic typing rule. He proved the resulting type system, which we call the MilnerMycroft Calculus, sound with respect to Milner’s semantics, and showed that it preserves the principal typing property of the DamasMilner Calculus. The extension is of practical significance in typed logic programming languages and, more generally, in any language with (mutually) recursive definitions. In this paper we show that the type inference problem for the MilnerMycroft Calculus is logspace equivalent to semiunification, the problem of solving subsumption inequations between firstorder terms. This result has been proved independently by Kfoury et al. In connection with the recently established undecidability of semiunification this implies that typability in the MilnerMycroft Calculus is undecidable. We present some reasons why type inference with polymorphic recursion appears to be practical despite its undecidability. This also sheds some light on the observed practicality of ML
A direct algorithm for type inference in the rank2 fragment of the secondorder λcalculus
, 1993
"... We study the problem of type inference for a family of polymorphic type disciplines containing the power of CoreML. This family comprises all levels of the stratification of the secondorder lambdacalculus by "rank" of types. We show that typability is an undecidable problem at every rank k >= 3 o ..."
Abstract

Cited by 78 (14 self)
 Add to MetaCart
We study the problem of type inference for a family of polymorphic type disciplines containing the power of CoreML. This family comprises all levels of the stratification of the secondorder lambdacalculus by "rank" of types. We show that typability is an undecidable problem at every rank k >= 3 of this stratification. While it was already known that typability is decidable at rank 2, no direct and easytoimplement algorithm was available. To design such an algorithm, we develop a new notion of reduction and show howto use it to reduce the problem of typability at rank 2 to the problem of acyclic semiunification. A byproduct of our analysis is the publication of a simple solution procedure for acyclic semiunification.
Programming with Intersection Types and Bounded Polymorphism
, 1991
"... representing the official policies, either expressed or implied, of the U.S. Government. ..."
Abstract

Cited by 67 (4 self)
 Add to MetaCart
representing the official policies, either expressed or implied, of the U.S. Government.
On the undecidability of partial polymorphic type reconstruction
 FUNDAMENTA INFORMATICAE
, 1992
"... We prove that partial type reconstruction for the pure polymorphic *calculus is undecidable by a reduction from the secondorder unification problem, extending a previous result by H.J. Boehm. We show further that partial type reconstruction remains undecidable even in a very small predicative f ..."
Abstract

Cited by 27 (0 self)
 Add to MetaCart
We prove that partial type reconstruction for the pure polymorphic *calculus is undecidable by a reduction from the secondorder unification problem, extending a previous result by H.J. Boehm. We show further that partial type reconstruction remains undecidable even in a very small predicative fragment of the polymorphic *calculus, which implies undecidability of partial type reconstruction for * ML as introduced by Harper, Mitchell, and Moggi.
Rank 2 Type Systems and Recursive Definitions
, 1995
"... We demonstrate an equivalence between the rank 2 fragments of the polymorphic lambda calculus (System F) and the intersection type discipline: exactly the same terms are typable in each system. An immediate consequence is that typability in the rank 2 intersection system is DEXPTIMEcomplete. We int ..."
Abstract

Cited by 26 (1 self)
 Add to MetaCart
We demonstrate an equivalence between the rank 2 fragments of the polymorphic lambda calculus (System F) and the intersection type discipline: exactly the same terms are typable in each system. An immediate consequence is that typability in the rank 2 intersection system is DEXPTIMEcomplete. We introduce a rank 2 system combining intersections and polymorphism, and prove that it types exactly the same terms as the other rank 2 systems. The combined system suggests a new rule for typing recursive definitions. The result is a rank 2 type system with decidable type inference that can type some interesting examples of polymorphic recursion. Finally,we discuss some applications of the type system in data representation optimizations such as unboxing and overloading.
Rank 2 Intersection Type Assignment in Term Rewriting Systems
, 1996
"... A notion of type assignment on Curryfied Term Rewriting Systems is introduced that uses Intersection Types of Rank 2, and in which all function symbols are assumed to have a type. Type assignment will consist of specifying derivation rules that describe how types can be assigned to terms, using the ..."
Abstract

Cited by 23 (15 self)
 Add to MetaCart
A notion of type assignment on Curryfied Term Rewriting Systems is introduced that uses Intersection Types of Rank 2, and in which all function symbols are assumed to have a type. Type assignment will consist of specifying derivation rules that describe how types can be assigned to terms, using the types of function symbols. Using a modified unification procedure, for each term the principal pair (of basis and type) will be defined in the following sense: from these all admissible pairs can be generated by chains of operations on pairs, consisting of the operations substitution, copying, and weakening. In general, given an arbitrary typeable CuTRS, the subject reduction property does not hold. Using the principal type for the lefthand side of a rewrite rule, a sufficient and decidable condition will be formulated that typeable rewrite rules should satisfy in order to obtain this property. Introduction In the recent years, several paradigms have been investigated for the implementatio...
Relating Typability and Expressiveness in FiniteRank Intersection Type Systems (Extended Abstract)
 In Proc. 1999 Int’l Conf. Functional Programming
, 1999
"... We investigate finiterank intersection type systems, analyzing the complexity of their type inference problems and their relation to the problem of recognizing semantically equivalent terms. Intersection types allow something of type T1 /\ T2 to be used in some places at type T1 and in other places ..."
Abstract

Cited by 22 (9 self)
 Add to MetaCart
We investigate finiterank intersection type systems, analyzing the complexity of their type inference problems and their relation to the problem of recognizing semantically equivalent terms. Intersection types allow something of type T1 /\ T2 to be used in some places at type T1 and in other places at type T2 . A finiterank intersection type system bounds how deeply the /\ can appear in type expressions. Such type systems enjoy strong normalization, subject reduction, and computable type inference, and they support a pragmatics for implementing parametric polymorphism. As a consequence, they provide a conceptually simple and tractable alternative to the impredicative polymorphism of System F and its extensions, while typing many more programs than the HindleyMilner type system found in ML and Haskell. While type inference is computable at every rank, we show that its complexity grows exponentially as rank increases. Let K(0, n) = n and K(t + 1, n) = 2^K(t,n); we prove that recognizing the pure lambdaterms of size n that are typable at rank k is complete for dtime[K(k1, n)]. We then consider the problem of deciding whether two lambdaterms typable at rank k have the same normal form, Generalizing a wellknown result of Statman from simple types to finiterank intersection types. ...
Typability and Type Checking in the SecondOrder lambdaCalculus Are Equivalent and Undecidable
, 1993
"... We consider the problems of typability and type checking in the Girard/Reynolds secondorder polymorphic typedcalculus, for which we use the short name "System F" and which we use in the "Curry style" where types are assigned to pureterms. These problems have been considered and proven to be d ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
We consider the problems of typability and type checking in the Girard/Reynolds secondorder polymorphic typedcalculus, for which we use the short name "System F" and which we use in the "Curry style" where types are assigned to pureterms. These problems have been considered and proven to be decidable or undecidable for various restrictions and extensions of System F and other related systems, and lowerbound complexity results for System F have been achieved, but they have remained "embarrassing open problems" 3 for System F itself. We first prove that type checking in System F is undecidable by a reduction from semiunification. We then prove typability in System F is undecidable by a reduction from type checking. Since the reverse reduction is already known, this implies the two problems are equivalent. The second reduction uses a novel method of constructingterms such that in all type derivations, specific bound variables must always be assigned a specific type. Using this technique, we can require that specif subterms must be typable using a specific, fixed type assignment in order for the entire term to be typable at all. Any desired type assignment maybe simulated. We develop this method, which we call \constants for free", for both the K and I calculi.
Rank 2 Types for Term Graph Rewriting (Extended Abstract)
"... We define a notion of type assignment with polymorphic intersection types of rank 2 fora term graph rewriting language that expresses sharing and cycles. We show that type assignment is decidable through defining, using the extended notion of unification from [5],a notion of principal pair which gen ..."
Abstract

Cited by 4 (4 self)
 Add to MetaCart
We define a notion of type assignment with polymorphic intersection types of rank 2 fora term graph rewriting language that expresses sharing and cycles. We show that type assignment is decidable through defining, using the extended notion of unification from [5],a notion of principal pair which generalizes ml's principal type property.
Polymorphic Intersection Type Assignment for Rewite Systems with Intersection and betarule (Extended Abstract)
 IN TYPES’99. LNCS
, 2000
"... We define two type assignment systems for firstorder rewriting extended with application,abstraction, andreduction (TRS). The types used in these systems are a combination of (free) intersection and polymorphic types. The first system is the general one, for which we prove a subject reduction t ..."
Abstract

Cited by 4 (2 self)
 Add to MetaCart
We define two type assignment systems for firstorder rewriting extended with application,abstraction, andreduction (TRS). The types used in these systems are a combination of (free) intersection and polymorphic types. The first system is the general one, for which we prove a subject reduction theorem and show that all typeable terms are strongly normalisable. The second is a decidable subsystem of the first, by restricting types to Rank 2. For this system we define, using an extended notion of unification, a notion of principal type, and show that type assignment is decidable.