[eclipse-clp-users] strange behaviour of minimize/bb_min

From: Stephan Schiffel <stephan.schiffel_at_...69...>
Date: Wed, 4 Aug 2010 12:01:17 +0200
Hi all,

Consider the following two examples:

?- minimize((member(X,[3,2,1]), Y=X), X).
Found a solution with cost 3
Found a solution with cost 2
Found a solution with cost 1
Found no solution with cost -1.0Inf .. 0

X = 1
Y = 1
Yes (0.00s cpu)

%%%%%%

?- hash_create(H), minimize((member(X,[3,2,1]), hash_add(H,solution,X)), X).
Found a solution with cost 3
Found a solution with cost 2
Found a solution with cost 1
Found no solution with cost -1.0Inf .. 0

H = hash(4, 0, [])
X = 1

%%%%%%

Why is Y in the first goal instantiated to 1 while the hash map in the second 
goal does not contain the solution? Is there a way to make the second goal 
work?

Regards,
Stephan
Received on Wed Aug 04 2010 - 10:01:29 CEST

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