Download presentation

Presentation is loading. Please wait.

Published byLuca Tray Modified about 1 year ago

2
Resolution Theorem Proving G51IAI Introduction to Artificial Intelligence Dr Matthew Hyde

3
Outline Propositional Logic Recap Conjunctive normal form The Resolution Algorithm Strategies to Guide the Search Conclusion

4
Propositional Logic Proposition symbols (“literals”) A, B, C, D, Student, North Each can be either True or False The name is irrelevant It is just the name you give to the proposition In your model, if North = True, it could mean that you are facing north, or everyone is facing north, or that it is possible to go north, etc...

5
Propositional Logic Logical Connectives form more complex sentences OR: “V” - True if one of the symbols is true, or both ( Awake V Asleep ) AND: “Λ” - True if both of the symbols are true ( Awake Λ Listening ) NOT: “¬” ¬Awake, ¬A, ¬B, ¬Student IMPLIES: “=>” P => Q - True unless P is true and Q is false ( Awake Λ Listening ) => ¬Fail

6
Propositional Logic A “knowledge base” Simply, a group of logical expressions that we already know to be true. E.g.: North Awake Λ Listening Student Awake V Asleep Literals

7
Propositional Logic The knowledge base evaluates to true, because it is equivalent to putting an “Λ” between each expression North Awake Λ Listening Student Awake V Asleep North Λ (Awake Λ Listening) Λ Student Λ (Awake V Asleep)

8
Summary so far Literals can be either TRUE or FALSE – e.g A, B, ¬C, D, ¬Student, North... Knowledge base made up of combinations of literals Each line of the knowledge base is TRUE Therefore, ALL of the knowledge base evaluates to TRUE

9
Inference in Propositional Logic We can infer new facts from what we already know “Modus Ponens” Rule A => B A B Also works for longer sentences A Λ B Λ C => D A Λ B Λ C D We know these two We can therefore infer that this is true

10
Example of Inference CompassNorth => FacingNorth Snowing => Cold CompassNorth Awake Cold We can infer that FacingNorth = ????

11
Example of Inference CompassNorth => FacingNorth Snowing => Cold CompassNorth Awake Cold FacingNorth We can infer that FacingNorth = True

12
Resolution in Propositional Logic Resolution is one method for automated theorem proving It is important to Artificial Itelligence because it helps logical agents to reason about the world It helps them to prove new theorems, and therefore helps them to add to their knowledge

13
Resolution Algorithm Input a knowledge base and an expression It negates the expression, adds that to the knowledge base, and then finds a contradiction if one exists If it finds a contradiction, then the negated statement is false Therefore, the original statement must be true

14
Resolution Algorithm Small example Is it sunny? sunny = TRUE? Prove sunny Knowledge base: sunny daytime sunny V night

15
Resolution Algorithm Small example Is it sunny? sunny = TRUE? Prove sunny Knowledge base: sunny daytime sunny V night ¬sunny Negate it Add it to the knowledge base CONTRADICTION ¬sunny = FALSE Therefore: sunny = TRUE

16
Conjunctive Normal Form Resolution algorithm needs sentences in CNF A series of “conjunctions” (clauses joined together by “AND”) (¬ A V B) Λ (B V C) Λ (D V ¬ E V F) Λ (G) Λ... Inside the brackets, we only have V (OR) ¬ (NOT) symbols There are no “implies” (=>) symbols anywhere

17
Conjunctive Normal Form (A V B) Λ (B V C) Λ (D V E V F) Λ (G) Λ... Clauses The whole thing represents the knowledge base, so it evaluates to TRUE

18
Conjunctive Normal Form Resolution algorithm ‘resolves’ clauses In fact, it only applies to clauses Each pair of clauses that contains complementary literals is resolved Complementary literals have the property that one negates the other A, ¬A Student, ¬Student

19
Procedure for converting to CNF (a) To eliminate ↔, – (a ↔ b) ≡ (a → b) Λ (b→ a) (b) To eliminate →, – (a → b) ≡ ¬ a ν b (c) Double negation ¬ (¬a) ≡ a (d) De Morgan – ¬ (a Λ b) ≡ (¬a ν ¬b) ¬(a ν b) ≡ (¬a Λ ¬b) (e) Distributivity of Λ over ν – (a Λ (b ν c )) ≡ ((a Λ b) ν (a Λ c)) (f) Distributivity of ν over Λ – (a ν (b Λ c )) ≡ ((a ν b) Λ (a ν c))

20
Resolution Rule Given two clauses: ( A V B )( ¬B V C ) Produce one clause containing all of the literals except the two complementary literals: A V C

