Skip to main content
Log in

Moded flat GHC and its message-oriented implementation technique

  • Regular Papers
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Concurrent processes can be used both for programming computation and for programming storage. Previous implementations of Flat GHC, however, have been tuned for computation-intensive programs, and perform poorly for storage-intensive programs (such as programs implementing reconfigurable data structures using processes and streams) and demand-driven programs. This paper proposes an optimization technique for programs in which processes are almost always suspended. The technique compiles unification for data transfer into message passing. Instead of reducing the number of process switching operations, the technique optimizes the cost of each process switching operation and reduces the number ofcons operations for data buffering.

The technique is based on a mode system which is powerful enough to analyze bidirectional communication and streams of streams. The mode system is based on mode constraints imposed by individual clauses rather than on global dataflow analysis, enabling separate analysis of program modules. The introduction of a mode system into Flat GHC effectively subsets Flat GHC; the resulting language is calledModed Flat GHC. Moded Flat GHC programs enjoy two important properties under certain conditions: (1) reduction of a goal clause retains the well-modedness of the clause, and (2) when execution terminates, all the variables in an initial goal clause will be bound to ground terms. Practically, the computational complexity of all-at-once mode analysis can be made almost linear with respect to the sizen of the program and the complexity of the data structures used, and the complexity of separate analysis is higher only by O(logn) times. Mode analysis provides useful information for debugging as well.

