# A compositional semantics for Concurrent Prolog

- 7 Citations
- 120 Downloads

## Abstract

Concurrent logic languages like Concurrent Prolog have mechanisms in common with imperative concurrent languages: concurrency, communication, synchronization and indeterminacy, finite and infinite behaviour. A goal statement can be considered as a network of processes which run in parallel and can communicate. For imperative concurrent languages a lot of research on the semantics has been done. In this paper we show that a model, which was originally designed for imperative languages, can be used to give a formal description of Concurrent Prolog. This model is compositional: for any two conjunctions *C*_{1}, *C*_{2} the meaning of *C*_{1} ⋀ *C*_{2} can be obtained by applying a function to the meanings of *C*_{1} and *C*_{2}. To be more specific: we shall employ a domain where some choices made during the computation are recorded in certain tree-like structures, and which allows for interleaving. We use tree like structures because it is not possible to use flat structures (like traces or sequences of substitutions). They do not contain enough information to handle deadlock or infinite computations. Such phenomena require that we know at a certain moment in time all the alternatives. The domain is obtained as a solution of a domain equation. We apply metric topological tools to find a solution of the domain equation, and to define operations on elements of the domain. The semantic function maps goals, given a program P, to elements of the domain. This function is defined recursively. The model is able to handle both finite and infinite computations.

## Keywords

Logic Program Logic Programming Operational Semantic Unique Fixed Point Isometric Embedding## Preview

Unable to display preview. Download preview PDF.

## 7. References

- [America & Rutten 1987] P. America, J. Rutten, Solving Reflexive Domain Equations in a Category of Complete Metric Spaces, Proceedings 3rd workshop on the Mathematical Foundations of Programming Language Semantics, to appear.Google Scholar
- [Apt & van Emden 1982] K.R. Apt, M.H. van Emden, Contributions to the theory of logic programming, Journal of the ACM 29, 1982, pp. 841–862.Google Scholar
- [de Bakker & Zucker 1982] J.W. de Bakker, J.I. Zucker, Processes and the Denotational Semantics of Concurrency, Information and Control 54, 1982, pp. 70–120.Google Scholar
- [de Bakker & Zucker 1983] J.W. de Bakker, J.I. Zucker, Compactness in Semantics for Merge and Fair Merge, Proceedings Workshop Logic of Programs, Springer, 1983, pp. 18–33.Google Scholar
- [de Bakker et al 1984] J.W. de Bakker, J.A. Bergstra, J.W. Klop, J.-J.Ch. Meyer, Linear Time and Branching Time Semantics for Recursion with Merge, Theoretical Computer Science 34, 1984, pp. 135–156.Google Scholar
- [Debray & Mishra 1987] S.K. Debray, P. Mishra, Denotational and Operational Semantics for Prolog, Proceedings of 3rd Working Conference on the Formal Description of Programming Concepts, North-Holland, 1987, pp. 245–270.Google Scholar
- [Dugundji 1966] J. Dugundji, Topology, Allyn and Bacon Inc, 1966.Google Scholar
- [van Emden 1986] M. van Emden, Quantitative Deduction and its fixpoint theory, Journal on Logic Programming 1, 1986, pp. 37–53.Google Scholar
- [Engelking 1977] R. Engelking, General Topology, Polish Scientific Publishers, 1977.Google Scholar
- [Fitting 1985a] Fitting, A Deterministic Prolog Fixpoint Semantics, Journal on Logic Programming 2, 1985, pp. 111–118.Google Scholar
- [Fitting 1985b] Fitting, A Kripke-Kleene semantics for Logic Programs, Journal on Logic Programming 4, 1985, pp. 295–312.Google Scholar
- [Gelernter 1984] D. Gelernter, A Note on Systems Programming in Concurrent Prolog, Proceedings 1984 Symposium on Logic Programming, IEEE Comp. Society Press, 1984, pp. 76–82.Google Scholar
- [Lloyd 1984] J.W. Lloyd, Foundations of Logic Programming, Springer, 1984.Google Scholar
- [Levi & Palamidessi 1985] G. Levi, C. Palamidessi, The declarative semantics of logical read-only variables, Proceedings 1985 Symposium on Logic Programming, IEEE Comp. Society Press, 1985, pp. 128–137.Google Scholar
- [Levi & Palamidessi 1987] G. Levi, C. Palamidessi, An approach to the declarative semantics of synchronization in logic languages, to appear.Google Scholar
- [Nait Abdallah 1984] M.A. Nait Abdallah, On the interpretation of infinite computations in logic programming, Proceedings 11th ICALP, (J. Paredaens ed.), Springer, 1984, pp. 358–370.Google Scholar
- [Saraswat 1986] V.A. Saraswat, Problems with Concurrent Prolog, CMU-CS-86-100, Departement of Computer Science, Carnegie-Mellon University, 1986Google Scholar
- V.A. Saraswat, The concurrent logic programming language CP: Definition and Operational Semantics, Proceedings 1987 Principles Of Programming Languages, 1987, pp. 49–62.Google Scholar
- E.Y. Shapiro, A subset of Concurrent Prolog and its interpreter, Techn. Rep. TR-003, ICOT, 1983.Google Scholar
- S. van Veen, E. de Vink, Semantics of Logic Programming, Note CS-N8508, Centre for Mathematics and Computer Science, 1985.Google Scholar