Results 1  10
of
109
A theory of type polymorphism in programming
 Journal of Computer and System Sciences
, 1978
"... The aim of this work is largely a practical one. A widely employed style of programming, particularly in structureprocessing languages which impose no discipline of types, entails defining procedures which work well on objects of a wide variety. We present a formal type discipline for such polymorp ..."
Abstract

Cited by 939 (0 self)
 Add to MetaCart
The aim of this work is largely a practical one. A widely employed style of programming, particularly in structureprocessing languages which impose no discipline of types, entails defining procedures which work well on objects of a wide variety. We present a formal type discipline for such polymorphic procedures in the context of a simple programming language, and a compile time typechecking algorithm w which enforces the discipline. A Semantic Soundness Theorem (based on a formal semantics for the language) states that welltype programs cannot “go wrong ” and a Syntactic Soundness Theorem states that if fl accepts a program then it is well typed. We also discuss extending these results to richer languages; a typechecking algorithm based on w is in fact already implemented and working, for the metalanguage ML in the Edinburgh LCF system, 1.
A Syntactic Approach to Type Soundness
 Information and Computation
, 1992
"... We present a new approach to proving type soundness for Hindley/Milnerstyle polymorphic type systems. The keys to our approach are (1) an adaptation of subject reduction theorems from combinatory logic to programming languages, and (2) the use of rewriting techniques for the specification of the la ..."
Abstract

Cited by 538 (21 self)
 Add to MetaCart
We present a new approach to proving type soundness for Hindley/Milnerstyle polymorphic type systems. The keys to our approach are (1) an adaptation of subject reduction theorems from combinatory logic to programming languages, and (2) the use of rewriting techniques for the specification of the language semantics. The approach easily extends from polymorphic functional languages to imperative languages that provide references, exceptions, continuations, and similar features. We illustrate the technique with a type soundness theorem for the core of Standard ML, which includes the first type soundness proof for polymorphic exceptions and continuations. 1 Type Soundness Static type systems for programming languages attempt to prevent the occurrence of type errors during execution. A definition of type error depends on a specific language and type system, but always includes the use of a function on arguments for which it is not defined, and the attempted application of a nonfunction. ...
Type Inclusion Constraints and Type Inference
 In Proceedings of the 1993 Conference on Functional Programming Languages and Computer Architecture
, 1993
"... We present a general algorithm for solving systems of inclusion constraints over type expressions. The constraint language includes function types, constructor types, and liberal intersection and union types. We illustrate the application of our constraint solving algorithm with a type inference sys ..."
Abstract

Cited by 214 (19 self)
 Add to MetaCart
We present a general algorithm for solving systems of inclusion constraints over type expressions. The constraint language includes function types, constructor types, and liberal intersection and union types. We illustrate the application of our constraint solving algorithm with a type inference system for the lambda calculus with constants. In this system, every pure lambda term has a (computable) type and every term typable in the Hindley/Milner system has all of its Hindley/Milner types. Thus, the inference system is an extension of the Hindley/Milner system that can type a very large set of lambda terms. 1 Introduction Type inference systems for functional languages are based on solving systems of type constraints. The best known and most widely used type inference algorithm was first discovered by Hindley and later independently by Milner [Hin69, Mil78]. In its simplest form, the algorithm generates type equations from the program text and then solves the equations. If the equati...
Introduction to Lambda Calculus
, 1994
"... ion is said to bind the free variable x in M . E.g. we say that x:yx has x as bound and y as free variable. Substitution [x := N ] is only performed in the free occurrences of x: yx(x:x)[x := N ] yN(x:x): In calculus there is a similar variable binding. In R b a f(x; y)dx the variable x is bou ..."
Abstract

Cited by 183 (4 self)
 Add to MetaCart
ion is said to bind the free variable x in M . E.g. we say that x:yx has x as bound and y as free variable. Substitution [x := N ] is only performed in the free occurrences of x: yx(x:x)[x := N ] yN(x:x): In calculus there is a similar variable binding. In R b a f(x; y)dx the variable x is bound and y is free. It does not make sense to substitute 7 for x: R b a f(7; y)d7; but substitution for y makes sense: R b a f(x; 7)dx. For reasons of hygiene it will always be assumed that the bound variables that occur in a certain expression are dierent from the free ones. This can be fullled by renaming bound variables. E.g. x:x becomes y:y. Indeed, these expressions act the same way: (x:x)a = a = (y:y)a and in fact they denote the same intended algorithm. Therefore expressions that dier only in the names of bound variables are identied. 8 Introduction to Lambda Calculus Functions of more arguments Functions of several arguments can be obtained by iteration of applica...
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 Practical Soft Type System for Scheme
 In Proceedings of the 1994 ACM Conference on LISP and Functional Programming
