Results 1  10
of
43
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
Putting Type Annotations to Work
, 1996
"... We study an extension of the HindleyMilner system with explicit type scheme annotations and type declarations. The system can express polymorphic function arguments, userdefined data types with abstract components, and structure types with polymorphic fields. More generally, all programs of the po ..."
Abstract

Cited by 94 (1 self)
 Add to MetaCart
We study an extension of the HindleyMilner system with explicit type scheme annotations and type declarations. The system can express polymorphic function arguments, userdefined data types with abstract components, and structure types with polymorphic fields. More generally, all programs of the polymorphic lambda calculus can be encoded by a translation between typing derivations. We show that type reconstruction in this system can be reduced to the decidable problem of firstorder unification under a mixed prefix.
Feature Constraint Logics for Unification Grammars
 Journal of Logic Programming
, 1992
"... This paper studies feature description languages that have been developed for use in unification grammars, logic programming and knowledge representation. The distinctive notational primitive of these languages are features that can be understood as unary partial functions on a domain of abstract ..."
Abstract

Cited by 83 (10 self)
 Add to MetaCart
This paper studies feature description languages that have been developed for use in unification grammars, logic programming and knowledge representation. The distinctive notational primitive of these languages are features that can be understood as unary partial functions on a domain of abstract objects. We show that feature description languages can be captured naturally as sublanguages of firstorder predicate logic with equality and show the equivalence of a loose Tarski semantics with a fixed feature graph semantics for quantifierfree constraints. For quantifierfree constraints we give a constraint solving method and show the NPcompleteness of satisfiability checking. For general feature constraints with quantifiers satisfiability is shown to be undecidable. Moreover, we investigate an extension of the logic with sort predicates and setdenoting expressions called feature terms.
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.
A Region Inference Algorithm
 ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS
, 1998
"... This article presents an algorithm which implements the specification. We prove that the algorithm is sound with respect to the region inference rules and that it always terminates even though the region inference rules permit polymorphic recursion in regions. The algorithm is the result of several ..."
Abstract

Cited by 70 (4 self)
 Add to MetaCart
This article presents an algorithm which implements the specification. We prove that the algorithm is sound with respect to the region inference rules and that it always terminates even though the region inference rules permit polymorphic recursion in regions. The algorithm is the result of several years of experiments with region inference algorithms in the ML Kit, a compiler from Standard ML to assembly language. We report on practical experience with the algorithm and give hints on how to implement it.
Implementation of the typed callbyvalue λcalculus using a stack of regions
 In ACM Symposium on Principles of Programming Languages
, 1994
"... We present a translation scheme for the polymorphically typed callbyvalue λcalculus. All runtime values, including function closures, are put into regions. The store consists of a stack of regions. Region inference and effect inference are used to infer where regions can be allocated and dealloc ..."
Abstract

Cited by 57 (0 self)
 Add to MetaCart
We present a translation scheme for the polymorphically typed callbyvalue λcalculus. All runtime values, including function closures, are put into regions. The store consists of a stack of regions. Region inference and effect inference are used to infer where regions can be allocated and deallocated. Recursive functions are handled using a limited form of polymorphic recursion. The translation is proved correct with respect to a store semantics, which models a regionbased runtime system. Experimental results suggest that regions tend to be small, that region allocation is frequent and that overall memory demands are usually modest, even without garbage collection. 1
A Theory of Stack Allocation in Polymorphically Typed Languages
, 1993
"... We present a stackallocation scheme for the callbyvalue lambda calculus typed according to Milner's polymorphic type discipline. All the values a program produces, including function closures, are put into regions at runtime. Regions are allocated and deallocated in a stacklike manner. Region in ..."
Abstract

Cited by 24 (6 self)
 Add to MetaCart
We present a stackallocation scheme for the callbyvalue lambda calculus typed according to Milner's polymorphic type discipline. All the values a program produces, including function closures, are put into regions at runtime. Regions are allocated and deallocated in a stacklike manner. Region inference and effect inference is used to infer where regions can be allocated and deallocated. By allowing a limited form of polymorphic recursion in region types, the region inference is able to distinguish between the lifetimes of different invocations of a function, even when the function is recursive. The region analysis is eager in its attempt to reclaim memory as quickly as possible. The main result of this report is that region inference is safe, a result which entails that regions really can be deallocated, when region inference says they can. We give detailed proofs of this claim, which (in various forms) has been advanced several times in the literature. An algorithm for implementi...
Inclusion Constraints over Nonempty Sets of Trees
, 1997
"... We present a new constraint system called INES. Its constraints are conjunctions of inclusions t1 `t2 between firstorder terms (without set operators) which are interpreted over nonempty sets of trees. The existing systems of set constraints can express INES constraints only if they include ne ..."
Abstract

Cited by 14 (5 self)
 Add to MetaCart
We present a new constraint system called INES. Its constraints are conjunctions of inclusions t1 `t2 between firstorder terms (without set operators) which are interpreted over nonempty sets of trees. The existing systems of set constraints can express INES constraints only if they include negation. Their satisfiability problem is NEXPTIMEcomplete. We present an incremental algorithm that solves the satisfiability problem of INES constraints in cubic time. We intend to apply INES constraints for type analysis for a concurrent constraint programming language.
BetaReduction As Unification
, 1996
"... this report, we use a lean version of the usual system of intersection types, whichwe call . Hence, UP is also an appropriate unification problem to characterize typability of terms in . Quite apart from the new light it sheds on fireduction, such an analysis turns out to have several othe ..."
Abstract

Cited by 13 (9 self)
 Add to MetaCart
this report, we use a lean version of the usual system of intersection types, whichwe call . Hence, UP is also an appropriate unification problem to characterize typability of terms in . Quite apart from the new light it sheds on fireduction, such an analysis turns out to have several other benefits
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.