On Mon, Jul 11, 2011 at 7:50 PM, Torsten Anders <
[email protected]> wrote:

> Dear Lyle,
>
> NOTE: the equality constraint is =:, which := is the assignment operator!
>

Yes, sorry. Typo.


>  > how does it get translated into functions?
>
> As far as I know, this syntax translation is not well documented (one of
> the rare cases of missing docs in Oz).
>
> However, by forcing a failure the compiler tells us how this syntax is
> translated.
>

Interesting, thanks! I may have to be clever to come up with ways of
inducing failure sometimes.


> If I remember correctly, propagators can work with larger numbers
> internally, but no FD int (including plain ints) can be larger than FD.sup.
>

It's nice to know that they can work with larger numbers internally.
Otherwise I'd have to guess what input values would lead to what internal
values, which loses some of the value of constraint computation. I can
easily follow a rule of not exceeding a certain value with my constants.


> > if [A B C]::1###1000, and V is unbound, then:
> >
> > A+B+C =: V
> >
> > should be enough for Oz to determine that V must be an FD variable with a
> range from 3 to 3000.
>
> The following code reduces C as expected.
>
> declare
> [A B] = {FD.list 2 1#100}
> C = {FD.decl}
> A+B =: C
>

OK, that's great! So I just have to tell it that it's some kind of FD
variable, not specify bounds. I wonder if it's feasible to extend the
expression parser so that it could see when temporary variables ought to be
FD variables. It would amount to a bit of static type checking, I guess.

- Lyle
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to