Results 1  10
of
20
Type inference with constrained types
 Fourth International Workshop on Foundations of ObjectOriented Programming (FOOL)
, 1997
"... We present a general framework HM(X) for type systems with constraints. The framework stays in the tradition of the Hindley/Milner type system. Its type system instances are sound under a standard untyped compositional semantics. We can give a generic type inference algorithm for HM(X) so that, unde ..."
Abstract

Cited by 57 (5 self)
 Add to MetaCart
We present a general framework HM(X) for type systems with constraints. The framework stays in the tradition of the Hindley/Milner type system. Its type system instances are sound under a standard untyped compositional semantics. We can give a generic type inference algorithm for HM(X) so that, under sufficient conditions on X, type inference will always compute the principal type of a term. We discuss instances of the framework that deal with polymorphic records, equational theories and subtypes.
Principal Type Schemes for Functional Programs with Overloading and Subtyping
 Science of Computer Programming
, 1994
"... We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and ..."
Abstract

Cited by 51 (1 self)
 Add to MetaCart
(Show Context)
We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and prove its soundness and completeness. We find that it is necessary in practice to simplify the inferred types, and we describe techniques for type simplification that involve shape unification, strongly connected components, transitive reduction, and the monotonicities of type formulas.
TypeIndexed Rows
, 2001
"... Record calculi use labels to distinguish between the elements of products and sums. This paper presents a novel variation, typeindexed rows, in which labels are discarded and the types of the elements themselves serve as indices. The calculus, TIR , can express tuples, recursive datatypes, monom ..."
Abstract

Cited by 36 (7 self)
 Add to MetaCart
Record calculi use labels to distinguish between the elements of products and sums. This paper presents a novel variation, typeindexed rows, in which labels are discarded and the types of the elements themselves serve as indices. The calculus, TIR , can express tuples, recursive datatypes, monomophic records, polymorphic extensible records, and closedworld style typebased overloading. Our key application of TIR , however, is to encode the \choice" types of XML, and the \unordered sequence" types of SGML. Indeed, TIR is the kernel of the language XM, a lazy functional language extending XML with polymorphism and higherorder functions. The system is built from rows, equality constraints, membership constraints and constrained parametric polymorphism. The constraint domain enjoys decidable entailment and satisfaction (in EXP). We present a type checking algorithm, and show how TIR may be implemented by a typedirected translation which replaces typeindexing by conven...
A General Framework for Hindley/Milner Type Systems with Constraints
, 2000
"... with constraints. The basic idea is to factor out the common core of previous extensions of the Hindley/Milner system. I present a Hindley/Milner system where the constraint part is a parameter. Speci c applications can be obtained by providing speci c constraint systems which capture the applicat ..."
Abstract

Cited by 30 (8 self)
 Add to MetaCart
with constraints. The basic idea is to factor out the common core of previous extensions of the Hindley/Milner system. I present a Hindley/Milner system where the constraint part is a parameter. Speci c applications can be obtained by providing speci c constraint systems which capture the application in mind. For instance, the Hindley/Milner system can be recovered by instantiating the constraint part to the standard Herbrand constraint system. Type system instances of the general framework are sound if the underlying constraint system is sound. Furthermore, I give a generic type inference algorithm for the general framework, under sucient conditions on the speci c constraint system type inference yields principal types.
ML typing, explicit polymorphism and qualified types
 In TACS '94: Conference on theoretical aspects of computer software
, 1994
"... Abstract. The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as coreML, whose evaluation could be guaranteed not to “go wrong”. In subsequent work, the terms of coreML have also been viewed as a ‘convenient shorth ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
(Show Context)
Abstract. The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as coreML, whose evaluation could be guaranteed not to “go wrong”. In subsequent work, the terms of coreML have also been viewed as a ‘convenient shorthand ’ for programs in typed languages. Notable examples include studies of ML polymorphism and investigations of overloading, motivated by the use of type classes in Haskell. In this paper, we show how qualified types, originally developed to study type class overloading, can be used to explore the relationship between coreML programs and their translations in an explicitly typed language. Viewing these two distinct applications as instances of a single framework has obvious advantages; many of the results that have been established for one can also be applied to the other. We concentrate particularly on the issue of coherence, establishing sufficient conditions to guarantee that all possible translations of a given coreML term are equivalent. One of the key features of this work is the use of conversions, similar to Mitchell’s retyping functions, to provide an interpretation of the ordering between type schemes in the target language. 1
Secure flow typing
 Computers and Security
