Power set: Difference between revisions
Content added Content deleted
(RPL: add section) |
m (RPL: add section) |
||
Line 3,706: | Line 3,706: | ||
≪ |
≪ |
||
'''IF''' DUP SIZE |
'''IF''' DUP SIZE |
||
'''THEN''' LAST OVER SWAP GET → |
'''THEN''' LAST OVER SWAP GET → last |
||
≪ LIST→ 1 - SWAP DROP →LIST POWST |
≪ LIST→ 1 - SWAP DROP →LIST '''POWST''' |
||
1 OVER SIZE '''FOR''' j |
1 OVER SIZE '''FOR''' j |
||
DUP j GET |
DUP j GET last + 1 →LIST + '''NEXT''' |
||
≫ |
≫ |
||
'''ELSE''' 1 →LIST '''END''' |
'''ELSE''' 1 →LIST '''END''' |
||
Line 3,716: | Line 3,716: | ||
'''POWST''' ''( { set } -- { power set } )'' |
'''POWST''' ''( { set } -- { power set } )'' |
||
if set is not empty |
if set is not empty |
||
then store |
then store last item |
||
get power set of { set } - |
get power set of ''{ set } - last item'' |
||
for all sets of { set } - |
for all sets of ''{ set } - last item'' power set |
||
add |
add last item to set, then set to power set |
||
else return { { } } |
else return { { } } |