Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个从门对象创建的面向对象的逻辑电路(类似于这里的第二个示例:
http://www.openbookproject.net/books/pythonds/Introduction/ObjectOrientedProgramminginPythonDefiningClasses.html )
我需要将电路表示为 CNF:例如https://ibb.co/W2Z4M3y
有没有图书馆可以做到?或任何其他解决方案?
有两个库:
Sympy 既有to_cnf功能又有to_dnf功能。
to_cnf
to_dnf
类似地,PyEDA也 同时具有to_cnf和to_dnf功能。
您应该检查这两个文档,看看哪一个适合您的需要。
您可以使用Pysathq将文本转换为 DIMACS CNF 格式