|
![](/i/fill.gif) |
On 31/05/2012 02:32 PM, Invisible wrote:
> Actually, there is /already/ an SEqual{} predicate, which is solved if
> two lists are "set-equal". That is, X is a subset of Y and Y is a subset
> of X. More simply, every element of X is also an element of Y and vice
> versa.
Ha! Yes, SEqual{} is already defined. It also doesn't /work/. o_O
The mistake is simple. SEqual{} calls SSubset{}, and SSubset{} has a
bug. Its definition is
SSubset{sub, super}:
(sub = End[]) | (~item ((SMember{item, sub}) & (SMember{item, super})))
;
In other words,
"S is a subset of T if S is the empty set OR _there exists_ an X
which is a member of S and a member of T."
What it /should/ of course say is
"S is a subset of T if S is the empty set OR _for all_ X which is a
member of S, X is a member of T."
In short, I've mixed up "exists" and "for all". Kind of an important
distinction, that one.
Logic Box of course doesn't /have/ an explicit for-all construct. At
this point I am uncertain whether I can work around that...
Post a reply to this message
|
![](/i/fill.gif) |