Dear Torsten,

2009/3/25 Torsten Anders <[email protected]>

> On 23 Mar 2009, at 18:32, Raphael Collet wrote:
>
> The nice equation syntax does not work with distributed programs :-(
>
>
> In order to replace all occurances of these operators I tried to come up
> with a list of their corresponding plain procedures. However, I was unable
> to find the procedures for =: and \=:
>
> Here is what I can up with. Any problem here? Did I perhaps miss any
> convenience notation?  What are the procedures for =: and \=:?
>
> :: / :::                 - FD.int, FD.decl
> Addition etc   - FD.sum, FD.plus, FD.minus
> <: etc.              - FD.less, FD.lesseq, FD.greater, FD.greatereq
> =: / \=:              - ??
>

In fact, all equations and inequations are translated to calls to FD.sum,
FD.sumC, and FD.sumCN, depending on the respective complexity of the
polynomial involved.  This holds for all the relational operators '=:',
'\=:', '<:', '=<:', '>:', and '>=:'.

For instance,
A+B+C =: 10     =>     {FD.sum [A B C] '=:' 10}
A+2*B <: C        =>     {FD.sumC [1 2 ~1] [A B C] '<:' 0}
A+B*C >=: D     =>     {FD.sumCN [1 1 ~1] [[A] [B C] [D]] '>=:' 0}

I think you can observe the translation if you compile a statement to its
"core" syntax.  Just be careful, because the core syntax expansion makes
direct reference to some builtins that are behind FD.sum*.  You should not
use those builtin references directly in your program.

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

Reply via email to