-
Notifications
You must be signed in to change notification settings - Fork 12
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
setof/3 incorrect #233
Comments
This is important. |
I don't doubt it. It seems to be common problem though, from a common
source.
…On Tue, Jul 4, 2023 at 4:12 PM UWN ***@***.***> wrote:
This *is* important.
—
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEVWJ7ZXZ622IVBB2OLXOOX6XANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Common? Apart from Scryer, I do not see another system with this problem. |
B Prolog. CxProlog. Tau Prolog.
…On Wed, Jul 5, 2023 at 12:32 AM UWN ***@***.***> wrote:
Common? Apart from Scryer, I do not see another system with this problem.
—
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSETSJ3RN3ZKLELXTJV3XOQSRHANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thank you, I'm getting sloppy... . But at least I corrected my test cases. |
Tau works with |
I've been looking into this. Trealla like a number of systems uses a
version of ROK's aggregates.pl, which I thought may be faulty here. But I
looked at Ciao which behaves correctly, and it does the same (but uses an
older version, I believe, that does assert/retract temporarily). Replacing
Trealla's code with that code and... it's still wrong 😢. That said, I
think the fault is in replace_instance_/5, possibly to do with arg/3.
…On Sun, Jul 2, 2023 at 5:44 PM UWN ***@***.***> wrote:
Item#42 <http://www.complang.tuwien.ac.at/ulrich/trealla-prolog/Item#42>
—
Reply to this email directly, view it on GitHub
<#233>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSER6PSSQXQTRRMHJVB3XOERGHANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I write the above mainly as a mental note to myself.
…On Sun, Jul 2, 2023 at 5:44 PM UWN ***@***.***> wrote:
Item#42 <http://www.complang.tuwien.ac.at/ulrich/trealla-prolog/Item#42>
—
Reply to this email directly, view it on GitHub
<#233>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSER6PSSQXQTRRMHJVB3XOERGHANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I added those two tests to the latest Logtalk git version: LogtalkDotOrg/logtalk3@cc74f95. I bit tricky to adapt given that order of solutions returned by |
I have a fix, indeed was arg/3. I thank RO'K for the clue.
…On Sun, Jul 2, 2023 at 5:44 PM UWN ***@***.***> wrote:
Item#42 <http://www.complang.tuwien.ac.at/ulrich/trealla-prolog/Item#42>
—
Reply to this email directly, view it on GitHub
<#233>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSER6PSSQXQTRRMHJVB3XOERGHANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Now it's
These anonymous underscores in answers are all odd. Sometimes they appear, and sometimes they are named. It would be ideal to have no anonymous underscores in answers, similar to SICStus, Scryer. |
Yeah, it's coming. But not until tomorrow.
…On Wed, 5 July 2023, 21:09 UWN, ***@***.***> wrote:
Now it's
?- L=[_,_,_], setof(t,member(E,L),_).
L = [_A,_,_], E = _, unexpected, unsound.
These anonymous underscores in answers are all odd. Sometimes they appear,
and sometimes they are named. It would be ideal to have no anonymous
underscores in answers, similar to SICStus, Scryer.
—
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEWLW4RPAMHRYM76T3TXOVDODANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
It's all perfect, but why and when do you write these intermediary variables? In other words, why not the same as in
(Could be, that you treat the underscores as kind-of-named variables) |
It must be the order the variables are bound.
…On Thu, 6 July 2023, 16:27 UWN, ***@***.***> wrote:
?- L=[_,_,_], setof(t,member(E,L),_).
L = [_A,_B,_C], E = _A
; L = [_A,_B,_C], E = _B
; L = [_A,_B,_C], E = _C.
It's all perfect, but why and when do you write these intermediary
variables? In other words, why not the same as in
?- length(L,3), setof(t,member(E,L),_).
L = [E,_A,_B]
; L = [_A,E,_B]
; L = [_A,_B,E].
(Could be, that you treat the underscores as kind-of-named variables)
—
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEVKNNGERRDGE6YB7NDXOZLF5ANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
What do you mean by the order the variables are bound? |
Yes, one would think these first two would be the same, if not the third as
well..
/trealla (devel) $ tpl
Trealla Prolog (c) Infradig 2020-2023, v2.21.16-dirty
?- length(L,3), setof(t,member(E,L),_).
L = [E,_A,_B]
; L = [_A,E,_B]
; L = [_A,_B,E].
?- L=[_,_,_], setof(t,member(E,L),_).
L = [_A,_B,_C], E = _A
; L = [_A,_B,_C], E = _B
; L = [_A,_B,_C], E = _C.
?- L=[A,B,C], setof(t,member(E,L),_).
L = [A,B,C], E = A
; L = [A,B,C], E = B
; L = [A,B,C], E = C.
?-
…On Thu, Jul 6, 2023 at 5:27 PM UWN ***@***.***> wrote:
?- length(L,3), setof(t,member(E,L),_),L=[_,_,_].
L = [E,_A,_B]
; L = [_A,E,_B]
; L = [_A,_B,E].
?- length(L,3), L=[_,_,_],setof(t,member(E,L),_).
L = [_A,_B,_C], E = _A
; L = [_A,_B,_C], E = _B
; L = [_A,_B,_C], E = _C.
What do you mean by *the order the variables are bound*?
—
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSET24ZYRXNBFJZAWBQ3XOZSELANCNFSM6AAAAAAZ3JEL6M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
In the third case, there are three times two named variables which are unified. So in this situation, one has to state that |
Item#42
The text was updated successfully, but these errors were encountered: