當前位置: 首頁>>代碼示例>>Python>>正文


Python Term.from_bool方法代碼示例

本文整理匯總了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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:9,代碼來源:convert.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:4,代碼來源:askers.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:4,代碼來源:askers.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:7,代碼來源:convert.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:7,代碼來源:convert.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:8,代碼來源:convert.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:5,代碼來源:convert.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:6,代碼來源:convert.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:4,代碼來源:properties.py

示例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))
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:4,代碼來源:properties.py

示例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)
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:4,代碼來源:properties.py

示例12: direct_inference

# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_bool [as 別名]
 def direct_inference(asker):
     return T.from_bool(True)
開發者ID:paulfchristiano,項目名稱:interpreter,代碼行數:4,代碼來源:properties.py


注:本文中的term.Term.from_bool方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。