Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS621: Artificial Intelligence

Similar presentations


Presentation on theme: "CS621: Artificial Intelligence"— Presentation transcript:

1 CS621: Artificial Intelligence
Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5 – Logic

2 Logic and inferencing Vision NLP Search Reasoning Learning Knowledge Robotics Expert Systems Planning Obtaining implication of given facts and rules -- Hallmark of intelligence

3 Inferencing through Deduction Induction
Deduction (General to specific) Induction (Specific to General) Abduction (Conclusion to hypothesis in absence of any other evidence to contrary) Deduction Given: All men are mortal (rule) Shakespeare is a man (fact) To prove: Shakespeare is mortal (inference) Induction Given: Shakespeare is mortal Newton is mortal (Observation) Dijkstra is mortal To prove: All men are mortal (Generalization)

4 If there is rain, then there will be no picnic
Fact1: There was rain Conclude: There was no picnic Deduction Fact2: There was no picnic Conclude: There was no rain (?) Induction and abduction are fallible forms of reasoning. Their conclusions are susceptible to retraction Two systems of logic 1) Propositional calculus 2) Predicate calculus

5 Propositions Stand for facts/assertions Declarative statements As opposed to interrogative statements (questions) or imperative statements (request, order) Operators => and ¬ form a minimal set (can express other operations) - Prove it. Tautologies are formulae whose truth value is always T, whatever the assignment is

6 Model In propositional calculus any formula with n propositions has 2n models (assignments) - Tautologies evaluate to T in all models. Examples: 1) 2) e Morgan with AND

7 Semantic Tree/Tableau method of proving tautology
Start with the negation of the formula - α - formula α-formula β-formula - β - formula α-formula - α - formula

8 Example 2: Contradictions in all paths X (α - formula) (α - formulae)
B C Contradictions in all paths B C

9 Exercise: Prove the backward implication in the previous example

10 Inferencing in PC Backward chaining Resolution Forward chaining

11 Knowledge Procedural Declarative Declarative knowledge deals with factoid questions (what is the capital of India? Who won the Wimbledon in 2005? Etc.) Procedural knowledge deals with “How” Procedural knowledge can be embedded in declarative knowledge

12 Example: Employee knowledge base
Employee record Emp id : 1124 Age : 27 Salary : 10L / annum Tax : Procedure to calculate tax from basic salary, Loans, medical factors, and # of children

13 Text Knowledge Representation

14 A Semantic Graph bought student June computer new past tense agent
in: modifier a: indefinite the: definite student past tense agent bought object time computer new June modifier The student bought a new computer in June.

15 Representation of Knowledge
UNL representation Representation of Knowledge Ram is reading the newspaper

16 UNL: a United Nations project
Dave, Parikh and Bhattacharyya, Journal of Machine Translation, 2002 Started in 1996 10 year program 15 research groups across continents First goal: generators Next goal: analysers (needs solving various ambiguity problems) Current active language groups UNL_French (GETA-CLIPS, IMAG) UNL_Hindi (IIT Bombay with additional work on UNL_English) UNL_Italian (Univ. of Pisa) UNL_Portugese (Univ of Sao Paolo, Brazil) UNL_Russian (Institute of Linguistics, Moscow) UNL_Spanish (UPM, Madrid)

17 Knowledge Representation
UNL Graph - relations read agt obj Ram newspaper

18 Knowledge Representation
UNL Graph - UWs read(icl>interpret) obj agt Ram(iof>person) newspaper(icl>print_media)

19 Knowledge Representation
UNL graph - attributes @entry @present @progress read(icl>interpret) obj agt @def newspaper(icl>print_media) Ram(iof>person) Ram is reading the newspaper

20 The boy who works here went to school
Another Example The boy who works here went to school plt agt @ past school(icl>institution) go(icl>move) boy(icl>person) work(icl>do) here @ entry plc :01

21 Predicate Calculus

22 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)

23 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

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

25 Resolution - Refutation
man(x) → mortal(x) Convert to clausal form ~man(shakespeare) mortal(x) Clauses in the knowledge base man(shakespeare) mortal(shakespeare)

26 Resolution – Refutation contd
Negate the goal ~man(shakespeare) Get a pair of resolvents

27 Resolution Tree

28 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

29 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

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

31 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.

32 Predicate Calculus Rules
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

33 Predicate Calculus: 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.

34 Club example: Inferencing
member(A) member(B) member(C) Can be written as

35 Negate–

36 Now standardize the variables apart which results in the following
member(A) member(B) member(C)

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

38 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)


Download ppt "CS621: Artificial Intelligence"

Similar presentations


Ads by Google