Results 1  10
of
25
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 65 (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.
Code generation via higherorder rewrite systems
 In Functional and Logic Programming, 10th International Symposium: FLOPS 2010, volume 6009 of Lecture Notes in Computer Science
, 2010
"... Abstract. We present the metatheory behind the code generation facilities of Isabelle/HOL. To bridge the gap between the source (higherorder logic with type classes) and the many possible targets (functional programming languages), we introduce an intermediate language, MiniHaskell. To relate th ..."
Abstract

Cited by 46 (5 self)
 Add to MetaCart
(Show Context)
Abstract. We present the metatheory behind the code generation facilities of Isabelle/HOL. To bridge the gap between the source (higherorder logic with type classes) and the many possible targets (functional programming languages), we introduce an intermediate language, MiniHaskell. To relate the source and the intermediate language, both are given a semantics in terms of higherorder rewrite systems (HRSs). In a second step, type classes are removed from MiniHaskell programs by means of a dictionary translation; we prove the correctness of this step. Building on equational logic also directly supports a simple but powerful algorithm and data refinement concept. 1 Introduction and related work Like many theorem provers, Isabelle/HOL can generate functional programs from recursive functions specified in the logic. Many applications have taken advantage of this feature, e.g. the certified termination analysis tool CeTA [19] or the Quickcheck counterexample search [3]. The initial code generator [2] has since
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 31 (7 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.
Type Inference Verified: Algorithm W in Isabelle/HOL
, 1997
"... This paper presents the first machinechecked verification of Milner's type inference algorithm W for computing the most general type of an untyped term enriched with letexpressions. This term language is the core of most typed functional programming languages and is also known as MiniML ..."
Abstract

Cited by 18 (1 self)
 Add to MetaCart
(Show Context)
This paper presents the first machinechecked verification of Milner's type inference algorithm W for computing the most general type of an untyped term enriched with letexpressions. This term language is the core of most typed functional programming languages and is also known as MiniML. We show how to model all the concepts involved, in particular types and type schemes, substitutions, and the thorny issue of "new" variables. Only a few key proofs are discussed in detail. The theories and proofs are developed in Isabelle/HOL, the HOL instantiation of the generic theorem prover Isabelle.
OutsideIn(X)  Modular type inference with local assumptions
, 2010
"... Advanced type system features, such as GADTs, type classes, and type families have have proven to be invaluable language extensions for ensuring data invariants and program correctness among others. Unfortunately, they pose a tough problem for type inference, because they introduce local type assump ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
Advanced type system features, such as GADTs, type classes, and type families have have proven to be invaluable language extensions for ensuring data invariants and program correctness among others. Unfortunately, they pose a tough problem for type inference, because they introduce local type assumptions. In this article we present a novel constraintbased type inference approach for local type assumptions. Our system, called OutsideIn(X), is parameterised over the particular underlying constraint domain X, in the same way as HM(X). This stratification allows us to use a common metatheory and inference algorithm. Going beyond the general framework, we also give a particular constraint solver for X = type classes + GADTs + type families, a nontrivial challenge in its own right.
Type classes in Mercury
, 1998
"... The type systems of functional languages such as Haskell have recently become more powerful and expressive. They not only allow programmers to write code that works on values of any type (genericity), they also allow programmers to require that a particular type belongs to a given type class (const ..."
Abstract

Cited by 10 (0 self)
 Add to MetaCart
The type systems of functional languages such as Haskell have recently become more powerful and expressive. They not only allow programmers to write code that works on values of any type (genericity), they also allow programmers to require that a particular type belongs to a given type class (constrained genericity). Such code may use any of the methods listed in the interface of the type class, since every type that is a member of the type class must implement those methods. This capability makes it significantly easier to express solutions to many common problems, and promotes code reuse. Incorporating type classes in a logic programming language provides some new challenges. In this paper, we explain how we have extended Mercury's type system to include support for type classes. We give a formal semantics for this extension to our type system, adapting the typing rules used in functional languages to the differing demands of logic programming languages. We show that type classes in...
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 10 (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...