>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  Dictionary

11. Classification (Sets and Propositions)

The list -.+./t appended to any classification table t will yield a complete classification table, and the function defined below therefore completes a classification table. The function tab ensures that a scalar or vector argument is treated as a one-rowed table.
```   c=: complete=: (] , (+./ {. ,:)@:-.@:(+./))@:tab
tab=: ,:^:(0:>.2:-#@\$)

c 0 0 1,:0 1 0
0 0 1
0 1 0
1 0 0

c 1 0 1,:0 1 0
1 0 1
0 1 0

(c 1 0 1);(c c 1 0 1);(c 0);(c 1)
+-----+-----+-+-+
|1 0 1|1 0 1|0|1|
|0 1 0|0 1 0|1| |
+-----+-----+-+-+
```
A function that yields a single boolean list is called a proposition; its result is a one-way classification called a set. The classification can, of course, be completed by the complementary set. For example:
```   p1=: 2&<: *. <&5           Set defined by interval
p1a=: (2:<:]) *. (]<5:)    Alternative definition
p2=: = <.                  Set of integers
a=: 2 %~ i. 11
(],p1,p1a,p2,(p1+.p2),:(p1*.p2)) a
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0   0 0   0 1   1 1   1 1   1 0
0   0 0   0 1   1 1   1 1   1 0
1   0 1   0 1   0 1   0 1   0 1
1   0 1   0 1   1 1   1 1   1 1
0   0 0   0 1   0 1   0 1   0 0

list=: 1 : 'x # ]'         Adverb to list elements of set

((p1 list);(p2 list);((p1*.p2)list)) a
+-----------------+-----------+-----+
|2 2.5 3 3.5 4 4.5|0 1 2 3 4 5|2 3 4|
+-----------------+-----------+-----+
```

>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  Dictionary