You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not assuming that CLP(B) from SWI-Prolog uses branch and bound
for weighted_maximum/2. But theoreticall CLP(B) branch and bound should
work for any constraints, given as freeze/2, when/2, CLP(FD) etc..
I tried this theoretical claim. In my system I get:
/* Jekejeke Prolog 1.5.0 */
?- List = [Alice, Bob, Carla, David], weighted_maximum([5,-3,7,-9], List, Max).
List = [1, 0, 1, 0],
Max = 12 ;
No
?- List = [Alice, Bob, Carla, David], Alice*5-Bob*3+Carla*7-David*9 #<10,
weighted_maximum([5,-3,7,-9], List, Max).
List = [1, 1, 1, 0],
Max = 9 ;
No
But in SWI-Prolog I get:
/* SWI-Prolog 8.3.20 */
?- List = [Alice, Bob, Carla, David], weighted_maximum([5,-3,7,-9], List, Max).
List = [1, 0, 1, 0],
Max = 12.
?- List = [Alice, Bob, Carla, David], Alice*5-Bob*3+Carla*7-David*9 #<10,
weighted_maximum([5,-3,7,-9], List, Max).
false.
Is this unavoidable in SWI-Prolog? Does CLP(Z) fare better?
The text was updated successfully, but these errors were encountered:
I am not assuming that CLP(B) from SWI-Prolog uses branch and bound
for weighted_maximum/2. But theoreticall CLP(B) branch and bound should
work for any constraints, given as freeze/2, when/2, CLP(FD) etc..
I tried this theoretical claim. In my system I get:
But in SWI-Prolog I get:
Is this unavoidable in SWI-Prolog? Does CLP(Z) fare better?
The text was updated successfully, but these errors were encountered: