Efficient Specialisation in Prolog Using the Hand-Written Compiler Generator LOGEN

Michaël Leuschel, Jesper Jørgensen · Electronic Notes in Theoretical Computer Science · 2000

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. In earlier work we have shown that this approach is also applicable to partial evaluation of logic programming languages, also called partial deduction. In this paper we extend upon this by allowing partially instantiated datastructures (via binding types), which are especially important in the context of logic programming. We also extend cogen to directly support a large part of Prolog's declarative and non-declarative features and how semi-online specialisation can be efficiently integrated. Benchmarks show that the resulting cogen is very efficient, 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.

Read the paper · More papers on PaperTik