Raul,

Would your suggestions be met if instead of
set =: ~.
the definition were
set =: (/:~)@~.
?

And if that were correct, would "your" definition of
   realset =: 3 : 0
s =. y
for_k. i. >: L. y do. s =. sortset L:k s end.
)

be changed to

   realset =: 3 : 0
s =. y
for_k. i. >: L. y do. s =. set L:k s end. NB. changed
)
?

I think this would enable the system to "compare" more complicated
sets like power sets, for example, whereas I am not sure how your
apparent preference would permit such "compare"s. I am using "compare"
in the sense that Kip combined u and n and iselementof.

My problem with sorting sets is that the user may have a good reason
for the unsorted order of a set and sorting might disrupt that
preference. (My comment earlier about a preference for the verb u0
over u was based on this preference.) So I would prefer a system that
manipulates ordered sets but returns the result to the original
unordered state. I am not sure whether I also would want the
duplicates, if any, restored.

I would also like all of the verbs which produce boolean results to be
prefixed with "is" as are isset and isboxed, but not as for equalset
and in.



On Sat, Aug 15, 2009 at 8:20 AM, Raul Miller<[email protected]> wrote:
> On Fri, Aug 14, 2009 at 11:51 PM, Kip >
> Let us imagine that you have unsorted lists representing sets.
>
> Let us also imagine that you have a set of sequences of sets of sequences
> of sets.
>
> How can you determine if one such set is a subset of another such set?
>
> If your representation of sets had used sorted lists, the answer would
> be the same as for any other question involving subsets.  But if you
> use unsorted lists, you must introduce special code which knows
> about this specific application domain, to sort your sets (level 4, 2 and 0)
> just before you make your comparison.
>
> Note also that if you use realset on the sequences (level 3 and 1)
> that you will sometimes be treating sequences as identical which
> were different.
>
> The sequence 1 0 1 0 1 is different from the sequence 0 1 0 1 0.
> Likewise, the sequence {{}}, {}, {{}}, {}, {{}} is different from
> the sequence {}, {{}}, {}, {{}}, {}.  And, so on...
>
>
> I do not see the benefit in this form of generality.
>
> I mean, yes, I can see that the array ?100#2 can represent a set, and
> so can i.2 3 4 5 6, but I do not see any value in introducing complexities
> so that I can manipulate them with the same primitives.

-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to