Constraints on array's

Gianni Alberti c2s.computer at interbusiness.it
Mon Feb 11 12:27:52 CET 2002


Tks.
Based on Yr answer I wrote the attached small oz program to play
around whit 2 dim array:
I would like to know if possibile why doesn't work and exit without a
solution
or errors.
I compiled it using ozc -x 1.oz to make the exe
Tks in advance
Best Regards

"Frank Rehberger" <Frank.Rehberger at web.de> ha scritto nel messaggio
news:1012918106.4567.35.camel at papaya.casa.de...
> On Tue, 2002-02-05 at 13:42, Gianni Alberti wrote:
> > Tks for Yr suggestion , but I 'm basically a programmer and short on my
> > spare time.
> > Tutorials are usefuls but sometimes pieces of code would help better.
> > So a  part the model I'm referring to let put my questions in this way:
> > 1)Do You can provide pieces of code examples on how to define a 2 dim
> > array of FD variables ?
>
> %%
> %% returns 2 dim arrays (of records)
> %% N: number of rows
> %% M: number of cols
> %%
>    fun{Create2DAr N M}
>       ColIdcs={List.number 1 N 1}
>       RowIdcs={List.number 1 M 1}
>    in
>       {List.toRecord row
>        {List.map ColIdcs
> fun{$ R} R#{FD.record col RowIdcs 0#FD.sup} end
>        }
>       }
>    end
>
>
> > 2)collect the variables and distribute over them : what do You mean
exactly
> > ?
>
> FDVar={FD.decl}
> Ar2D={Create2DAr 4 6}
>
> FDVar=:Ar2D.1.1  && access Fd-Var within 2D-array
>
> %% transforms inner and outer records to lists and flatten them
> %% to a single list afterwards
> CollectedFDVars={List.flatten {List.map
>                                   {Record.toList Ar2D} Record.toList
>                               }
>                 }
>
> %% first fail (ff) distribution
> %% i.e. at first choose variable that offers few alternatives
> %%
> {FD.distribute ff CollectedFDVars}
>
> Regards, Frank
>
> --
> -------------------------------------------------
>  Frank.Rehberger at acm.org
> -------------------------------------------------
>  The Twelve Networking Truths
>  http://www.ietf.org/rfc/rfc1925.txt?number=1925
> -------------------------------------------------
>
>
> -
> 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/.

           Name: 1.oz
   1.oz    Type: unspecified type (application/octet-stream)
       Encoding: x-uuencode
-
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