Power set: Difference between revisions

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

edits