, 1993
"... Soft type systems provide the benefits of static type checking for dynamically typed languages without rejecting untypable programs. A soft type checker infers types for variables and expressions and inserts explicit runtime checks to transform untypable programs to typable form. We describe a prac ..."
Abstract

Cited by 108 (4 self)
 Add to MetaCart
Soft type systems provide the benefits of static type checking for dynamically typed languages without rejecting untypable programs. A soft type checker infers types for variables and expressions and inserts explicit runtime checks to transform untypable programs to typable form. We describe a practical soft type system for R4RS Scheme. Our type checker uses a representation for types that is expressive, easy to interpret, and supports efficient type inference. Soft Scheme supports all of R4RS Scheme, including procedures of fixed and variable arity, assignment, continuations, and toplevel definitions. Our implementation is available by anonymous FTP. The first author was supported in part by the United States Department of Defense under a National Defense Science and Engineering Graduate Fellowship. y The second author was supported by NSF grant CCR9122518 and the Texas Advanced Technology Program under grant 003604014. 1 Introduction Dynamically typed languages like Scheme...
Unification: A multidisciplinary survey
 ACM Computing Surveys
, 1989
"... The unification problem and several variants are presented. Various algorithms and data structures are discussed. Research on unification arising in several areas of computer science is surveyed, these areas include theorem proving, logic programming, and natural language processing. Sections of the ..."
Abstract

Cited by 103 (0 self)
 Add to MetaCart
The unification problem and several variants are presented. Various algorithms and data structures are discussed. Research on unification arising in several areas of computer science is surveyed, these areas include theorem proving, logic programming, and natural language processing. Sections of the paper include examples that highlight particular uses
Simple Imperative Polymorphism
 LISP and Symbolic Computation
, 1995
"... . This paper describes a simple extension of the HindleyMilner polymorphic type discipline to callbyvalue languages that incorporate imperative features like references, exceptions, and continuations. This extension sacrifices the ability to type every purely functional expression that is typable ..."
Abstract

Cited by 92 (3 self)
 Add to MetaCart
. This paper describes a simple extension of the HindleyMilner polymorphic type discipline to callbyvalue languages that incorporate imperative features like references, exceptions, and continuations. This extension sacrifices the ability to type every purely functional expression that is typable in the HindleyMilner system. In return, it assigns the same type to functional and imperative implementations of the same abstraction. Hence with a module system that separates specifications from implementations, imperative features can be freely used to implement polymorphic specifications. A study of a number of ML programs shows that the inability to type all HindleyMilner typable expressions seldom impacts realistic programs. Furthermore, most programs that are rendered untypable by the new system can be easily repaired. Keywords: Continuations, functional programming, polymorphism, references, state 1. Polymorphism, Imperative Features, and Modules The HindleyMilner polymorphic ty...
Partial polymorphic type inference and higherorder unification
 IN PROCEEDINGS OF THE 1988 ACM CONFERENCE ON LISP AND FUNCTIONAL PROGRAMMING, ACM
, 1988
"... We show that the problem of partial type inference in the nthborder polymorphic Xcalculus is equivalent to nthorder unification. On the one hand, this means that partial type inference in polymorphic Xcalculi of order 2 or higher is undecidable. On the other hand, higherorder unification is oft ..."
Abstract

Cited by 80 (8 self)
 Add to MetaCart
We show that the problem of partial type inference in the nthborder polymorphic Xcalculus is equivalent to nthorder unification. On the one hand, this means that partial type inference in polymorphic Xcalculi of order 2 or higher is undecidable. On the other hand, higherorder unification is often tractable in practice, and our translation entails a very useful algorithm for partial type inference in the worder polymorphic Xcalculus. We present an implementation in AProlog in full.
Functional Programming with Overloading and HigherOrder Polymorphism
, 1995
"... The Hindley/Milner type system has been widely adopted as a basis for statically typed functional languages. One of the main reasons for this is that it provides an elegant compromise between flexibility, allowing a single value to be used in different ways, and practicality, freeing the progr ..."
Abstract

Cited by 70 (3 self)
 Add to MetaCart
The Hindley/Milner type system has been widely adopted as a basis for statically typed functional languages. One of the main reasons for this is that it provides an elegant compromise between flexibility, allowing a single value to be used in different ways, and practicality, freeing the programmer from the need to supply explicit type information. Focusing on practical applications rather than implementation or theoretical details, these notes examine a range of extensions that provide more flexible type systems while retaining many of the properties that have made the original Hindley/Milner system so popular. The topics discussed, some old, but most quite recent, include higherorder polymorphism and type and constructor class overloading. Particular emphasis is placed on the use of these features to promote modularity and reusability.