Abstract
This report surveys techniques for implementing the programming language Prolog. It focuses on explaining the procedural semantics of the language in terms of functional programming constructs. The techniquessuccess continuations andproof streams are introduced, and it is shown how Horn clause interpreters can be built upon them. Continuations are well known from denotational semantics theory, in this paper it is shown that they are viable constructs in actual programs.
Other issues include implementation of logical variables, structure sharing vs. structure copying, determinacy, builtin predicates, andcut.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Abelson, H. and Sussman, G. J.: “Structure and interpretation of computer programs,” Draft (Department of EE and CS, MIT) (July, 1983) Sections 4.3 and 4.4.
Boyer, R. S. and Moore, J. S.: “The sharing of structure in theorem proving programs,” Machine Intelligence, 7 (ed. Meltzer and Mitchie) (Edinburgh UP) (1972).
Carlsson, M.: “LM-Prolog—The Language and Its Implementation,” UPMAIL Technical Report (Computing Science Department, Uppsala University) (forthcoming 1984).
Carlsson, M. and Kahn, K. M.: “LM-Prolog User Manual,” UPMAIL Technical Report,No. 24 (Computing Science Department, Uppsala University) (1983).
van Emden, R. H.: “An Interpreting Algorithm for Logic Programs,” Proc. 1st International Logic Programming Conference (Marseille) (1982).
Greenblatt, R.: “The Lisp Machine,” MIT AI Lab Working Paper,79 (Cambridge MA) (November, 1974).
Kahn, K. M. and Carlsson, M.: “How to Implement Prolog on a Lisp Machine,” in Implementations of Prolog, J. Campbell (ed.) (Ellis Horwood Ltd., Chichester) (1984).
Kohlbecker, E.: “eu-Prolog,” Technical Report,No. 155 (Indiana University, Computer Science Department, Broomington IN) (April, 1984).
Komorowski, H. J.: “QLOG—The Software for Prolog and Logic Programming,” in Logic Programming, K. Clark and S.-Å. Tärnlund (eds.) (Academic Press, London) (1982).
Komorowski, H.J.: “A Specification of an Abstract Prolog Machine and Its Application to Partial Evaluation,” Ph. D. Thesis (Linköping University, Linköping) (1981).
Kornfeld, W. A.: “Equality for Prolog,” Proc. 8th IJCAI (Karlsruhe) (1983).
McCabe, F.: “Abstract PROLOG machine—a specification” Department of Computing, Imperial College, London) (1983).
Mellish, C. S.: “An Alternative to Structure Sharing in the Implementation of a Prolog Interpreter,” in Logic Programming, K. Clark and S.-Å. Tärnlund (eds.) (Academic Press, London) (1982).
Mellish, C. S. and Hardy, S.: “Integrating Prolog in the POPLOG environment,” in Implementations of Prolog, J. Campbell (ed.) (Ellis Horwood Ltd., Chichester) (1984).
Nakashima, H.: “Prolog/KR Language Features,” Proc. First Logic Programming Conference (Marseille) (September, 1982).
Nilsson, M.: “Foolog—A Small and Efficient Prolog Interpreter,” Technical Report,No. 20 (UPMAIL, Uppsala University) (June, 1983).
Robinson, J. A. and Sibert, E. E.: “Logic Programming in LISP” (School of Computer and Information Science, Syracuse University) (1980).
Strachey, C. and Wadsworth, C. P.: “Continuations—A Mathematical Semantics for Handling Full Jumps” (Programming Research Group, Oxford University) (1974).
Warren, D. H. D.: “Implementing Prolog—compiling predicate logic programs” (Department of Artificial Intelligence, University of Edinburgh) (1977).
Warren, D. H. D.: “An Abstract Prolog Instruction Set” Technical Note,309 (Artificial Intelligence Center, SRI International) (October, 1983).
Author information
Authors and Affiliations
Additional information
Adapted from the paper “On Implementing Prolog In Functional Programming” by MATS CARLSSON appearing in 1984 INTERNATIONAL SYMPOSIUM ON LOGIC PROGRAMMING, February 6–9, 1984, Atlantic City, NJ, pp. 154–159. Copyright © 1984 IEEE.
About this article
Cite this article
Carlsson, M. On implementing Prolog in functional programming. New Gener Comput 2, 347–359 (1984). https://doi.org/10.1007/BF03037326
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF03037326