Académique Documents
Professionnel Documents
Culture Documents
2014
Artificial Intelligence
Chapter 9: Inference in First-Order Logic
Andreas Zell
After the Textbook: Artificial Intelligence
Intelligence,
A Modern Approach
by Stuart Russell and Peter Norvig (3rd Edition)
14.01.2014
x / Father ( John)
14.01.2014
v
SUBST v / k ,
If existential quantifier is embedded in a universally
q antified statement
quantified
statement, use
se a skolem ffunction
nction - a ne
new
generic function of the universally quantified variable
Ex. x Crown( x) Gold ( x) becomes Crown(C1 ) Gold (C1 )
Ex. y King ( y ) x Crown( x) becomes
y King ( y ) Crown(C2 ( y ))
Zell: Artificial Intelligence (after Russell/Norvig, 3rd Ed.)
14.01.2014
p1, p2 , , pn
p1 p2 pn q
SUBST , q
p1 is King(x)
p2 is Greedy(John)
p2 is Greedy(x)
is {x/John}
q is Evil(x)
SUBST(,q) is Evil(John)
Ki ( John
King
J h ) Greedy
G d ( JJohn
h )
p1, p2 , , pn
Ki ( x) Greedy
King
G d ( x) E
Evil
il ( x)
p1 p2 pn q
SUBST , q
Evil ( John)
14.01.2014
10
14.01.2014
11
12
14.01.2014
13
14
14.01.2014
15
Weapon( M 1)
16
14.01.2014
Weapon( M 1)
17
Weapon( M 1)
Hostile( Nono)
Criminal (West )
Zell: Artificial Intelligence (after Russell/Norvig, 3rd Ed.)
18
14.01.2014
Criminal (West )
American(West )
Enemy ( Nono, America )
Weapon( M 1)
Hostile( Nono)
19
20
10
14.01.2014
21
22
11
14.01.2014
23
24
12
14.01.2014
25
26
13
14.01.2014
27
28
14
14.01.2014
X [1]
Y [1, 2]
Y [2] ;
Y [] ;
29
30
15
14.01.2014
path( X , Z ) : link ( X , Z ).
OR
path( X , Z ) : path( X , Y ), path(Y , Z ).
c
Zell: Artificial Intelligence (after Russell/Norvig, 3rd Ed.)
31
32
16
14.01.2014
X 0, Y 0, Z 0,
X Y Z, Y Z X ,
X Z Y.
33
34
17
14.01.2014
9.5 Resolution
Generalized Resolution: an extension of
propositional resolution to FOL
Proof by contradiction: negated goal is added to
KB. If {} is derived, the goal is proved
These proofs are non-constructive: they only show if
the query is true or false. Alternatives:
Restrict query variables to a single binding &
backtrack
Add answer literal as a disjunction with the
negated goal. The resulting proof will have a
disjunction of possible answers instead of an
empty clause multiple answers.
Zell: Artificial Intelligence (after Russell/Norvig, 3rd Ed.)
35
9.5 Resolution
36
18
14.01.2014
9.5 Resolution
Example of CNF Conversion
Example: Everyone who loves all animals is loved by somebody
x [y
Animal ( y ) Loves ( x, y )] [y
Eliminate implications: x
Move inwards:
Skolemization:
[y Animal ( y ) Loves ( x, y )] [y
x [y
Standardize variables: x
Loves ( y, x)]
[y
Loves ( y, x)]
Animal ( y ) Loves ( x, y )] [y
Loves ( y, x)]
Animal ( y ) Loves ( x, y )] [z
Loves ( z , x)]
Distribute over :
[ Animal ( F ( x)) Loves (G ( x), x)] [Loves ( x, F ( x)) Loves (G ( x), x)]
37
9.5 Resolution
The Resolution Inference Rule
Propositional literals are complementary if one is the
negation of the other
FOL literals if one unifies with negation of other
Binary First-Order Resolution when UNIFY i , m j
1 k
m1 mn
SUBST( , 1 i 1 i 1 k m1 m j 1 m j 1 mn )
Animal(F(x)) Loves(G(x),x)
Loves(G(x) x)
Loves(u,v) Kills(u,v)
Loves(G(x),x) and Loves(u,v) have unifier = {u/G(x),v/x}
Resolvent clause: Animal(F(x)) Kills(G(x),x)
38
19
14.01.2014
39
9.5 Resolution
First-order Resolution Procedure
Algorithm outline:
1. Begin with propositionalization & conversion to CNF
2 Apply the binary Resolution Inference Rule
2.
40
20
14.01.2014
9.5 Resolution
Example: Prove West is Criminal
Resolution proof that Col. West is a criminal
41
9.5 Resolution
Example: Curiosity killed the Cat
Example
42
21
14.01.2014
9.5 Resolution
Example: Curiosity killed the Cat
Converting each sentence to CNF yields:
A1. Animal ( F ( x)) Loves (G ( x), x)
A2 . Loves ( x, F ( x)) Loves (G ( x), x)
B. Loves ( y, x) Animal ( z ) Kill ( x, z )
C. Animal ( x) Loves ( Jack , x)
D. Kills ( Jack , Tuna ) Kills (Curiosity, Tuna )
E. Cat (Tuna)
F . Cat ( x) Animal ( x)
G. Kills (Curiosity , Tuna )
43
9.5 Resolution
Example: Curiosity killed the Cat
Resolution proof that curiosity killed the cat
P
Prooff (in
(i E
English):
li h) S
Suppose C
Curiosity
i it did nott kill T
Tuna. W
We kknow
either Jack or Curiosity did; thus, Jack must have. Further, Tuna is a
cat & cats are animals, so Tuna is an animal. Because anybody who
kills animals is loved by no one, nobody loves Jack. However, Jack
also loves all animals and thus is loved by somebody, which is a
contradiction. Thus, Curiosity killed Tuna.
Zell: Artificial Intelligence (after Russell/Norvig, 3rd Ed.)
44
22
14.01.2014
x y yx
x y y z x z
x y P1 x P1 y
w, x, y, z
w y x z F1 w, x F1 y, z
45
46
23
14.01.2014
9.5 Resolution
Equality
#3 Equational Unification: unification designed
for the particular axiom used rather than explicit
inference with those axioms
Under this approach, terms are unifiable if they are
provably equal under some substitution
Proving equality allows for equality reasoning
47
9.5 Resolution
Strategies for Efficient Resolution
Unit preference: prefer resolution with unit
clauses; always makes the resolvents shorter
unit clause: a sentence of a single literal
literal.
unit resolution: resolution only with unit clauses
Incomplete in general, but complete for Horn KBs
48
24
14.01.2014
9.5 Resolution
Strategies for Efficient Resolution
Input Resolution: every resolution combines an
input sentence (KB and query) with some other
sentence;; ex: Modus Ponens
complete for Horn KBs but incomplete in general
49
9.5 Resolution
Completeness of Resolution
Completeness of Resolution: If S is an
unsatisfiable set of clauses, then the application
of a finite number of resolution steps to S will
yield a contradiction; that is, resolution is
refutation complete
Refutation complete: if S is unsatisfiable, a finite
number of resolution rules will yield a contradiction
50
25
14.01.2014
9.5 Resolution
Completeness of Resolution
Structure of the Proof:
51
9.5 Resolution
Hebrands Theorem
Herbrand Universe HS : the set of all ground terms
constructible from the symbols in set of clauses S
Saturation P(S): set of all ground clauses obtained
from consistent substitutions of terms in P, a set of
ground terms, applied to variables in S
Herbrand base HS(S): The saturation of set S of
clauses with respect to its Herbrand Universe.
52
26
14.01.2014
9.5 Resolution
Ground Resolution Revisited
Ground Resolution Theorem: as presented in
Chapter 7, propositional resolution is complete
for ground sentences; hence
hence, the resolution
closure RC(S) will contain the empty clause:
a contradiction
53
54
27