Hi, Russ! Yes, what you call "thread bombs" is an instance of logic programming with concurrency and it is _very_ appealing indeed. However, not everybody looks so keen because despite it's expressiveness it is not so effective as constraint programming to reduce search complexity. Actually, that's the whole point of constraint programming: the earlier there is action (propagation) and failure the better, _especially_ if the variables are not yet determined.
Don't postpone trying to grasp constraint programming. It is totally worth it and then all of the Oz attitude to logic programming becames clear. Cheers, Jorge. Selon Russ Abbott <[EMAIL PROTECTED]>: > I thought that the definition of Permute using thread bombs ( > http://cs.calstatela.edu/~wiki/index.php/Courses/CS_460/Fall_2005/What_programmers_should_know_about_Oz#Using_the_thread_bomb) > was a very cool little illustration of the power of delayed evaluation for > implementing constraints without using extra constraint mechanisms. Isn't > anyone else tickled by it? Is it a technique that is so standard that it > seems like old hat to everyone else? I'm surprised at lack of > response--other than Raph's somewhat sour message. > -- Russ > On 10/24/05, Raphael Collet <[EMAIL PROTECTED]> wrote: > > > > Russ Abbott wrote: > > > I'd be interested in your thoughts on > > > > > > http://cs.calstatela.edu/~wiki/index.php/Courses/CS_460/Fall_2005/What_programmers_should_know_about_Oz#Thread_bombs > > > < > > > http://cs.calstatela.edu/~wiki/index.php/Courses/CS_460/Fall_2005/What_programmers_should_know_about_Oz#Thread_bombs> > > and > > > the example that follows it. > > > > > > It seems like a nice way to use thread-encapsulated suspension to > > > implement go/no-go constraints. > > > > This is the basic requirement for the implementation of a constraint: it > > must be checked when all its variables are determined. > > > > > The idea is embed a constraint in a thread that will fail and kill > > > off the computation if the constraint fails. > > > > > > Now that I'm beginning to know about ByNeed and value.Failed, should > > > this be written differently? This version seems to do the job. > > > > Constraints are usually implemented by "eager" threads, so that they > > fail as soon as possible. ByNeed is more appropriate to functional > > style programming. > > > > Value.failed is used to "transmit" an exception from one thread to > > another. As exception handling is non-declarative, it is rarely used in > > logic or constraint programming contexts. > > > > Cheers, > > raph > > > > > > > > > _________________________________________________________________________________ > > mozart-users mailing list [email protected] > > http://www.mozart-oz.org/mailman/listinfo/mozart-users > > > > > > -- > _____________________________________________ > Professor, Computer Science > California State University, Los Angeles > o Check out my blog at http://russabbott.blogspot.com/ > _________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
