Compiling OR-parallelism into AND-parallelism

  • Michael Codish
  • Ehud Shapiro
Session 3a: Concurrent Logic Languages
Part of the Lecture Notes in Computer Science book series (LNCS, volume 225)


This paper suggests a general method for compiling OR-parallelism into AND-parallelism. An interpreter for an AND/OR-parallel language written in the AND-parallel subset of the language induces a source-to-source transformation from the full language into the AND-parallel subset. This transformation can be identified and implemented as a special purpose compiler or applied using a general purpose partial evaluator.

The method is demonstrated to compile a variant of Concurrent Prolog into an AND-parallel subset of the language called Flat Concurrent Prolog (FCP). It is also shown applicable to the compilation of OR-parallel Prolog to FCP. The transformation identified is simple and efficient. The performance of the method is discussed in the context of programming examples. These compare well with conventionally compiled Prolog programs.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    C. Bloch, “Source-to-Source Transformations of Logic Programs”, Weizmann Institute Technical Report CS84-22, 1984.Google Scholar
  2. [2]
    K.L. Clark and S. Gregory, “PARLOG: Parallel programming in logic”, Research Report DOC 84/4, April, 1984.Google Scholar
  3. [3]
    M. Codish, “Compiling OR-Parallelism To AND-Parallelism”, Weizmann Institute of Science, Masters Thesis.Google Scholar
  4. [4]
    Y. Futamura, “Partial evaluation of computation process — an approach to a compiler-compiler”, Systems, Computers, Controls, Vol. 2, No. 5, 1971, pp. 721–728.Google Scholar
  5. [5]
    S. Gregory, “Design, Application and Implementation of a Parallel Logic Programming Language”, Phd. Thesis, Imperial College of Science and Technology, 1985.Google Scholar
  6. [6]
    N.D. Jones, P. Sestoft, H. Sondergaard, “A Experiment in Partial Evaluation: The Generation of a Compiler Generator”, Institute of Datalogy, University of Copenhagen, Denmark, 1985.Google Scholar
  7. [7]
    K. Kahn, “The Compilation of Prolog Programs Without the use of a Prolog Compiler”, UPMAIL, The Dept. of Computing Science, Uppsala University, 1984.Google Scholar
  8. [9]
    J. Levi, “A GHC Abstract Machine and Instruction Set”, 1985, Proceedings of 3rd ICLP, 1986.Google Scholar
  9. [10.
    C. Mierowsky, S. Taylor, E. Shapiro, J. Levy and M. Safra, “The design and implementation of Flat Concurrent Prolog”, Weizmann Institute Technical Report CS85-09, 1985.Google Scholar
  10. [11]
    T. Miyazaki, A. Takeuchi and T. Chikayama, “A sequential implementation of Concurrent Prolog based on the shallow binding scheme”, 1985 Symposium on Logic Programming, IEEE Computer Society, 1985, pp. 110–118.Google Scholar
  11. [12]
    Quintus Prolog Reference Manual, Quintus Computer Systems Inc., 1985.Google Scholar
  12. [13]
    S. Safra, “Partial Evaluation of Concurrent Prolog”, 1986, to appear as a Weizmann Institute Tech. Report.Google Scholar
  13. [14]
    S. Safra, S. Taylor, E. Shapiro, “Distributed Execution of Flat Concurrent Prolog”, Unpublished note, 1985.Google Scholar
  14. [15]
    V.A. Saraswat, “Problems with Concurrent Prolog”, Unpublished note.Google Scholar
  15. [16]
    E. Shapiro, “A subset of Concurrent Prolog and its interpreter”, ICOT Technical Report TR-003, February, 1983.Google Scholar
  16. [17]
    E. Shapiro, “Concurrent Prolog: A Progress Report”, 1985, preliminary version.Google Scholar
  17. [18]
    W. Silverman, A. Houri and M. Hirsch, “Logix user manual, release 1.1”, Weizmann Institute of Science, 1985.Google Scholar
  18. [19]
    A. Takeuchi, “How to solve it in Concurrent Prolog”, Unpublished note, 1983.Google Scholar
  19. [20]
    A. Takeuchi and K. Furukawa, “Partial evaluation of Prolog programs and its application to meta programming”, ICOT Technical Report TR-126, 1985.Google Scholar
  20. [21]
    K. Ueda, “Guarded Horn Clauses”, ICOT Technical Report TR-103, 1985.Google Scholar
  21. [22]
    K. Ueda, “Concurrent Prolog re-examined”, to appear as ICOT Technical Report.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1986

Authors and Affiliations

  • Michael Codish
    • 1
  • Ehud Shapiro
    • 1
  1. 1.Department of Computer ScienceThe Weizmann Institute of ScienceRehovotIsrael

Personalised recommendations