home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / parallel / 1795 < prev    next >
Encoding:
Text File  |  1992-07-24  |  3.7 KB  |  83 lines

  1. Newsgroups: comp.parallel
  2. Path: sparky!uunet!gatech!hubcap!fpst
  3. From: mmh@cs.qmw.ac.uk (Matthew Huntbach)
  4. Subject: Re: CSP to STRAND/Parlog
  5. Message-ID: <1992Jul24.104839.9229@dcs.qmw.ac.uk>
  6. Sender: usenet@dcs.qmw.ac.uk (Usenet News System)
  7. Nntp-Posting-Host: tea.dcs.qmw.ac.uk
  8. Organization: Computer Science Dept, QMW, University of London, UK.
  9. References: <1992Jul23.134920.4944@hubcap.clemson.edu>
  10. Date: Fri, 24 Jul 1992 10:48:39 GMT
  11. Approved: parallel@hubcap.clemson.edu
  12. Lines: 69
  13.  
  14. From: Steven Zenith <zenith@kai.com>
  15. >In article <1992Jul20.075511.17628@dcs.qmw.ac.uk>, mmh@cs.qmw.ac.uk
  16. >Matthew Huntbach writes:
  17. >
  18. >> If you think that Strand or Parlog are basically
  19. >> "parallel Prologs", you are completely wrong. Many people who
  20. >> program in them, such as myself, think of them more in CSP-like
  21. >> terms than in Prolog-like terms.
  22. >
  23. >I'm pleased to hear it, I don't dispute that a parallel between CSP and
  24. >Strand or Parlog can be drawn - but you don't answer my question: why is the
  25. >parallel between committed choice concurrent logic languages closer than any
  26. >other (say, CSP and functional or concurrent imperative languages)?
  27.  
  28. The parallel is shown by the name the ICOT team gave to their
  29. version of the language "Guarded Horn Clauses". The Guarded
  30. clauses which from the basis of Strand/Parlog/GHC are
  31. very similar (in fact taken from) the guarded commands of CSP.
  32.  
  33. The logic variables of Strand/Parlog/GHC can be used as
  34. CSP-like channels. A logic variable shared between two
  35. processes (a term which many Strand/Parlog/GHC programmers
  36. prefer to the logic-oriented "goal") may be consideed as a
  37. channel. Suppose we have two processes p(X,C),q(C,Y). If the
  38. process p(X,C) binds C to [message|C1] i.e. a list with unbound
  39. tail, and rewrites recursively to p(X,C1), it has in effect
  40. sent a message over the channel C to the q process. The q
  41. process is effectively suspended waiting for this message if it
  42. rewrites using a clause of the form:
  43.  
  44. q([H|T],Y) :- process(H),q(T,Y).
  45.  
  46. since a Strand/Parlog/GHC goal will not rewrite until its
  47. arguments are sufficiently bound for it to be able to commit to
  48. a clause without any outwards unification.
  49.  
  50. These things are not CSP-like elements bolted on to a language,
  51. they are what Strand/Parlog/GHC are all about. That is why I
  52. see these languages as essentially logical CSP.
  53.  
  54. >It wasn't clear from your earlier posts that execution was your primary
  55. >interest. I'm still not sure that if I was considering a target language for
  56. >the execution of CSP scripts that STRAND or Parlog would be a good choice.
  57. >So, we should clarify what you are interested in when executing CSP scripts.
  58.  
  59. A CSP script translated into Strand can be tested by executing
  60. it. As a logic language, Strand programs are open to program
  61. reasoning and transformation techniques in a way which CSP
  62. scripts are not. I find it far easier to see what a Strand
  63. program is doing than what a CSP script is supposed to do. In
  64. fact, it's difficult to see why anyone should bother with CSP
  65. at all when Strand is easier to program in, easier to reason with
  66. understand, and just as powerful.
  67.  
  68. As an illustration, one of my recent pieces of work has been to
  69. take an algorithm written in CSP (Lavallee and Roucairol's
  70. Minimum Spanning Tree algorithm in Information Processing
  71. Letters 23 (1986) pp.55-62). I hand translated it to Strand,
  72. which instantly revealed a number of small errors in the
  73. specification, instantly explained to me what it actually did
  74. (I was very unclear when I just looked at the CSP) and enabled
  75. me to hack around with the Strand code for a bit to produce a
  76. much improved version of this distributed minimal spanning tree
  77. algorithm (Technical Report giving more details available from
  78. me at Queen Mary and Westfield College, Dept. of Computer Science,
  79. Mile End Road, London E1 4NS, UK).
  80.  
  81. Matthew Huntbach
  82.  
  83.