16368_15840-unit vi

58
Artificial Intelligence Course Code: ECE434 Sonit SukhRaj Singh Assistant Professor UID: 15840 Email ID: [email protected] Domain: Robotics & Automation(D6) School of Electronics & Engineering(SEE) Discipline of Electronics & Communication Engineering UNIT -VI

Upload: anu123456789

Post on 18-Jul-2016

39 views

Category:

Documents


3 download

DESCRIPTION

Artificial Intelligence

TRANSCRIPT

Page 1: 16368_15840-UNIT VI

Artificial Intelligence

Course Code: ECE434

Sonit SukhRaj Singh Assistant Professor UID: 15840 Email ID: [email protected] Domain: Robotics & Automation(D6) School of Electronics & Engineering(SEE) Discipline of Electronics & Communication Engineering

UNIT -VI

Page 2: 16368_15840-UNIT VI

Syllabus UNIT

1. Introduction to Artificial Intelligence

2. Problem Solving : state-space Search And Control Strategies

3. Problem Reduction And Game Playing

4. Logic Concept And Logic Programming

5. Prolog Programming Language

MID TERM

1. Knowledge Representations

2. Expert Systems And Applications

3. Uncertainty Measure: Probability Theory And Fuzzy Logic

4. Machine Learning, Ann And Evolutionary Computation

5. Introduction To Intelligent Agents And Natural Language

Processing

Page 3: 16368_15840-UNIT VI

References

Text

1. “Artificial Intelligence” Saroj Kaushik 1st Edition

Cengage Learning 2011

Reference Books

2. “Introduction to Artificial Intelligence and Expert

Systems” Dan. W. Patterson 1st Edition 1990 PHI

(Pretice Hall India).

3. “Artificial Intelligence- A Modern Approach”

Stuart Russel Peter Norvig 3rd Edition Pearson, 2009 .

4. “Artificial Intelligence” Elaine Rich Kevin Knight

3rd Edition 2008 Tata McGraw Hill, India

Page 4: 16368_15840-UNIT VI

Topics to be covered in Unit VI

Introduction to Knowledge Representation

Approaches to KR

KR using Semantic Networks

Extended Semantic Networks for KR

KR using Frames

Page 5: 16368_15840-UNIT VI

Introduction to Knowledge Representation Knowledge Representation (KR) is an important

issue both in cognitive science as well in AI.

In Cognitive Science, KR deals with how information is stored and processed by humans.

In AI, the main focus is on storing knowledge or information in such a manner that programs can process it and achieve human intelligence.

In AI, KR is an important area because intelligent problem solving can be achieved and simplified using appropriate KR techniques.

Page 6: 16368_15840-UNIT VI

Introduction to Knowledge Representation …

Since, knowledge needs to be utilized to achieve intelligent behavior, the fundamental goal of KR is to represent knowledge in a manner that facilitates the process of inferencing (i.e drawing conclusions) from it.

Page 7: 16368_15840-UNIT VI

Programming Languages for KR

Several programming languages oriented to KR have been developed till date.

KL- ONE (1980) aimed at knowledge representation itself.

Languages such as SGML, XML, RDF were used for handling electronic documents in web systems.

PROLOG(1972) knowledge is represented in the form of rules and facts.

These languages facilitate processes such as information retrieval, data mining, etc.

Page 8: 16368_15840-UNIT VI

Desirable Properties of KR

LEARNING: Refers to capability to acquire new knowledge, behaviors, understanding, etc. By learning, it should avoid redundancy and ensure replication to storage to enable easy retrieval. By learning, Knowledge may be gained by reasoning and logic, by experience, by observation, mathematical proofs and by scientific methods

EFFICIENCY IN ACQUISITION: Instead of using human intervention it acquires knowledge using automatic methods.

Page 9: 16368_15840-UNIT VI

Desirable Properties of KR…

REPRESENTATIONAL ADEQUACY: Refers the ability to represent required knowledge.

INFERENTIAL ADEQUACY: Manipulating knowledge to produce new knowledge from existing one.

Page 10: 16368_15840-UNIT VI

Importance of KR

KR is a core component of a number of applications such as Expert Systems, Machine Translation Systems, Computer-Aided Maintenance systems, Information Retrieval Systems, Database Systems, etc.

Page 11: 16368_15840-UNIT VI

Approaches to KR

AI programs use knowledge structures to represent objects, facts, relationships and procedures.

The main function of these knowledge structures is to provide expertise and information so that a program can operate in an intelligent way.

Knowledge structures are semantic networks, Frames, scripts, conceptual dependency structures.

Page 12: 16368_15840-UNIT VI

Basic Knowledge Representation schemes

RELATIONAL KNOWLEDGE: Comprises objects consisting of attributes and associated values.

In this method, each fact is stored in a row of a relational table ie RDBMS.

Table – Columns-Represent Attribute names; Rows-Represent Values of the attribute. i.e ova

Name AGE GENDER QUALIFICATION SALARY

JOHN 38 Male Graduate 20,000

MIKE 25 Male Under Graduate 15,000

MARY 30 Female Ph D 30,000

JAMES 29 Male Graduate 18,000

