[Oz] Generating lists of variables

Christian Schulte schulte at ps.uni-sb.de
Fri Jul 7 15:03:33 CEST 2000


Raphael Collet wrote:
> Now we are close to a solution.  FD.distribute is used to specify the
> order variables will be chosen and the strategy for distribution.
> Actually, the following two lines are equivalent:
> 
>         {FD.distribute ff [X Y]}
>         {FD.distribute ff [X]} {FD.distribute ff [Y]}

No! They are not equivalent! No! You misunderstood the very idea of ff
(first fail): pick the variable with the smallest domain from the
variables supplied to FD.distribute. So these two versions are
different!.


> Thus, you can specify the distribution strategy you expect by saying:
> "Distribute on the first subrecord, then distribute on the second
> subrecord, etc."  This is done by distributing on each field of Channel:
> 
>         {Record.forAll Channel proc {$ X}
>                                   {FD.distribute ff X}
>                                end}

As said, it works but doesn't use ff appropriately. So please do the
following for full satisfaction:

	{FD.distribute ff {List.foldR 
                           {Record.map Channel Record.toList}
                            Append nil}}

Regards
Christian

-- 
Christian Schulte, http://www.ps.uni-sb.de/~schulte/
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list