Professional Documents
Culture Documents
Koumparkhc
' $
Knowledge-Based Agents
Basic concepts:
• The knowledge-base (KB): a set of representations of facts
about the world.
• The knowledge representation language: a language
whose sentences represent facts about the world.
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Example:
• Knowledge level or epistemological level:
The automated taxi driver knows that Golden Gate Bridge
links San Francisco and Marin County.
• Logical level:
The automated taxi driver has the FOL sentence
Links(GGBridge, SF, M arin) in its KB.
• Implementation level:
The sentence Links(GGBridge, SF, M arin) is implemented by
a C structure (or a Prolog fact).
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Stench Breeze
4 PIT
Breeze
Breeze
3 Stench PIT
Gold
Stench Breeze
2
Breeze Breeze
1 PIT
START
1 2 3 4
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
The WW (cont’d)
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
OK OK
1,1 2,1 3,1 4,1 1,1 2,1 3,1 4,1
A P?
A
V B
OK OK OK OK
(a) (b)
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
(a) (b)
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
What do we need?
• A way to learn facts about the world.
• A way to represent facts and rules about the world.
• A way to reason with the existing facts in order to deduce
new ones.
Examples of facts:
• The wumpus is in square [1,3].
• There is no pit in square [2,2].
• There is a pit in square [2,2] or square [3,1].
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Entailment (cont’d)
Sentences Sentence
Entails
Semantics
Semantics
Representation
World
Facts Fact
Follows
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Logic
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
PL: Semantics
I : P → {true, f alse}.
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Compositionality of PL
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Satisfiability
Examples: P, P ∨ Q, (P ∧ R) ∨ Q
Example: P ∧ ¬P
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Validity
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Entailment
Example: P ∧ Q |= P
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Example: P ∧ Q |= P
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Equivalence
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
• (α ∧ β) ≡ (β ∧ α) commutativity of ∧
• (α ∨ β) ≡ (β ∨ α) commutativity of ∨
• ((α ∧ β) ∧ γ) ≡ (α ∧ (β ∧ γ)) associativity of ∧
• ((α ∨ β) ∨ γ) ≡ (α ∨ (β ∨ γ)) associativity of ∨
• ¬(¬α) ≡ α double-negation elimination
• (α ⇒ β) ≡ (¬β ⇒ ¬α) contraposition
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Truth Tables
Truth tables are tools that allow us to find the truth value of a
PL formula if we know the truth value of its constituent parts.
A ¬A
true f alse
f alse true
Truth Tables
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
P H P ∨H (P ∨ H) ∧ ¬H ((P ∨ H) ∧ ¬H)
⇒P
f alse f alse f alse f alse true
f alse true true f alse true
true f alse true true true
true true true f alse true
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
PL Satisfiability as a CSP
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
The above results mean that it is highly unlikely that we will ever
find a polynomial time algorithm for these problems.
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Horn Sentences
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Inference
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Example
P H P ∨H ¬H P
f alse f alse f alse true f alse
f alse true true f alse f alse
true f alse true true true
true true true f alse true
Method: Go through all the lines of the truth table that make
each sentence of KB true, and check whether they make φ true too.
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
α⇒β, α
• Modus Ponens: β
α1 ∧α2 ∧...∧αn
• And-Elimination: αi
α1 ,α2 ,...,αn
• And-Introduction: α1 ∧α2 ∧...∧αn
αi
• Or-Introduction: α1 ∨α2 ∨...∨αn
¬¬α
• Double-Negation Elimination: α
α∨β, ¬β
• Unit Resolution: α
α∨β, ¬β∨γ
• Resolution: α∨γ
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
input sentences
conclusions
World
User
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Formalizing the WW in PL
OK OK
1,1 2,1 3,1 4,1 1,1 2,1 3,1 4,1
A P?
A
V B
OK OK OK OK
(a) (b)
& %
Teqnht
' NohmosÔnh M. Koumparkhc$
R1 : ¬P11
R3 : ¬B11
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Inference in the WW
The agent can now use the PL inference rules and logical
equivalences to prove the following: “There is no pit in squares
[1, 2] or [1, 2] ”
• Apply biconditional elimination to R2 :
• Apply And-elimination to R4 :
R7 : ¬(P12 ∨ P21 )
R8 : ¬P12 ∧ ¬P21
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
& %
Teqnht NohmosÔnh M. Koumparkhc
' $
Readings
We did not cover all the material in Section 7.5 in great detail (e.g.,
resolution) because these techniques will be revisited in the more
general framework of FOL in the forthcoming lectures.
& %