1 / 31

CS344: Introduction to Artificial Intelligence

CS344: Introduction to Artificial Intelligence. Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 8 and 9– Predicate Calculus; Interpretation; Inferencing. Predicate Calculus: well known examples. Man is mortal : rule ∀x[man(x) → mortal(x)] shakespeare is a man man(shakespeare)

tracy
Télécharger la présentation

CS344: Introduction to Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS344: Introduction to Artificial Intelligence Pushpak BhattacharyyaCSE Dept., IIT Bombay Lecture 8 and 9– Predicate Calculus; Interpretation; Inferencing

  2. Predicate Calculus: well known examples • Man is mortal : rule ∀x[man(x) → mortal(x)] • shakespeare is a man man(shakespeare) • To infer shakespeare is mortal mortal(shakespeare)

  3. Wh-Questions and Knowledge what where Factoid / Declarative who when which how procedural why Reasoning

  4. Fixing Predicates • Natural Sentences <Subject> <verb> <object> Verb(subject,object) predicate(subject)

  5. Examples • Ram is a boy • Boy(Ram)? • Is_a(Ram,boy)? • Ram Playes Football • Plays(Ram,football)? • Plays_football(Ram)?

  6. Knowledge Representation of Complex Sentence • “In every city there is a thief who is beaten by every policeman in the city”

  7. Interpretation in Logic Logical expressions or formulae are “FORMS” (placeholders) for whom contents are created through interpretation. Example: This is a Second Order Predicate Calculus formula. Quantification on ‘F’ which is a function.

  8. Examples Interpretation:1 D=N (natural numbers) a = 0 and b = 1 x ∈ N P(x) stands for x > 0 g(m,n) stands for (m x n) h(x) stands for (x – 1) Above interpretation defines Factorial

  9. Examples (contd.) Interpretation:2 D={strings) a = b = λ P(x) stands for “x is a non empty string” g(m, n) stands for “append head of m to n” h(x) stands for tail(x) Above interpretation defines “reversing a string”

  10. Inferencing in PC Backward chaining Forward chaining Resolution

  11. Forward Chaining/ Inferencing • man(x) → mortal(x) • Dropping the quantifier, implicitly Universal quantification assumed • man(shakespeare) • Goal mortal(shakespeare) • Found in one step • x = shakespeare, unification

  12. Backward Chaining/ Inferencing • man(x) → mortal(x) • Goal mortal(shakespeare) • x = shakespeare • Travel back over and hit the fact asserted • man(shakespeare)

  13. Inferencing Inferencing Forward Chaining Forward Chaining Forward Chaining Backward Chaining Goal Driven Fact Driven Goal Must Be Known Focused Search

  14. AND-OR Graphs • P(x) → Q(x) AND R(x) • P(x) → M(x) P(X) OR M(X) AND Q(X) R(X)

  15. AND-OR Graphs • Whole rule base can be represented as an AND-OR graph • AO* Search: A* like search on AND-OR graphs

  16. Deciding the Strategy • Forward Chaining/Backward Chaining is decided from: • AO Graph and, • OR Fan-Out and, • Fan-In of Goal Node

  17. Hilbert's Logical Axioms • P(x) → (Q(x) → P(x)) • [P(x) → (Q(x) → R(x))] → [(P(x) → Q(x)) → (P(x) → Q(x))] • ~(~P(x)) → P(x)

  18. Resolution – Refutation contd • Negate the goal • ~mortal(shakespeare) • Get a pair of resolvents

  19. Resolution Tree Resolvent1 Resolvent2 Resolute

  20. Search in resolution • Heuristics for Resolution Search • Goal Supported Strategy • Always start with the negated goal • Set of support strategy • Always one of the resolvents is the most recently produced resolute

  21. Search in resolution • Heuristics for Resolution Search • Goal Supported Strategy • Always start with the negated goal • Set of support strategy • Always one of the resolvents is the most recently produced resolute

  22. Inferencing in Predicate Calculus • Forward chaining • Given P, , to infer Q • P, match L.H.S of • Assert Q from R.H.S • Backward chaining • Q, Match R.H.S of • assert P • Check if P exists • Resolution – Refutation • Negate goal • Convert all pieces of knowledge into clausal form (disjunction of literals) • See if contradiction indicated by null clause can be derived

  23. P • converted to Draw the resolution tree (actually an inverted tree). Every node is a clausal form and branches are intermediate inference steps.

  24. Terminology • Pair of clauses being resolved is called the Resolvents. The resulting clause is called the Resolute. • Choosing the correct pair of resolvents is a matter of search.

  25. Himalayan Club example • Introduction through an example (Zohar Manna, 1974): • Problem: A, B and C belong to the Himalayan club. Every member in the club is either a mountain climber or a skier or both. A likes whatever B dislikes and dislikes whatever B likes. A likes rain and snow. No mountain climber likes rain. Every skier likes snow. Is there a member who is a mountain climber and not a skier? • Given knowledge has: • Facts • Rules

  26. Example contd. • Let mc denote mountain climber and sk denotes skier. Knowledge representation in the given problem is as follows: • member(A) • member(B) • member(C) • ∀x[member(x) → (mc(x) ∨ sk(x))] • ∀x[mc(x) → ~like(x,rain)] • ∀x[sk(x) → like(x, snow)] • ∀x[like(B, x) → ~like(A, x)] • ∀x[~like(B, x) → like(A, x)] • like(A, rain) • like(A, snow) • Question: ∃x[member(x) ∧ mc(x) ∧ ~sk(x)] • We have to infer the 11th expression from the given 10. • Done through Resolution Refutation.

  27. Club example: Inferencing • member(A) • member(B) • member(C) • Can be written as

  28. Negate–

  29. member(A) • member(B) • member(C) • Now standardize the variables apart which results in the following

  30. 10 7 12 5 4 13 14 2 11 15 16 13 2 17

  31. Assignment • Prove the inferencing in the Himalayan club example with different starting points, producing different resolution trees. • Think of a Prolog implementation of the problem • Prolog Reference (Prolog by Chockshin & Melish)

More Related