本文整理匯總了Python中pysmt.shortcuts.And.simplify方法的典型用法代碼示例。如果您正苦於以下問題:Python And.simplify方法的具體用法?Python And.simplify怎麽用?Python And.simplify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pysmt.shortcuts.And
的用法示例。
在下文中一共展示了And.simplify方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_create_and_solve
# 需要導入模塊: from pysmt.shortcuts import And [as 別名]
# 或者: from pysmt.shortcuts.And import simplify [as 別名]
def test_create_and_solve(self):
solver = Solver(logic=QF_BOOL)
varA = Symbol("A", BOOL)
varB = Symbol("B", BOOL)
f = And(varA, Not(varB))
g = f.substitute({varB:varA})
solver.add_assertion(g)
res = solver.solve()
self.assertFalse(res, "Formula was expected to be UNSAT")
h = And(g, Bool(False))
simp_h = h.simplify()
self.assertEqual(simp_h, Bool(False))
示例2: test_trivial_false_and
# 需要導入模塊: from pysmt.shortcuts import And [as 別名]
# 或者: from pysmt.shortcuts.And import simplify [as 別名]
def test_trivial_false_and(self):
x,y,z = (Symbol(name) for name in "xyz")
f = And(x, y, z, Not(x))
self.assertEqual(f.simplify(), FALSE())
示例3: test_and_flattening
# 需要導入模塊: from pysmt.shortcuts import And [as 別名]
# 或者: from pysmt.shortcuts.And import simplify [as 別名]
def test_and_flattening(self):
x,y,z = (Symbol(name) for name in "xyz")
f1 = And(x, y, z)
f2 = And(x, And(y, z))
self.assertEqual(f2.simplify(), f1)