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_cnffunction as well as ato_dnffunction.Similiarly there's PyEDA which also has both the
to_cnfandto_dnffunction.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