def generateCNFVariables(self,circuitfile): ###generate (cnf,vars) as code values C = [] for line in file(circuitfile): if line.strip(): C.append(eval(line)) (self.cnf,self.variables) = SATfunctions.circuit_to_cnf(C)
def generateDimacs(self,code,dimacsfile): ###generates a dimacs file from the CNF form dimacs = SATfunctions.cnf_to_dimacs(self.cnf) f = open(dimacsfile,'w') f.write(dimacs) f.close()