Skip to content

Commit

Permalink
flatten add children bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
beckydvn committed Sep 21, 2021
1 parent 667a886 commit 98e22b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nnf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ def flatten(nnf: NNF, operator_type: t.Union[And, Or]):
elif type(c) == operator_type:
set_and_children.update(c.children)
else:
set_other.update(c)
set_other.add(c)
nnf = operator_type(set_and_children | set_other)

for c in nnf.children:
Expand Down Expand Up @@ -1919,7 +1919,7 @@ def __call__(self, **settings: str) -> _ConfigContext:
#test nnf nesting - both and's and or's
print()
nnf_formula = Var(1)
for i in range(10):
for i in range(3):
nnf_formula = nnf_formula & (Var(i) | Var(i + 1))
print(nnf_formula)
print()
Expand Down

0 comments on commit 98e22b1

Please sign in to comment.