Skip to content

Commit

Permalink
Remove non-deterministic set operation in dnf normalize (related: #45).
Browse files Browse the repository at this point in the history
  • Loading branch information
Feras A. Saad committed Mar 2, 2020
1 parent 929a27c commit ce75b1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def dnf_normalize(event):
]))
if not solutions:
return None
conjunctions = set([
conjunctions = [
reduce(lambda x, e: x & e, [(symbol << S) for symbol, S in clause])
for clause in solutions
])
for i, clause in enumerate(solutions) if clause not in solutions[:i]
]
disjunctions = reduce(lambda x, e: x|e, conjunctions)
return disjunctions.to_dnf()

Expand Down

0 comments on commit ce75b1a

Please sign in to comment.