Knowledge Representation and Reasoning - LOGIC

Chapters 14 and 15 in Russell and Norvig textbook

Lecture notes from CS8803B Artificial Intelligence, Fall 2002, 9/6/2002

First, we discussed the "wumpus world" environment described on page 154 of our textbook. Sven wanted to illustrate that knowledge representation languages should be expressive, concise, unambiguous, independent of context, and effective.

In a run through the wumpus world, we have to tell the search engine in our AI man what actions are safe:

  1. Safe to go north? yes
    East? yes
  2. - Went east -
    Safe for west? yes (already visited)
    North? Maybe
    East? No
  3. - Went west -
    - Went north -
    North? no
    South? yes
    East? yes

0110 - could mean many things:

How do we represent facts in memory?
propositional logic = sentences represent whole propositions

"2 is prime"P
"I ate breakfast today"Q

syntax = how a sentence looks

sentence -> AtomicSentence | ComplexSentence
AtomicSentence -> T(rue) | F(alse) | Symbols
Symbols -> P | Q | R
ComplexSentence -> (Sentence) | NOT Sentence | Sentence Connective Sentence

example: (P AND Q) IMPLIES R

semantics = what a sentence means
interpretation: assigns each symbol a truth value, T or F

truth tables ("compositional semantics"):
ABNOT AA and BA or BA implies BA equiv B
ttftttt
tffftff
fttfttf
fftfftt

EXAMPLES OR PITFALLS when sentences -> logic
Either I go to the movies or I go swimming (inclusive vs. exclusive or) (Implication doesn't imply causality)

2 is odd implies that 3 is even
(Implication doesn't imply causality)

It says something about B if A is T. Otherwise it doesn't say anything.

valid = always true
satisfiable = there is an interpretation (at least one is true)
unsatisfiable = always false

example:
2 is prime. (Is this always true?)
2 is prime or 2 is not prime.

This second statement is the same as saying P OR (NOT P). Check out the truth table:
PNOT PP OR (NOT P)
TFT
FTT

Therefore it's both valid and satisfiable.

To say that a knowledge base entails a sentence =
When an interpretation makes the knowledge base true, it also makes the sentence true as well. The advantage is that the computer does not need to know the interpretation.

example:
Does "head, I win; tails, you lose"
- entail -
"I win"?
(note: background knowledge is important!)

symbols:
H = coin lands heads up
T = coin lands tails up
I = I win
U = You lose

background knolwedge:
(H implies I) AND (T implies U)
entails
I

Is there an interpretation, or assignment of truth values to the symbols, that is false? If so, it's no longer valid. Well, if you make the following assignment:

H is false
I is false
T is true
U is true

It doesn't follow. To check if something is valid, you can write down all the interpretations in a truth table and check. In this case, there are 2^4 = 16 interpretations since there are 4 symbols and 2 values.

Inference Procedures: these can infer the sentence from the knowledge base.
The inference procedure is sound if the knowledge base entails the sentence.

inference procedures = repeated application of inference rules. We can use these instead of constructing massive truth tables, which are exponential in the number of symbols.