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.
This work was supported by the National Science Foundation under grant number DCR 85-01277.
Preview
Unable to display preview. Download preview PDF.
References
Abelson, H., and Sussman, G.J., with Sussman, J., Structure and Interpretation of Computer Programs, MIT Press, 1985.
Baker, H.G., Jr., Shallow Binding in Lisp 1.5, C. ACM, 21:565–569 (1978).
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).
Carlsson, M., On implementing Prolog in Functional Programming, New Generation Computing, 2:347–359 (1984).
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.
Clocksin, W.F. and Mellish, C.S., Programming in Prolog, Second Edition, Springer-Verlag, New York, 1984.
Dybvig, R.K., and Smith B., The Scheme Programming Language, Prentice-Hall, 1986.
Felleisen, M., Transliterating Prolog into Scheme, Computer Science Department Technical Report No. 182, Indiana University, Bloomington, Indiana, 1985.
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.
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).
Hanson, C., and Lamping, J., Dynamic Binding in Scheme, unpublished manuscript, 1984.
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).
Kluźniak, F., and Szpakowicz, S., Prolog for Programmers, Academic Press, 1985.
Kohlbecker, E., eu-Prolog, Computer Science Department Technical Report No. 155, Indiana University, Bloomington, Indiana, 1984.
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).
Landin, P. A correspondence between ALGOL 60 and Church's lambda notation, C. ACM, 8:89–101 and 158–165 (1965).
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).
Reynolds, J.C., Definitional interpreters for higher-order programming languages, Proceedings of the 25th ACM National Conference, pp. 717–740 (1972).
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).
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).
Sussman, G.J., and Steele, G.L., Jr., Scheme: an interpreter for extended lambda calculus", Artificial Intelligence Memo No. 349, MIT, Cambridge, Massachusetts, 1975.
Wand, M., Continuation-based program transformation strategies, J. ACM, 27:164–180 (1980).
Wand, M., A semantic algebra for logic programming, Computer Science Department Technical Report No. 134, Indiana University, Bloomington, Indiana, 1983.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1986 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Haynes, C.T. (1986). Logic continuations. In: Shapiro, E. (eds) Third International Conference on Logic Programming. ICLP 1986. Lecture Notes in Computer Science, vol 225. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-16492-8_117
Download citation
DOI: https://doi.org/10.1007/3-540-16492-8_117
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-16492-0
Online ISBN: 978-3-540-39831-8
eBook Packages: Springer Book Archive