Sorry, I forgot to reply to all...
--- Begin Message ---
Hi Jorge,
Hi, all! During some experiments I found a behaviour of cond during search that
I cannot explain. It looks like a bug to me.
I scratched my head for a few minutes to explain this. I thought it was
a bug, too. I started writing my reply in that state of mind. Then I
found out the explanation of that "feature".
S = {FS.var.upperBound [1#20]}
C = ({FS.card S} <: 2)
thread
cond
C = 1
As soon as S becomes a subset of {1}, the reified cardinality constraint
is entailed, hence C=1. So the cond is entailed, too.
In the second case,
S = {FS.var.upperBound [1#20]}
thread
cond
{FS.card S} <: 2
For the same reason as above, the cardinality constraint is entailed.
However, the condition encapsulates two propagators, FS.card and '<:'.
The inequality is entailed, and its propagator terminates. But the
cardinality propagator is not entailed yet. Its two variables are S
(either empty or {1}) and a variable with domain 0#1. You need some
advanced reasoning on lexical scope to realize you can't make it fail.
That's why the subspace created by cond is not entailed.
Therefore the solution is to let the cardinality propagator outside the
cond:
proc {F S}
N
in
S = {FS.var.upperBound [1#20]}
N = {FS.card S}
thread
cond
N <: 2
then
{Browse here}
case {FS.reflect.upperBound S} of
[X] then {FS.include X S}
else skip end
end
end
{Space.waitStable}
{FS.subset S {FS.value.make [1]}}
end
I hope it helps...
Cheers,
raph
--- End Message ---
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users