, 1997
"... Some of the most promising work in the area of enforcing secure information ow in programs is based on static analyses of source code. However, as yet, these e orts have not had much impact in practice. We present a new approach to analyzing programs statically for secrecy and integrity ow violation ..."
Abstract

Cited by 9 (1 self)
 Add to MetaCart
(Show Context)
Some of the most promising work in the area of enforcing secure information ow in programs is based on static analyses of source code. However, as yet, these e orts have not had much impact in practice. We present a new approach to analyzing programs statically for secrecy and integrity ow violations. The analysis is characterized as a form of type inference in a secure ow type system. The type system provides a uniform framework for traditional type checking of programs and information ow control. Typecorrect programs have principal types that characterize how they can be called securely. Applications of the type system include ow analysis of legacy code as well as code written in newlyemerging Web languages like Java(tm).
Type Inference for Overloading without Restrictions, Declarations or Annotations
, 1999
"... This article presents a type system based on the DamasMilner system [DM82], that supports overloading. Types of overloaded symbols are constrained polymorphic types. The work is related to Haskell type classes [Wad89, NP93, HHJW96], System O [OWW95] and other similar type systems [Kae88, Smi91, Jon ..."
Abstract

Cited by 9 (5 self)
 Add to MetaCart
This article presents a type system based on the DamasMilner system [DM82], that supports overloading. Types of overloaded symbols are constrained polymorphic types. The work is related to Haskell type classes [Wad89, NP93, HHJW96], System O [OWW95] and other similar type systems [Kae88, Smi91, Jon94, DCO96]. Restrictions imposed in these systems with respect to overloading are eliminated. Userdefined global and local overloading is supported without restrictions. There is no need for declarations or annotations of any sort. No language construct is added in order to cope with overloading. The type system uses a contextdependent overloading policy, specified by a predicate used in a single inference rule. Overloading of functions defined over different type constructors is supported, as done with Haskell's constructor classes. No monomorphism restriction is required in order to solve ambiguity problems. The system uses an openworld approach, in which new overloaded definition...
Haskellstyle Overloading is NPhard
 In Proceedings of the 1994 International Conference on Computer Languages
, 1994
"... Extensions of the ML type system, based on constrained type schemes, have been proposed for languages with overloading. Type inference in these systems requires solving the following satisfiability problem. Given a set of type assumptions C over finite types and a type basis A, is there is a substit ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Extensions of the ML type system, based on constrained type schemes, have been proposed for languages with overloading. Type inference in these systems requires solving the following satisfiability problem. Given a set of type assumptions C over finite types and a type basis A, is there is a substitution S that satisfies C in that A ` CS is derivable? Under arbitrary overloading, the problem is undecidable. Haskell limits overloading to a form similar to that proposed by Kaes called parametric overloading. We formally characterize parametric overloading in terms of a regular tree language and prove that although decidable, satisfiability is NPhard when overloading is parametric. 1 Introduction A practical limitation of the ML type system is that it prohibits global overloading in a programming language by restricting to at most one the number of assumptions per identifier in a type context, a limitation noted by Milner himself [Mil78]. Suppose we wish to assert that a free identifier...
Convenient explicit effects using type inference with subeffects
, 2010
"... Most programming languages in use today let one freely use arbitrary (side) effects. This is despite the fact that unknown and unrestricted side effects are the cause of many software problems. We propose a programming model where effects are treated in a disciplined way, and where the potential sid ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
(Show Context)
Most programming languages in use today let one freely use arbitrary (side) effects. This is despite the fact that unknown and unrestricted side effects are the cause of many software problems. We propose a programming model where effects are treated in a disciplined way, and where the potential sideeffects of a function are apparent in its type signature. In contrast to most effect systems that are meant for internal compiler optimizations, our system is designed to be used by the programmer. Inspired by Haskell, we use a coarsegrained hierarchy of effects, like pure and io, which makes it convenient to read and write type signatures. The type and effect of expressions can also be inferred automatically, and we describe a polymorphic type inference system based on HindleyMilner style inference.