本文整理汇总了Python中dd.bdd.BDD._succ[2]方法的典型用法代码示例。如果您正苦于以下问题:Python BDD._succ[2]方法的具体用法?Python BDD._succ[2]怎么用?Python BDD._succ[2]使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dd.bdd.BDD
的用法示例。
在下文中一共展示了BDD._succ[2]方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reduce_combined
# 需要导入模块: from dd.bdd import BDD [as 别名]
# 或者: from dd.bdd.BDD import _succ[2] [as 别名]
def test_reduce_combined():
"""Fig.5 in 1986 Bryant TOC"""
ordering = {'x': 0, 'y': 1, 'z': 2}
g = BDD(ordering)
g.roots.add(2)
g._succ[2] = (0, 3, 4)
g._succ[3] = (1, -1, 5)
g._succ[4] = (1, 5, 6)
g._succ[5] = (2, -1, 1)
g._succ[6] = (2, -1, 1)
h = g.reduction()
assert 1 in h
assert ordering == h.ordering
r = nx.MultiDiGraph()
r.add_node(1, level=3)
r.add_node(2, level=0)
r.add_node(3, level=1)
r.add_node(4, level=2)
r.add_edge(2, 3, value=False, complement=False)
r.add_edge(2, 4, value=True, complement=False)
r.add_edge(3, 4, value=True, complement=False)
r.add_edge(3, 1, value=False, complement=True)
r.add_edge(4, 1, value=False, complement=True)
r.add_edge(4, 1, value=True, complement=False)
(u, ) = h.roots
compare(u, h, r)
示例2: test_elimination
# 需要导入模块: from dd.bdd import BDD [as 别名]
# 或者: from dd.bdd.BDD import _succ[2] [as 别名]
def test_elimination():
ordering = {'x': 0, 'y': 1}
g = BDD(ordering)
g.roots.add(2)
# high == low, so node 2 is redundant
g._succ[2] = (0, 3, 3)
g._succ[3] = (1, -1, 1)
h = g.reduction()
assert set(h) == {1, 2}
示例3: test_isomorphism
# 需要导入模块: from dd.bdd import BDD [as 别名]
# 或者: from dd.bdd.BDD import _succ[2] [as 别名]
def test_isomorphism():
ordering = {'x': 0}
g = BDD(ordering)
g.roots.update([2, 3])
g._succ[2] = (0, -1, 1)
g._succ[3] = (0, -1, 1)
h = g.reduction()
assert set(h) == {1, 2}, set(h)
assert 0 not in h
assert h._succ[1] == (1, None, None)
assert h._succ[2] == (0, -1, 1)
assert h.roots == {2}