# output_eqn[x].dotPrint2() output_eqn[0].dotPrint2() output_eqn[0].makeQRBDD() #------- Output file --------- outputContent = ".model " + f.name.split('/')[-1].split('.')[0] + '_k_feasible\n.inputs' for inVar in range(0,inputs): outputContent += " x%s" %inVar outputContent += "\n.outputs" for outVar in range(0,outputs): outputContent += " y%s" %outVar for module in range(0,outputs): outputContent += "\n.names" for inVar in range(0,inputs): # must be adjusted to the remaining input parameters outputContent += " x%s" %inVar outputContent += " y%s\n" %module + bdd.bddToBlif(output_eqn[module]) outputContent += "\n.end" #print bdd.bddToBlif(output_eqn[0]) outputFile = open(f.name.split('.')[0] + '_k_feasible.blif', 'w') print >>outputFile, outputContent outputFile.close() print "\n>>> Saved Blif Output to " + outputFile.name
#bdd.Node(variable, TrueNode, FalseNode) n1=bdd.Node('x1', bdd.Node.T, bdd.Node.F) n2=bdd.Node('x1', bdd.Node.T, bdd.Node.F) n3=bdd.Node('x1', bdd.Node.T, bdd.Node.F) n4=bdd.Node('x1', bdd.Node.F, bdd.Node.F) n5 = bdd.Node('x2', n1,n2) n6 = bdd.Node('x2', n3,n4) n7 = bdd.Node('x3', n5, n6) #print n1 #print n2 #print n4 n7.makeQRBDD() n7.makeQRBDD() print "\n###############################\n\nBLIF representation:" print bdd.bddToBlif(n7) n7.dotPrint2() #gen=bdd.createTree(4) #gen.dotPrint2()