Page 13: 16368_15840-UNIT VI

Basic knowledge representation schemes

Question - What is the age of John?

How much does Mary earn?

What is the qualification of Mike?

Inferencing new knowledge is not possible from these structures.

For eg – Does a person having Ph D qualification earn more?

Name AGE GENDER QUALIFICATION SALARY

JOHN 38 Male Graduate 20,000

MIKE 25 Male Under Graduate 15,000

MARY 30 Female Ph D 30,000

JAMES 29 Male Graduate 18,000

Page 14: 16368_15840-UNIT VI

Knowledge Representation as Logic

Inferential capability can be achieved if knowledge is represented in the form of formal logic.

Uses predicate logic.

(x)human(x) Mortal(x)

Given a fact “John is human”, we can easily infer to “John is mortal”.

The advantage of this approach is that we can represent a set of rules, derive more facts, truths, and verify the correctness of sentences.

Page 15: 16368_15840-UNIT VI

Procedural Knowledge as KR

Procedural knowledge is encoded in the form of procedures which carry out specific tasks based on relevant knowledge.

Example – Interpreter for a programming language interprets the program using the semantics and syntax of the language.

This method suffers from two disadvantages: Completeness and consistency.

By Procedural Knowledge, all cases may not be represented. Secondly, all deductions may not be correct.

Page 16: 16368_15840-UNIT VI

Knowledge Representation using Semantic Network

The basic idea behind using Semantic Network is that meaning of concept is derived from its relationship with other concepts, and information is stored by interconnecting nodes with labelled arcs.

Represented in graphical notation where nodes represent concepts or objects and arcs represent relation between two concepts

Isa- This relation connects two classes. For eg- Man is a human.

Inst- This relation relates specific members of a class. For eg- John is instance of Man.

Page 17: 16368_15840-UNIT VI

Knowledge Representation using Semantic Network…

Every human and animal are living things who can breathe and eat. All birds are animals and can fly. Every man and woman are humans who have two legs. A cat has fur and is an animal. All animals have skin and can move. A giraffe is an animal and has long legs and is tall. A parrot is bird and is green in color.

Page 18: 16368_15840-UNIT VI

Knowledge Representation using Semantic Network …

PROPERTY RELATIONS

Relations such as can, has, color, height

Represented by dotted lines pointing from the concept to its property.

Does a parrot breathe? Can be easily answered as yes.

Page 19: 16368_15840-UNIT VI

Knowledge Representation using Semantic Network …

Page 20: 16368_15840-UNIT VI

Knowledge Representation using Semantic Network …

Page 21: 16368_15840-UNIT VI

Inheritance in Semantic Networks

Hierarchical structures of KR allows knowledge to be stored at the highest possible level of abstraction which reduces the size of the knowledge base.

Page 22: 16368_15840-UNIT VI

Inheritance in Semantic Networks.

Property Inheritance Algorithm Input: Object and property to be found from Semantic Net.

Output: return yes, if the object has the desired property else returns false.

Procedure:

Find an object in the semantic net;

Found=False;

while[(object=root) or Found] Do

