Sets

From NARS2000
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Z←L§R returns a vector consisting of the elements of L that are not in R.
L is a scalar or one-element vector.
R is a scalar or one-element vector.
Z is the vector result equivalent to (L~R),R~L.


Z←L⊆R returns a Boolean scalar indicating whether or not L is a subset of R.
L is a scalar or one-element vector.
R is a scalar or one-element vector.
Z is the Boolean scalar result equivalent to ∧/L∊R as well as R⊇L.


Z←L⊇R returns a Boolean scalar indicating whether or not L is a superset of R.
L is a scalar or one-element vector.
R is a scalar or one-element vector.
Z is the Boolean scalar result equivalent to ∧/R∊L as well as R⊆L.


These functions behave differently when invoked via the Multiset Operator which takes into account multiplicities.

For example,

      'miasma'§'sis'
mama
      'miasma'§⍦'sis' ⍝ Using the Multiset form
mamas
      'immiss'⊆'mississippi'
1
      'immiss'⊆⍦'mississippi' ⍝ Using the Multiset form
0                             ⍝ because the # m's doesn't match