本文整理匯總了Python中pysmt.shortcuts.And.get_atoms方法的典型用法代碼示例。如果您正苦於以下問題:Python And.get_atoms方法的具體用法?Python And.get_atoms怎麽用?Python And.get_atoms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pysmt.shortcuts.And
的用法示例。
在下文中一共展示了And.get_atoms方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_ackermannization_dictionaries
# 需要導入模塊: from pysmt.shortcuts import And [as 別名]
# 或者: from pysmt.shortcuts.And import get_atoms [as 別名]
def test_ackermannization_dictionaries(self):
self.env.enable_infix_notation = True
a,b = (Symbol(x, INT) for x in "ab")
f,g = (Symbol(x, FunctionType(INT, [INT, INT])) for x in "fg")
h = Symbol("h", FunctionType(INT, [INT]))
formula1 = Not(Equals(f(a, g(a, h(a))),
f(b, g(b, h(b)))))
formula2 = Equals(a, b)
formula = And(formula1, formula2)
ackermannization = Ackermannizer()
_ = ackermannization.do_ackermannization(formula)
terms_to_consts = ackermannization.get_term_to_const_dict()
consts_to_terms = ackermannization.get_const_to_term_dict()
# The maps have the same length
self.assertEqual(len(terms_to_consts), len(consts_to_terms))
# The maps are the inverse of each other
for t in terms_to_consts:
self.assertEqual(t, consts_to_terms[terms_to_consts[t]])
# Check that the the functions are there
for atom in formula.get_atoms():
if atom.is_function_application():
self.assertIsNotNone(terms_to_consts[atom])