{

If there is an attribute attached with an object then Found=true;

Else (object=isa(object,class) or object=inst(object,class)

};

If Found=true, then report yes else report no;

Page 23: 16368_15840-UNIT VI

Inheritance in Semantic Networks…

Prolog language is very convenient for representing an entire semantic structure in the form of facts (relation as predicate and nodes as arguments) and inheritance rules.

Inheritance of Semantic Nets in Prolog can be easily achieved by unification of appropriate arguments in Prolog.

Page 24: 16368_15840-UNIT VI

Inheritance in Semantic Networks …

Page 25: 16368_15840-UNIT VI

Inheritance Rules in PROLOG

In class hierarchy structure, a member subclass of a class is also member of all super classes connected with a “isa” link.

For example- If man is member of sub class human, then man is also member of living class.

Page 26: 16368_15840-UNIT VI

Inheritance Rules in PROLOG…

Page 27: 16368_15840-UNIT VI

Queries for inheritance

Page 28: 16368_15840-UNIT VI

Extended Semantic Networks for Knowledge Representation

Logic and Semantic Networks are two different formalisms that can be used for KR.

Simple Semantic Net is represented as directed graph whose nodes represent concepts or objects and arcs represent relationships between concepts or objects.

For example- John gives an apple to Mike and John and Mike are human.

Page 29: 16368_15840-UNIT VI

Extended Semantic Networks for KR (ESNet)

‘E’ represents an event which is an act of giving

Actor – John, Object – Apple, Recipient - Mike

Page 30: 16368_15840-UNIT VI

Relations in clausal form for Semantic Net

object(E, apple)

Action(E, give)

Actor(E, john)

Recipient(E, mike)

Isa(john, human)

Isa(mike, human)

Page 31: 16368_15840-UNIT VI

Advantages of semantic networks

Predicate relations corresponding to labels on the arcs of semantic networks always have two arguments.

The entire semantic network can be coded using binary representation (two argument representation).

It is easy to additional information to the facts.

For example- John gives an apple to Mike in the kitchen.

It is easy to add “location(E, kitchen)” to the set of facts.

John gives an apple to everyone he likes

Give(john,X,apple) likes(john,X)

Page 32: 16368_15840-UNIT VI

Advantages of Predicate logic

Every logic can be converted into clausal form.

By the help of Backward chaining, we can prove any sort of query.

Page 33: 16368_15840-UNIT VI

Disadvantages of predicate Logic

Give( john, X, apple) likes( john, X)

Not convenient to add new information in an n-ary representation of predicate logic.

3-ary relationship – give(john, mike, apple)

To add location we have to change it into 4-ary relationship. give(john, mike, apple, kitchen).

Page 34: 16368_15840-UNIT VI

Extended Semantic Network

In 1979, R. Kowalski proposed an Extended Semantic Network (ESNet) that combines the advantages of both logic and Semantic Networks.

ESNet have the same expressive power as that of predicate logic with well defined semantics, inference rules, and procedural interpretation.

ESNet is more powerful representation as compared to logic and semantic network.

Page 35: 16368_15840-UNIT VI

Extended Semantic Network…

Predicate symbols in clausal form are represented by labels on arcs of ESNet

John mary

Denial links are denoted by thick dotted lines.

These arcs denote negative atoms.

Grandfather(X,Y) father(X,Z),parent(Z,Y)

Love

Page 36: 16368_15840-UNIT VI

Inference rules

The inference rule that an actor who performs a taking action is also the recipient of this action

Recipient(E,X) action(E, take),actor(E,X)

Page 37: 16368_15840-UNIT VI

ESNet Example

Recipient(E,X) action(E, take), actor(E,X)

Object(e, apple)

Action(e, take)

Actor(e, john)

E – variable for some event

e - actual event

Page 38: 16368_15840-UNIT VI

ESNet Example

Page 39: 16368_15840-UNIT VI

Deduction in ESNet

Forward reasoning inference mechanism

Backward reasoning inference mechanism

Page 40: 16368_15840-UNIT VI

Forward reasoning Inference

Uses Modus ponen rule

Example- isa(X, human) isa(X, man)

isa(john, man)

Page 41: 16368_15840-UNIT VI

Forward reasoning Inference

Page 42: 16368_15840-UNIT VI

Backward reasoning Inference

Uses resolution refutation.

Example- isa(X, human) isa(X, man)

isa(john, man)

Page 43: 16368_15840-UNIT VI

Backward reasoning Inference

Page 44: 16368_15840-UNIT VI

Forward reasoning Inference (by Students)

Example- isa(X, living_thing) isa(X, animate)

isa(X, animate) isa(X, human)

isa(X, human) isa(X, man)

isa(john, man)

Query – john is a animate.

Page 45: 16368_15840-UNIT VI

Forward reasoning Inference

Page 46: 16368_15840-UNIT VI

Forward reasoning Inference

Page 47: 16368_15840-UNIT VI

Forward reasoning Inference

Page 48: 16368_15840-UNIT VI

Backward Reasoning Inference

Query – isa(john, living_thing)

Page 49: 16368_15840-UNIT VI

Backward Reasoning Inference

Page 50: 16368_15840-UNIT VI

Inheritance

Example- isa(X, living_thing) isa(X, animate)

isa(X, animate) isa(X, human)

isa(X, human) isa(X, man)

isa(john, man)

Part_of(human, two_legs)

Page 51: 16368_15840-UNIT VI

Inheritance

Page 52: 16368_15840-UNIT VI

Inheritance

Addition of a denial link to a network

Page 53: 16368_15840-UNIT VI

Inheritance

Obtaining a contradiction

Page 54: 16368_15840-UNIT VI

Knowledge Representation using Frames

The idea regarding Frames was first given by Marvin Minsky in 1975.

Frames are regarded as Extension of semantic Nets. ie each node of semantic net is represented by frame.

Frame is a collection of attributes describing real world entity.

Frames are considered to organize and package knowledge in more structured form.

Page 55: 16368_15840-UNIT VI

Links in Frames …

Frames in a network of frames are connected using following links:

Ako: This link connects two class frames, one of which is a kind of the other class. Eg the class child_hospital is a kind of the class hospital. A class defines its own slots and also inherits slot-value pairs from its super class.

Inst: This link connects a particular instance frame to a class frame. Eg. AIIMS is an instance of the class frame hospital. An instance class possesses the same structure as its class frame.

Part_of: This link connects two class frames one of which is contained in the other class. eg. Ward is Part_of the class

hospital.

Page 56: 16368_15840-UNIT VI

Frame Description of Hospital

Hospital Frame (Root of the Network)

F_name: hospital

Country: (value-India)

Phone_No: (default-2564799)

Address: (default-New Delhi)

Director: (default-XYZ)

Labs: lab (Lab Frame)

Wards: ward (Ward Frame)

Doctors: doctor (Doctor Frame)

Page 57: 16368_15840-UNIT VI

Frame Description of Hospital …

Child Hospital Frame

F_name: child_hospital

Ako: hospital (Hospital Frame)

Age: (range-[0-10])

Page 58: 16368_15840-UNIT VI