本文整理匯總了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)