scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

`findall/3`: unexpected behavior in some cases

Open haijinSk opened this issue 9 months ago • 4 comments

A file to consult:

fact(a).
fact(b).

facts(L) :- findall(X,fact(X),L).

Unexpected (too-much-non-monotonicity-like behaviour):

?- facts([a,B]).
   false, unexpected.
   B = b. % expected, but not found.

But:

?- facts([A,B]).
   A = a, B = b. % as expected.

haijinSk avatar Apr 13 '25 17:04 haijinSk

Could you please try it with the rebis-dev development branch? With it, I get:

?- facts([a,B]).
   B = b. % expected

triska avatar Apr 13 '25 17:04 triska

My example was with: https://github.com/mthom/scryer-prolog/tree/d18ef52e67319e22694ac03c4301d0c6e5379196

I see, yes, it works as in your example with rebis-dev https://github.com/mthom/scryer-prolog/commit/6e0af25fcdcbeed35d7c3bc5cf9544bb61896b11

So, what does it mean? Should I close this?

haijinSk avatar Apr 13 '25 17:04 haijinSk

I suggest you keep it open until it is resolved also in master (i.e., after rebis-dev is merged). Very nice catch!

triska avatar Apr 13 '25 17:04 triska

Ok, thank you...

haijinSk avatar Apr 13 '25 17:04 haijinSk