Resolution and Refutation Resolution and Refutation
York University CSE 3401 Vida Movahedi
York University‐ CSE 3401‐ V. Movahedi
1
04_Resolution
Resolution and Refutation Resolution and Refutation York University - - PowerPoint PPT Presentation
Resolution and Refutation Resolution and Refutation York University CSE 3401 Vida Movahedi 1 York University CSE 3401 V. Movahedi 04_Resolution Overview Overview Propositional Logic p g Resolution Refutation Predicate
York University‐ CSE 3401‐ V. Movahedi
1
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
2
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
3
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
4
04_Resolution
Complementary literals
Resolving upon p, being on
different sides of :‐
York University‐ CSE 3401‐ V. Movahedi
5
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
6
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
7
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
8
04_Resolution
. } 3 , 2 , 1 { Q A A A
If C i i i t t YES (t )
York University‐ CSE 3401‐ V. Movahedi
9
04_Resolution
p: H has two days off
weather is bad, Henry is not fishing.
in a pub with his friends, then he is
p y q: weather is bad r: H is fishing s: H is drinking in a pub with
p , watching TV at home.
drinking in a pub with his friends nor
his friends t: H is watching TV at home u: H is working
drinking in a pub with his friends nor watching TV at home. Q If H i hi TV h d
A3 u > (~s & ~t)
Q.If Henry is not watching TV at home and he has two days off, then he is drinking in a pub with his friends provided that the th i b d
weather is bad.
York University‐ CSE 3401‐ V. Movahedi
10
04_Resolution
− = ⇒ ∨ ∨ ⇒ ∨ ¬ ∧ ¬ ¬ ⇒ → ¬ ∧ ¬ − = ⇒ ¬ ∨ ¬ ∨ ¬ ⇒ ¬ → → . : , , ) ( ) ( : 2 . , , : ) ( : 1
2 1
t s r C t s r t s r t s r A r q p C r q p r q p A ⎨ ⎧ − = ⇒ ¬ ∨ ¬ ∧ ¬ ∨ ¬ ⇒ ¬ ∧ ¬ ∨ ¬ ⇒ ¬ ∧ ¬ → . , : ) ( ) ( ) ( ) ( : 3 , , ) ( ) (
3 2
s u C t u s u t s u t s u A
⎧ ¬ ∧ ∧ ∧ ¬ ⇒ ∨ ¬ ¬ ∧ ∧ ¬ ⇒ → → ∧ ¬ ¬ ¬ ⎩ ⎨ − = ⇒ : ) ( ) ( ) ( ) ( : . , :
4
t C s q p t s q p t s q p t Q t u C ⎪ ⎪ ⎪ ⎨ ⎧ − = − = − = ⇒ . : . : . :
7 6 5
C C t C q p
York University‐ CSE 3401‐ V. Movahedi
11
⎪ ⎪ ⎩ − = . :
8 7
s C
04_Resolution
5 4 3 2 8 7 6 1
York University‐ CSE 3401‐ V. Movahedi
12
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
13
04_Resolution
k
k
k
York University‐ CSE 3401‐ V. Movahedi
14
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
15
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
16
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
17
04_Resolution
A more general unifier
York University‐ CSE 3401‐ V. Movahedi
18
04_Resolution
All their corresponding components match
York University‐ CSE 3401‐ V. Movahedi
19
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
20
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
21
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
22
04_Resolution
[Nilsson]
York University‐ CSE 3401‐ V. Movahedi
23
04_Resolution
[Nilsson] G0: :‐ proud(Z). (copy of) C0: proud(X1) :‐ parent(X1, Y1), newborn(Y1). Resolve with G0: e=[X1/Z] G1: :‐ parent(Z,Y1), newborn(Y1). ( f) ( ) f h ( ) (copy of) C1: parent(X2,Y2) :‐ father (X2, Y2). Resolve with G1: e=[X2/Z, Y2/Y1] G2: :‐ father(Z, Y1), newborn(Y1). (copy of) C3: father(adam mary) (copy of) C3: father(adam, mary). Resolve with G2: e=[Z/adam, Y1/mary] G3: :‐newborn(mary). (copy of) C4: newborn(mary) (copy of) C4: newborn(mary). Resolve with G3: e=[] G4: :‐ Empty clause answer to query: true and Z=adam
York University‐ CSE 3401‐ V. Movahedi
24
04_Resolution
[Nilsson] Just a different notation for :‐
1 1 1 1 1 1 2 2 2 2 1 1 1 1
1 1
York University‐ CSE 3401‐ V. Movahedi
25
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
26
04_Resolution
York University‐ CSE 3401‐ V. Movahedi
27
04_Resolution
C0: grandfather(X Z) : C0: grandfather(X,Z) :‐ father(X,Y), parent(Y,Z). C1: parent(X,Y) :‐ father(X,Y). C2: parent(X,Y) :‐ mother(X,Y). C0, [Z/X, X0/a] C3: father(a,b):‐. C4: mother(b,c):‐. C5: mother(b,d):‐. G0: :‐ grandfather(a X) C3, [Y0/b] G0: :‐ grandfather(a,X). C1, [X1/b, Y1/X] C2, [X2/b, Y2/X] Nothing to resolve with, C4, [X/c] C5, [X/d]
York University‐ CSE 3401‐ V. Movahedi
28
resolve with, backtrack! TRUE, X=c ; (backtrack!) TRUE, X=d
04_Resolution
Prolog uses DFS
York University‐ CSE 3401‐ V. Movahedi
29
04_Resolution