Specialization in logic programming: From horn clause logic to prolog and concurrent prolog
ABSTRACT. A Prolog or a Concurrent Prolog program can be seen as a specialization or refinement of a program in Horn Clause Logic: In addition to the logic component a Prolog or Concurrent Prolog program contains information about the flow of control. In Prolog we have the cut statement and a leftmost depth first search strategy, in Concurrent Prolog we have read-only variables and commits. In this paper we study the flow of control of these languages by giving transition systems for abstract versions of Prolog, Horn Clause Logic and Concurrent Prolog. On the basis of these transition systems we define operational semantics for all three languages. Three basic sets (success set, finite failure set and the infinite failure set or divergence set) can be derived from the operational semantics. A comparison is made between the different sets: for Prolog we show that the success set and the finite failure sets of a Prolog program are smaller than the corresponding sets of a Horn Clause Logic program. The infinite failure sets are incomparable. A similar comparison is made between the success set and the finite failure sets for Horn Clause Logic and Concurrent Prolog. These comparisons give some feeling what happens if we put extra logical information in Horn Clause Logic programs.
Remark: part of the work was carried out in the ESPRIT Basic Research Action Integration.
Key wordsLogic programming operational semantics Horn Clause Logic Prolog Concurrent Prolog cut operator backtracking committed-choice synchronization mechanisms
Unable to display preview. Download preview PDF.
- [AB87]B. Arbab and D.M. Berry. Operational and denotational semantics of prolog. Journal of Logic Programming, 4:309–330, 1987.Google Scholar
- [dBdV89]A. de Bruin and E. de Vink. Continuation semantics for prolog with cut. In J. Diaz and F. Orejas, editors, Proceedings CAAP 89, volume 351 of Lecture Notes in Computer Science, pages 178–192, 1989.Google Scholar
- [dBK88]J.W. de Bakker and J.N. Kok. Uniform abstraction, atomicity and contractions in the comparative semantics of concurrent prolog. In Proc. Fifth Generation Computer Systems (FGCS 88), pages 347–355, Tokyo, Japan, 1988. Extended Abstract, full version available as CWI report CS-8834.Google Scholar
- [dBK89]J.W. de Bakker and J.N. Kok. Comparative semantics for concurrent prolog. Theoretical Computer Science, 1989. To appear.Google Scholar
- [dBKPR89]F.S. de Boer, J.N. Kok, C. Palamidessi, and J.J.M.M. Rutten. From failure to success: Comparing a denotational and a declarative semantics for horn clause logic. Technical Report CS-R89.., Centre for Mathematics and Computer Science, Amsterdam, 1989.Google Scholar
- [DM87]S.K. Debray and P. Mishra. Denotational and operational semantics for prolog. In M. Wirsing, editor, Formal Description of Programming Concepts III, pages 245–269. North-Holland, 1987.Google Scholar
- [HP79]M. Hennessy and G.D. Plotkin. Full abstraction for a simple parallel programming language. In J. Becvar, editor, Proceedings Mathematical Foundations of Computer Science (MFCS 79), volume 74 of Lecture Notes in Computer Science, pages 108–120. Springer Verlag, 1979.Google Scholar
- [JM84]N.D. Jones and A. Mycroft. Stepwise development of operational and denotational semantics for prolog. In Proceedings International Symposium on Logic Programming (ICLP 84), pages 281–288. IEEE, 1984.Google Scholar
- [KK89]P. Knijnenburg and J.N. Kok. A compositional semantics for the finite and infinite failures of a language with atomized statements. Technical report, University of Utrecht, 1989. To appear in proceedings CSN 89.Google Scholar
- [Llo87]J.W. Lloyd. Foundations of Logic Programming. Springer Verlag, 1987. Second edition.Google Scholar
- [LMP89]G. Levi, M. Martelli, and C. Palamidesssi. A logic programming semantics scheme. Technical report, Dipartimento di Informatica, Università di Pisa, 1989.Google Scholar
- [Plo81]G.D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, Aarhus Univ., Comp.Sci.Dept., 1981.Google Scholar
- [Sar89]V.A. Saraswat. Concurrent Constraint Programming Languages. PhD thesis, Carnegie-Mellon University, 1989.Google Scholar
- [Sha88]E.Y. Shapiro. Concurrent Prology: Collected Papers, volume 1–2. MIT press, 1988.Google Scholar
- [Sha89]E.Y. Shapiro. The family of concurrent logic programming languages. Technical Report CS 89-09, Department of Applied Mathematics and Computer Science, The Weizmann Institute of Science, Rehovot 76100, Israel, 1989.Google Scholar