Documente Academic
Documente Profesional
Documente Cultură
v
SUBST ({v /g }, )
v
SUBST ({v /k}, )
Idee: For n = 0 to do
creaza KB propozitionalizat instantiind cu termeni de adancime n
verifica daca este determinat de KB
p q
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y , OJ)
Knows(John, x) Knows(y , Mother (y ))
Knows(John, x) Knows(x, OJ)
Metode de inferenta specifice FOL - Unificarea
p q
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y , OJ) {x/OJ, y /John}
Knows(John, x) Knows(y , Mother (y ))
Knows(John, x) Knows(x, OJ)
Metode de inferenta specifice FOL - Unificarea
p q
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y , OJ)
Knows(John, x) Knows(y , Mother (y )) {y /John, x/Mother (John)}
Knows(John, x) Knows(x, OJ)
Metode de inferenta specifice FOL - Unificarea
p q
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y , OJ)
Knows(John, x) Knows(y , Mother (y ))
Knows(John, x) Knows(x, OJ) fail
Standardizing apart eliminarea variabilelor care se suprapun, ex.
Knows(z17 , OJ)
Generalized Modus Ponens (GMP)
Criminal(West)
Surse de ineficienta:
gasirea tuturor unificatorilor pentru unificarea premiselor
regulilor cu fapte din KB
reverificarea fiecarei reguli pentru satisfacerea premiselor
generarea faptelor irelevante
Algoritmul rete. Production system - actualizare eficienta a KB
Backward chaining algorithm
Demonstratie Backward chaining
Criminal(West)
Demonstratie Backward chaining
Criminal(West) {x/West}
Criminal(West) {x/West}
Criminal(West) {x/West}
Missile(y)
Demonstratie Backward chaining
Missile(y)
{ y/M1 }
Demonstratie Backward chaining
unde UNIFY (i , mj ) = .
Exemplu
Rich(x) Unhappy (x)
Rich(Ken)
2. Mutare in interior a : x p x p, x p x p:
6. Distributia peste :
[Animal (F (x))Loves(G (x), x)][Loves(x, F (x))Loves(G (x), x)]
Resolution proof: definite clauses
>
>
>
>
L
L
American(West) American(West) Weapon(y) Sells(West,y,z) Hostile(z)
>
>
>
L
L
Missile(x) Weapon(x) Weapon(y) Sells(West,y,z) Hostile(z)
>
>
>
L
L
Missile(M1) Missile(y) Sells(West,y,z) Hostile(z)
>
>
L
L
Missile(x) Owns(Nono,x) Sells(West,x,Nono) Sells(West,M1,z) Hostile(z)
>
>
>
L
L
Missile(M1) Missile(M1) Owns(Nono,M1) Hostile(Nono)
>
>
L
L
Owns(Nono,M1) Owns(Nono,M1) Hostile(Nono)
>
L
L
Enemy(x,America) Hostile(x) Hostile(Nono)
>
L
Enemy(Nono,America) Enemy(Nono,America)
Resolution proof: Curiosity killed the cat
>
L
L
Animal(Tuna) Loves(y,x) Animal(z) Kills(x,z) Kills(Jack,Tuna)
>
>
L
>
>
L
L
Loves(y,Jack) Animal(F(Jack)) Loves(G(Jack),Jack) Animal(F(x)) Loves(G(x),x)
>
>
L
Loves(G(Jack),Jack)
Resolutia - demonstratie in Prover9
10 lives(A) agatha = A butler = A charles = A
11 lives(c1)
15 -killed(A,B) -richer(A,B)
16 richer(A,agatha) hates(butler,A)
17 killed(c1,agatha)
18 butler = A hates(agatha,A)
19 agatha != butler
20 butler != agatha.
21 -killed(agatha,agatha) %negarea a ceea ce vrem sa dem
22 -hates(A,f1(A))
23 -hates(agatha,A) -hates(charles,A)
24 -killed(A,B) hates(A,B)
25 -hates(agatha,A) hates(butler,A)
26 agatha = c1 butler = c1 charles = c1. [resolve(10,a,11,a)].
27 c1 = agatha c1 = butler c1 = charles. [copy(26),flip(a),flip(b),flip(c)].
30 -killed(A,agatha) hates(butler,A). [resolve(15,b,16,a)].
32 hates(c1,agatha). [resolve(24,a,17,a)].
35 -hates(agatha,f1(butler)). [ur(25,b,22,a)].
38 -killed(f1(butler),agatha). [ur(30,b,22,a)].
41 f1(butler) = butler. [resolve(35,a,18,b),flip(a)].
42 -killed(butler,agatha). [38, 41]....
43 c1 = agatha c1 = butler hates(charles,agatha). [para(27(c,1),32(a,1))].
Resolutia - demonstratie in Prover9
10 lives(A) agatha = A butler = A charles = A
11 lives(c1)
15 -killed(A,B) -richer(A,B)
16 richer(A,agatha) hates(butler,A)
17 killed(c1,agatha)
18 butler = A hates(agatha,A)
19 agatha != butler
20 butler != agatha.
21 -killed(agatha,agatha) %negarea a ceea ce vrem sa dem
22 -hates(A,f1(A))
23 -hates(agatha,A) -hates(charles,A)
24 -killed(A,B) hates(A,B)
25 -hates(agatha,A) hates(butler,A)
26 agatha = c1 butler = c1 charles = c1. [resolve(10,a,11,a)].
27 c1 = agatha c1 = butler c1 = charles. [copy(26),flip(a),flip(b),flip(c)].
30 -killed(A,agatha) hates(butler,A). [resolve(15,b,16,a)].
32 hates(c1,agatha). [resolve(24,a,17,a)].
35 -hates(agatha,f1(butler)). [ur(25,b,22,a)].
38 -killed(f1(butler),agatha). [ur(30,b,22,a)].
41 f1(butler) = butler. [resolve(35,a,18,b),flip(a)].
42 -killed(butler,agatha). [38, 41]....
43 c1 = agatha c1 = butler hates(charles,agatha). [para(27(c,1),32(a,1))].
Resolutia - demonstratie in Prover9
10 lives(A) agatha = A butler = A charles = A
11 lives(c1)
15 -killed(A,B) -richer(A,B)
16 richer(A,agatha) hates(butler,A)
17 killed(c1,agatha)
18 butler = A hates(agatha,A)
19 agatha != butler
20 butler != agatha.
21 -killed(agatha,agatha) %negarea a ceea ce vrem sa dem
22 -hates(A,f1(A))
23 -hates(agatha,A) -hates(charles,A)
24 -killed(A,B) hates(A,B)
25 -hates(agatha,A) hates(butler,A)
26 agatha = c1 butler = c1 charles = c1. [resolve(10,a,11,a)].
27 c1 = agatha c1 = butler c1 = charles. [copy(26),flip(a),flip(b),flip(c)].
30 -killed(A,agatha) hates(butler,A). [resolve(15,b,16,a)].
32 hates(c1,agatha). [resolve(24,a,17,a)].
35 -hates(agatha,f1(butler)). [ur(25,b,22,a)].
38 -killed(f1(butler),agatha). [ur(30,b,22,a)].
41 f1(butler) = butler. [resolve(35,a,18,b),flip(a)].
42 -killed(butler,agatha). [38, 41]....
43 c1 = agatha c1 = butler hates(charles,agatha). [para(27(c,1),32(a,1))].
10 lives(A) agatha = A butler = A charles = A
11 lives(c1)
15 -killed(A,B) -richer(A,B)
16 richer(A,agatha) hates(butler,A)
17 killed(c1,agatha)
18 butler = A hates(agatha,A)
19 agatha != butler
20 butler != agatha.
21 -killed(agatha,agatha) %negarea a ceea ce vrem sa dem
22 -hates(A,f1(A))
23 -hates(agatha,A) -hates(charles,A)
24 -killed(A,B) hates(A,B)
25 -hates(agatha,A) hates(butler,A)
26 agatha = c1 butler = c1 charles = c1. [resolve(10,a,11,a)].
27 c1 = agatha c1 = butler c1 = charles. [copy(26),flip(a),flip(b),flip(c)].
30 -killed(A,agatha) hates(butler,A). [resolve(15,b,16,a)].
32 hates(c1,agatha). [resolve(24,a,17,a)].
35 -hates(agatha,f1(butler)). [ur(25,b,22,a)].
38 -killed(f1(butler),agatha). [ur(30,b,22,a)].
41 f1(butler) = butler. [resolve(35,a,18,b),flip(a)].
42 -killed(butler,agatha). [38, 41]
43 c1 = agatha c1 = butler hates(charles,agatha). [para(27(c,1),32(a,1))].
47 c1 = agatha c1 = butler -hates(agatha,agatha). [resolve(43,c,23,b)].
48 c1 = agatha c1 = butler. [resolve(47,c,18,b),].
49 c1 = agatha. [para(48(b,1),17(a,1))].
52 $F. [brewrite(17),rewrite([49(1)]))].
Resolution-based theorem prover