Reputation: 61
i have an object-oriented logical circuit that's created from gate objects (similar to the second example here:
I need to represent the circuit as CNF: for example https://ibb.co/W2Z4M3y
is there any library that can do it? or any other solution?
Upvotes: 2
Views: 727
Reputation: 1994
There's two libraries:
Sympy which has a to_cnf
function as well as a to_dnf
function.
Similiarly there's
PyEDA which also has both the to_cnf
and to_dnf
function.
You should check both the documentations to see which one fits your need.
You can use Pysathq to convert the text to DIMACS CNF format
Upvotes: 2