本文整理汇总了Python中term.Term.from_bool方法的典型用法代码示例。如果您正苦于以下问题:Python Term.from_bool方法的具体用法?Python Term.from_bool怎么用?Python Term.from_bool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类term.Term
的用法示例。
在下文中一共展示了Term.from_bool方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exposed_modifier
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def exposed_modifier(asker, rep):
head = asker.ask(fields.get_field(representations.head(), rep)).answer
if head is None:
return asker.reply(answer=T.no())
else:
result = strings.to_str(asker, head) not in hidden_modifier_heads
return asker.reply(answer=T.from_bool(result))
示例2: deny
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def deny(self):
return self.reply(answer=T.from_bool(False))
示例3: affirm
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def affirm(self):
return self.reply(answer=T.from_bool(True))
示例4: both
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def both(asker, a, b):
for x in [a, b]:
if not to_bool(asker, x):
return asker.reply(answer=T.from_bool(False))
return asker.reply(answer=T.from_bool(True))
示例5: either
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def either(asker, a, b):
for x in [a, b]:
if to_bool(asker, x):
return asker.reply(answer=T.from_bool(True))
return asker.reply(answer=T.from_bool(False))
示例6: irreducible
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def irreducible(asker, rep):
head = asker.ask(fields.get_field(representations.head(), rep)).firm_answer
result = strings.to_str(asker, head) not in reducible_heads
return asker.reply(answer=T.from_bool(result))
#FIXME this is much cleaner, but too slow; at any rate could remove duplicate code
return asker.ask_tail(properties.check(opposite(reducible()), rep))
示例7: check_trivial_default
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def check_trivial_default(asker, property):
if properties.check_firmly(asker, irreducible(), property):
return asker.reply(answer=T.from_bool(False))
示例8: reducible
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def reducible(asker, rep):
head = asker.ask(fields.get_field(representations.head(), rep)).firm_answer
result = strings.to_str(asker, head) in reducible_heads
return asker.reply(answer=T.from_bool(result))
示例9: trivial_is_trivial
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def trivial_is_trivial(asker):
return asker.reply(answer=T.from_bool(True))
示例10: trivial
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def trivial(asker, object):
return asker.reply(answer=T.from_bool(True))
示例11: give_up
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def give_up(asker, m):
return T.from_bool(False)
示例12: direct_inference
# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import from_bool [as 别名]
def direct_inference(asker):
return T.from_bool(True)