+ All Categories
Home > Documents > CS621: Artificial Intelligence

CS621: Artificial Intelligence

Date post: 23-Feb-2016
Category:
Upload: shaina
View: 29 times
Download: 0 times
Share this document with a friend
Description:
CS621: Artificial Intelligence. Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 35–Himalayan Club example; introducing Prolog. Himalayan Club example. Introduction through an example (Zohar Manna, 1974): - PowerPoint PPT Presentation
Popular Tags:
12
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 35–Himalayan Club example; introducing Prolog
Transcript
Page 1: CS621: Artificial Intelligence

CS621: Artificial Intelligence

Pushpak BhattacharyyaCSE Dept., IIT Bombay

Lecture 35–Himalayan Club example; introducing Prolog

Page 2: CS621: Artificial Intelligence

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

Page 3: CS621: Artificial Intelligence

Example contd. Let mc denote mountain climber and sk denotes skier. Knowledge representation in the given problem is as follows:

1. member(A)2. member(B)3. member(C)4. ∀x[member(x) → (mc(x) ∨ sk(x))]5. ∀x[mc(x) → ~like(x,rain)]6. ∀x[sk(x) → like(x, snow)]7. ∀x[like(B, x) → ~like(A, x)]8. ∀x[~like(B, x) → like(A, x)]9. like(A, rain)10. like(A, snow)11. Question: ∃x[member(x) ∧ mc(x) ∧ ~sk(x)]

We have to infer the 11th expression from the given 10. Done through Resolution Refutation.

Page 4: CS621: Artificial Intelligence

Club example: Inferencing1. member(A)2. member(B)3. member(C)4.

– Can be written as –

5. –

6. –

7. –

))]()(()([ xskxmcxmemberx

))]()(()([ xskxmcxmember )()()(~ xskxmcxmember )],()([ snowxlkxskx

),()(~ snowxlkxsk )],(~)([ rainxlkxmcx

),(~)(~ rainxlkxmc )],(~),([ xBlkxAlikex

),(~),(~ xBlkxAlike

Page 5: CS621: Artificial Intelligence

8. –

9. 10. 11.

– Negate–

)],(),([~ xBlkxAlkx

),(),( xBlkxAlk

),( rainAlk

),( snowAlk)](~)()([ xskxmcxmemberx

)]()(~)([~ xskxmcxmemberx

Page 6: CS621: Artificial Intelligence

Now standardize the variables apart which results in the following

1. member(A)2. member(B)3. member(C)4. 5. 6. 7. 8. 9. 10. 11.

)()()(~ 111 xskxmcxmember

),()(~ 22 snowxlkxsk ),(~)(~ 33 rainxlkxmc

),(~),(~ 44 xBlkxAlike

),(),( 55 xBlkxAlk

),( rainAlk),( snowAlk

)()(~)(~ 666 xskxmcxmember

Page 7: CS621: Artificial Intelligence

),(~),(~ 44 xBlkxAlike ),( snowAlk

),(~ snowBlk ),()(~ 22 snowxlkxsk

)()()(~ 111 xskxmcxmember )(~ Bsk

)()(~ BmcBmember )(Bmember

)(Bmc)()(~)(~ 666 xskxmcxmember

)()(~ BskBmember )(~ Bsk

)(~ Bmember )(Bmember

710

12 5

13 4

14 2

1115

16 13

17 2

Page 8: CS621: Artificial Intelligence

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)

Page 9: CS621: Artificial Intelligence

Prolog

Page 10: CS621: Artificial Intelligence

Introduction PROgramming in LOGic Emphasis on what rather than how

Basic Machine

Logic Machine

Problem in Declarative Form

Page 11: CS621: Artificial Intelligence

Prolog’s strong and weak points Assists thinking in terms of objects

and entities Not good for number crunching Useful applications of Prolog in

Expert Systems (Knowledge Representation and Inferencing)

Natural Language Processing Relational Databases

Page 12: CS621: Artificial Intelligence

A Typical Prolog programCompute_length ([],0).Compute_length ([Head|Tail], Length):-

Compute_length (Tail,Tail_length),Length is Tail_length+1.

High level explanation:The length of a list is 1 plus the length of the tail of the list, obtained by removing the first element of the list.

This is a declarative description of the computation.


Recommended