Path: utzoo!attcan!telly!lethe!torsqnt!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!kddlab!icot32!hawley From: hawley@icot32.icot.or.jp (David John Hawley) Newsgroups: comp.lang.prolog Subject: Re: co-routining Message-ID: <8155@icot32.icot.or.jp> Date: 7 Dec 90 05:33:16 GMT References: Distribution: comp Organization: Fifth Generation Computing Systems (ICOT), Tokyo, Japan Lines: 29 In article ted@nmsu.edu (Ted Dunning) writes: > > >i have two questions about prologs which contain a freeze/2 predicate >such as sicstus prolog. > >1) how can one delay a goal until _either_ of two variables are >instantiated? How about: ?- freeze(X,foo(Flag,G)), freeze(Y,foo(Flag,G)). foo(Flag,G) :- var(Flag), !, Flag=done, G. foo(_,_). By continuations you can do this to an arbitrarily complex delay condition. I think. >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? Don't know. I use a concurrent logic language :-). Speaking of which, our local cll (KL1) runs 3 times slower than our local Prolog (ESP) on the same hardware. If anyone can answer the above question (2), maybe (s)he can comment on the performance hit of doing heavy freeze-based coroutining in Prolog. David Hawley