Beruflich Dokumente
Kultur Dokumente
Logical Agents
Outline
Knowledge-based agents
Wumpus world
Logic in general - models and entailment
Propositional (Boolean) logic
Equivalence, validity, satisfiability
Inference rules and theorem proving
Introduction
The representation of knowledge and the
reasoning processes that bring knowledge to life are
central to entire field of artificial intelligence
[1,2]
KB = R1 R2 R3 R4 R5
Inference
Decide whether KB
First method: enumerate the models and
check that is true in every model in
which KB is true
B1,1 B2,1, P1,1 , P1,2, P2,1, P2,2 ,P3,1
7 symbols : 27 = 128 possible models
Truth tables for inference
Logical equivalence
Two sentences are logically equivalent iff they are true in
same models:
iff and
Logical Agents
Propositional logic: (Exapmle)
Simplify the following sentence: ( )
to determine the following desired model
A B C (D C)
Implication Elimination
A B C (D C)
De Morgan
( A B C) (D C)
Not (Not()) =
((A B) C) (D C)
Distributivity
( A B D) C
Logical Agents
Propositional logic: (Exapmle)
Convert the following sentence: AB D (C D) E
A B D (C D) E
De Morgan
A B D (C D) E
Distributivity
AB C D E
De Morgan
AB C D E
De Morgan
AB C D E
Inverse(Implication Elimination)
A B C D E
Validity and satisfiability
Tautology:
Statement composed of simpler statements in
a manner that makes it logically true
whether the simpler statements are factually
true or false
Example
Proof
Truth tables for inference
Example:
|= if and only if the sentence ( ) is valid.
KB=>
Truth tables for inference
Proof:
|= if and only if the sentence ( ) is valid.
The notation means that, whenever any sentences of the form and is given,
then the sentence can be inferred.
Which says that, from a conjunction any of the conjuncts can be inferred
Unit Resolution
The unit resolution rule takes a clause (disjunction of
literals) and produces a new clause. : You can walk
: You can take a bus
Complementary Resolution
Takes two clauses and produces a new clause containing all the
literals of the two original clauses except the two complementary
literals. For example, we have
Example:
Factoring :
If we resolve (A B) with (A B),
we obtain (A A), which is reduced to just A.
Logical Agents
P1,1 P1,2
Propositional logic: (Inference and proofs)
Example (1):
P2,1 P2,2
B ( P1, 2 P2,1 )
If the alert B is ON, parking P1,2 or P2,1 is occupied .
No alert B. Are given
P1, 2 P2,1
From the original sentence we can arrive to the last sentence which means :
If no alert case is already given thus the two parking cells are free
Logical Agents
P1,1 P1,2
Propositional logic: (Inference and proofs)
Example (1):
P2,1 P2,2
P1, 2 P2,1 Was already inferred true from the last step
(Not given data)
G ( RR RL )
(G ( RR RL )) (( RR RL ) G )
( RR RL ) G
G ( RR RL )
( RR RL )
RR RL
12 (13 22 ) TRUE
12 13 22
We may
F F
Resolve 22 , 12 think
F T
13 T T
12 is already TRUE
13 22 has to be TRUE
13 is TRUE
T F
Wumpus is located in the
F T
cell [1,3]
T T
Prove KB=> R
Example - 1
KB
Prove KBI= R
Example - 2
KB
Prove: KBI= R
Example - 2
Logical Agents
Propositional logic: (Resolution Algorithm) Example 3
If we have the knowledge base:
KB =
and we wish to prove which is, say, P1,2.
Example :