Results 1  10
of
31
A theory of overloading
 ACM Transactions on Programming Languages and Systems (TOPLAS
, 2002
"... Abstract We introduce a novel approach for debugging illtyped programs in the Hindley/Milner system. We map the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to f ..."
Abstract

Cited by 64 (21 self)
 Add to MetaCart
(Show Context)
Abstract We introduce a novel approach for debugging illtyped programs in the Hindley/Milner system. We map the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to find minimal justifications of type errors, and to explain unexpected types that arise. Through an interactive process akin to declarative debugging, a user can track down exactly where a type error occurs. We are able to capture various extensions of the Hindley/Milner system such as type annotations and Haskellstyle type class overloading. The approach has been implemented as part of the Chameleon system.
A constraintbased approach to guarded algebraic data types
 ACM Trans. Prog. Languages Systems
, 2007
"... We study HMG(X), an extension of the constraintbased type system HM(X) with deep pattern matching, polymorphic recursion, and guarded algebraic data types. Guarded algebraic data types subsume the concepts known in the literature as indexed types, guarded recursive datatype constructors, (firstcla ..."
Abstract

Cited by 27 (0 self)
 Add to MetaCart
We study HMG(X), an extension of the constraintbased type system HM(X) with deep pattern matching, polymorphic recursion, and guarded algebraic data types. Guarded algebraic data types subsume the concepts known in the literature as indexed types, guarded recursive datatype constructors, (firstclass) phantom types, and equality qualified types, and are closely related to inductive types. Their characteristic property is to allow every branch of a case construct to be typechecked under different assumptions about the type variables in scope. We prove that HMG(X) is sound and that, provided recursive definitions carry a type annotation, type inference can be reduced to constraint solving. Constraint solving is decidable, at least for some instances of X, but prohibitively expensive. Effective type inference for guarded algebraic data types is left as an issue for future research.
ConstraintBased Type Inference for Guarded Algebraic Data Types
, 2003
"... Guarded algebraic data types, which subsume the concepts known in the literature as indexed types, guarded recursive datatype constructors, and phantom types, and are closely related to inductive types, have the distinguishing feature that, when typechecking a function defined by cases, every branch ..."
Abstract

Cited by 21 (3 self)
 Add to MetaCart
(Show Context)
Guarded algebraic data types, which subsume the concepts known in the literature as indexed types, guarded recursive datatype constructors, and phantom types, and are closely related to inductive types, have the distinguishing feature that, when typechecking a function defined by cases, every branch must be checked under di#erent typing assumptions. This mechanism allows exploiting the presence of dynamic tests in the code to produce extra static type information.
A Framework for Extended Algebraic Data Types
, 2005
"... Extended forms of algebraic data types allow for sophisticated type extensions. A number of proposals exists and its often hard to understand what has been achieved. Here, we present a unifying framework which subsumes previous systems such as guarded recursive data types, the combination of type cl ..."
Abstract

Cited by 19 (8 self)
 Add to MetaCart
Extended forms of algebraic data types allow for sophisticated type extensions. A number of proposals exists and its often hard to understand what has been achieved. Here, we present a unifying framework which subsumes previous systems such as guarded recursive data types, the combination of type classes and existential types etc. We give an in depth discussion of the type inference problem and identify sufficient conditions under which we obtain completeness. Our results show that our system is practical and greatly extends the expressive power of languages such as Haskell and ML.
Type Inference for GADTs via Herbrand Constraint Abduction
, 2008
"... Type inference for Hindley/Milner and variants is well understood as a constraint solving problem. Recent extensions to Hindley/Milner such as generalized algebraic data types (GADTs) force us to go beyond this approach to inference. In this paper we show how to perform type inference for GADTs usin ..."
Abstract

Cited by 13 (7 self)
 Add to MetaCart
Type inference for Hindley/Milner and variants is well understood as a constraint solving problem. Recent extensions to Hindley/Milner such as generalized algebraic data types (GADTs) force us to go beyond this approach to inference. In this paper we show how to perform type inference for GADTs using Herbrand constraint abduction, a solving method to infer missing facts in terms of Herbrand constraints, i.e. conjunctions of type equations. But typeinference for GADTs is very hard, we are the first to give example programs with an infinite number of maximal types. We propose to rule out several kinds of “nonintuitive” solutions and show that we can construct in this way a complete and decidable type inference approach for GADTs and sketch how to support type error diagnosis. Our results point out new direction how to perform type inference for expressive type systems.
Simple type inference for structural polymorphism
 In: The Ninth International Workshop on Foundations of ObjectOriented Languages
, 2002
"... We propose a new way to mix constrained types and type inference, where the interaction between the two is minimal. By using local constraints embedded in types, rather than the other way round, we obtain a system which keeps the usual structure of an HindleyMilner type system. In practice, this me ..."
Abstract

Cited by 10 (5 self)
 Add to MetaCart
(Show Context)
We propose a new way to mix constrained types and type inference, where the interaction between the two is minimal. By using local constraints embedded in types, rather than the other way round, we obtain a system which keeps the usual structure of an HindleyMilner type system. In practice, this means that it is easy to introduce local constraints in existing type inference algorithms. Eventhough our system is notably weaker than general constraintbased type systems, making it unable to handle subtyping for instance, it is powerful enough to accomodate many features, from simple polymorphic records à la Ohori to Objective Caml’s polymorphic variants, and accurate typing of pattern matching (i.e. polymorphic message dispatch), all these through tiny variations in the constraint part of the system. 1.
HM(X) Type Inference is CLP(X) Solving
 UNDER CONSIDERATION FOR PUBLICATION IN J. FUNCTIONAL PROGRAMMING
"... The HM(X) system is a generalization of the Hindley/Milner system parameterized in the constraint domain X. Type inference is performed by generating constraints out of the program text which are then solved by the domain specific constraint solver X. The solver has to be invoked at the latest when ..."
Abstract

Cited by 9 (0 self)
 Add to MetaCart
The HM(X) system is a generalization of the Hindley/Milner system parameterized in the constraint domain X. Type inference is performed by generating constraints out of the program text which are then solved by the domain specific constraint solver X. The solver has to be invoked at the latest when type inference reaches a let node so that we can build a polymorphic type. A typical example of such an inference approach is Milner’s algorithm W. We formalize an inference approach where the HM(X) type inference problem is first mapped to a CLP(X) program. The actual type inference is achieved by executing the CLP(X) program. Such an inference approach supports the uniform construction of type inference algorithms and has important practical consequences when it comes to reporting type errors. The CLP(X) style inference system where X is defined by Constraint Handling Rules is implemented as part of the Chameleon system.
A crash course on database queries
, 2007
"... Complex database queries, like programs in general, can ‘crash’, i.e., can raise runtime errors. We want to avoid crashes without losing expressive power, or we want to correctly predict the absence of crashes. We show how concepts and techniques from programming language theory, notably type system ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
Complex database queries, like programs in general, can ‘crash’, i.e., can raise runtime errors. We want to avoid crashes without losing expressive power, or we want to correctly predict the absence of crashes. We show how concepts and techniques from programming language theory, notably type systems and reflection, can be adapted to this end. Of course, the specific nature of database queries (as opposed to general programs), also requires some new methods, and raises new questions.
A semisyntactic soundness proof for HM(X)
 Research Report 4150, INRIA, March 2001. URL: ftp://ftp.inria.fr/INRIA/publication/RR/ RR4150.ps.gz
, 2001
"... This document gives a soundness proof for the generic constraintbased type inference framework HM(X). Our proof is semisyntactic. It consists in interpreting HM(X) judgements as (sets of) judgements in an underlying type system, which is itself given a syntactic soundness proof. The former ste ..."
Abstract

Cited by 8 (3 self)
 Add to MetaCart
(Show Context)
This document gives a soundness proof for the generic constraintbased type inference framework HM(X). Our proof is semisyntactic. It consists in interpreting HM(X) judgements as (sets of) judgements in an underlying type system, which is itself given a syntactic soundness proof. The former step gives a logical, intuitive view of polymorphism and constraints, yielding a concise proof. The latter is a matter of routine, because the lowlevel type system is simple. Thus, both logic and syntax are put to best use. 1 Introduction In approaches based on denotational semantics, types are viewed as (certain) sets of values [3, 1]. Proofs based on operational semantics, on the other hand, often oer a purely syntactic view of types, which are not given any logical interpretation [7]. In this paper, we will strike a balance between these two approaches. We start by giving a purely syntactic type system, called B(S), which enjoys a subject reduction theorem. It is described in a very ...
Syntactic Type Soundness for HM(X)
, 2002
"... The HM(X) framework is a constraintbased type framework with builtin letpolymorphism. This paper establishes purely syntactic type soundness for the framework, treating an extended version of the language containing state and recursive binding. These results demonstrate that any instance of HM(X), ..."
Abstract

Cited by 8 (3 self)
 Add to MetaCart
The HM(X) framework is a constraintbased type framework with builtin letpolymorphism. This paper establishes purely syntactic type soundness for the framework, treating an extended version of the language containing state and recursive binding. These results demonstrate that any instance of HM(X), comprising a specialized constraint system and possibly additional functional constants and their types, enjoys syntactic type soundness.