(self, formula)
return frozenset(res)
Convert formula into an Equisatisfiable CNF.

        Returns a set of clauses: a set of set of literals.
Convert formula into an Equisatisfiable CNF.
Convert formula into an Equisatisfiable CNF .
def convert(self, formula):
        """Convert formula into an Equisatisfiable CNF.

        Returns a set of clauses: a set of set of literals.
        """
        tl, _cnf = self.walk(formula)
        res = [frozenset([tl])]
        for clause in _cnf:
            if len(clause) == 0:
                return CNFizer.FALSE_CNF
            simp = []
            for lit in clause:
                if lit.is_true():
                    # Prune clauses that are trivially TRUE
                    simp = None
                    break
                elif not lit.is_false():
                    # Prune FALSE literals
                    simp.append(lit)
            if simp:
                res.append(frozenset(simp))
        return frozenset(res)
def convert ( self , formula ) : tl , _cnf = self . walk ( formula ) res = [ frozenset ( [ tl ] ) ] for clause in _cnf : if len ( clause ) == 0 : return CNFizer . FALSE_CNF simp = [ ] for lit in clause : if lit . is_true ( ) : # Prune clauses that are trivially TRUE simp = None break elif not lit . is_false ( ) : # Prune FALSE literals simp . append ( lit ) if simp : res . append ( frozenset ( simp ) ) return frozenset ( res )