Oz and Mozart Users Mailing List

How to model this FD problem?


From: Kenneth Olving (kenneth.olving@eoncompany.com)
Date: Tue Aug 21 2001 - 06:27:04 CEST


I've tried before; hope I have any takers this time with a simplified
script...

Given the below script:

        proc {Foo Root}
                A B C
        in
                Root = solution(a:A b:B c:C)

                % domains
                A :: 0#2
                B :: 0#2
                C :: 0#2

                % simple constraint
                {FD.impl A=:1 B::[1 2] 1}

                % starting point
                A=:1
                
                {FD.distribute ff Root}

        end

If solved, it returns 6 solutions:

solution(a:1 b:1 c:0)
solution(a:1 b:1 c:1)
solution(a:1 b:1 c:2)
solution(a:1 b:2 c:0)
solution(a:1 b:2 c:1)
solution(a:1 b:2 c:2)

But: how can I limit the solution such that if a variable isn't
constrained otherwise, the only solution(s) listed for that variable is
the the value 0? In this case:

solution(a:1 b:1 c:0)
solution(a:1 b:2 c:0)

The idea is that I don't know how it's going to turn out; I have all the
domains and rules and I then vary the 'starting point'.

Please, if I can get this to work I'd be happy as a clam...I've
experimented with filters and user-defined distributors etc, but I'm
just not knowledgeable enough to figure it out.

ken1
-
Please send submissions to users@mozart-oz.org
and administriva mail to users-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.