Although the 2nd rule has two heads and I only added one constraint c(X,Y), the rule still fired (?). This should be considered an unexpected behavior.
The expected behavior is
?- c(X,Y).
c($VAR(X),$VAR(Y)).
The “rule 2 fired” should not be printed, because there is only one constraint. It could matches the 1st constraint at head, but no partner constraint in the store.
Note that apparently the behaviour changed from v7.2 to v7.3 of SWI-Prolog. v7.2:
> swivm use 7.2
Now using SWI-Prolog v7.2.3
> swipl -s test.pl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.2.3)
Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- c(X,Y).
c(_G39140,_G39150)
true .
c(_G39140,_G39150)
v7.3:
> swivm use 7.3
Now using SWI-Prolog v7.3.35
> swipl -s test.pl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.3.35)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
1 ?- c(X,Y).
rule 2 fired
c(X, Y).
Did Leuven make major changes? I guess the 2 directions to find the cause are
a) put their changes into the previous SWI build
b) check the newest SWI with the previous CHR code.