Download PDF

Journal of logic programming

Publication date: 1999-11-01
Volume: 41 Pages: 231 - 277
Publisher: Elsevier science inc

Author:

De Schreye, Danny
Glück, R ; Jørgensen, Jesper ; Leuschel, Michael ; Martens, Bern ; Sørensen, Morten Heine

Keywords:

program specialisation and transformation, partial evaluation, partial deduction, unfold/fold, supercompilation, logic programming, well-quasi orders, unfold fold transformation, logic programs, interpreters, trees, Science & Technology, Technology, Computer Science, Theory & Methods, Computer Science, UNFOLD FOLD TRANSFORMATION, LOGIC PROGRAMS, INTERPRETERS, TREES, Computation Theory & Mathematics

Abstract:

Partial deduction in the Lloyd-Shepherdson framework cannot achieve certain optimisations which are possible by unfold/fold transformations. We introduce conjunctive partial deduction, an extension of partial deduction accommodating such optimisations, e.g., tupling and deforestation, We first present a framework for conjunctive partial deduction, extending the Lloyd-Shepherdson framework by considering conjunctions of atoms (instead of individual atoms) for specialisation and renaming. Correctness results are given for the framework with respect to computed answer semantics, least Herbrand model semantics, and finite failure semantics, Maintaining the well-known distinction between local and global control, we describe a basic algorithm for conjunctive partial deduction, and refine it into a concrete algorithm for which we prove termination, The problem of finding suitable renamings which remove redundant arguments turns out to be important, so we give an independent technique for this. A fully automatic implementation has been undertaken, which always terminates, Differences between the abstract semantics and Prolog's left-to-right execution motivate deviations from the abstract technique in the actual implementation, which we discuss. The implementation has been tested on an extensive set of benchmarks which demonstrate that conjunctive partial deduction indeed pays off, surpassing conventional partial deduction on a range of small to medium-size programs, while remaining manageable in an automatic and terminating system. (C) 1999 Elsevier Science Inc. All rights reserved.