triska / clpz

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

nvalue/2 non-monotonic #9

Closed UWN closed 7 years ago

UWN commented 7 years ago

(i3a#372)

| ?- B=1, B in 1..2, C in 1..2, #(A)#> #(B),nvalue(A,[B,B,C]),labeling([],[B,C]).
B = 1,
C = 2,
A = 2 ? ;
no
| ?-      B in 1..2, C in 1..2, #(A)#> #(B),nvalue(A,[B,B,C]),labeling([],[B,C]).
no

It's not the labeling:

| ?- B=1, B in 1..2, C in 1..2, #(A)#> #(B),nvalue(A,[B,B,C]), A = 2, B = 1, C = 2.
B = 1,
C = 2,
A = 2 ? ;
no
| ?-      B in 1..2, C in 1..2, #(A)#> #(B),nvalue(A,[B,B,C]), A = 2, B = 1, C = 2.
no

In fact, both can be generalized to:

| ?-       B in 1..2, C in 1..2, #(A)#> #(B),nvalue(A,[B,B,C]).
no
triska commented 7 years ago

It works correctly in the latest version, please have a look.