Results 1 
8 of
8
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
Typability and Type Checking in System F Are Equivalent and Undecidable
 Annals of Pure and Applied Logic
, 1998
"... Girard and Reynolds independently invented System F (a.k.a. the secondorder polymorphically typed lambda calculus) to handle problems in logic and computer programming language design, respectively. Viewing F in the Curry style, which associates types with untyped lambda terms, raises the questions ..."
Abstract

Cited by 58 (4 self)
 Add to MetaCart
Girard and Reynolds independently invented System F (a.k.a. the secondorder polymorphically typed lambda calculus) to handle problems in logic and computer programming language design, respectively. Viewing F in the Curry style, which associates types with untyped lambda terms, raises the questions of typability and type checking . Typability asks for a term whether there exists some type it can be given. Type checking asks, for a particular term and type, whether the term can be given that type. The decidability of these problems has been settled for restrictions and extensions of F and related systems and complexity lowerbounds have been determined for typability in F, but this report is the rst to resolve whether these problems are decidable for System F. This report proves that type checking in F is undecidable, by a reduction from semiuni cation, and that typability in F is undecidable, by a reduction from type checking. Because there is an easy reduction from typability to typ...
Type inference and semiunification
 In Proceedings of the ACM Conference on LISP and Functional Programming (LFP ) (Snowbird
, 1988
"... In the last ten years declarationfree programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically type ..."
Abstract

Cited by 25 (6 self)
 Add to MetaCart
In the last ten years declarationfree programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically typed languages (Algol68, Pascal). These polymorphic languages can be type checked at compile time, yet allow functions whose arguments range over a variety of types. We investigate several polymorphic type systems, the most powerful of which, termed MilnerMycroft Calculus, extends the socalled letpolymorphism found in, e.g., ML with a polymorphic typing rule for recursive definitions. We show that semiunification, the problem of solving inequalities over firstorder terms, characterizes type checking in the MilnerMycroft Calculus to polynomial time, even in the restricted case where nested definitions are disallowed. This permits us to extend some infeasibility results for related combinatorial problems to type inference and to correct several claims and statements in the literature. We prove the existence of unique most general solutions of term inequalities, called most general semiunifiers, and present an algorithm for computing them that terminates for all known inputs due to a novel “extended occurs check”. We conjecture this algorithm to be
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.
A General Theory of SemiUnification
, 1993
"... Various restrictions on the terms allowed for substitution give rise to different cases of semiunification. Semiunification on finite and regular terms has already been considered in the literature. We introduce a general case of semiunification where substitutions are allowed on nonregular term ..."
Abstract
 Add to MetaCart
Various restrictions on the terms allowed for substitution give rise to different cases of semiunification. Semiunification on finite and regular terms has already been considered in the literature. We introduce a general case of semiunification where substitutions are allowed on nonregular terms, and we prove the equivalence of this general case to a wellknown undecidable data base dependency problem , thus establishing the undecidability of general semiunification. We present a unified way of looking at the various problems of semiunification. We give some properties that are common to all the cases of semiunification. We also the principality property and the solution set for those problems. We prove that semiunification on general terms has the principality property. Finally, we present a recursive inseparability result between semiunification on regular terms and semiunification on general terms. Partly supported by NSF grant CCR9113196. Address: Department of Compu...
Extending the Type Checker of SML by Polymorphic Recursion: A Correctness Proof
, 1997
"... . We describe an extension of the type inference of Standard ML that covers polymorphic recursion. For any term t of SML, a type scheme ø and a system L of inequations between (simple) types is computed, such that the types of t are the instances of ø by substitutions S that satisfy L. The inequat ..."
Abstract
 Add to MetaCart
. We describe an extension of the type inference of Standard ML that covers polymorphic recursion. For any term t of SML, a type scheme ø and a system L of inequations between (simple) types is computed, such that the types of t are the instances of ø by substitutions S that satisfy L. The inequation constraints L are computed bottomup in a modification of Milner's algorithm W . The correctness proof is complicated by the fact that unknowns for polytypes are needed  in contrast to type inference for SML. 1 Introduction Functional programming languages like ML[19], Miranda[23], or Haskell[?], have made statically typed polymorphic languages popular. Their success depends to a large extend on the following properties of the underlying type system of Damas/Milner[2]:  typability of an untyped term is decidable,  for typable terms, a schema representing the set of its types can be inferred automatically,  the declaration of polymorphic values by the user is supported,  welltyped...
Simultaneous Rigid EUnification is not so Simple
, 1995
"... Simultaneous rigid Eunification has been introduced in the area of theorem proving with equality. It is used in extension procedures, like the tableau method or the connection method. Many articles in this area tacitly assume the existence of an algorithm for simultaneous rigid Eunification. There ..."
Abstract
 Add to MetaCart
Simultaneous rigid Eunification has been introduced in the area of theorem proving with equality. It is used in extension procedures, like the tableau method or the connection method. Many articles in this area tacitly assume the existence of an algorithm for simultaneous rigid Eunification. There were several faulty proofs of the decidability of this problem. In this article we prove several results about the simultaneous rigid Eunification. Two results are reductions of known problems to simultaneous rigid Eunification. Both these problems are very hard. The word equation solving (unification under associativity) is reduced to the monadic case of simultaneous rigid Eunification. The variablebounded semiunification problem is reduced to the general simultaneous rigid Eunification. The word equation problem used in the first reduction is known to be decidable, but the decidability result is extremely nontrivial. As for the variablebounded semiunification, its decidability is ...
A Decidable Case of the SemiUnification Problem (Draft Version)
, 1991
"... Semiunification is a common generalization of unification and matching. The semiunification problem is to decide solvability of finite sets of equations s = t and inequations ˜s ≤i ˜t between firstorder terms, with different inequality relations ≤i, i ∈ I. A solution consists of a substitution T0 ..."
Abstract
 Add to MetaCart
Semiunification is a common generalization of unification and matching. The semiunification problem is to decide solvability of finite sets of equations s = t and inequations ˜s ≤i ˜t between firstorder terms, with different inequality relations ≤i, i ∈ I. A solution consists of a substitution T0 and residual substitutions Ti, i ∈ I, such that, respectively, T0(s) = T0(t) and Ti(T0(˜s)) = T0(˜t). The semiunification problem has recently been shown to be undecidable [9]. We present a new subclass of decidable semiunification problems, properly containing those over monadic languages. In our ‘quasimonadic ’ problems, function symbols may be of arity> 1, but only terms with at most one free variable are admitted. 1