def main(): """ The main driver. """ # File checking if len(sys.argv) < 2 or len(sys.argv) > 2: print_usage() # Run the front-end, davis-putnam, and back-end fe.front_end(sys.argv[1]) dp.davis_putnam() be.back_end() return
def solve(n): clauses = all_clauses(n) solution = davis_putnam(clauses, set()) if solution != set([frozenset()]): print_board(solution, n) else: print("The problem is not solvable for $n$ queens!") print("Try to increase the number of queens.")
def solve(n): clauses = all_clauses(n) print(clauses) solution = davis_putnam(clauses, Set()) if solution != Set(Set()): print_board(solution, n) else: print("The problem is not solvable for %s queens!" % str(n)) print("Try to increase the number of queens.")