Results 1  10
of
53
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 146 (3 self)
 Add to MetaCart
(Show Context)
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
Algebraic Reconstruction of Types and Effects
, 1991
"... We present the first algorithm for reconstructing the types and effects of expressions in the presence of first class procedures in a polymorphic typed language. Effects are static descriptions of the dynamic behavior of expressions. Just as a type describes what an expression computes, an effect de ..."
Abstract

Cited by 114 (6 self)
 Add to MetaCart
We present the first algorithm for reconstructing the types and effects of expressions in the presence of first class procedures in a polymorphic typed language. Effects are static descriptions of the dynamic behavior of expressions. Just as a type describes what an expression computes, an effect describes how an expression computes. Types are more complicated to reconstruct in the presence of effects because the algebra of effects induces complex constraints on both effects and types. In this paper we show how to perform reconstruction in the presence of such constraints with a new algorithm called algebraic reconstruction, prove that it is sound and complete, and discuss its practical import. This research was supported by DARPA under ONR Contract N0001489J1988. 1
What Are Principal Typings and What Are They Good For?
, 1995
"... We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property ..."
Abstract

Cited by 102 (0 self)
 Add to MetaCart
We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property provides elegant support for separate compilation, including "smartest recompilation" and incremental type inference, and for accurate type error messages. Moreover, it motivates a novel rule for typing recursive definitions that can type many examples of polymorphic recursion.
Haskell overloading is dexptimecomplete
 Information Processing Letters
, 1994
"... ..."
(Show Context)
The complexity of type inference for higherorder typed lambda calculi
 In. Proc. 18th ACM Symposium on the Principles of Programming Languages
, 1991
"... We analyse the computational complexity of type inference for untyped X,terms in the secondorder polymorphic typed Xcalculus (F2) invented by Girard and Reynolds, as well as higherorder extensions F3,F4,...,/ ^ proposed by Girard. We prove that recognising the i^typable terms requires exponential ..."
Abstract

Cited by 31 (12 self)
 Add to MetaCart
We analyse the computational complexity of type inference for untyped X,terms in the secondorder polymorphic typed Xcalculus (F2) invented by Girard and Reynolds, as well as higherorder extensions F3,F4,...,/ ^ proposed by Girard. We prove that recognising the i^typable terms requires exponential time, and for Fa the problem is nonelementary. We show as well a sequence of lower bounds on recognising the i^typable terms, where the bound for Fk+1 is exponentially larger than that for Fk. The lower bounds are based on generic simulation of Turing Machines, where computation is simulated at the expression and type level simultaneously. Nonaccepting computations are mapped to nonnormalising reduction sequences, and hence nontypable terms. The accepting computations are mapped to typable terms, where higherorder types encode reduction sequences, and firstorder types encode the entire computation as a circuit, based on a unification simulation of Boolean logic. A primary technical tool in this reduction is the composition of polymorphic functions having different domains and ranges. These results are the first nontrivial lower bounds on type inference for the Girard/Reynolds
Garbage Collection for StronglyTyped Languages using Runtime Type Reconstruction
 IN ACM CONFERENCE ON LISP AND FUNCTIONAL PROGRAMMING
, 1994
"... Garbage collectors perform two functions: liveobject detection and deadobject reclamation. In this paper, we present a new technique for liveobject detection based on runtime type reconstruction for a stronglytyped, polymorphic language. This scheme uses compiletime type information together ..."
Abstract

Cited by 30 (0 self)
 Add to MetaCart
Garbage collectors perform two functions: liveobject detection and deadobject reclamation. In this paper, we present a new technique for liveobject detection based on runtime type reconstruction for a stronglytyped, polymorphic language. This scheme uses compiletime type information together with the runtime tree of activation frames to determine the exact type of every object participating in the computation. These reconstructed types are then used to identify and traverse the live heap objects during garbage collection. We describe an implementation of our scheme for the Id parallel programming language compiled for the *T multiprocessor architecture. We present simulation studies that compare the performance of typereconstructing garbage collection with conservative garbage collection and compilerdirected storage reclamation.
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 27 (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.
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
(Show Context)
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. ...
Collecting More Garbage
 LISP 94
, 1994
"... We present a method, adapted to polymorphically typed functional languages, to detect and collect more garbage than existing GCs. It can be applied to strict or lazy higher order languages and to several garbage collection schemes. Our GC exploits the information on utility of arguments provided by ..."
Abstract

Cited by 17 (0 self)
 Add to MetaCart
(Show Context)
We present a method, adapted to polymorphically typed functional languages, to detect and collect more garbage than existing GCs. It can be applied to strict or lazy higher order languages and to several garbage collection schemes. Our GC exploits the information on utility of arguments provided by polymorphic types of functions. It is able to detect garbage that is still referenced from the stack and may collect useless parts of otherwise useful data structures. We show how to partially collect shared data structures and to extend the type system to infer more precise information. We also present how this technique can plug several common forms of space leaks.