# [eclipse-clp-users] ECLiPSe - Real variables domain propagation problem

Date: Wed, 22 Jul 2009 11:52:48 +0100
Hi,
Hopefully someone can help me with my problem, I have been advised to send
an email to this mailing list.

I have the following predictate

prob_sum([],Sum,Sum).
prob_sum([E | Tail], Sum,End):-
prob_sum(Tail,Sum+E-Sum*E,End).

It take a list of Variables and gets the probabilistic sum fo them.
Somewhere else the sum is then constrained to be less than or equal to some
other variable.
However when the list has more than one element the domains of the variables
in the list don't seem to propagate correctly.
For example consider this query

N::0.0..0.5, NA::0.0..1.0, NC::0.0..1.0, prob_sum([NA,NC],0,M),N1::0.0..1.0,
eval(M) \$=N1, N1 \$=<N.

It gives the result

?- N::0.0..0.5, NA::0.0..1.0, NC::0.0..1.0,
prob_sum([NA,NC],0,M),N1::0.0..1.0, eval(M) \$=N1, N1 \$=<N.
N = N{0.0 .. 0.5}
NA = NA{0.0 .. 1.0}
NC = NC{0.0 .. 1.0}
M = 0 + NA{0.0 .. 1.0} - 0 * NA + NC{0.0 .. 1.0} - (0 + NA - 0 * NA) * NC
N1 = N1{0.0 .. 0.5}
There are 5 delayed goals.
Yes (0.00s cpu)

As you can see the domains for NA and NC remain from 0.0..1.0 when you would
think they should be 0.0..0.5.

Does anyone know how to solve this problem?
It forms part of a larger problem in which I am getting an incorrect result
because of the domains staying between 0.0..1.0.

Any help is appreciated,
Thanks,
Wayne
Received on Wed Jul 22 2009 - 10:52:56 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST