Sep 18, 2006 ------------- - Recap how to write puzzles as satisfiability problems - magic square puzzle - 8-queens puzzle - five letter words with four vowels - Use consistent boolean form - conjunction of disjunctions - every clause is a disjunction - puzzle is a list of clauses - After writing such expressions how do we solve them? - many approaches - Trivial way: model checking - test out all exponential number of rows - brute force! - Better algorithms - GSAT - DPLL - GSAT - Guess a value assignment for all variables - See if it works - Else, pick a variable and flip it - go back to step 2 - GSAT is - sound: if it finds an answer, that is indeed a solution - not complete: not guaranteed to find solution even when it exists - DPLL - Named after inventors - Davis, Putnam, Logemann, and Loveland - DPLL also has - exponential worst case time complexity - but has lots of tricks up its sleeve - Example DPLL heuristic - "pure symbol" heuristic - if a variable always appears in negated, or non-negated form, - pick the value that will make it to be true - forward propagate the value - some new symbol might become a pure symbol - Example where this heuristic solves the puzzle! - Another DPLL example - look for "unit clauses" - make them true - forward propagate and see what happens to rest - Much more is needed in full fledged implementation of DPLL - modern implementations can solve problems with hundreds of variables and thousands of clauses - example domain: hardware verification - Next problem in propositional logic - Proving theorems, not model checking - Simple rules - Modus Ponens - Modus Tollens - Resolution - Using these rules to encode basic facts and prove results