def dpll(clauses, symbols, model):
unknown_clauses = [] <EOL>for c in clauses:<EOL><INDENT>val =  pl_true(c, model)<EOL>if val == False:<EOL><INDENT>return False<EOL><DEDENT>if val != True:<EOL><INDENT>unknown_clauses.append(c)<EOL><DEDENT><DEDENT>if not unknown_clauses:<EOL><INDENT>return model<EOL><DEDENT>P, value = find_pure_symbol(symbols, unknown_clauses)<EOL>if P:<EOL><INDENT>return dpll(clauses, removeall(P, symbols), extend(model, P, value))<EOL><DEDENT>P, value = find_unit_clause(clauses, model)<EOL>if P:<EOL><INDENT>return dpll(clauses, removeall(P, symbols), extend(model, P, value))<EOL><DEDENT>P, symbols = symbols[<NUM_LIT:0>], symbols[<NUM_LIT:1>:]<EOL>return (dpll(clauses, symbols, extend(model, P, True)) or<EOL>dpll(clauses, symbols, extend(model, P, False)))<EOL>
See if the clauses are true in a partial model.