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

Unexpected multiple solutions of setof/3

Open hurufu opened this issue 6 months ago • 2 comments

This query unexpectedly produces multiple answers:

?- setof(X, phrase((...,seq(X)),"abc"), Xs).
   Xs = [[]]
;  Xs = ["abc"]
;  Xs = ["bc"]
;  Xs = ["c"].

But the next succeeds deterministically and behaves as expected:

?- setof(X, phrase(...,"abc",X), Xs).
   Xs = [[],"abc","bc","c"].

I'm struggling to find a minimal example.

hurufu avatar Aug 21 '24 09:08 hurufu