The proof that SAT is NP-complete is constructive proof, so it can be implemented as a program. Has anyone done this?
I am looking for a program (compiler) that takes as input program (which returns true or false) and displays the SAT formula.
So, for example, the compiler can accept the following program (show in pythonic syntax, but any language is fine with me), as input, and output the SAT formula. Submitting the SAT formula to the SAT solver will provide a solution for the certificate parameter. In this case, the solution will be [False, True, True, True, False], which means that {-3, -2, 5} is the solution.
def verify(certificate):
problem = [-7, -3, -2, 5, 8]
sum = 0
for (x, b) in zip(problem, certificate):
if b:
sum += x
return sum == 0
, SAT , , .
? - ?