Advertisement

Logic continuations

  • Christopher T. Haynes
Session 7b: Models Of Computation And Implementation
Part of the Lecture Notes in Computer Science book series (LNCS, volume 225)

Abstract

We develop a ‘complete’ embedding of logic programming into Scheme—a lexically scoped Lisp dialect with first-class continuations. Logic variables are bound in the Scheme environment and the success and failure continuations are represented as Scheme continuations. To account for the semantics of logic variables and failure continuations, the state-space model of control is modified in a novel way that generalizes the trail mechanism. This assures that logic variable bindings are properly restored when continuations are invoked to perform ‘lateral’ control transfers that are not possible in a traditional logic programming context. It is thereby possible to obtain greater control over logic program behavior by using continuations as first-class objects.

Keywords

Logic Program Logic Programming Logic Variable Control Context Control Transfer 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    Abelson, H., and Sussman, G.J., with Sussman, J., Structure and Interpretation of Computer Programs, MIT Press, 1985.Google Scholar
  2. [2]
    Baker, H.G., Jr., Shallow Binding in Lisp 1.5, C. ACM, 21:565–569 (1978).Google Scholar
  3. [3]
    Bruynooghe, M., The memory management of PROLOG implementations, in: K.L. Clark and S.-A. Tärnlund (eds.), Logic Programming, Academic Press, New York, pp. 83–98 (1982).Google Scholar
  4. [4]
    Carlsson, M., On implementing Prolog in Functional Programming, New Generation Computing, 2:347–359 (1984).Google Scholar
  5. [5]
    Clinger, W.C., Ed., The Revised Revised Report on Scheme, Computer Science Department Technical Report No. 174, Indiana University, Bloomington, Indiana, 1985, and Artificial Intelligence Memo No. 848, MIT, Cambridge, Massachusetts, 1985.Google Scholar
  6. [6]
    Clocksin, W.F. and Mellish, C.S., Programming in Prolog, Second Edition, Springer-Verlag, New York, 1984.Google Scholar
  7. [7]
    Dybvig, R.K., and Smith B., The Scheme Programming Language, Prentice-Hall, 1986.Google Scholar
  8. [8]
    Felleisen, M., Transliterating Prolog into Scheme, Computer Science Department Technical Report No. 182, Indiana University, Bloomington, Indiana, 1985.Google Scholar
  9. [9]
    Friedman, D.P., and Haynes, C.T., Constraining control, Conf. Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages, pp. 245–254 (1985), revised in Computer Science Department Technical Report No. 183, Indiana University, Bloomington, Indiana, 1985.Google Scholar
  10. [10]
    Friedman, D.P., Haynes, C.T. and Kohlbecker, E., Programming with continuations, in: P. Pepper (ed.), Program Transformation and Programming Environments, Springer-Verlag, New York, pages 263–274 (1984).Google Scholar
  11. [11]
    Hanson, C., and Lamping, J., Dynamic Binding in Scheme, unpublished manuscript, 1984.Google Scholar
  12. [12]
    Kahn, K.M., and Carlsson, M., How to implement Prolog on a LISP Machine, in: J.A. Campbell (ed.), Implementations of PROLOG, Halstead Press, New York, pp. 117–134 (1984).Google Scholar
  13. [13]
    Kluźniak, F., and Szpakowicz, S., Prolog for Programmers, Academic Press, 1985.Google Scholar
  14. [14]
    Kohlbecker, E., eu-Prolog, Computer Science Department Technical Report No. 155, Indiana University, Bloomington, Indiana, 1984.Google Scholar
  15. [15]
    Komorowski, H.J., QLOG—the programming environment for Prolog, in: K.L. Clark and S.-A. Tärnlund (eds.), Logic Programming, Academic Press, New York, pp. 315–324 (1982).Google Scholar
  16. [16]
    Landin, P. A correspondence between ALGOL 60 and Church's lambda notation, C. ACM, 8:89–101 and 158–165 (1965).Google Scholar
  17. [17]
    Mellish, C., and Hardy, S., Integrating Prolog in the POPLOG environment, in: J.A. Campbell (ed.), Implementations of PROLOG, Halstead Press, New York, pp. 147–162 (1984).Google Scholar
  18. [18]
    Reynolds, J.C., Definitional interpreters for higher-order programming languages, Proceedings of the 25th ACM National Conference, pp. 717–740 (1972).Google Scholar
  19. [19]
    Robinson, J.A., and Sibert, E.E., LOGLISP: motivation, design and implementation, in: K.L. Clark and S.-A. Tärnlund (eds.), Logic Programming, Academic Press, New York, pp. 299–314 (1982).Google Scholar
  20. [20]
    Srivastava, A., Oxley, D., and Srivastava, D., An(other) integration of logic and functional programming, Proceedings of The IEEE Symposium on Logic Programming, pp. 254–260 (1985).Google Scholar
  21. [21]
    Sussman, G.J., and Steele, G.L., Jr., Scheme: an interpreter for extended lambda calculus", Artificial Intelligence Memo No. 349, MIT, Cambridge, Massachusetts, 1975.Google Scholar
  22. [22]
    Wand, M., Continuation-based program transformation strategies, J. ACM, 27:164–180 (1980).Google Scholar
  23. [23]
    Wand, M., A semantic algebra for logic programming, Computer Science Department Technical Report No. 134, Indiana University, Bloomington, Indiana, 1983.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1986

Authors and Affiliations

  • Christopher T. Haynes
    • 1
  1. 1.Computer Science DepartmentIndiana UniversityBloomingtonUSA

Personalised recommendations