本文整理汇总了Python中Search.search_true方法的典型用法代码示例。如果您正苦于以下问题:Python Search.search_true方法的具体用法?Python Search.search_true怎么用?Python Search.search_true使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search.search_true方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: true
# 需要导入模块: import Search [as 别名]
# 或者: from Search import search_true [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