Supervising Offline Partial Evaluation of Logic Programs using Online Techniques
[PDF] [Bibtex]In Proceedings LOPSTR'06, volume 4407 of Lecture Notes in Computer Science, Springer-Verlag, 2006.
The Ecce and Logen Partial Evaluators and their Web Interfaces
[PDF] [Bibtex]In Proceedings PEPM 06, IBM Press, 2006.
We present Ecce and Logen, two partial evaluators for Prolog using the online and offline approach respectively. We briefly present the foundations of these tools and discuss various applications. We also present new implementations of these tools, carried out in Ciao Prolog. In addition to a command-line interface new user-friendly web interfaces were developed. These enable non-expert users to specialise logic programs using a web browser, without the need for a local installation.
A Reconstruction of the Lloyd-Topor Transformation using Partial Evaluation
[PDF] [Bibtex]In Pre-Proceedings of LOPSTR'05, 2005.
The Lloyd-Topor transformation is a classical transformation that translates extended logic programs with logical connectives and explicit quantifiers into normal logic programs. In this paper we show that this translation can be achieved in a natural way by specialising a meta-interpreter for extended logic programs. For this we use the Logen partial evaluation system, extended to handle coroutining.
Self-Tuning Resource Aware Specialisation for Prolog
[PDF] [Bibtex]In Proceedings PPDP'2005, ACM Press, 2005.
The paper develops a self-tuning resource aware partial evaluation technique for Prolog programs, which derives its own control strategies tuned for the underlying computer architecture and Prolog compiler using a genetic algorithm approach. The algorithm is based on mutating the annotations of offline partial evaluation.
Using a set of representative sample queries it decides upon the fitness of annotations, controlling the trade-off between code explosion, speedup gained and specialisation time. The user can specify the importance of each of these factors in determining the quality of the produced code, tailoring the specialisation to the particular problem at hand.
We present experimental results for our implemented technique on a series of benchmarks. The results are compared against the aggressive termination based binding-time analysis and optimised using different measures for the quality of code. We also show that our technique avoids some classical pitfalls of partial evaluation.
Lix: An Effective Self-applicable Partial Evaluator for Prolog
[PDF] [Bibtex]In FLOPS, Springer-Verlag, 2004.
This paper presents a self-applicable partial evaluator for a considerable subset of full Prolog. The partial evaluator is shown to achieve non-trivial specialisation and be effectively self-applied. The attempts to self-apply partial evaluators for logic programs have, of yet, not been all that successful. Compared to earlier attempts, our LIX system is practically usable in terms of efficiency and can handle natural logic programming examples with partially static data structures, built-ins, side-effects, and some higher-order and meta-level features such as call and findall.
The LIX system is derived from the development of the LOGEN compiler generator system. It achieves a similar kind of efficiency and specialisation, but can be used for other applications. Notably, we show first attempts at using the system for deforestation and tupling in an offline fashion. We will demonstrate that, contrary to earlier beliefs, declarativeness and the use of the ground representation is not the best way to achieve self-applicable partial evaluators.
In LOPSTR, volume 3573 of Lecture Notes in Computer Science, Springer-Verlag, 2004.
Offline partial evaluation techniques rely on an annotated version of the source program to control the specialisation process. These annotations guide the specialisation and have to ensure termination of the partial evaluation. We present an algorithm for generating these annotations automatically. The algorithm uses state-of-the-art termination analysis techniques, combined with a new type-based abstract interpretation for propagating the binding types. This algorithm has been implemented as part of the Logen partial evaluation system, and we report on performance of the algorithm on a series of benchmarks.
Specializing Interpreters using Offline Partial Deduction
[PDF] [Bibtex]In Program Development in Computational Logic, volume 3049 of Lecture Notes in Computer Science, Springer-Verlag, 2004.
We present the latest version of the Logen partial evaluation system for logic programs. In particular we present new binding-types, and show how they can be used to effectively specialise a wide variety of interpreters.We show how to achieve Jones-optimality in a systematic way for several interpreters. Finally, we present and specialise a non-trivial interpreter for a small functional programming language. Experimental results are also presented, highlighting that the Logen system can be a good basis for generating compilers for high-level languages.
A Compiler Generator for Constraint Logic Programs
[PDF] [Bibtex]In Ershov Memorial Conference, volume 2890 of Lecture Notes in Computer Science, Springer-Verlag, 2003.
The Cogen approach to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success. This paper demonstrates that the Cogen approach is also applicable to the specialisation of constraint logic programs and leads to effective specialisers. We present the basic specialisation technique for CLP(Q) programs and show how we can handle non-declarative features as well. We present an implemented system along with experimental results.
Specializing Interpreters using Offline Partial Deduction
[PDF] [Bibtex]Technical Report, No. DSSE-TR-2003-5, ECS, University of Southampton, 2003.
We present the latest version of the logen partial evaluation system for logic programs. In particular we present new binding-types, and show how they can be used to effectively specialise a wide variety of interpreters.We show how to achieve Jones-optimality in a systematic way for several interpreters. Finally, we present and specialise a non-trivial interpreter for a small functional programming language. Experimental results are also presented, highlighting that the logen system can be a good basis for generating compilers for high-level languages.