Abstract
The Equality check and the Subsumption check are weakly sound, but are not complete even for function-free logic programs. Although the OverSize (OS) check is complete for positive logic programs, it is too general in the sense that it prunes SLD-derivations merely based on the depth-bound of repeated predicate symbols and the size of atoms, regardless of the inner structure of the atoms, so it may make wrong conclusions even for some simple programs. In this paper, we explore complete loop checking mechanisms for positive logic programs. We develop an extended Variant of Atoms (VA) check that has the following features: (1) it generalizes the concept of “variant” from “the same up to variable renaming” to “the same up to variable renaming except possibly with some arguments whose size recursively increases”, (2) it makes use of the depth-bound of repeated variants of atoms instead of depth-bound of repeated predicate symbols, (3) it combines the Equality/Subsumption check with the VA check, (4) it is complete w. r. t. the leftmost selection rule for positive logic programs, and (5) it is more sound than both the OS check and all the existing versions of the VA check.
Similar content being viewed by others
References
Bol, R. N., Apt, K. R., and Klop, J. W., “An Analysis of Loop Checking Mechanisms for Logic Programs,”Theoretical Computer Science, 86, 1, pp. 35–79, 1991.
Bol. R., “Loop Checking in Partial Deduction,”J. Logic Programming, 16, pp. 25–46, 1993.
Covington, M. A., “Eliminating Unwanted Loops in Prolog,”SLGPLAN Notices, 20, 1, pp. 20–26, 1985.
Covington, M. A., “A Further Note on Loops in Prolog,”SIGPLAN Notices, 20, 8, pp. 28–31, 1985.
Lloyd, J. W.Foundations of Logic Programming, 2nd ed., Springer-Verlag, Berlin, 1987.
Pool, D. and Goebel, R., “On Eliminating Loops in Prolog,”SIGPLAN Notices, 20, 8, pp. 38–40, 1985.
Sahlin, D., “The Mixtus Approach to Automatic Partial Evaluation of Full Prolog,” inLogic Programming: Proc. of the 1990 North American Conference (S. Debray and M. Hermenegildo, eds.), Austin, TX, Oct. 1990, MIT Press, Cambridge, MA, pp. 377–398, 1990.
Shen, Y. D., “Verifying Local Stratifiability of Logic Programs and Databases,”New Generation Computing, 11, 1, pp. 23–46, 1992.
Shen, Y. D., “Verifying Local Stratifiability of Logic Programs and Databases II,”New Generation Computing, 14, 3, pp. 317–341, 1996.
van Gelder, A., “Efficient Loop Detection in Prolog,”J. Logic Programming, 4, pp. 23–31, 1987.
Author information
Authors and Affiliations
Corresponding author
Additional information
The research was completed when the author visited the University of Maryland Institute for Advanced Computer Studies.
Yi-Dong Shen, Ph. D: He is a professor of Computer Science at Chongqing University, China. He received the Ph. D degree in computer Science from Chongqing University in 1991. He was a visiting researcher at the University of Valenciennes, France (1992–1993) and the University of Maryland Institute for Advanced Computer Studies (UMIACS), U. S. A. (1995–1996), respectively. His present interests include: Artificial Intelligence, Deductive and Object-Oriented Databases, Logic Programming and Parallel Processing.
About this article
Cite this article
Shen, Y.D. An extended variant of atoms loop check for positive logic programs. NGCO 15, 187–203 (1997). https://doi.org/10.1007/BF03037237
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF03037237