I just added a simple propagator to the puzzle. It's only used in Clue4. Originally it read
{IsAnElt properties(day:sunday month:june) Elts}
This adds these field values to as many of the sister records as possible, generating a new computation for each one. Now this line reads
{PropagateAll properties(month:june) properties(day:sunday) Elts}
This sets up a thread for each sister record. If that sister record ever gets a month value of june, it then unifies the day value with of that record with sunday. If the unification fails, acts as a thread bomb.
-- Russ
On 10/24/05, Russ Abbott <[EMAIL PROTECTED]> wrote:
Note that "X1 precedes X2 in Xs" is also done as a constraint rather than as a search.Of course something has to do some generation sometime. But other than the specific information provided by the problem statement, that is put off until the end. It's like a range declaration at the end instead of at the beginning.Of course, this approach is not able to narrow variables ranges. The constraints are all yes or no. And its search options are not as slick as those in FD. But still it's pretty slick.It's all built on suspension and multiple threads, which aren't available in standard prolog. It doesn't use data flow variables to communicate between distributed processes. It uses them as a way to trigger constraint tests. Of course to do that is to rely on monotonicity.This is an attempt to explore what one can do with suspension and multiple threads without having to use any additional constraint propagation machinery.-- Russ
--On 10/24/05, Russ Abbott <[EMAIL PROTECTED] > wrote:Here is an example of a solution to a Zebra-like logic puzzle using straight logic programming tools (no FD) but with constraints implemented as thread bombs. The puzzle is here: http://www.puzzlersparadise.com/article1021.html.The problem solution, showing the representation used, is here: http://cs.calstatela.edu/~wiki/index.php/Courses/CS_460/Fall_2005/Homework#The_five_sisters_using_an_alternate_representation_.28and_using_thread_bombs.29.The solution code is here: http://cs.calstatela.edu/~wiki/index.php/Courses/CS_460/Fall_2005/Homework#Problem_specific_information . Note how closely the solution code is to the problem statement. The negative statements are expressed negatively, i.e., as constraints, which are implemented as thread bombs.The utilities that enable this are here: http://cs.calstatela.edu/~wiki/index.php/Courses/CS_460/Fall_2005/Homework#Utilities .-- Russ
_____________________________________________
Professor, Computer Science
California State University, Los Angeles
o Check out my blog at http://russabbott.blogspot.com/
--
_____________________________________________
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
