New Generation Computing

, Volume 2, Issue 4, pp 347–359 | Cite as

On implementing Prolog in functional programming

  • Mats Carlsson
Special Issue

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.

Keywords

Continuations Functional Programming Interpreters Logic Programming Prolog 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1).
    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.Google Scholar
  2. 2).
    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).Google Scholar
  3. 3).
    Carlsson, M.: “LM-Prolog—The Language and Its Implementation,” UPMAIL Technical Report (Computing Science Department, Uppsala University) (forthcoming 1984).Google Scholar
  4. 4).
    Carlsson, M. and Kahn, K. M.: “LM-Prolog User Manual,” UPMAIL Technical Report,No. 24 (Computing Science Department, Uppsala University) (1983).Google Scholar
  5. 5).
    van Emden, R. H.: “An Interpreting Algorithm for Logic Programs,” Proc. 1st International Logic Programming Conference (Marseille) (1982).Google Scholar
  6. 6).
    Greenblatt, R.: “The Lisp Machine,” MIT AI Lab Working Paper,79 (Cambridge MA) (November, 1974).Google Scholar
  7. 7).
    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).Google Scholar
  8. 8).
    Kohlbecker, E.: “eu-Prolog,” Technical Report,No. 155 (Indiana University, Computer Science Department, Broomington IN) (April, 1984).Google Scholar
  9. 9).
    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).Google Scholar
  10. 10).
    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).Google Scholar
  11. 11).
    Kornfeld, W. A.: “Equality for Prolog,” Proc. 8th IJCAI (Karlsruhe) (1983).Google Scholar
  12. 12).
    McCabe, F.: “Abstract PROLOG machine—a specification” Department of Computing, Imperial College, London) (1983).Google Scholar
  13. 13).
    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).Google Scholar
  14. 14).
    Mellish, C. S. and Hardy, S.: “Integrating Prolog in the POPLOG environment,” in Implementations of Prolog, J. Campbell (ed.) (Ellis Horwood Ltd., Chichester) (1984).Google Scholar
  15. 15).
    Nakashima, H.: “Prolog/KR Language Features,” Proc. First Logic Programming Conference (Marseille) (September, 1982).Google Scholar
  16. 16).
    Nilsson, M.: “Foolog—A Small and Efficient Prolog Interpreter,” Technical Report,No. 20 (UPMAIL, Uppsala University) (June, 1983).Google Scholar
  17. 17).
    Robinson, J. A. and Sibert, E. E.: “Logic Programming in LISP” (School of Computer and Information Science, Syracuse University) (1980).Google Scholar
  18. 18).
    Strachey, C. and Wadsworth, C. P.: “Continuations—A Mathematical Semantics for Handling Full Jumps” (Programming Research Group, Oxford University) (1974).Google Scholar
  19. 19).
    Warren, D. H. D.: “Implementing Prolog—compiling predicate logic programs” (Department of Artificial Intelligence, University of Edinburgh) (1977).Google Scholar
  20. 20).
    Warren, D. H. D.: “An Abstract Prolog Instruction Set” Technical Note,309 (Artificial Intelligence Center, SRI International) (October, 1983).Google Scholar

Copyright information

© Ohmsha, Ltd. and Springer 1984

Authors and Affiliations

  • Mats Carlsson
    • 1
  1. 1.UPMAIL, Uppsala Programming Methodology and Artificial Intelligence Laboratory, Department of Computing ScienceUppsala UniversityUppsalaSweden

Personalised recommendations