Results 1 - 10
of
50
An Overview of HAL
, 1999
"... Experience using constraint programming to solve real-life problems has shown that finding an efficient solution to the problem often requires experimentation with different constraint solvers or even building a problem-specific constraint solver. HAL is a new constraint logic programming language e ..."
Abstract
-
Cited by 41 (22 self)
- Add to MetaCart
Experience using constraint programming to solve real-life problems has shown that finding an efficient solution to the problem often requires experimentation with different constraint solvers or even building a problem-specific constraint solver. HAL is a new constraint logic programming language expressly designed to facilitate this process. It provides a well-defined solver interface, mutable global variables for implementing a constraint store, and dynamic scheduling which support combining, extending and writing new constraint solvers. Equally importantly, HAL supports semi-optional type, mode and determinacy declarations. These allow natural constraint specification by means of type overloading, better compile-time error checking and generation of more efficient run-time code.
Offline specialisation in Prolog using a hand-written compiler generator
, 2004
"... The so called âcogen approachâ to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that this approach is also applicable to partial eva ..."
Abstract
-
Cited by 38 (21 self)
- Add to MetaCart
The so called âcogen approachâ to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that this approach is also applicable to partial evaluation of logic programming languages, also called partial deduction. Self-application has not been as much in focus in logic programming as for functional and imperative languages, and the attempts to self-apply partial deduction systems have, of yet, not been altogether that successful. So, especially for partial deduction, the cogen approach should prove to have a considerable importance when it comes to practical applications. This paper first develops a generic offline partial deduction technique for pure logic programs, notably supporting partially instantiated datastructures via binding types. From this a very efficient cogen is derived, which generates very efficient generating extensions (executing up to several orders of magnitude faster than current online systems) which in turn perform very good and non-trivial specialisation, even rivalling existing online systems. All this is supported by extensive benchmarks. Finally, it is shown how the cogen can be extended to directly support a large part of Prologâs declarative and non-declarative features and how semi-online specialisation can be efficiently integrated.
Optimizing Compilation of Constraint Handling Rules
, 2001
"... CHRs are a multi-headed committed choice constraint language, commonly applied for writing incremental constraint solvers. CHRs are usually implemented as a language extension that compiles to the underlying language. In this paper we discuss the optimizing compilation of Constraint Handling Rul ..."
Abstract
-
Cited by 37 (7 self)
- Add to MetaCart
CHRs are a multi-headed committed choice constraint language, commonly applied for writing incremental constraint solvers. CHRs are usually implemented as a language extension that compiles to the underlying language. In this paper we discuss the optimizing compilation of Constraint Handling Rules (CHRs). In particualr, we show how we can use dierent kinds of information in the compilation of CHRs in order to obtain access eciency, and a better translation of the CHR rules into the underlying language. The kinds of information used include the types, modes, determinism, functional dependencies and symmetries of the CHR constraints. We also show how to analyze CHR programs to determine information about functional dependencies, symmetries and other kinds of information supporting optimizations.
Promoting Rewriting to a Programming Language: A Compiler for Non-Deterministic Rewrite Programs in Associative-Commutative Theories
, 2001
"... First-order languages based on rewrite rules share many features with functional languages. But one difference is that matching and rewriting can be made much more expressive and powerful by incorporating some built-in equational theories. To provide reasonable programming environments, compilation ..."
Abstract
-
Cited by 28 (6 self)
- Add to MetaCart
First-order languages based on rewrite rules share many features with functional languages. But one difference is that matching and rewriting can be made much more expressive and powerful by incorporating some built-in equational theories. To provide reasonable programming environments, compilation techniques for such languages based on rewriting have to be designed. This is the topic addressed in this paper. The proposed techniques are independent from the rewriting language and may be useful to build a compiler for any system using rewriting modulo associative and commutative (AC) theories. An algorithm for many-to-one AC matching is presented, that works efficiently for a restricted class of patterns. Other patterns are transformed to fit into this class. A refined data structure, namely compact bipartite graph, allows encoding all matching problems relative to a set of rewrite rules. A few optimisations concerning the construction of the substitution and of the reduced term are described. We also address the problem of non-determinism related to AC rewriting and show how to handle it through the concept of strategies. We explain how an analysis of the determinism can be performed at compile time and we illustrate the benefits of this analysis for the performance of the compiled evaluation process. Then we briefly introduce the ELAN system and its compiler, in order to give some experimental results and comparisons with other languages or rewrite engines.
The implementation technology of the Mercury debugger
- In Proceedings of the Tenth Workshop on Logic Programming Environments
, 1999
"... Every programming language needs a debugger. Mercury now has three debuggers: a simple procedural debugger similar to the tracing systems of Prolog implementations, a prototype declarative debugger, and a debugger based on the idea of automatic trace analysis. In this paper, we present the shared in ..."
Abstract
-
Cited by 15 (4 self)
- Add to MetaCart
Every programming language needs a debugger. Mercury now has three debuggers: a simple procedural debugger similar to the tracing systems of Prolog implementations, a prototype declarative debugger, and a debugger based on the idea of automatic trace analysis. In this paper, we present the shared infrastructure that underlies the three debuggers, and describe the implementation of the procedural debugger. We give our reasons for each of our main design decisions, and show how several of these decisions are rooted in our experience with the debugging of large programs working with large data structures.
Mode Analysis Domains for Typed Logic Programs
, 2000
"... . Precise mode information is important for compiler optimisations and in program development tools. Within the framework of abstract compilation, the precision of a mode analysis depends, in part, on the expressiveness of the abstract domain and its associated abstraction function. This paper consi ..."
Abstract
-
Cited by 15 (3 self)
- Add to MetaCart
. Precise mode information is important for compiler optimisations and in program development tools. Within the framework of abstract compilation, the precision of a mode analysis depends, in part, on the expressiveness of the abstract domain and its associated abstraction function. This paper considers abstract domains for polymorphically typed logic programs and shows how specialised domains may be constructed for each type in the program. These domains capture the degree of instantiation to a high level of precision. By providing a generic definition of abstract unication, the abstraction of a program using these domains is formalised. The domain construction procedure is fully implemented using the Godel language and tested on a number of example programs to demonstrate the viability of the approach. Note: Some proofs have been omitted for space reasons. They can be found in the full version of this paper [17]. 1 Introduction 1.1 Background Typed logic programming languages su...
Proving Termination of Input-Consuming Logic Programs
, 1999
"... A class of predicates is identified for which termination does not depend on left-to-right execution. The only assumption about the selection rule is that derivations are input-consuming, that is, in each derivation step, the input arguments of the selected atom do not become instantiated. This assu ..."
Abstract
-
Cited by 14 (5 self)
- Add to MetaCart
A class of predicates is identified for which termination does not depend on left-to-right execution. The only assumption about the selection rule is that derivations are input-consuming, that is, in each derivation step, the input arguments of the selected atom do not become instantiated. This assumption is a natural abstraction of previous work on programs with delay declarations. The method for showing that a predicate is in that class is based on level mappings, closely following the traditional approach for LD-derivations. Programs are assumed to be well and nicely moded, which are two widely used concepts for verification. Many predicates terminate under such weak assumptions. Knowing these predicates is useful even for programs where not all predicates have this property.
Run time type information in Mercury
- In Proceedings of the 1999 International Conference on the Principles and Practice of Declarative Programming
, 1999
"... . The logic/functional language Mercury uses a strong, mostly static type system based on polymorphic many-sorted logic. For eÆ- ciency, the Mercury compiler uses type specic representations of terms, and implements polymorphic operations such as unications via generic code invoked with descriptions ..."
Abstract
-
Cited by 14 (6 self)
- Add to MetaCart
. The logic/functional language Mercury uses a strong, mostly static type system based on polymorphic many-sorted logic. For eÆ- ciency, the Mercury compiler uses type specic representations of terms, and implements polymorphic operations such as unications via generic code invoked with descriptions of the actual types of the operands. These descriptions, which consist of automatically generated data and code, are the main components of the Mercury runtime type information (RTTI) system. We have used this system to implement several extensions of the Mercury system, including an escape mechanism from static type checking, generic input and output facilities, a debugger, and automatic memoization, and we are in the process of using it for an accurate, native garbage collector. We give detailed information on the implementation and uses of the Mercury RTTI system as well as measurements of the space costs of the system. 1 Introduction Many modern functional and logic programming lang...
Accurate Garbage Collection in an Uncooperative Environment
- In Proceedings of the Third International Symposium on Memory Management
, 2002
"... Previous attempts at garbage collection in uncooperative environments have generally used conservative or mostly conservative approaches. We describe a technique for doing fully type-accurate garbage collection in an uncooperative environment, using a "shadow stack" to link structs of pointer-contai ..."
Abstract
-
Cited by 13 (0 self)
- Add to MetaCart
Previous attempts at garbage collection in uncooperative environments have generally used conservative or mostly conservative approaches. We describe a technique for doing fully type-accurate garbage collection in an uncooperative environment, using a "shadow stack" to link structs of pointer-containing variables, together with the data or code needed to trace them. We have implemented this in the Mercury compiler, which generates C code, and present preliminary performance data on the overheads of this technique. We also show how this technique can be extended to handle multithreaded applications.

