main_code_refactored.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:LSAT 作者: BillVanderLugt 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号