Results 11  20
of
60
Translating constraint handling rules into action rules
 In Proceedings of the Third Workshop on Constraint Handling Rules
, 2006
"... Abstract. CHR is a popular highlevel language for implementing constraint solvers and other general purpose applications. It has a wellestablished operational semantics and quite a number of different implementations, prominently in Prolog. However, there is still much room for exploring the com ..."
Abstract

Cited by 9 (7 self)
 Add to MetaCart
(Show Context)
Abstract. CHR is a popular highlevel language for implementing constraint solvers and other general purpose applications. It has a wellestablished operational semantics and quite a number of different implementations, prominently in Prolog. However, there is still much room for exploring the compilation of CHR to Prolog. Nearly all implementations rely on attributed variables. In this paper, we explore a different implementation target for CHR: BProlog’s Action Rules (ARs). As a rulebased language, it is a good match for particular aspects of CHR. However, the strict adherence to CHR’s refined operational semantics poses some difficulty. We report on our work in progress: a novel compilation schema, required changes to the AR language and the preliminary benchmarks and experiences. 1
CHR for imperative host languages
 Issue of LNAI on Constraint Handling Rules
, 2008
"... Abstract. In this paper, we address the different conceptual and technical difficulties encountered when embedding CHR into an imperative host language. We argue that a tight, natural integration leads to a powerful programming language extension, intuitive to both CHR and imperative programmers. We ..."
Abstract

Cited by 5 (4 self)
 Add to MetaCart
(Show Context)
Abstract. In this paper, we address the different conceptual and technical difficulties encountered when embedding CHR into an imperative host language. We argue that a tight, natural integration leads to a powerful programming language extension, intuitive to both CHR and imperative programmers. We show how to compile CHR to highly optimized imperative code. To this end, we first review the wellestablished CHR compilation scheme, and survey the large body of possible optimizations. We then show that this scheme, when used for compilation to imperative target languages, leads to stack overflows. We therefore introduce new optimizations that considerably improve the performance of recursive CHR programs. Rules written using tail calls are even guaranteed to run in constant space. We implemented systems for both Java and C, following the language design principles and compilation scheme presented in this paper, and show that our implementations outperform other stateoftheart CHR compilers by several orders of magnitude. 1
Type processing by constraint reasoning
 Pages 1–25 of: Proc. of APLAS’06. LNCS
, 2006
"... Abstract. Herbrand constraint solving or unification has long been understood as an efficient mechanism for type checking and inference for programs using Hindley/Milner types. If we step back from the particular solving mechanisms used for Hindley/Milner types, and understand type operations in ter ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
(Show Context)
Abstract. Herbrand constraint solving or unification has long been understood as an efficient mechanism for type checking and inference for programs using Hindley/Milner types. If we step back from the particular solving mechanisms used for Hindley/Milner types, and understand type operations in terms of constraints we not only give a basis for handling Hindley/Milner extensions, but also gain insight into type reasoning even on pure Hindley/Milner types, particularly for type errors. In this paper we consider typing problems as constraint problems and show which constraint algorithms are required to support various typing questions. We use a light weight constraint reasoning formalism, Constraint Handling Rules, to generate suitable algorithms for many popular extensions to Hindley/Milner types. The algorithms we discuss are all implemented as part of the freely available Chameleon system. 1
Principal type inference for GHCstyle multiparameter type classes
 In Proc. of APLAS’06
, 2006
"... Abstract. We observe that the combination of multiparameter type classes with existential types and type annotations leads to a loss of principal types and undecidability of type inference. This may be a surprising fact for users of these popular features. We conduct a concise investigation of the ..."
Abstract

Cited by 5 (5 self)
 Add to MetaCart
(Show Context)
Abstract. We observe that the combination of multiparameter type classes with existential types and type annotations leads to a loss of principal types and undecidability of type inference. This may be a surprising fact for users of these popular features. We conduct a concise investigation of the problem and are able to give a type inference procedure which, if successful, computes principal types under the conditions imposed by the Glasgow Haskell Compiler (GHC). Our results provide new insights on how to perform type inference for advanced type extensions. 1 Introduction Type systems are important building tools in the design of programming languages. They are typically specified in terms of a set of typing rules which are formulated in natural deduction style. The standard approach towards establishing type soundness is to show that any welltyped program cannot go wrong at runtime. Hence, one of the first tasks of a compiler is to verify whether aprogram is welltyped or not.
The Chameleon System
 Source Code: Optimal UnionFind ufd rank make @ make(X) <=> root(X,0). findNode @ X ~> PX , find(X,R) <=> find(PX,R), X ~> R. findRoot @ root(X,_) \ find(X,R) <=> R=X. linkEq @ link(X,X) <=> true. linkLeft @ link(X,Y), root(X,RX) root(Y,RY) <=> RX >= RY 
