Abstract
A Prolog interpreter can be viewed as a process that searches a tree in order to produce the sets of terms at certain successful leaves. It does this by constructing the set of terms for each node in the tree. Moving from one node to another requires (re)construction of the set of terms at that node. The choice of representation of sets of terms influences the kind of tree search that can be supported.
The most efficient Prolog implementations represent terms by using chains of pointers through activation records. This is efficient because it allows much sharing of representation. However, it does constrain any search algorithm using these representations to be depth-first. There are various reasons why search orders other than depth-first might be desirable, not the least of which is to support a multiprocessor tree search. This paper describes a representation for terms that is comparable in efficiency to the best known, and yet supports arbitrary orders of tree search.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Bruynooghe, M.: “The memory management of PROLOG implementations,” in Logic Programming, K. L. Clark and S.-Å. Tärnlund (eds.) (Academic Press, New York, NY) (1982) 83–98.
Mellish, C. S.: “An Alternative to Structure Sharing in the Implementation of a Prolog Interpreter,” in Logic Programming, K. L. Clark and S.-Å. Tärnlund (eds.) (Academic Press, New York, NY) (1982) 99–106.
Pereira, F. C. N. and Warren, D. H. D.: “Parsing as Deduction,” Proceedings of the 21st Annual Meeting of the Association for Computational Linguistics (Cambridge, MA) (June, 1983) 137–144.
Warren, D. H. D.: “Implementing Prolog—Compiling Logic Programs, 1 and 2,” D. A. I. Research Report (University of Edinburgh, Edinburgh) (1977).
Warren, D. S.: “Efficient Parsing with General Grammars,” Tech. Rep. #81/028 (Dept. of Computer Science, SUNY, Stony Brook, NY) (July, 1981).
Warren, D. S., Ahamad, M., Debray, S. K. and Kale, L. V.: “Executing Distributed Prolog Programs on a Broadcast Network,” Tech. Rep. #83/054 (Dept. of Computer Science, SUNY, Stony Brook, NY) (August, 1983).
Author information
Authors and Affiliations
Additional information
Copyright © 1984 IEEE. Reprinted, with permission, from 1984 INTERNATIONAL SYMPOSIUM ON LOGIC PROGRAMMING, February 6–9, 1984, Atlantic City, NJ, pp. 198–202.
About this article
Cite this article
Warren, D.S. Efficient Prolog memory management for flexible control strategies. New Gener Comput 2, 361–369 (1984). https://doi.org/10.1007/BF03037327
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF03037327