Results 1  10
of
30
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 53 (18 self)
 Add to MetaCart
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 24 (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 23 (3 self)
 Add to MetaCart
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
 In Proc. of FLOPS’06, volume 3945 of LNCS
, 2006
"... Abstract. There are a number of extended forms of algebraic data types such as type classes with existential types and generalized algebraic data types. Such extensions are highly useful but their interaction has not been studied formally so far. Here, we present a unifying framework for these exten ..."
Abstract

Cited by 22 (9 self)
 Add to MetaCart
Abstract. There are a number of extended forms of algebraic data types such as type classes with existential types and generalized algebraic data types. Such extensions are highly useful but their interaction has not been studied formally so far. Here, we present a unifying framework for these extensions. We show that the combination of type classes and generalized algebraic data types allows us to express a number of interesting properties which are desired by programmers. We support type checking based on a novel constraint solver. Our results show that our system is practical and greatly extends the expressive power of languages such as Haskell and ML. 1
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 (8 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.
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
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 ...
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 8 (4 self)
 Add to MetaCart
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.
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 7 (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.
JOIN(X): ConstraintBased Type Inference for the JoinCalculus
 Proceedings of the 10th European Symposium on Programming (ESOP'01), volume 2028 of Lecture Notes in Computer Science
, 2001
"... This paper defines JOIN(X), a generic constraintbased type system for the joincalculus. The main difficulty concerns type generalization, which, in the presence of state and concurrency, is known to be unsafe unless it is restricted. We first define a very liberal, yet sound, generalization criter ..."
Abstract

Cited by 6 (2 self)
 Add to MetaCart
This paper defines JOIN(X), a generic constraintbased type system for the joincalculus. The main difficulty concerns type generalization, which, in the presence of state and concurrency, is known to be unsafe unless it is restricted. We first define a very liberal, yet sound, generalization criterion, whose formulation is independent of the constraint logic X. Then, we find that it makes type inference impractical, and propose a simpler, syntactic criterion, reminiscent of ML's socalled value restriction. We establish type safety for JOIN(X) using a semisyntactic technique, which we believe is of independent interest. It consists in interpreting JOIN(X) judgements as (sets of) judgements in an underlying system, which itself is given a syntactic soundness proof. This hybrid approach allows giving pleasant logical meaning to highlevel notions such as type variables, constraints and generalization, and clearly separating them from lowlevel aspects (substitution lemmas, et...
Type Inference using Constraint Handling Rules
 IN ELETRONIC NOTESIN THEORETICAL COMPUTER SCIENCE (PROCEEDINGS OF THE 10TH INTERNATIONAL WORKSHOP ON FUNCTIONAL AND LOGIC PROGRAMMING
, 2001
"... In this paper we present an implementation of the general system for type inference algorithms HM(X) using Prolog and Constraint Handling Rules. In our implementation the difference between the general aspects of the type inference algorithms and the constraint resolution module becomes more clear w ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
In this paper we present an implementation of the general system for type inference algorithms HM(X) using Prolog and Constraint Handling Rules. In our implementation the difference between the general aspects of the type inference algorithms and the constraint resolution module becomes more clear when compared to other implementations of the same systems, usually made in a functional programming language. In the constraint module solving equality constraints, here implemented by Prolog unification, is completely separated from constraint simplification which is made by a solver implemented in CHR for each system. CHR rules become a clear and natural way of specifying the simpli cation mechanism.