21
Resolution Rule Given two clauses: ( A V B V C V D ) ( E V F V ¬B V G V H ) Produce one clause containing all of the literals except the two complementary literals: A V C V D V E V F V G V H

22
Resolution Example ¬asleep v fail asleep Show that the knowledge base entails “fail” Negate the theorem ¬asleep v failasleep

23
Very Important: NEGATE THE THEOREM This means, put a “¬” symbol in front of it If it already has one, then remove it

24
Very Important: TheoremNegated Theorem A ¬A ¬B B Fail ¬Fail Then add it to the knowledge base and find a contradiction

25
Resolution Example ¬asleep v fail asleep Show that the knowledge base entails “fail” Negate the theorem ¬asleep v failasleep¬fail ¬asleep Empty fail

26
Example 2 Roadrunner and Coyote Beep Beep!

27
Example 2 Coyote chases Roadrunner If Roadrunner is smart, Coyote does not catch it If coyote chases Roadrunner and does not catch it, then Coyote is annoyed. Roadrunner is smart Theorem: Coyote is annoyed ???? Beep Beep!

28
Example 2 Theorem: Coyote is annoyed We try to prove that “Coyote is NOT annoyed” is false We add “Coyote is NOT annoyed” to the knowledge base, and prove false So, the original theorem must be true Beep Beep!

29
Example 2 SentenceExpression Coyote chases RoadrunnerChase If Roadrunner is smart, Coyote does not catch it Smart => ¬Catch If coyote chases Roadrunner and does not catch it, then Coyote is Annoyed Chase Λ ¬Catch => Annoyed Roadrunner is smartSmart Coyote is not annoyed¬Annoyed We are asking: Does the knowledge base entail “Annoyed”

30
Example 2 ExpressionSimplified ChaseC Smart => ¬CatchS => ¬B Chase Λ ¬Catch => AnnoyedC Λ ¬B => A SmartS ¬Annoyed¬A Convert these into Conjunctive Normal Form: S => ¬B C Λ ¬B => A

31
Example 2 ExpressionCNF CC S => ¬B¬S V ¬B C Λ ¬B => A¬C V B V A SS ¬A

32
Example 2 NumberExpression 1C 2¬S V ¬B 3¬C V B V A 4S 5¬A C = Coyote Chases Roadrunner S = Roadrunner is Smart B = Coyote Catches Roadrunner A = Coyote is Annoyed

33
Example 2 NumberExpressionNumberExpression 1C6B V A from 1 and 3 2¬S V ¬B7¬B from 2 and 4 3¬C V B V A8A from 6 and 7 4S9False from 5 and 8 5¬A ¬Annoyed Λ Annoyed

34
Example 2 – Proved in a different way NumberExpressionNumberExpression 1C6¬S V ¬C V A from 2 and 3 2¬S V ¬B7¬C V A from 4 and 6 3¬C V B V A8¬C from 5 and 7 4S9False from 1 and 8 5¬A Coyote catches Roadrunner AND Coyote does not catch Roadrunner

35
Example 2 – conclusion Annoyed Λ ¬Annoyed This cannot be true, therefore adding “¬Annoyed” causes a contradiction in the knowledge base Theorem was: “Coyote is annoyed” We added the opposite and proved FALSE We proved that Annoyed = TRUE, by proving that ¬Annoyed = FALSE Therefore Coyote is annoyed The knowledge base entails “annoyed”

36
Resolution Problems Can take a very long time Depending on the number of clauses in the knowledge base

37
Example 3 B V A ¬C V A ¬B V A C V ¬D ¬A V ¬B V D Does this entail A? In other words: Does all of this mean that A is TRUE? If we set A to FALSE, and find a contradiction, then A must be TRUE

38
The Knowledge Base B V A ¬C V A ¬B V A C V ¬D ¬A V ¬B V D ¬A Example 3 A V AA Contradiction

39
1) B V A 2) ¬C V A 3) ¬B V A 4) C V ¬D 5) ¬A V ¬B V D 6) ¬A Example 3 7) ¬C From 2,6 8) ¬D From 4,7 9) ¬A V ¬B From 5,8 10) B From 1,6 11) ¬A From 9,10 12) ¬B From 3,11 Contradiction

40
Example 3 - conclusion So you can find the answer in 1 step or 6 steps, depending on the order in which you resolve the clauses The speed of the resolution algorithm depends on the order But, resolution will always find a proof if one exists. You just have to keep going until there are no more clauses to resolve

41
What you need to know The resolution algorithm Uses the principle of proof by contradiction Why the knowledge base must be in Conjunctive Normal Form The speed of the algorithm depends on the order in which you resolve the clauses

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google