Prolog semantics for measuring space consumption

  • A. Ja. Dikovsky
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 592)


A new operational semantics of Prolog is introduced which allows measuring space consumption of Prolog programs. Space complexity classes are introduced in four subsets of Prolog: kernel Prolog (no structures, no builtins), kernel dynamic Prolog (dynamic clauses control operators allowed), flat Prolog (the subset of kernel Prolog with no lists) and flat dynamic Prolog (the corresponding subset of kernel dynamic Prolog. Main results show that functional programs can be reduced to deterministic ones, any program in kernel Prolog can be transformed into equivalent program with optimized recursion guaranteeing constant local stack and trail, and any program in dynamic kernel Prolog can be transformed into an equivalent purely iterative program.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Lloyd, J.W. Foundations of logic programming. Springer Series Symbolic Computation Artificial Intelligence(1987).Google Scholar
  2. 2.
    Warren, D. An abstract Prolog instruction set. — Tech. note 309, SRI Intern.(1983).Google Scholar
  3. 3.
    Tick, E. Warren, D. Towards a pipelined Prolog processor. New Generation Computing, 2, pp. 323–345(1984).Google Scholar
  4. 4.
    Gallagher, J. Codish, M. Shapiro, E. Specialization of Prolog and FCP programs using abstract interpretation. New Generation Computing, 6, pp. 159–186(1988).Google Scholar
  5. 5.
    Janssens, G. Bruynooghe, M. On abstracting the procedural behavior of logic programs. This volume.Google Scholar
  6. 6.
    Kanamory, T. Kawamura, T. Analyzing success patterns of logic programs by abstract hybrid interpretation. ICOT Tech. Report, TR.279(1987).Google Scholar
  7. 7.
    Debray, S.K. Warren, D.S. Automatic mode inference of logic programs”. J.Logic Programming, 5(3), pp. 207–229(1988).CrossRefGoogle Scholar
  8. 8.
    Mannila, H. Ukkonen, E. Flow analysis of Prolog programs. Proc. 4th Symp. on Logic Programming, pp. 205–214, San Francisco(1987).Google Scholar
  9. 9.
    Mellish, C.S. Abstract interpretation of Prolog programs. Proc. 3d Int. Conf. on Logic Programming, pp. 181–198, London(1986).Google Scholar
  10. 10.
    Boulanger, D. Deep logic program transformation using abstract interpretation. This volume.Google Scholar
  11. 11.
    Bruynooghe, M. The memory management of Prolog implementations. Logic Programming, N.Y, Academic Press, pp. 193–210(1982).Google Scholar
  12. 12.
    Warren, D. An improved Prolog implementation which optimizes tail recursion. Proc. of the Logic Programming Workshop (Tarnlund, S.A. ed.), Debrecen, Hungary(1980).Google Scholar
  13. 13.
    Dikovsky, A.Ja. Space considerations in Prolog. Proc. of the Symp. on Logical Foundations of Comput. Sci. “Logic at Botik'89”, (Meyer, A.R. Taitslineds.), pp.101–107(1989).Google Scholar
  14. 14.
    Gavrilenko, Ju. Recursion and iteration on Cuper algebras (Russ.). To publish.Google Scholar
  15. 15.
    Gavrilenko, Ju. Applications of Cuper algebras to the theory of tail recursion in logic programming (Russ.). To publish.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • A. Ja. Dikovsky
    • 1
  1. 1.Institute for Applied MathematicsMoscowUSSR

Personalised recommendations