, 2004
"... We give an overview of the major features of the Chameleon programming language, as well as use of the system, from a Haskell programmer's point of view. Chameleon supports typeclass overloading a la Haskell. The novelty of Chameleon is to allow the programmer to specify almost arbitrary condit ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
(Show Context)
We give an overview of the major features of the Chameleon programming language, as well as use of the system, from a Haskell programmer's point of view. Chameleon supports typeclass overloading a la Haskell. The novelty of Chameleon is to allow the programmer to specify almost arbitrary conditions on type classes in terms of Constraint Handling Rules (CHRs). In fact, Chameleon's entire type inference system and evidence translation of programs is phrased in terms of CHRs. 1
Transformationbased Indexing Techniques for Constraint Handling Rules
"... Abstract. Multiheaded rules are essential for the expressiveness of Constraint Handling Rules (CHR), but incur considerable performance overhead. Current indexing techniques are often unable to address this problem—they require matchings to have particular form, or offer good runtime complexity ra ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
(Show Context)
Abstract. Multiheaded rules are essential for the expressiveness of Constraint Handling Rules (CHR), but incur considerable performance overhead. Current indexing techniques are often unable to address this problem—they require matchings to have particular form, or offer good runtime complexity rather than good absolute figures. We introduce two lightweight program transformations, based on term flattening, which improve the effectiveness of existing CHR indexing techniques, in terms of both complexity and constant factors. We also describe a set of complementary postprocessing program transformations, which considerably reduce the flattening overhead. We compare our techniques with the current state of the art in CHR compilation, and measure their efficacy in K.U.Leuven CHR and CHRd. 1
Let should not be generalized
, 2009
"... From the dawn of time, all derivatives of the classic HindleyMilner type system have supported implicit generalisation of local letbindings. Yet, as we will show, for more sophisticated type systems implicit letgeneralisation imposes a disproportionate complexity burden. Moreover, it turns out tha ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
From the dawn of time, all derivatives of the classic HindleyMilner type system have supported implicit generalisation of local letbindings. Yet, as we will show, for more sophisticated type systems implicit letgeneralisation 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.
Towards constraintbased type inference with polymorphic recursion for functional and logic languages
 Department of Computer Science, Trinity College Dublin
, 2005
"... Abstract. Type inference in the context of polymorphic recursion is notoriously difficult. The extensions to the traditional λcalculus type inference algorithm by both HindleyMilner and Mycroft are not capable of deriving the most general, i.e. principal types for programs with polymorphic recurs ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
(Show Context)
Abstract. Type inference in the context of polymorphic recursion is notoriously difficult. The extensions to the traditional λcalculus type inference algorithm by both HindleyMilner and Mycroft are not capable of deriving the most general, i.e. principal types for programs with polymorphic recursion. Henglein has proposed a different algorithm, based on arrow graph reweriting, with an extended occurs check that allows for practical principal type inference in a large class of programs. We propose a new constraintbased formulation of Henglein’s inference algorithm. Our formulation of the algorithm is simple, elegant and highly declarative in nature. It relates the opertional nature of the type inference more clearly to the formal theory of the type constraints and reveals how to extend the algorithm for logic programs. 1
A type system for CHR
 IN SCHRIJVERS AND FRÜHWIRTH (2005B
, 2005
"... We propose a generic type system for the Constraint Handling Rules (CHR), a rewriting rule language for implementing constraint solvers. CHR being a highlevel extension of a host language, such as Prolog or Java, this type system is parameterized by the type system of the host language. We show th ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
(Show Context)
We propose a generic type system for the Constraint Handling Rules (CHR), a rewriting rule language for implementing constraint solvers. CHR being a highlevel extension of a host language, such as Prolog or Java, this type system is parameterized by the type system of the host language. We show the consistency of the type system for CHR w.r.t. its operational semantics. We also study the case when the host language is a constraint logic programming language, typed with the prescriptive type system we developed in our previous work. In particular, we show the consistency of the resulting type system w.r.t. the extended execution model CLP+CHR. This system is implemented through an extension of our type checker TCLP for constraint logic languages. We report on experimental results about the typechecking of 12 CHR solvers and programs, including TCLP itself.