Artificial
Intelligence

Fall 2015
course
navigation

Sep 22

propositional logic

We'll discuss the material in chapter 7, which I asked you to read :
That's the main idea of the chapter.
The fine print :
The horn search techniques are

AIMA logic.py

This implements some of the algorithms described in the text.
The logic expressions are built on an Expr() object, using python operations including
>> implies | or & and ~ not A, B, C, D, E, F, G, P, Q, x, y, z = map(Expr, 'ABCDEFGPQxyz')
so for example exercise 7.17 becomes
>> from logic import * # AIMA routines >> kb = PropKB() # propositional logic, general but slow >> kb.tell( (A | B) & (~A | C) & (~B | D) & (~C | G) & (~D | G) ) >> kb.ask(G) {} # meaning "nothing is required to make this true" >> kb.ask(E) False >> kb.clauses [(A | B), (~A | C), (~B | D), (~C | G), (~D | G)] >> kb.tell(A >> B) # It will convert to CNF >> kb.clauses [(A | B), (~A | C), (~B | D), (~C | G), (~D | G), (B | ~A)]
Are we having fun yet?

class exercises

Put this into CNF form: (A → B) and (B → C). Use the resolution procedure to infer (A → C). See if we can encode some of these ...
Lewis Carroll puzzles
The PropDefiniteKB does forward chaining. But it only accepts clauses in one of these forms : 'A', 'A >> B', '(A & B & C) >> D'. (It doesn't like 'A | ~B'. Go figure.)

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 powerpoint ?

walk through chap 7 slides (2nd edition of textbook) from http://aima.cs.berkeley.edu/slides-ppt/m7-logic.ppt | this

summary :
http://cs.marlboro.edu/ courses/ fall2015/ai/ notes/ Sep_22
last modified Tuesday September 22 2015 11:44 am EDT