Loop checking in partial deduction

From MaRDI portal





Although partial evaluation dates back to the 1970s, and was introduced into logic programming in the early 1980s, the topic only recently has attracted more substantial attention. In the framework of \textit{J. W. Lloyd} and \textit{J. C. Shepherdson} [J. Log. Program. 11, No. 3/4, 217-242 (1991; Zbl 0741.68030)], partial deduction, as it is called in logic programming, involves the creation of SLDNF-trees for a given program and some goals, up to certain halting points. Placing these halting points is closely related to loop checking: stopping derivations at run-time. A formal theory for loop checking has been developed by \textit{R. N. Bol}, \textit{K. R. Apt} and \textit{J. W. Klop} [An Analysis of Loop Checking Mechanisms for Logic Programs, Theor. Comput. Sci. 86, No. 1, 35-79 (1991)]. When a loop check prunes a derivation at run-time, then this derivation is treated as if it is failed. Thus a loop check should not prune a derivation that leads to an answer, unless that answer can be obtained also by another (unpruned) derivation. This property of a loop check is called soundness. On the other hand, a loop check should prune all infinite derivations; this is called completeness. Loop checks used at run-time should first of all be sound; thus they cannot be complete for all programs, but only for certain classes of programs. The paper concludes that loop checks for determining halting points in partial deduction must first of all be complete: partial deduction is a preprocessing step that must terminate. But when a sound loop check is added to the process, it can give rise to the removal of loops from the output program. This is generally not correct with respect to SLDNF-resolution, but it is with respect to SLS-resolution (the paper considers positive programs and SLD-resolution only). Partial deduction has another potential source of nontermination: a halting point may give rise to a new goal that must be evaluated, and hence to a new tree, with new halting points. This form of nontermination cannot be solved by loop checks, and is therefore not discussed in depth. The paper begins with brief, but self-contained introductions in partial deduction and loop checking, both with an example. Then it is shown that placing halting points corresponds to the application of a complete loop check, and how a sound loop check can be added fruitfully. Some loop checks used for partial deduction in the literature are discussed, together with a framework for complete loop checks proposed by \textit{M. Bruynooghe}, \textit{D. de Schreye} and \textit{B. Martens} [A General Criterion for Avoiding Infinite Unfolding During Partial Evaluation, in: Proc. of the 1991 International Logic Programming Symposium, M.I.T. Press, Cambridge, MA (1991)]. Finally, the conclusions of the paper are summed up.











This page was built for publication: Loop checking in partial deduction

Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q5286916)