Tricky CHR behaviour

Hello, I have a CHR as follows:

:- use_module(library(chr)).
:- chr_constraint try/1.

try(X), try(Y) <=> X == Y | writeln(succeed).

then I declared a constraint, but got an unexpected result:

?- try(A).
succeed
try(A).

The unexpected succeed seems to be because Prolog matches try(A) to both try(X) and try(Y). But does this make sense?

Thanks in advance! :slightly_smiling_face:

See A strange behavior of CHR package

However, if you only have grounded constraints, then you should be okay. try(X) by itself doesn’t make sense (at least to me) as a constraint.

Thanks Ian!
From the post your shared, it is a pretty old issue.
Hope this will be fixed, sooner rather than later…