triska / clpz

Constraint Logic Programming over Integers
https://www.metalevel.at/prolog/clpz
184 stars 15 forks source link

tuples_in/2 non-relational #22

Closed UWN closed 1 year ago

UWN commented 1 year ago
?- A = 0, tuples_in([[A,A]],[[0,1],[2,0]]).
   false.
?-        tuples_in([[A,A]],[[0,1],[2,0]]).
   A = 0, unexpected.

As followup to https://github.com/SWI-Prolog/swipl-devel/issues/1160

UWN commented 1 year ago

?- tuples_in([[A,A]],[[0,1],[1,0]]).
   A in 0..1, tuples_in([[A,A]],[[0,1],[1,0]]) % weak, but not incorrect
|  false.  % would be much better
UWN commented 1 year ago

Maybe more convincing:


?-        tuples_in([[A,B]],[[0,1],[2,0]]), A = B.
   false.
?- A = B, tuples_in([[A,B]],[[0,1],[2,0]]), A = B.
   A = 0, B = 0, unexpected.