Thanks Luis, that worked just fine!
One thing I am confused about, why does the scope control whether or not
the search blocks? If I had to guess I'd say it's probably one of those
well-documented bits of behavior that I kind of just skimmed over. Am I
right?

Thanks again,
Ryan

Luis Quesada wrote:
> Ryan Kaulakis wrote:
> 
>> Hi Everyone,
>> I'm just getting started at using reified constraints, and I've made up
>> an example test program to see how stuff works. I'd like it to find all
>> values of two variables such that they aren't within a certain range of
>> each other (and yes I know you can do that with the distance propagator,
>> I'm trying to see how [x + z < y] OR [x > y + z] works). Everything
>> looks fine to me, but when I run it from the OPI (and anywhere else I'd
>> guess) it suspends and then terminates without doing anything. Can
>> anyone tell me, what's wrong with my code?
>>
> Hi Ryan
> You should declare the FD variables inside the script:
> 
> declare  Foo
> proc {Foo Sol} X Y Z D1 D2 D3 in
>    Sol = sol(x:X y:Y)
>    Z = 2
>    X::1#10
>    Y::1#10
>    (X + Z <: Y) = D1
>    (X >: Y + Z) = D2
>    {FD.disj D1 D2 D3}
>    D3 =: 1
>    {FD.distribute ff [X Y D2 D1 D3]}
> end
> {Browse {SearchAll Foo}}
> 
> Cheers,
> Luis
> 

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

Reply via email to