Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea

Similar presentations


Presentation on theme: "Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea"— Presentation transcript:

1 Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea http://turing.cs.pub.ro/aifils_08

2 Lecture No. 5 Theorem proving through resolution refutation Standard form Expression unification Resolution in propositional logic Resolution in predicate logic Resolution strategies Answers through resolution

3 1. Standard form (clausal) Clause Horn Clause Definite Horn Clause Empty clause Transformation into clausal form

4

5

6 2. Expression unification Substitution  Unifier Most general unifier  Expression Unification algorithm

7

8

9 Algorithm Unify(E1,E2):Expression unification 1.if E1 and E2 are constants then 1.1.if E1=E2 then return { } 1.2. return FAIL 2. if E1 is a variable or E2 is a variable then 2.1.Exchange E1 with E2 such as E1 to be a variable 2.2. if E1=E2 then return { } 2.3. if E1 occurs in E2 then return FAIL 2.4. return {E1/E2}

10 3.if E1=simb(t 11,…,t 1n ) and E2=simb(t 21,…t 2n ) then 3.1 x  t 11, y  t 21 3.2 Rest 1  t 12,…,t 1n, Rest 2  t 22,…t 2n 3.3  1  Unify(x,y) 3.4 if  1= FAIL then return FAIL 3.5 G 1  Rest 1 /  1, G 2  Rest 2 /  1 3.6  2  Unify(Rest 1, Rest 2 ) 3.7 if  2= FAIL then return FAIL else return (  1,  2 ) 4.return FAIL end.

11 3. Resolution in propositional logic Resolvent Clauses that resolve Proof principle Proof tree

12 Algorithm:Resolution refutation in propositional logic. 1.Transform the set of axioms A in clausal form and get S0 2.Negate the theorem, transform the negated theorem in clausal form and add it to S0 3.repeat 3.1.Select two clauses C1 and C2 from S 3.2.Compute R = Res(C1,C2) 3.3.if R   then add R to S until R =  or there are no two other clauses that resolve 4.if R =  then the theoren is proven 5.else it is not a theorem end.

13 Example Mihai has money The car is white The car is beautiful If the car is white or the car is beautiful and Mihai has money then Mihai goes to the mountain B A F (A  F)  B  C

14 4. Resolution in predicate logic Resolvent Clauses that resolve Factor of a clause

15

16 Algorithm: Resolution refutation in predicate logic. 1. Transform the set of axioms A in clausal form and get S0 2.Negate the theorem, transform the negated theorem in clausal form and add it to S0 3.repeat 3.1.Select two clauses C1 and C2 from S 3.2.Compute R = {Res(C1,C2)} 3.3.if   R then add R to S until   R or there are no two other clauses that resolve or a predefined amount of effort has been exhausted 4.if   R then the theoren is proven 5.else if there are no two other clauses that resolve then it is not a theorem else there is not a definite conclusion end.

17 Example Horses are faster than dogs and there is a greyhound that is faster than every rabbit. We know that Harry is a horse and that Ralph is a rabbit. Derive that Harry is faster than Ralph. Horse(x) Greyhound(y) Dog(y) Rabbit(z) Faster(y,z))  y Greyhound(y)  Dog(y)  x  y  z Faster(x,y)  Faster(y,z)  Faster(x,z)  x  y Horse(x)  Dog(y)  Faster(x,y)  y Greyhound(y)  (  z Rabbit(z)  Faster(y,z)) Horse(Harry) Rabbit(Ralph)

18 A1.  x  y Horse(x)  Dog(y)  Faster(x,y) A2.  y Greyhound(y)  (  z Rabbit(z)  Faster(y,z)) A3. Horse(Harry) A4. Rabbit(Ralph) A5.  y Greyhound(y)  Dog(y) A6.  x  y  z Faster(x,y)  Faster(y,z)  Faster(x,z) T Faster(Harry,Ralph) C1. ~Horse(x)  ~Dog(y)  Faster(x,y) C2. Greyhound(Greg) C2’ ~Rabbit(z)  Faster(Greg,z) C3. Horse(arry) C4. Rabbit(Ralph) C5. ~Greyhound(y)  Dog(y) C6. ~Faster(x,y)  ~Faster(y,z)  Faster(x,z) C7. ~Faster(Harry,Ralph)

19

20 5. Resolution strategies Breadth first (level order) strategy Set of support strategy Linear resolution Input linear resolution Unit resolution Elimination strategy

21 Level order strategy

22 S 0, L 0 L k+1  {Res(C i, C j )| C i  L k, C j  S k } S k+1  S k  L k+1 k = 0,1,2,…

23 Linear resolution S, C 0  S C 1  {Res(C 0, C i )| C 0, C i  S} C k+1  {Res(C k, C i )| C i  {C k-1, C k-2,.. }  S} k=1, 2, 3,… Input linear resolution S, C 0  S C 1  {Res(C 0, C i )| C 0, C i  S} C k+1  {Res(C k, C i )| C i  S} k=1, 2, 3,…

24 A clause C subsumes a clause D iff there is a substitution  such that C   D. D is called subsumed clause. C=P(x)D=P(a)  Q(a) Subsumed clauses

25 6. Obtaining answers C1 C2 C3

26


Download ppt "Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea"

Similar presentations


Ads by Google