I have been struggling with this problem so I would appreciate your help!
My university task is to write this method:
def removeRedundant(clauses, setOfSupport):
newClauses = set()
for clause in clauses:
if not clause.isRedundant(clauses):
newClauses.add(clause)
newSOS = set()
for clause in setOfSupport:
if not clause.isRedundant(setOfSupport):
newSOS.add(clause)
return newClauses, newSOS
in a different way which avoids these 2 for loops. I am wondering if it is possible to merge these two loops in one or there is even some other way to replace them?
Thank you in advance!