Benchmark results show that the proposed technique well improves the performance of storage-intensive programs and demand-driven programs compared with a conventional native-code implementation. It also improves the performance of some computation-intensive programs. We expect that the proposed technique will expand the application areas of concurrent logic languages.

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. Aït-Kaci, H. and Nasr, R., “LOGIN: A Logic Programming Language with Built-In Inheritance,”J. Logic Programming, 3, 3, pp. 185–215, 1986.

    Article  Google Scholar 

  2. Clark, K. L. and Gregory, S., “PARLOG: Parallel Programming in Logic,”ACM Trans. Prog. Lang. Syst., 8, 1, pp. 1–49, 1986.

    Article  MATH  Google Scholar 

  3. Colmerauer, A., “Prolog and Infinite Trees,” inLogic Programming (K. L. Clark and S.-Å. Tärnlund, eds.), Academic Press, London, pp. 231–251, 1982.

    Google Scholar 

  4. Debray, S. A., “Static Inference of Modes and Data Dependencies in Logic Programs,”ACM Trans. Prog. Lang. Syst., 11, 3, pp. 418–450, 1989.

    Article  Google Scholar 

  5. Byrd, L., Pereira, F. C. N., Pereira, L. M. and Warren, D. H. D.,DECsystem-10 Prolog User’s Manual (D. L. Bowen, ed.), Department of Artificial Intelligence, University of Edinburgh, 1983.

  6. Foster, I. and Taylor, S., “Strand: A Practical Parallel Programming Language,” inProc. 1989 North American Conf. on Logic Programming (E. L. Lusk and R. A. Overbeek, eds.), MIT Press, Cambridge, MA, pp. 497–512, 1989.

    Google Scholar 

  7. Hirata, M., “Programming Language Doc and Its Self-Description or,X=X is Considered Harmful,” inProc. 3rd Conf. of Japan Society of Software Science and Technology, pp. 69–72, 1986.

  8. Jaffar, J., “Efficient Unification over Infinite Terms,”New Generation Computing, 2, 3, pp. 207–219, 1984.

    Article  MathSciNet  Google Scholar 

  9. Kimura, Y. and Chikayama, T., “An Abstract KL1 Machine Instruction Set,” inProc. 1987 Symp. on Logic Programming, IEEE Computer Society, pp. 468–477, 1987.

  10. Morita, M., Yoshimitsu, H., Dasai, T. and Ueda, K., “GHC Compiler on a General-Purpose Computer,” inProc. 35th Annual Convention IPS Japan, Information Processing Society of Japan, pp. 759–760, 1987. [in Japanese]

  11. Morita, M. and Ueda, K., “Optimization of GHC Programs,” inProc. the Logic Programming Conference ’89, ICOT, Tokyo, pp. 203–214, 1989. [in Japanese]

  12. Pereira, F. C. N., “Grammars and Logics of Partial Information,” inProc. Fourth Int. Conf. on Logic Programming (J.-L. Lassez, ed.), MIT Press, pp. 989–1013, 1987.

  13. Saraswat, V. A., Kahn, K. and Levy, J., “Janus: A Step Towards Distributed Constraint Programming,” inProc. 1990 North American Conference on Logic Programming (S. Debray and M. Hermenegildo, eds.), MIT Press, pp. 431–446, 1990.

  14. Shapiro, E. Y. (ed.),Concurrent Prolog: Collected Papers, Vol. 1–2, MIT Press, Cambridge, MA, 1987.

    Google Scholar 

  15. Shapiro, E., “The Family of Concurrent Logic Programming Languages,”Computing Surveys, 21, 3, pp. 413–510, 1989.

    Article  Google Scholar 

  16. Ueda, K., “Guarded Horn Clauses,”doctoral thesis, Faculty of Engineering, University of Tokyo, 1986.

  17. Ueda, K., “Guarded Horn Clauses: A Parallel Logic Programming Language with the Concept of a Guard,”ICOT Technical Report, TR-208, ICOT, 1986. Also inProgramming of Future Generation Computers (M. Nivat and K. Fuchi, eds.), North-Holland, Amsterdam, pp. 441–456, 1988.

    Google Scholar 

  18. Ueda, K., “Parallelism in Logic Programming,” inInformation Processing 89 (G. X. Ritter, ed.), North-Holland, Amsterdam, pp. 957–964, 1989.

    Google Scholar 

  19. Ueda, K., “Designing a Concurrent Programming Language,” inProc. InfoJapan’90, Information Processing Society of Japan, pp. 87–94, 1990.

  20. Ueda, K. and Chikayama, T., “Design of the Kernel Language for the Parallel Inference Machine,”The Computer Journal, 33, 6, pp. 494–500, 1990.

    Article  MathSciNet  Google Scholar 

  21. Ueda, K. and Furukawa, K., “Transformation Rules for GHC Programs,” inProc. Int. Conf. on Fifth Generation Computer Systems 1988, ICOT, Tokyo, pp. 582–591, 1988.

  22. Ueda, K. and Morita, M., “A New Implementation Technique for Flat GHC,” inProc. Seventh Int. Conf. on Logic Programming (D, H. D. Warren and P. Szeredi, eds.), MIT Press, pp. 3–17, 1990.

  23. Ueda, K. and Morita, M., “Message-Oriented Parallel Implementation of Moded Flat GHC,” inProc. Int. Conf. on Fifth Generation Computer Systems 1992, ICOT, Tokyo, pp. 799–808, 1992. Revised version inNew Generation Computing, 11, 3–4, pp. 323–341, 1993.

  24. Warren, D. H. D., “An Improved Prolog Implementation Which Optimises Tail Recursion,” inProc. Logic Programming Workshop (S.-Å. Tärnlund, ed.), Debrecen, Hungary, pp. 1–11, 1980.

  25. Yardeni, E. and Shapiro, E., “A Type System for Logic Programs,” inConcurrent Prolog: Collected Papers (E. Y. Shapiro, ed.),Vol. 2, MIT Press, Cambridge, MA, pp. 211–244, 1987.

    Google Scholar 

  26. Yoshida, K. and Chikayama, T., “AUM — A Stream-Based Concurrent Object-Oriented Language,” inProc. Int. Conf. on Fifth Generation Computer Systems 1988, ICOT, Tokyo, pp. 638–649, 1988. Also inNew Generation Computing, 7, 2–3, pp. 127–157, 1990.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Kazunori Ueda: He received the M. Eng. and Dr. Eng. degrees in information engineering from the University of Tokyo in 1980 and 1986, respectively. He joined NEC Corporation in 1983 and has engaged mainly in the design and implementation of concurrent logic programming languages ever since. From 1985 to 1992, he was with the Institute for New Generation Computer Technology on loan from NEC. Since 1993, he is an Associate Professor in the Department of Information and Computer Science at Waseda University. His current research interests include design and implementation of programming languages, logic programming, concurrency and parallelism, and knowledge information processing.

Masao Morita: He graduated from the electrical engineering course of Kobe Technical College in 1976. He has since worked on wideranging software, including on-line systems and CAD systems, at Mitsubishi Research Institute. Since 1986, he has been engaged in the research and development of concurrent logic language implementations as part of the Fifth Generation Computer Systems project. He also has interest in man-machine interface.

About this article

Cite this article

Ueda, K., Morita, M. Moded flat GHC and its message-oriented implementation technique. New Gener Comput 13, 3–43 (1994). https://doi.org/10.1007/BF03038307

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation