Work

Constrained partial deduction

Year: 1997
Type: conference-paper
Abstract: Partial deduction based upon the Lloyd and Shepherdson framework generates a specialised program given a set of atoms.Each such atom represents all its instances.This can severely limit the specialisation potential of partial deduction.We therefore extend the precision the Lloyd and Shepherdson approach by integrating ideas from constraint logic programming.We formally prove correctness of this new framework of constrained partial deduction and illustrate its potential on some examples.1 Partial Deduction In contrast to ordinary (full) evaluation, a partial evaluator is given a program P along with only part of its input, called the static input.The remaining part of the input, called the dynamic input, will only be known at some later point in time.Given the static input S, the partial evaluator then produces a specialised version P S of P which, when given the dynamic input D, produces the same output as the original program P. The goal is to exploit the static input in order to derive more ecient programs.To obtain the specialised program P S , a partial evaluator performs a mixture of evaluation, i.e. it executes those parts of P which only depend on the static input S, and of code generation for those parts of P which require the dynamic input D. Because part of the computation has already been performed beforehand by the partial evaluator, the hope that we obtain a more ecient program P S seems justi ed.Partial evaluation has received considerable attention in logic programming [9, 18, 29] and functional programming (see e.g.[15] and references therein).In the context of logic programming, full input to a program P consists of a goal G and evaluation corresponds to constructing a complete SLDNF-tree for P [ fGg.For partial evaluation, the static input then takes the form of a partially instantiated goal G 0 (and the specialised program should be correct and more ecient for all goals which are instances of G 0 ).In contrast to other programming languages and paradigms, one can still execute P for G 0 and (try to) construct a SLDNF-tree for P [fG 0 g.However, because G 0 is not yet fully instantiated, the SLDNF-tree for P [ fG 0 g is usually in nite and ordinary evaluation will not terminate.A more re ned approach to partial evaluation of logic programs is therefore required.A technique which solves this problem is known under the name of partial deduction.Partial deduction, originates from [16,17] (introductions can be found in [18,9,4,21]).Its general idea is to construct a nite set of atoms A and a nite set of nite, but possibly
Source: Lirias
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W128863294
FWCI: 0.309
Cites: 27
Cited by: 4
Related to: 8