The University of Southampton
University of Southampton Institutional Repository

Practicable Prolog specialisation

Practicable Prolog specialisation
Practicable Prolog specialisation

In software development an emphasis is placed on creating reusable general programs which solve a wide class of problems, however it is a struggle to balance generality with efficiency.  Highly parameterised molecular code is reusable but suffers a penalty in terms of efficiency, in contrast carefully optimising the code by hand produces faster programs which are less general and have fewer opportunities for reuse.  Partial evaluation is an automatic technique for program optimisation that optimises programs by exploiting known data.

While partial evaluation is improving, the uptake by mainstream users is disappointing. The aim of this thesis is to make partial evaluation accessible to a wider audience.  A basic partial evaluation algorithm is given and then extended to handle the features encountered in real life Prolog implementations including constraint logic programming, coroutining and non-declarative constructs.  Offline partial evaluation methods rely on an annotated version of the source program to control the specialisation process.  A graphical development environment for specialising logic programs is presented allowing users to create, visualise and modify their annotated source programs.

An algorithm for automatically generating annotations is given using state of the art termination analysis, combined with type-based abstract interpretation for propagating the binding types.  The algorithm has been fully implemented and we report on performance of the process on a series of benchmarks.  In addition to an algorithm for generating a safe set of annotations we also investigate the generation of optimal annotations.  A self-tuning system, which derives its own specialisation control for the particular Prolog compiler and architecture by trial and error is developed.  The system balances the desire for faster code against code explosion and specialisation time.

Additionally it is demonstrated that the developed partial evaluator is self-applicable. The attempts to self-apply partial evaluators for logic programs have, of yet, not been all that successful.  Compared to earlier attempts, the system is effective and surprisingly simple.  The power and efficiency of the implementation is evaluated using the specialisation of a series of non-trivial interpreters.

University of Southampton
Craig, Stephen-John
70e3474a-2043-482f-9e1c-27f68e9aba16
Craig, Stephen-John
70e3474a-2043-482f-9e1c-27f68e9aba16

Craig, Stephen-John (2005) Practicable Prolog specialisation. University of Southampton, Doctoral Thesis.

Record type: Thesis (Doctoral)

Abstract

In software development an emphasis is placed on creating reusable general programs which solve a wide class of problems, however it is a struggle to balance generality with efficiency.  Highly parameterised molecular code is reusable but suffers a penalty in terms of efficiency, in contrast carefully optimising the code by hand produces faster programs which are less general and have fewer opportunities for reuse.  Partial evaluation is an automatic technique for program optimisation that optimises programs by exploiting known data.

While partial evaluation is improving, the uptake by mainstream users is disappointing. The aim of this thesis is to make partial evaluation accessible to a wider audience.  A basic partial evaluation algorithm is given and then extended to handle the features encountered in real life Prolog implementations including constraint logic programming, coroutining and non-declarative constructs.  Offline partial evaluation methods rely on an annotated version of the source program to control the specialisation process.  A graphical development environment for specialising logic programs is presented allowing users to create, visualise and modify their annotated source programs.

An algorithm for automatically generating annotations is given using state of the art termination analysis, combined with type-based abstract interpretation for propagating the binding types.  The algorithm has been fully implemented and we report on performance of the process on a series of benchmarks.  In addition to an algorithm for generating a safe set of annotations we also investigate the generation of optimal annotations.  A self-tuning system, which derives its own specialisation control for the particular Prolog compiler and architecture by trial and error is developed.  The system balances the desire for faster code against code explosion and specialisation time.

Additionally it is demonstrated that the developed partial evaluator is self-applicable. The attempts to self-apply partial evaluators for logic programs have, of yet, not been all that successful.  Compared to earlier attempts, the system is effective and surprisingly simple.  The power and efficiency of the implementation is evaluated using the specialisation of a series of non-trivial interpreters.

Text
983059.pdf - Version of Record
Available under License University of Southampton Thesis Licence.
Download (3MB)

More information

Published date: 2005

Identifiers

Local EPrints ID: 465695
URI: http://eprints.soton.ac.uk/id/eprint/465695
PURE UUID: 7e90a502-89b4-4e7f-855a-08d12037acec

Catalogue record

Date deposited: 05 Jul 2022 02:36
Last modified: 16 Mar 2024 20:19

Export record

Contributors

Author: Stephen-John Craig

Download statistics

Downloads from ePrints over the past year. Other digital versions may also be available to download e.g. from the publisher's website.

View more statistics

Atom RSS 1.0 RSS 2.0

Contact ePrints Soton: eprints@soton.ac.uk

ePrints Soton supports OAI 2.0 with a base URL of http://eprints.soton.ac.uk/cgi/oai2

This repository has been built using EPrints software, developed at the University of Southampton, but available to everyone to use.

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we will assume that you are happy to receive cookies on the University of Southampton website.

×