Results 21 - 30
of
50
Towards a Modular Binding-time Analysis for Higher-order Mercury
- In Special Issue on Optimization and Implementation of Declarative Programming Languages, volume 30 of Electronic Notes in Theoretical Computer Science. Elsevier - North
, 2000
"... This extended abstract describes work in progress on binding-time analysis (BTA) for Mercury. It reports on a so called phased BTA that deals with the higher-order aspects of Mercury, and of which a large part can be performed on a modular basis. ..."
Abstract
-
Cited by 7 (1 self)
- Add to MetaCart
This extended abstract describes work in progress on binding-time analysis (BTA) for Mercury. It reports on a so called phased BTA that deals with the higher-order aspects of Mercury, and of which a large part can be performed on a modular basis.
Reuse of Results in Termination Analysis of Typed Logic Programs
- In Static Analysis, 9th International Symposium
, 2002
"... Recent works by the authors address the problem of automating the selection of a candidate norm for the purpose of termination analysis. These works illustrate a powerful technique in which a collection of simple type-based norms, one for each data type in the program, are combined together to provi ..."
Abstract
-
Cited by 7 (1 self)
- Add to MetaCart
Recent works by the authors address the problem of automating the selection of a candidate norm for the purpose of termination analysis. These works illustrate a powerful technique in which a collection of simple type-based norms, one for each data type in the program, are combined together to provide the candidate norm. This paper extends these results by investigating type polymorphism. We show that by considering polymorphic types we reduce, without sacrificing precision, the number of type-based norms which should be combined to provide the candidate norm. Moreover, we show that when a generic polymorphic typed program component occurs in one or more specific type contexts, we need not reanalyse it. All of the information concerning its termination and its e ect on the termination of other predicates in that context can be derived directly from the context independent analysis of that component based on norms derived from the polymorphic types.
A choice-point library for backtrack programming
- Proceedings of the JICSLP-98 Workshop on Implementation Technologies for Programming Languages based on Logic
, 1998
"... Implementing a compiler for a language with nondeterministic features is known to be a difficult task. This paper presents two new functions setChoicePoint and fail that extend the C language to efficiently handle choice point management. Originally, these two functions were designed to compile the ..."
Abstract
-
Cited by 7 (2 self)
- Add to MetaCart
Implementing a compiler for a language with nondeterministic features is known to be a difficult task. This paper presents two new functions setChoicePoint and fail that extend the C language to efficiently handle choice point management. Originally, these two functions were designed to compile the ELAN strategy language. However, they can be used by programmers for general programming in C. We illustrate their use by presenting the classical 8-queens problem and giving some experimental results. Algorithms and implementation techniques are sufficiently detailed to be easily modified and re-implemented. 1
Properties of Input-Consuming Derivations
, 1999
"... We study the properties of input-consuming derivations of moded logic programs. Input-consuming derivations do not employ a fixed selection rule, and can be used to model the behavior of logic programs using dynamic scheduling and employing constructs such as delay declarations. We consider the clas ..."
Abstract
-
Cited by 7 (4 self)
- Add to MetaCart
We study the properties of input-consuming derivations of moded logic programs. Input-consuming derivations do not employ a fixed selection rule, and can be used to model the behavior of logic programs using dynamic scheduling and employing constructs such as delay declarations. We consider the class of nicely-moded programs and queries. We show that for these programs one part of the well-known Switching Lemma holds also for input-consuming derivations. Furthermore, we provide conditions which guarantee that all input-consuming derivations starting in a Nicely-Moded query are finite. The method presented here is easy to apply and generalizes other related works.
Herbrand Constraint Solving in HAL
, 1999
"... HAL is a new constraint logic programming language specifically designed to support the construction of and experimentation with constraint solvers. One of the most important constraint solvers in any logic programming language is the Herbrand (or term) constraint solver. HAL programs are compiled t ..."
Abstract
-
Cited by 6 (2 self)
- Add to MetaCart
HAL is a new constraint logic programming language specifically designed to support the construction of and experimentation with constraint solvers. One of the most important constraint solvers in any logic programming language is the Herbrand (or term) constraint solver. HAL programs are compiled to Mercury but, while Mercury provides only tests for equality and construction and deconstruction of ground terms, HAL supports full unification and logical variables. In this paper we describe the HAL Herbrand constraint solver and show how by using Parma bindings, rather than the standard term representation used in the WAM, we can implement a solver which interacts gracefully with Mercury's term representation. Like Mercury, HAL allows type, mode and determinism declarations. HAL uses information from these declarations to reduce the overhead of Herbrand constraint solving wherever possible. We systematically evaluate the effect of each kind of declaration on the efficiency of HAL programs. Essentially, we start with a pure Prolog program, then add type, then mode, and finally determinism declarations, and compare the efficiency of these different versions. This is possible since, as HAL provides full unification and a "constrained" mode, all versions are legitimate HAL programs.
When Size Does Matter - Termination Analysis for Typed Logic Programs
- Logic-based Program Synthesis and Transformation, 11th International Workshop, LOPSTR 2001, Selected Papers, volume 2372 of LNCS
, 2002
"... Proofs of termination typically proceed by mapping program states to a well founded domain and showing that successive states of the computation are mapped to elements decreasing in size. Automated termination analysers for logic programs achieve this by measuring and comparing the sizes of succ ..."
Abstract
-
Cited by 6 (4 self)
- Add to MetaCart
Proofs of termination typically proceed by mapping program states to a well founded domain and showing that successive states of the computation are mapped to elements decreasing in size. Automated termination analysers for logic programs achieve this by measuring and comparing the sizes of successive calls to recursive predicates. The size of the call is measured by a level mapping that in turn is based on a norm on the arguments of the call. A norm maps a term to a natural number.
Compiling Mercury to the .NET Common Language Runtime
"... The .NET Common Language Runtime (CLR) o ers a new opportunity to experiment with multi-language interoperation, and provides a relatively rare chance to explore deep interoperation of a wide range of programming language paradigms. This article describes how the logic/functional programming languag ..."
Abstract
-
Cited by 5 (1 self)
- Add to MetaCart
The .NET Common Language Runtime (CLR) o ers a new opportunity to experiment with multi-language interoperation, and provides a relatively rare chance to explore deep interoperation of a wide range of programming language paradigms. This article describes how the logic/functional programming language Mercury is compiled to the CLR. We describe the problems we have encountered with generating code for the CLR, give some preliminary benchmark results, and suggest some possible improvements to the CLR regarding separate compilation, verifiability, tail calls, and efficiency.
Using impurity to create declarative interfaces in Mercury
, 2000
"... The logic/functional language Mercury allows the programmer to annotate predicates and functions to mark impure predicates, allowing impure code to be safely integrated into a declarative language. By using purity declarations with the foreign language interface, programmers can take advantage of ma ..."
Abstract
-
Cited by 5 (2 self)
- Add to MetaCart
The logic/functional language Mercury allows the programmer to annotate predicates and functions to mark impure predicates, allowing impure code to be safely integrated into a declarative language. By using purity declarations with the foreign language interface, programmers can take advantage of many of the features of a high level programming language while writing imperative code to interface with existing imperative libraries. This paper outlines the purity system in Mercury and how it aects operational semantics, compares this purity system with other approaches to declaring impurity in a pure language, and gives an extended example of how impurity and foreign language interfaces can work together to simplify the chore of writing declarative interfaces to libraries. 1. INTRODUCTION Purely declarative languages often face the problem of interfacing with external systems that do not share the same clean semantics. In particular, external libraries will often provide an API consis...
Practical Aspects for a Working Compile Time Garbage Collection System for Mercury
, 2001
"... Compile-time garbage collection (CTGC) is still a very uncommon feature within compilers. In previous work we have developed a compile-time structure reuse system for Mercury, a logic programming language. This system indicates which datastructures can safely be reused at run-time. As preliminar ..."
Abstract
-
Cited by 4 (2 self)
- Add to MetaCart
Compile-time garbage collection (CTGC) is still a very uncommon feature within compilers. In previous work we have developed a compile-time structure reuse system for Mercury, a logic programming language. This system indicates which datastructures can safely be reused at run-time. As preliminary experiments were promising, we have continued this work and have now a working and well performing near-toship CTGC-system built into the Melbourne Mercury Compiler (MMC).

