Re: strange behavior of subset

db <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Ok I found the problem :

subset is based on membercheck that succeeds only once.

Bye.
Dominique


Le 07/01/2014 14:17, db a écrit :
> Hello,
>
> I used swi prolog Multi-threaded, 64 bits, Version 7.1.4
> under Ubuntu.
>
> I am suprise by the behavior of the subset predicate :
>
>
> ?- subset([p(A), q(A,B)], [p(1), p(2), q(2,3)]).
> false.
>
>
> ?- subset([p(A), q(A,B)], [p(2), p(1), q(2,3)]).
> A = 2,
> B = 3.
>
> Thus subset takes into account the order of the element
> in the sets, what is not expected when one deals with sets.
>   Is is normal ?
>
> Thanks a lot
>
> Dominique
>
>
>
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>
> !DSPAM:152,52cbff64251284767677671!
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.