optimization,satisfiability,cnf

You could use the Riss3g Coprocessor of Norbert Manthey to simplify your CNF. The SAT solver minisat 2 allows to store the preprocessed CNF in a file. Lingeling, a SAT solver from Austria has an option "-s" to simplify CNF clauses. To convert a Boolean expression into a simplified CNF,...

It seems you are over complicating it. Simply use str.split followed by str.strip to get the individual clauses in a list >>> [elem.strip('()') for elem in "(A+B)*(C+D)".split("*")] ['A+B', 'C+D'] You can even extend it to get the individual literals of the clauses as a tuple or lists to get a...