示例#1
0
 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
示例#2
0
 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()