Artificial
Intelligence

Fall 2011
course
navigation

Oct 4

exercises

Put this into CNF form: (A → B) and (B → C). Use the resolution procedure to infer (A → C).
Lewis Carroll puzzles

clarification

I think I implied last week that in automated resolution, all the clauses must go away leaving only (). This is incorrect; *any* () implies a contradiction, since it comes from something like (A and (not A)). This is the goal of the automated resolution search, to produce one empty clause somewhere.

ai-class.com

in the news

aside

Typing these may be awkward, but in these days of utf-8 you can nearly always cut'n'paste ...
from wikipedia: list of logic symbols ⇒ → implies ≡ ⇔ ↔ iff (if and only if) ¬ ~ ! not ∧ & and ∨ || or ∀ for all ∃ there exists ⊢ is provable ⊨ entails T true F false

chapter 7 material

walk through chap 7 slides (2nd edition of textbook) from http://aima.cs.berkeley.edu/slides-ppt/m7-logic.ppt
Pieces to note :
If time, look at test output of AIMA lisp code starting at "testing system LOGIC" :
$ clisp -M aima.mem # load AIMA lisp environment > (test 'all) ;; ... lots of output including : Testing System LOGIC ;;; Some simple examples in Propositional Logic ;;; First, just test the infix reader. > (LOGIC "P=>Q <=> ~Q=>~P") (<=> (=> P Q) (=> (NOT Q) (NOT P))) ;;; Print a truth table, as on [p 169]. > (TRUTH-TABLE "(P | H) ^ ~H => P") ----------------------------------------------------------- P H P | H ~ H (P | H) ^ (~ H) ((P | H) ^ (~ H)) => P ----------------------------------------------------------- F F F T F T T F T T T T F T T F F T T T T F F T ----------------------------------------------------------- NIL ;;; Some simple examples > (VALIDITY "P=>Q <=> ~Q=>~P") VALID > (VALIDITY "SillyQuestion") SATISFIABLE > (VALIDITY "~SillyQuestion") SATISFIABLE > (VALIDITY "ToBe or not ToBe") VALID > (VALIDITY "ToBe and not ToBe") UNSATISFIABLE > (VALIDITY "((S => W1|W2|W3|W4) ^ S ^ (~W1^~W2^~W3)) => W4") VALID > (VALIDITY "Ok ^ (Ok <=> ~W^~P) => ~W") VALID > (SETF KB (MAKE-PROP-KB)) #<a PROP-KB> > (TELL KB "S => W1|W2|W3|W4") T > (TELL KB "S") T > (TELL KB "~W1") T > (TELL KB "~W2") T > (ASK KB "W4") NIL > (TELL KB "~W3") T > (ASK KB "W4") T > (TELL KB "Ok <=> ~W ^ ~P") T > (TELL KB "Ok") T > (ASK KB "W") NIL > (ASK KB "~W") T > (TELL KB "ToBe and ~ToBe") T > (ASK KB "SillyQuestion") T ;;; A look at Normal forms (conjunctive, implicative, and Horn). > (->CNF '(<=> P Q)) (AND (OR P (NOT Q)) (OR (NOT P) Q)) > (->INF '(<=> P Q)) (AND (=> Q P) (=> P Q)) > (->HORN '(<=> P Q)) (AND (=> Q P) (=> P Q)) > (->CNF '(=> (NOT P) R)) (OR R P) > (->INF '(=> (NOT P) R)) (=> TRUE (OR R P)) ;;; Use the KB to solve the `Wumpus at [1,3]' problem [p 174-176]. ;;; This builds a KB with 12 propositional symbols -- about the max. ;;; you can do without starting to slow down. > (SETQ KB1 (MAKE-PROP-KB)) #<a PROP-KB> ;;; The initial state of knowledge > (TELL KB1 "~S11 ^ ~S21 ^S12 ^ ~B11 ^ B21 ^ ~B12") T ;;; Rules R1 through R4 > (TELL KB1 "~S11 => ~W11 ^ ~W12 ^ ~W21") T > (TELL KB1 "~S21 => ~W11 ^ ~W21 ^ ~W22 ^ ~W31") T > (TELL KB1 "~S12 => ~W11 ^ ~W12 ^ ~W22 ^ ~W13") T > (TELL KB1 "S12 => W13 | W12 | W22 | W11") T ;;; Now the query -- this may take a while. > (ASK KB1 "W13")
http://cs.marlboro.edu/ courses/ fall2011/ai/ notes/ Oct_4
last modified Tuesday October 4 2011 11:48 am EDT