Ordered and Unordered sets

Top  Previous  Next

Ord and the leads and lags below only work on ordered sets.  Such sets must have explicit element definitions and cannot contain calculated elements, only sets with a priori specified values.  Unordered sets are those that are not ordered.  The universal set is ordered and any set may be reported in ordered form using the special predefined tuple set SortedUels(*,*).  For example, to write a set in sorted order:

 

alias(*,u);

loop(SortedUels(u,i),

    put / i.tl i.te(i) );

 

Sets with explicit elements are not always ordered if the elements are defined in two explicitly specified sets and are referenced out of order in the second one as discussed here.