def solve(self, solver=pycosat_solve): clauses = self.clauses + \ assignment_to_clauses(self.assignment, self.names) model = solver(clauses) if model is None: return False model = lits_to_assignment(model, self.reverse) self.assignment = model return True
def simplify(self): clauses = self.clauses + \ assignment_to_clauses(self.assignment, self.names) self.clauses, self.partial, self.free = simplify_clauses(clauses) self.reset_assignment()