-
Notifications
You must be signed in to change notification settings - Fork 13
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
Dealing with variables in bagof/3 #614
Comments
I suspect that SWI-Prolog is the ISO behaviour, since
Which is derived from some folklore implementation of bagof/3, Source code: |
Just sayin':
|
Eclipse agrees with SWI, as does Ciao. |
Did you try GNU Prolog? It gives me the same as SWI-Prolog:
I have two issues related to variable handling in Scryer Prolog: Dealing with variables in bagof/3 Dealing with variables in library(tabling) The Problem also shows in tabling. |
|
|
You probably find a ISO test case, one of the examples informative what is the desired behaviour. The test case |
|
I don't have Sicstus or other.... maybe @pmoura |
For what it's worth, the Trealla bagof/3 is basically the old O'Keefe code. |
Then your
SICStus Prolog uses maybe some 1980's Quintus O'Keefes code? what the Quintus branch of Prolog systems does? |
Using your bags.pl:
I just changed term_variables/3 to term_variables/2 since the 3rd arg wasn't used & changed bagof/3 to xbagof/3. If this is definitive I will try using this version as a replacement to the existing implementation and see how other tests go. |
It needs
It should still give:
Its currently correct in Trealla Prolog. |
ok, well Trealla doesn't have term_variables/3 |
Yeah, same here. I first had also only Yes, its from here:
https://github.com/SWI-Prolog/swipl-devel/blob/master/boot/bags.pl |
Ok, going on this defn:
I get:
|
Just testing with Logtalk now. |
Fixed now. You should file an issue with Scryer Prolog as well. |
|
SWI-Prolog has a special ordering behaviour, although
Its sometimes difficult to reproduce these query results. It has to do
Note the different R's. Is it possible to get the SWI-Prolog ordering |
Looks quite bright now, the ticket can be closed now?
In SWI-Prolog the above did explode in the past, when
If long variable instantiation chain happen, the above might need 8 seconds or
When the carried around But mostlikely your are not bugged with this issue now. Here you see
|
P.S. Added 6 new |
Thanks. |
It might be desireable to test setof/3 and aggregate/3 |
The bagof/3 choker:
I get:
Goody, goody! |
I stepped over this test case:
I got a discrepancy between SWI-Prolog and Trealla Prolog:
I am afraid that SWI-Prolog would be the ISO behaviour.
The text was updated successfully, but these errors were encountered: