A logical operational semantics of full Prolog
Y. Gurevich recently proposed a framework for semantics of programming concepts which directly reflects the dynamic and resource-bounded aspects of computation. This approach is based on (essentially first-order) structures that evolve over time and are finite in the same way as real computers are (so-called “dynamic algebras”).
We use dynamic algebras to give an operational semantics for Prolog which, far from being hopelessly complicated or too machine-dependent, is both simple and abstract and supports the process oriented understanding of programs by programmers. In spite of its abstractness, our semantics can easily be made machine executable. It is designed for extensibility.
We give this semantics for the full language of Prolog including all the usual non-logical built-in predicates for arithmetic, input/output and manipulation of terms, files and databases. We hope to contribute in this way to reducing the “mismatch between theory and practice ... that much of the theory of logic programming only applies to pure subsets of Prolog, whereas the extra-logical facilities of the language appear essential for it to be practical” (Lloyd 1989). Our specific aim is to provide a mathematically precise but simple framework in which standards can be defined rigorously and in which different implementations may be compared and judged.
Part I deals with the core of Prolog which governs the selection mechanism of clauses for goal satisfaction including backtracking and cut and closely related built-in control predicates including call. In parts II and III the remaining classes of built-in predicates are treated. As a result of the inherent extensibility of dynamic algebra semantics, we are able to proceed by stepwise refinement.
KeywordsLogic Program Logic Programming Operational Semantic Transition Rule Current Goal
Unable to display preview. Download preview PDF.
- Arbab, B. & Berry, D. M. 1987: Operational and Denotational Semantics of Prolog. J. Logic Programming 4, pp. 309–329.Google Scholar
- Berry, D. M. 1985: A denotational semantics for shared-memory parallelism and nondeterminism in: Acta Informatica 21, pp. 599–627.Google Scholar
- Blakley, R. 1990: Ph.D. Thesis, University of Michigan (in preparation).Google Scholar
- Börger, E. 1987: Unsolvable Decision Problems for Prolog Programs, Springer LNCS 270, pp. 37–48.Google Scholar
- Börger, E. 1990: A Logical Operational Semantics of Full Prolog. Part II. Built-in Predicates for Database Manipulations (submitted).Google Scholar
- Börger, E. 1990: A Logical Operational Semantics of Full Prolog. Part III. Built-in Predicates for Files, Terms, In-Output and Arithmetic. In: Proc. Workshop Logic for Computer Science, Berkeley, MSRI, November, 1989 (to appear with Springer Verlag, ed. Y. Moschovakis).Google Scholar
- Deransart, P. & Ferrand, G. 1987: An operational formal definition of Prolog. INRIA RR763 (revised version of the abstract in Proc. 4th Symposium on Logic Programming, San Francisco 1987, pp. 162–172).Google Scholar
- DFPS 1989: Deransart, P., Folkjaer, P., Pique, J.-F., Scowen, R. S.: Prolog. Draft for Working Draft 2.0. ISO/IEC YTC1 SC22 WG17 No. 40, pp. VI + 96.Google Scholar
- Gurevich, Y. 1988: Logic and the Challenge of Computer Science in: Trends in Theoretical Computer Science (E. Börger, ed.), Computer Science Press, 1988, pp. 1–57.Google Scholar
- Gurevich, Y. 1988: Algorithms in the World of Bounded Resources. In: The Universal Turing Machine—a Half-Century Story (Ed. R. Herken), Oxford University Press, pp. 407–416.Google Scholar
- Gurevich, Y. & Morris, J. M. 1988: Algebraic Operational Semantics and Modula-2 in: CSL'87. 1st Workshop on Computer Science Logic (Eds. E. Börger, H. Kleine Büning, M. Richter), Springer LNCS 329, pp. 81–101.Google Scholar
- Gurevich, Y. & Moss, L. S. 1990: Algebraic Operational Semantics and Occam in: CSL'89, 3rd Workshop on Computer Science Logic (Eds. E. Börger, H. Kleine Büning, M. Richter), Springer LNCS.Google Scholar
- Hanus, M. & Sueggel, J. (1989): Eine formale Spezifikation der Warren-Maschine zur Ausführung übersetzter Prolog-Programme. Projektgruppe PROCOM, University of Dortmund, October, 1989.Google Scholar
- Jones, N. D. & Mycroft, A. 1984: Stepwise Development of Operational and Denotational Semantics for Prolog in: Proc. Int. Symp. on Logic Programming 2/84, Atlantic City, IEEE, pp. 289–298.Google Scholar
- Kappel, A. 1990: Implementation of Dynamic Algebras with an Application to Semantics for Prolog (tentative title). Diploma Thesis (ongoing project), University of Dortmund, Fed. Rep. of Germany.Google Scholar
- Lloyd, J. 1989: Current Theoretical Issues in Logic Programming. Abstract. EATCS-Bulletin 39, p. 211.Google Scholar
- LPA 1988: Johns, N. & Spenser, C.: LPA Mac Prolog™ 2.5, Reference Manual. Logic Programming Associates, London.Google Scholar
- Mansfield, A. J. 1989: An Explanation of the Formal Definition of Prolog. NPL Report DITC 149/89, October, 1989, National Physical Laboratory, Teddington, Middlesex, p. 9.Google Scholar
- North, N. 1988: A Denotational Definition of Prolog. NPL Report DITC 106/88. National Physical Lab, Teddington, Middlesex (submitted to the Journal of Logic Programming. I have seen this manuscript in the form of November 16, 1989.).Google Scholar
- Plotkin, G. 1981: A structural approach to operational semantics. Internal Report. CS Dept. Aarhus University, DAIMI FN-19, p. 172.Google Scholar
- Quintus 1987: Quintus Prolog Reference Manual, version 10, February, 1987. Quintus Computer Systems, Mt. View, CA.Google Scholar
- VDL 1969: Lucas P. & Walk, K.: On the formal description of PL/I in: Annual Review in Automatic Programming 6, No. 3.Google Scholar
- VM 1985: VM/Programming in Logic. Program Description and Operations Manual, IBM, 1st ed. July, 1985.Google Scholar
- Warren, D. H. D. 1983: An Abstract Prolog Instruction Set. SRI Techn. Note 309, October, 1983, p. 30.Google Scholar