Skip to main content
Log in

Transforming generate-and-test programs to execute under committed-choice AND-parallelism

  • Published:
International Journal of Parallel Programming Aims and scope Submit manuscript

Abstract

This paper concerns the exploitation of user transparent inherent parallelism of pure Prolog programs using program transformation. We describe a novel paradigmenumerate-and-filter for transforming generate-and-test programs for execution under the committed-choice model extended to incorporate multiple solutions based on set enumeration. The paradigm simulates OR-parallelism by stream AND-parallelism integrating OR-parallelism, AND-parallelism, and stream parallelism. Generate-and-test programs are classified into three categories:simple generate-and-test, recursively embedded generate-and-test, and deeply intertwined generate-and-test. The intermediate programs are further transformed to reduce structure copying and metacalls. Algorithms are presented and demonstrated by transforming the representative examples of different classes of generate-and-test programs to Flat Concurrent Prolog equivalents. Statistics show that the techniques are efficient.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. K. L. Clark and S. Gregory, A Relational Language for Parallel Programming, inFunctional Programming Languages and Computer Architecture, ACM, New York (1981).

    Google Scholar 

  2. E. Yardeni, S. Kliger, and E. Shapiro, The Languages FCP(∶) and FCP(∶, ?),New Generation Computing,7(2/3):89–107 (1990).

    Google Scholar 

  3. K. Ueda,Guarded Horn Clauses, Technical Report-103, ICOT, Tokyo, Japan (June 1985).

    Google Scholar 

  4. K. Clark and S. Gregory, PARLOG: Parallel Programming in Logic, Research Report Doc 84/4, Dept. of Computing, Imperial College of Science and Technology, London, United Kingdom (1984).

    Google Scholar 

  5. R. Yang and H. Aiso, P-Prolog: A Parallel Logic Language Based on Exclusive Relation, inProc. of the Third International Conf. on Logic Programming, London, pp. 255–269, (July 1986).

  6. D. H. D. Warren, The SRI Model for Or-parallel Execution of Prolog-Abstract design and Implementation, inProc. Symp. on Logic Programming, San Francisco, pp. 92–102 (September 1987).

  7. E. Lusk, R. Butler, T. Disz, R. Olson, R. Overbeek, R. Stevens, D. H. D. Warren, A. Calderwood, P. Szerdi, S. Haridi, P. Brand, M. Carlsson, A. Ciepielewski, and B. Hausman, The Auroraor-parallel Prolog System,New Generation Computing,7(2/3):243–271 (1990).

    Google Scholar 

  8. J. S. Conery, AND-parallelism and Nondeterminism in Logic Programs,New Generation Computing,3:43–70 (1985).

    Google Scholar 

  9. J. S. Conery, Parallel Execution of Logic Programs, Ph.D. Thesis, Kluwer Academic Publishers, Boston (1987).

    Google Scholar 

  10. D.Degroot, Restricted AND-parallelism, inProc. of the International Conf. on FGCS, Tokyo, Japan, pp. 471–478 (November 1984).

  11. S. Haridi and P. Brand, ANDORRA Prolog-An Integration of Prolog and Committedchoice Languages, inProc. of the International Conf. on Fifth Generation Computer Systems, Tokyo, Japan, pp. 745–754 (December 1988).

  12. L. V. Kale, The Reduce-Or Process Model for Parallel Evaluation of Logic Programs,Proc. of the Fourth International Conf. of Logic Programming, Melbourne, Australia, pp. 616–632 (May 1987).

  13. M. J. Wise,Prolog Multiprocessors, Prentice-Hall, Australia (December 1986).

    Google Scholar 

  14. G. Lindstrom and P. Panangaden, Stream-based Execution of Logic Programming,International Symp. on Logic Programming, Atlantic City, New Jersey, pp. 168–176 (1984).

  15. J. C. Cunha, M. C. Ferreira, and L. M. Pereira, Programming in Delta Prolog, inProc. of the Sixth International Conf. on Logic Programming, Lisbon, Portugal, pp. 487–502 (June 1989).

  16. L. M. Pereira, L. Monteiro, J. Cunha, and J. N. Aparicio, Delta Prolog: A Distributed Backtracking Extension with Events, inProc. of the Third International Conf. on Logic Programming, London, United Kingdom, pp. 69–83 (July 1986).

  17. A. K. Bansal, Incorporating Parallelism in Logic Programs by Program Transformation, Ph.D. Thesis, Case Western Reserve University, Cleveland, Ohio 44124(July 1988); Also available as University Microfilms International publications, Ann Arbor, Michigan (1989).

    Google Scholar 

  18. A. K. Bansal and L. S. Sterling, An Abstract Interpretation Scheme for Identifying Inherent Parallelism in Logic Programs, (inNew Generation Computing,7(2/3):273–324 (January 1990).

  19. A. K. Bansal and L. S. Sterling, A Scheme for Abstract Interpretation of Logic Programs using Type Expression, inProc. of the International Conf. on the Fifth Generation Computer Systems, Tokyo, Japan, pp. 422–429 (November 1988).

  20. M. Bruynooghe and G. Jennsens, An Instance of Abstract Interpretation Integrating Type and Mode Inferencing,Proc. of the Fifth International Conf. on Logic Programming, Seattle, pp. 669–683 (August 1988).

  21. K. L. Clark, F. G. McCabe, and S. Gregory, IC-PROLOG Language Features, inLogic Programming, K. L. Clark and S. A. Tarnlund (Eds.), London, Academic Press, pp.253–266.

  22. L. Sterling and M. Codish, PRESSing for Parallelism: A Prolog Program Made Concurrent,J. of Logic Programming,3:75–92 (April 1986).

    Google Scholar 

  23. M. Codish and E. Y. Shapiro, Compiling OR-parallelism into AND-parallelism,International Conf. on Logic Programming, London, United Kingdom, pp. 283–297 (July 1986).

  24. R. Trehan,A Comparison of Committed Choice Non-Deterministic Logic Languages Parallelism in a Mathematical Equation Solver (PRESS), Draft Report, Artificial Intelligence Applications Institute, University of Edinburugh, Edinburugh, United Kingdom (1987).

    Google Scholar 

  25. R. Kowalski,Logic for Problem Solving, Elsevier-North Holland (1979).

  26. L. Sterling and E. Y. Shapiro,The Art of Prolog, MIT Press (1986).

  27. E. Y. Shapiro (eds.), Concurrent Prolog—Collected Papers, MIT Press, Cambridge, Massachusetts (1987).

    Google Scholar 

  28. E. W. Dijkstra, Guarded Commands, Nondeterminacy and Formal Derivations of Programs,CACM 18(8):453–457 (1975).

    Google Scholar 

  29. C. Pyo and U. S. Reddy, Inference of Polymorphic Types for Prolog, inProc. of the North American Conf.of Logic Programming, Cleveland, Ohio, pp. 115–1134 (October 1989).

  30. J. Zobel, Derivation of Polymorphic Types for Prolog Programs, inProc. of the Fourth International Conf. of Logic Programming, Melbourne, Australia, pp. 817–838 (May 1987).

  31. J. B. Dennis and K. S. Weng, An Abstract Implementation for Concurrent Computation with Streams, inProc. of the International Conf. on Parallel Processing, pp. 35–45 (August 1979).

  32. A. K. Bansal and L. S. Sterling, On Source-to-Source Transformation of Sequential Logic Programs to AND-parallelism, inProc. of the IEEE International Conf. on Parallel Processing, St. Charles, Illinois, pp. 795–802 (August 1987).

  33. A. K. Bansal and L. S. Sterling, Compiling Enumerate-and-Filter Programs to Committed-choice AND-parallelism, inProc. of the IEEE International Conf. on Parallel Processing, St. Charles, Illinois, pp. 22–25 (August 1988).

  34. K. Ueda, Making Exhaustive Search Proceedings Programs Deterministic, inProc. of the Third International Conf. on Logic Programming, London, United Kingdom, pp. 270–282 (July 1986).

  35. K. Ueda, Making Exhaustive Search Programs Deterministic Proceedings II, inProc. of the Fourth International Conf. on Logic Programming, Melbourne, Australia, pp. 356–375 (May 1987).

  36. H. Tamaki, Stream-based Compilation of Ground I/O PROLOG into Committed-choice Languages,Proc. of the Fourth International Conf. of Logic Programming, Melbourne, Australia, pp. 376–393 (May 1987).

  37. A. Okumura and Y. Matsumoto, Parallel Programming with Layered Streams,Proc. Symp. on Logic Programming, San Francisco, pp. 224–232 (September 1987).

  38. E. Tick,Performance of Parallel Logic Programming Architectures, ICOT Technical Report TR-421, 136 pages (September 1988).

  39. S. K. Debray, N. Lin, and M. Hermenegildo, Task Granularity Analysis in Logic Programs,Proc. SIGPLAN-90 Conf. on Programming Language Design and Implementation, White Plains, New York (June 1990) (to appear).

  40. E. Tick, Compile time Granularity Analysis for Parallel Logic Programming Languages,Proc. of the International Conf. on Fifth Generation Computer Systems, Tokyo, Japan, pp. 994–1000 (December 1988).

  41. K. A. M. Ali,or-parallel Execution of Prolog on a Multisequential Machine, inInternational Journal of Parallel Programming,15(3):189–214 (June 1986).

  42. J. H. Chang, A. M. Despain, and D. Degroot, AND-parallelism of Logic programs based on Static Data Dependency Analysis,Digest of papers of COMPCON, pp. 218–225 (Spring 1985).

  43. M. Bruynooghe, G. Jennsens, A. Callebaut, and B. Demoen, Abstract Interpretation: towards the Global Optimization of PROLOG Programs,Proc. of the Fourth Symp. on Logic Programming, San Francisco, pp. 192–204 (September 1987).

  44. K. L. Clark and S. Gregory, Notes on the Implementation of PARLOG,J. of Logic Programming,2:17–42 (April 1985).

    Google Scholar 

  45. J. Crammond, An Execution Model for Committed-Choice Non-deterministic Languages, inProc. IEEE Symp. on Logic Programming, Salt Lake City, Utah, pp. 148–158 (1986).

  46. R. Hasegawa and M. Amamiya, Parallel Execution of Logic Programs Based on Dataflow Concepts, inProc. of the International Conf. on FGCS 1984, ICOT, Tokyo, Japan, pp. 507–516 (November 1984).

  47. C. S. Mellish, Abstract Interpretation of Prolog Programs, inProc. Third International Conf. on Logic Programming, London, pp. 463–474 (July 1986).

  48. A. Mycroft and R. A. O'Keefe, A Polymorphic Type System for Prolog, inArtificial Intelligence,23:295:307 (1984).

  49. E. Y. Shapiro, Anor-Parallel Execution Algorithm for PROLOG and its FCP Implementation, inProc. of the Fourth International Conf. of Logic Programming, Melbourne, Australia, pp. 311–337 (May 1987).

  50. S. Zoltan, A System of Precise Modes, inProc. of the Fourth International Conf. on Logic Programming, Melbourne, Australia, pp. 769–787 (May 1987).

  51. A. Takeuchi and K. Furukawa, Parallel Logic Programming Languages, inProc. Third International Conf. on Logic Programming, London, United Kingdom, pp. 242–254 (July 1986).

  52. D. H. D. Warren, L. M. Pereira, and F. Pereira, Users guide to DECsystem-10, Occasional Paper 15, Department of Artificial Intelligence, University of Edinburugh (1979).

  53. M. J. Wise, Derivation of Prolog from First Order Predicate Calculus, Technical Report 8315, Department of Computer Science, University of New South Wales (June 1982).

Download references

Author information

Authors and Affiliations

Authors

Additional information

Funded in part by Cleveland Advanced Manufacturing Program through the State of Ohio as a part of its core research program grant to Center of Automation and Intelligent Systems Research, Case Western Reserve University and NSF equipment grant CDA-8820390 to Kent State University.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bansal, A.K., Sterling, L.S. Transforming generate-and-test programs to execute under committed-choice AND-parallelism. Int J Parallel Prog 18, 401–446 (1989). https://doi.org/10.1007/BF01379187

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01379187

Key Words

Navigation