Untitled
unknown
plain_text
4 years ago
548 B
6
Indexable
def clean(clause_set, partial_assignment):
clause_set_copy = clause_set.copy()
for clause in clause_set_copy:
for literal in partial_assignment:
negated_literal = -1 * literal
# If literal in clause, remove the clause
if literal in clause:
clause_set.remove(clause)
break
# If negated literal is in the clause, remove the negated literal
if negated_literal in clause:
clause.remove(negated_literal)
return clause_setEditor is loading...