本文整理匯總了Python中Search.determination_list方法的典型用法代碼示例。如果您正苦於以下問題:Python Search.determination_list方法的具體用法?Python Search.determination_list怎麽用?Python Search.determination_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Search
的用法示例。
在下文中一共展示了Search.determination_list方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: true
# 需要導入模塊: import Search [as 別名]
# 或者: from Search import determination_list [as 別名]
def true(self, CE, mapping_list):
assert len(mapping_list) >0
nmapping_list = []
for mapping in mapping_list:
new_self = deepcopy(self)
assert new_self == self
for i in range(len(self.args)):
new_self.args[i] = self.args[i].unify(mapping)
#print 'Searching for %s' % self
if len(Search.determination_list(CE, new_self)) == 0:
continue
if Search.search_true(CE, self) is True:
nmapping_uf = Search.search_true(CE, self, return_mapping=True)
nmapping = {}
for a,b in nmapping_uf.items():
#print a,b
if isinstance(a, Atom):
nmapping[b]=a
else:
nmapping[a]=b
nmapping_list.append(dict(mapping.items() + nmapping.items()))
#print self, mapping_list, nmapping_list
return len(nmapping_list) > 0, nmapping_list