def _winnow_all(self):
'''
Apply all the rules to the pool of conceivable permutations.
Winnow out those that satisfy all the rules.
Return: the winnowed pool as a list
'''
pool = self.viable
print ("With {} variables, the pool starts with {} permutations...".format(len(self.vars), len(pool)))
for i, rule in enumerate(self.rules):
print (" ", " ".join(rule.text_list))
pool = self._winnow_one(rule.output, pool)
print ("After rule {} pool size shrunk down to {}".format(i, len(pool)))
print ()
if len(pool)<10: # if the remaining pool is small, go ahead and print it
print(pool)
return pool
评论列表
文章目录