Results 1 - 10
of
15
A theory of overloading
- ACM Transactions on Programming Languages and Systems (TOPLAS
, 2002
"... Abstract We introduce a novel approach for debugging ill-typed 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 52 (17 self)
- Add to MetaCart
Abstract We introduce a novel approach for debugging ill-typed 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 Haskell-style type class overloading. The approach has been implemented as part of the Chameleon system.
Constraint-Based 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
A constraint-based approach to guarded algebraic data types
- ACM Trans. Prog. Languages Systems
, 2007
"... We study HMG(X), an extension of the constraint-based 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, (first-cla ..."
Abstract
-
Cited by 19 (0 self)
- Add to MetaCart
We study HMG(X), an extension of the constraint-based 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, (first-class) 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.
A semi-syntactic soundness proof for HM(X)
- Research Report 4150, INRIA, March 2001. URL: ftp://ftp.inria.fr/INRIA/publication/RR/ RR-4150.ps.gz
, 2001
"... This document gives a soundness proof for the generic constraint-based type inference framework HM(X). Our proof is semi-syntactic. 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 constraint-based type inference framework HM(X). Our proof is semi-syntactic. 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 low-level 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 constraint-based type framework with built-in 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 6 (3 self)
- Add to MetaCart
The HM(X) framework is a constraint-based type framework with built-in 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): Constraint-Based Type Inference for the Join-Calculus
- 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 constraint-based type system for the join-calculus. 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 5 (2 self)
- Add to MetaCart
This paper defines JOIN(X), a generic constraint-based type system for the join-calculus. 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 so-called value restriction. We establish type safety for JOIN(X) using a semi-syntactic 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 high-level notions such as type variables, constraints and generalization, and clearly separating them from low-level 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.
Let should not be generalized
, 2009
"... From the dawn of time, all derivatives of the classic Hindley-Milner type system have supported implicit generalisation of local letbindings. Yet, as we will show, for more sophisticated type systems implicit let-generalisation imposes a disproportionate complexity burden. Moreover, it turns out tha ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
From the dawn of time, all derivatives of the classic Hindley-Milner type system have supported implicit generalisation of local letbindings. Yet, as we will show, for more sophisticated type systems implicit let-generalisation imposes a disproportionate complexity burden. Moreover, it turns out that the feature is very seldom used, so we propose to eliminate it. The payoff is a substantial simplification, both of the specification of the type system, and of its implementation.
Polymorphic Type Inference for the Named Nested Relational Calculus
"... The named nested relational calculus is the canonical query language for the complex object database model and is equipped with a natural static type system. Given an expression in the language, without type declarations for the input variables, there is the problem of whether there are any input ty ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
The named nested relational calculus is the canonical query language for the complex object database model and is equipped with a natural static type system. Given an expression in the language, without type declarations for the input variables, there is the problem of whether there are any input type declarations under which the expression is well-typed. Moreover, if there are, then which are they, and what is the corresponding output type for each of these? This problem is solved by a logic-based approach, and the decision problem is shown to be NP-complete. 1

