Path: utzoo!attcan!telly!lethe!torsqnt!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!wuarchive!uunet!kddlab!icot32!icot21!chik From: chik@icot.or.jp (Chikayama Takashi) Newsgroups: comp.lang.prolog Subject: Re: co-routining Message-ID: Date: 7 Dec 90 05:28:13 GMT References: Sender: chik@icot32.icot.or.jp Reply-To: chikayama@icot.or.jp Distribution: comp Organization: Institute for New Generation Computer Technology, Tokyo, Japan. Lines: 22 In-reply-to: ted@nmsu.edu's message of 6 Dec 90 21:55:17 GMT In article ted@nmsu.edu (Ted Dunning) writes: |1) how can one delay a goal until _either_ of two variables are |instantiated? A standard technique is: freeze(X, Y, G) :- freeze(X, V=go), freeze(Y, V=go), freeze(V, G). |2) how can freeze/2 be used to do co-routining? does this require a |modification of what is normally taken to be co-routining? The same technique as in concurrent logic languages like Concurrent Prolog, Parlog or Guarded Horn Clauses is available. See, for example: Ehud Shapiro and Akikazu Takeuchi "Object Oriented Programming in Concucrrent Prolog" in Ehud Shapiro ed. "Concurrent Prolog Collected Papers", Vol. 2 The MIT Press ISBN 0-262-19267-5 Takashi Chikayama