Bug in CHR; SWI 8.2.4

I noticed a bug in CHR SWI 8.2.4.

Test program:

%% testProp
:- use_module(library(chr)).
:- chr_constraint c/1.
c(X) \ c(Y)
<=>
write('matching head '), write(c(X)), write(' \\ '), write(c(Y)), nl
|
write('removed '), write(c(Y)), nl.

Test run, Mac OS 11.2.2

henning$ /Applications/SWI-Prolog.app/Contents/MacOS/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit [https://www.swi-prolog.org](https://www.swi-prolog.org/)
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- [testProp].
true.
?- c(X).
matching head c(_95486) \ c(_95486)
removed c(_95486)
c(X).
?-

It is some time I used CHR, so I cannot say in which release the bug has arisen; in 6.2.1 all is OK:

?- c(X).
c(_G18063)
true .
c(_G18063)
?- c(x),c(y).
matching head c(x) \ c(y)
removed c(y)
c(x)
true .
c(x)
1 Like