Beispiel #1
0
        + str(1)
        + " "
        + str(file.variables)
        + " "
        + str(file.clauses)
        + " "
        + str(cpu_secsWalkSAT)
        + " "
        + str(0)
        + "\n"
    )
    file.writeOutput(output, solution)

DPLL = DPLL(KB, file)
start_time = time.time()
solution = DPLL.satisfiable()
cpu_secsDPLL = time.time() - start_time
cpu_secsDPLL = round(cpu_secsDPLL, 2)

# Write to the .sol text file
if not solution:
    output.write(
        "s"
        + " "
        + str(file.formatID)
        + " "
        + str(0)
        + " "
        + str(file.variables)
        + " "
        + str(file.clauses)