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?
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?
There's two libraries:
Sympy which has a
to_cnf
function as well as ato_dnf
function.Similiarly there's PyEDA which also has both the
to_cnf
andto_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