Abstract
We propose an improved execution model for Prolog with occurcheck. Prolog's incompleteness is reduced in the case of difference-lists and similar data structures which are crucial for practical programming tasks. We show that adding the occur-check to the Prolog-system is not sufficient for using difference-lists in a reliable manner. In fact, most programs where the occur-check fails end up looping infinitely. By propagating the subterm annotations of variables via abstract interpretation we avoid the creation of these undesirable infinite SLD-trees. In addition, our extension provides a better framework for transformations of programs that use difference-lists that cannot be realized in the common framework of infinite trees.
Preview
Unable to display preview. Download preview PDF.
References
A. Colmerauer. Prolog and infinite trees. Logic Programming, Academic Press 231–251, (1982).
J.W. Lloyd, Foundations of Logic Programming, (2nd.Ed.) Springer-Verlag, (1987).
P. Deransart and G. Ferrand and M. Téguia, NSTO Programs (Not Subject To Occur-check), ISLP'91, 533–550, (1991).
L. Plümer, Automatic Termination Proofs for Prolog Programs Operating on Non-ground Terms, ISLP'91 503–517, (1991).
M. Proietti and A. Pettorossi, Construction of Efficient Logic Programs by Loop Absorption and Generalization. Proc. Meta 90, Leuven, 57–81, (1990).
J. Robinson, Computational logic: The unification computation. Machine Intelligence 6, 63–72, (1971).
L.S. Sterling and E. Shapiro, The Art of Prolog, MIT Press, (1986).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Neumerkel, U. (1992). Pruning infinite failure branches in programs with occur-check. In: Voronkov, A. (eds) Logic Programming and Automated Reasoning. LPAR 1992. Lecture Notes in Computer Science, vol 624. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0013059
Download citation
DOI: https://doi.org/10.1007/BFb0013059
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55727-2
Online ISBN: 978-3-540-47279-7
eBook Packages: Springer Book Archive