Results 1  10
of
15
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
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 70 (5 self)
 Add to MetaCart
(Show Context)
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 first to resolve whether these problems are decidable for System F. This report proves that type checking in F is undecidable, by a reduction from semiunification, and that typability in F is undecidable, by a reduction from type checking. Because there is an easy reduction from typability to type checking, the two problems are equivalent. The reduction from type checking to typability uses a novel method to construct lambda terms that simulate arbitrarily chosen type environments. All the results also hold for the lambdaIotacalculus.
Closure Analysis in Constraint Form
 ACM Transactions on Programming Languages and Systems
, 1995
"... Interpretation Bondorf's definition can be simplified considerably. To see why, consider the second component of CMap(E) \Theta CEnv(E). This component is updated only in Closure Analysis in Constraint Form \Delta 9 b(E 1 @ i E 2 )¯ae and read only in b(x l )¯ae. The key observation is that ..."
Abstract

Cited by 63 (5 self)
 Add to MetaCart
Interpretation Bondorf's definition can be simplified considerably. To see why, consider the second component of CMap(E) \Theta CEnv(E). This component is updated only in Closure Analysis in Constraint Form \Delta 9 b(E 1 @ i E 2 )¯ae and read only in b(x l )¯ae. The key observation is that both these operations can be done on the first component instead. Thus, we can omit the use of CEnv(E). By rewriting Bondorf's definition according to this observation, we arrive at the following definition. As with Bondorf's definition, we assume that all labels are distinct. Definition 2.3.1. We define m : (E : ) ! CMap(E) ! CMap(E) m(x l )¯ = ¯ m( l x:E)¯ = (m(E)¯) t h[[ l ]] 7! flgi m(E 1 @ i E 2 )¯ = (m(E 1 )¯) t (m(E 2 )¯) t F l2¯(var(E1 )) (h[[ l ]] 7! ¯(var(E 2 ))i t h[[@ i ]] 7! ¯(var(body(l)))i) . We can now do closure analysis of E by computing fix(m(E)). A key question is: is the simpler abstract interpretation equivalent to Bondorf's? We might attempt to prove this u...
Unification and ML Type Reconstruction
, 1991
"... We study the complexity of type reconstruction for a core fragment of ML with lambda abstraction, function application, and the polymorphic let declaration. We derive exponential upper and lower bounds on recognizing the typable core ML expressions. Our primary technical tool is unification of succi ..."
Abstract

Cited by 44 (12 self)
 Add to MetaCart
We study the complexity of type reconstruction for a core fragment of ML with lambda abstraction, function application, and the polymorphic let declaration. We derive exponential upper and lower bounds on recognizing the typable core ML expressions. Our primary technical tool is unification of succinctly represented type expressions. After observing that core ML expressions, of size n, can be typed in DTIME(2 n ), we exhibit two different families of programs whose principal types grow exponentially. We show how to exploit the expressiveness of the letpolymorphism in these constructions to derive lower bounds on deciding typability: one leads naturally to NPhardness and the other to DTIME(2 n k )hardness for each integer k 1. Our generic simulation of any exponential time Turing Machine by ML type reconstruction may be viewed as a nonstandard way of computing with types. Our worstcase lower bounds stand in contrast to practical experience, which suggests that commonly used al...
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 32 (7 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
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
(Show Context)
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
ML^F  Raising ML to the Power of System F
 In ICFP ’03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming
, 2003
"... We propose a type system ML F that generalizes ML with firstclass polymorphism as in System F. We perform partial type reconstruction. As in ML and in opposition to System F, each typable expression admits a principal type, which can be inferred. Furthermore, all expressions of ML are welltyped, ..."
Abstract

Cited by 18 (1 self)
 Add to MetaCart
We propose a type system ML F that generalizes ML with firstclass polymorphism as in System F. We perform partial type reconstruction. As in ML and in opposition to System F, each typable expression admits a principal type, which can be inferred. Furthermore, all expressions of ML are welltyped, with a possibly more general type than in ML, without any need for type annotation. Only arguments of functions that are used polymorphically must be annotated, which allows to type all expressions of System F as well.
Constructing type systems over an operational semantics
 Journal of Symbolic Computation
, 1992
"... Type theories in the sense of MartinLof and the NuPRL system are based on taking as primitive a typefree programming language given by an operational semantics, and defining types as partial equivalence relations on the set of closed terms. The construction of a type system is based on a general f ..."
Abstract

Cited by 13 (0 self)
 Add to MetaCart
Type theories in the sense of MartinLof and the NuPRL system are based on taking as primitive a typefree programming language given by an operational semantics, and defining types as partial equivalence relations on the set of closed terms. The construction of a type system is based on a general form of inductive definition that may either be taken as acceptable in its own right, or further explicated in terms of other patterns of induction. One such account, based on a general theory of inductivelydefined relations, was given by Allen. An alternative account, based on an essentially settheoretic argument, is presented. 1
STORAGE OPERATORS and ∀POSITIVE TYPES in TTR TYPE SYSTEM
"... In 1990, J.L. Krivine introduced the notion of storage operator to simulate ”call by value ” in the ”call by name” strategy. J.L. Krivine has shown that, using Gődel translation of classical into intuitionitic logic, we can find a simple type for the storage operators in AF 2 type system. This paper ..."
Abstract
 Add to MetaCart
(Show Context)
In 1990, J.L. Krivine introduced the notion of storage operator to simulate ”call by value ” in the ”call by name” strategy. J.L. Krivine has shown that, using Gődel translation of classical into intuitionitic logic, we can find a simple type for the storage operators in AF 2 type system. This paper studies the ∀positive types (the universal second order quantifier appears positively in these types), and the Gődel transformations (a generalization of classical Gődel translation) of T T R type system. We generalize, by using syntaxical methods, the J.L. Krivine’s Theorem about these types and for these transformations. We give a proof of this result in the case of the type of recursive integers.