Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bagof/3 #2649

Open
infradig opened this issue Oct 30, 2024 · 5 comments
Open

bagof/3 #2649

infradig opened this issue Oct 30, 2024 · 5 comments

Comments

@infradig
Copy link

infradig commented Oct 30, 2024

Just passing this on:

$ cat q.pl
q(A, _, A).
q(_, A, A).
q(A, _, A).

$ scryer-prolog q.pl
?- bagof(none, q(X,Y,Z), L).
   X = Z, L = [none]
;  Y = Z, L = [none]
;  X = Z, L = [none].
?- 

should be:

$ gprolog
GNU Prolog 1.6.0 (64 bits)
| ?- [q].
(1 ms) yes
| ?- bagof(none, q(X,Y,Z), L).
L = [none, none]
Z = X ? ;
L = [none]
Z = Y
yes


As per SWI, SICStus, Eclipse, Ciao.


@hurufu
Copy link
Contributor

hurufu commented Oct 30, 2024

Similar to #2499

@UWN
Copy link

UWN commented Oct 31, 2024

Similar to #2499

No, #2499 was related to goal expansion.

@UWN
Copy link

UWN commented Oct 31, 2024

Shorter:

?- bagof(t, (X = Z ; Y = Z ; X = Z ), L).
   X = Z, L = "t", unexpected
;  Z = Y, L = "t"
;  X = Z, L = "t", unexpected.
   X = Z, L = "tt" % expected, but not found
;  Z = Y, L = "t"
|  other_answer_sequence.

@UWN
Copy link

UWN commented Oct 31, 2024

Just passing this on:

From trealla#614.

@UWN
Copy link

UWN commented Oct 31, 2024

Shortest (?):

?- bagof(t, ( true ; X = Y ; true ), L).
   L = "t", unexpected
;  X = Y, L = "t"
;  L = "t", unexpected.
   L = "tt" % expected, but not found
;  X = Y, L = "t"
|  other_answer_sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants