Пример #1
0
 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)
Пример #2
0
    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()