From ce75b1a07ef38d729612bc5ea62834327eaa5329 Mon Sep 17 00:00:00 2001 From: "Feras A. Saad" Date: Mon, 2 Mar 2020 15:24:29 -0500 Subject: [PATCH] Remove non-deterministic set operation in dnf normalize (related: #45). --- src/dnf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dnf.py b/src/dnf.py index ec4f665..97b5057 100644 --- a/src/dnf.py +++ b/src/dnf.py @@ -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()