09-3sat_project/src/basic_types.py
def validate(self, solution: list) -> bool:
        """ validates solution against 3-SAT formula """
        passed_clauses = 0
        for triplet in self.literals:
            for literal in triplet:
                if literal < 0:
                    if not solution[abs(literal) - 1]:
                        passed_clauses += 1
                        break
                else:
                    if solution[literal - 1]:
                        passed_clauses += 1
                        break
        return passed_clauses, passed_clauses == self.clauses
 validates solution against 3-SAT formula 
validates solution against 3-SAT formula
validates solution against 3 - SAT formula
def validate(self, solution: list) -> bool:
        passed_clauses = 0
        for triplet in self.literals:
            for literal in triplet:
                if literal < 0:
                    if not solution[abs(literal) - 1]:
                        passed_clauses += 1
                        break
                else:
                    if solution[literal - 1]:
                        passed_clauses += 1
                        break
        return passed_clauses, passed_clauses == self.clauses
def validate ( self , solution : list ) -> bool : passed_clauses = 0 for triplet in self . literals : for literal in triplet : if literal < 0 : if not solution [ abs ( literal ) - 1 ] : passed_clauses += 1 break else : if solution [ literal - 1 ] : passed_clauses += 1 break return passed_clauses , passed_clauses == self . clauses
validates solution against 3-SAT formula
validates solution against 3 - SAT formula
""" validates solution against 3-SAT formula """
self
solution
list