Luis,
Sorry for not getting back pronto - I'll just have to leave this
interesting discussion for a while since my colleagues want me to focus
on some real-world immediate issues for a change...:-). But, I've gotten
a lot of good feedback (and esp. thanks for the sample script) from you
(and others) so I'll digest it slowly in the background and return to
this or similar topics later.
Thanks for your help so far, it's been most illuminating.
ken1
> -----Original Message-----
> From: Luis Quesada [mailto:luque@info.ucl.ac.be]
> Sent: Saturday, August 25, 2001 11:04
> To: users@mozart-oz.org
> Subject: Re: How to model this FD problem?
>
>
> Dear Kenneth:
>
> I don't know what you mean for "if I leave out the System.show of the
> solution(s) I get almost identical times". What I mean is that the
> number of * nodes of the search tree * can grow in a
> dramatic way using
> your solution.
>
> I just added another variable in the following example, however the
> tree is 20 times bigger. Using my solution the number of
> nodes is still
> one!
>
> declare
> proc {Foo Root}
> A B C D Dis
> in
> Root = solution(a:A b:B c:C d:D)
> [A B C]:::0#50
> {FD.impl A=:1 (B::1#20)+(C::1#20)+(D::1#20)=:3 1}
> A=1
> {Space.waitStable}
> Dis = {Record.filter Root fun {$ X} {Not {FD.reflect.min
> X} == 0}end}
>
> {FD.distribute ff Dis}
> end
> {ExploreAll Foo}
>
> BTW,
>
> {FD.impl A=:1 B::1#20 1}
> {FD.impl A=:1 C::1#20 1}
> {FD.impl A=:1 D::1#201}
>
> is equivalent (in terms of solutions) to
>
> {FD.impl A=:1 (B::1#20)+(C::1#20)+(D::1#20)=:3 1}
>
> and it also equivalent to:
>
> or A=:1 B::1#20 C::1#20 D::1#20 [] A\=:1 end.
> (This is what I meant when I told you about the rule in my previous
> message)
>
> Another useful rule could be:
>
> A1->B
> A2->B
> .
> .
> .
> An->B
> ____________________
> A1 \/ A2 \/...\/ An -> B
>
> You can use the above to reduce
>
> {FD.impl A=:1 B::1#20 1}
> {FD.impl A=:2 B::1#20 1}
> {FD.impl A=:3 B::1#201}
>
> to
>
> {FD.impl A::1#3 B::1#20 1} (in case you decide to keep your solution)
>
> In the attachment there is a *naive* alternative to create the script
> dynamically (I call it in that way because it was the first idea that
> came to my mind so I am not sure it is the best one :-). In
> short, the
> idea is to read the definition of the root variable from a stream (see
> the comments in the code). Note that the definition of the stream and
> the definition of the script are two processes that run concurrently.
>
> Cheers,
>
> Luis
>
> PD: I don't think your questions are stupid.
>
> --
> Catholic University of Louvain
> Department of Computing Science and Engineering
> Place Sainte Barbe, 2
> B-1348 Louvain-la-Neuve, Belgium
> Phone: (++32) (10) 47 90 13
> Fax: (++32) (10) 45 03 45
> E-mail: luque@info.ucl.ac.be
>
>
>
>
>
>
>
>
>
>
>
>
>
>
-
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/.