Hi
With the leq example in paragraph "7.5 Examples" in the online help, I get this (with the latest sources from GIT) :
?- leq(A,B), leq(B,C).
leq(_G61928, _G61932)
leq(_G61929, _G61932)
leq(_G61928, _G61929)
put_attr(B, leq, [suspension(2238, active, t(t(4, suspension(2237, active, t, 0, leq:leq___2__0(A, B, **), leq, A, B), **), x, -, t, t), 0, leq:leq___2__0(B, C, **), leq, B, C), suspension(2237, active, t, 0, leq:leq___2__0(A, B, **), leq, A, B)]),
put_attr(C, leq, [suspension(2239, active, t, 0, leq:leq___2__0(A, C, **), leq, A, C), suspension(2238, active, t(t(4, suspension(2237, active, t, 0, leq:leq___2__0(A, B, **), leq, A, B), **), x, -, t, t), 0, leq:leq___2__0(B, C, **), leq, B, C)]),
put_attr(A, leq, [suspension(2239, active, t, 0, leq:leq___2__0(A, C, **), leq, A, C), suspension(2237, active, t, 0, leq:leq___2__0(A, B, **), leq, A, B)]) ;
fail.
From this answer nothing tells me that _G61928 is bound to A, etc, contray to what the online help prints as the answer.
On this Web interface
http://chr.informatik.uni-ulm.de/~webchr/?load=solvers/leq.pl , one obtains the more satisfactory answer:
?- leq(A,B), leq(B,C) .
leq(A,C),
leq(B,C),
leq(A,B)
yes [0.006 seconds]
This Web CHR site apparently uses Sicstus Prolog 4.
So, is this a bug or a feature ?
Related this is this question: how can one get the content of the constraint store back into the Prolog stack or database ?
This doesn't work:
?- find_chr_constraint(Constraint).
fail.
I tried this too :
ANS = ( leq(A,B), leq(B,C) ).
--
Jean-Marc Vanel
http://jmvanel.free.fr/