0% found this document useful (0 votes)
139 views112 pages

Artificial Intelligence

The document outlines the syllabus for the Artificial Intelligence course (Subject Code: 310253) for T.E. (Computer Engineering) Semester VI at Savitribai Phule Pune University. It includes a comprehensive overview of the subject, covering key topics such as problem-solving, knowledge representation, reasoning, and planning, along with a structured approach to learning through illustrations and practical examples. The authors, Anamitra Deshmukh-Nimbalkar and Dr. Vaishali P. Vikhe, aim to provide a clear understanding of AI concepts for students and educators alike.

Uploaded by

Mahindra Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views112 pages

Artificial Intelligence

The document outlines the syllabus for the Artificial Intelligence course (Subject Code: 310253) for T.E. (Computer Engineering) Semester VI at Savitribai Phule Pune University. It includes a comprehensive overview of the subject, covering key topics such as problem-solving, knowledge representation, reasoning, and planning, along with a structured approach to learning through illustrations and practical examples. The authors, Anamitra Deshmukh-Nimbalkar and Dr. Vaishali P. Vikhe, aim to provide a clear understanding of AI concepts for students and educators alike.

Uploaded by

Mahindra Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 112

SUBJECT CODE : 310253

As per Revised Syllabus of


Savitribai Phule Pune University
Choice Based Credit System (CBCS)
T.E. (Computer) Semester - VI

Artificial Intelligence
Anamitra Deshmukh-Nimbalkar
CTO & Chief Software Trainer, Mentor
(PGDBM, PGDPC, NET, SET, MCS)

Dr. Vaishali P. Vikhe


Ph.D. (IT), M.Tech. (Computer), B.E. (IT),
Associate Professor,
Pravara Rural Engineering College, Loni,
Ahmednagar.

® ®
TECHNICAL
PUBLICATIONS
SINCE 1993 An Up-Thrust for Knowledge

(i)
Artificial Intelligence
Subject Code : 310253

T.E. (Computer Engineering) Semester - VI

ã Copyright with Anamitra Deshmukh-Nimbalkar


All publishing rights (printed and ebook version) reserved with Technical Publications. No part of this book
should be reproduced in any form, Electronic, Mechanical, Photocopy or any information storage and
retrieval system without prior permission in writing, from Technical Publications, Pune.

Published by :
® ® Amit Residency, Office No.1, 412, Shaniwar Peth,
TECHNICAL Pune - 411030, M.S. INDIA Ph.: +91-020-24495496/97
PUBLICATIONS
SINCE 1993 An Up-Thrust for Knowledge Email : [email protected] Website : www.technicalpublications.org

Printer :
Yogiraj Printers & Binders
Sr. No. 10/1A,
Ghule Industrial Estate, Nanded Village Road,
Tal. - Haveli, Dist. - Pune - 411041.

ISBN 978-93-5585-014-0

9 789355 850140
SPPU 19

9789355850140 [1] (ii)


preface
The importance of Artificial Intelligence is well known in various engineering fields.
Overwhelming response to our books on various subjects inspired us to write this book. The
book is structured to cover the key aspects of the subject Artificial Intelligence.

The book uses plain, lucid language to explain fundamentals of this subject. The book
provides logical method of explaining various complicated concepts and stepwise methods
to explain the important topics. Each chapter is well supported with necessary illustrations,
practical examples and solved problems. All the chapters in the book are arranged in a
proper sequence that permits each topic to build upon earlier studies. All care has been
taken to make students comfortable in understanding the basic concepts of the subject.

Representative questions have been added at the end of each chapter to help the
students in picking important points from that chapter.

The book not only covers the entire scope of the subject but explains the philosophy of
the subject. This makes the understanding of this subject more clear and makes it more
interesting. The book will be very useful not only to the students but also to the subject
teachers. The students have to omit nothing and possibly have to cover nothing more.

We wish to express our profound thanks to all those who helped in making this book a
reality. Much needed moral support and encouragement is provided on numerous
occasions by our whole family. We wish to thank the Publisher and the entire team of
Technical Publications who have taken immense pain to get this book in time with quality
printing.

Any suggestion for the improvement of the book will be acknowledged and well
appreciated.

Authors
Anamitra Deshmukh - Nimbalkar
Dr. Vaishali P. Vikhe

(iii)
Dedicated to my first love,
My father shri. Prakash Deshmukh,
On his 61st Birthday,
who put all his efforts and went through huge mental and
emotional pains, in making me a decisive decision maker
so that I grow up to become an independent person on
whom people can bank on.
Anamitra Deshmukh-Nimbalkar

Dedication
This book is dedicated to my family and parents who
always support me and inspired me in every stage.
Dr. Vaishali P. Vikhe

(iv)
Syllabus
Artificial Intelligence - (310253)
Credit : Examination Scheme :

Mid-Sem (TH) : 30 Marks


03
End-Sem (TH) : 70 Marks

Unit I Introduction
Introduction to Artificial Intelligence, Foundations of Artificial Intelligence, History of Artificial
Intelligence, State of the Art, Risks and Benefits of AI, Intelligent Agents, Agents and Environments, Good
Behavior : Concept of Rationality, Nature of Environments, Structure of Agents. (Chapter - 1)

Unit II Problem-solving
Solving Problems by Searching, Problem-Solving Agents, Example Problems, Search Algorithms,
Uninformed Search Strategies, Informed (Heuristic) Search Strategies, Heuristic Functions, Search in
Complex Environments, Local Search and Optimization Problems. (Chapters - 2, 3)

Unit III Adversarial Search and Games


Game Theory, Optimal Decisions in Games, Heuristic Alpha-Beta Tree Search, Monte Carlo Tree Search,
Stochastic Games, Partially Observable Games, Limitations of Game Search Algorithms, Constraint
Satisfaction Problems (CSP), Constraint Propagation : Inference in CSPs, Backtracking Search for CSPs.
(Chapters - 4, 5)

Unit IV Knowledge
Logical Agents, Knowledge-Based Agents, The Wumpus World, Logic, Propositional Logic : A Very
Simple Logic, Propositional Theorem Proving, Effective Propositional Model Checking, Agents Based on
Propositional Logic, First-Order Logic, Representation Revisited, Syntax and Semantics of First-Order
Logic, Using First-Order Logic, Knowledge Engineering in First-Order Logic. (Chapters - 6, 7, 8)

Unit V Reasoning
Inference in First-Order Logic, Propositional vs. First-Order Inference, Unification and First-Order
Inference, Forward Chaining, Backward Chaining, Resolution, Knowledge Representation, Ontological
Engineering, Categories and Objects, Events, Mental Objects and Modal Logic, Reasoning Systems for
Categories, Reasoning with Default Information. (Chapters - 9, 10)

Unit VI Planning
Automated Planning, Classical Planning, Algorithms for Classical Planning, Heuristics for Planning,
Hierarchical Planning, Planning and Acting in Nondeterministic Domains, Time, Schedules, and
Resources, Analysis of Planning Approaches, Limits of AI, Ethics of AI, Future of AI, AI Components, AI
Architectures. (Chapters - 11, 12)

(v)
Table of Contents
Unit I
Chapter - 1 Artificial Intelligence - The Concept (1 - 1) to (1 - 46)
1.1 The Concept of Artificial Intelligence (AI) ....................................................... 1 - 2
1.1.1 Introduction .................................................................................................. 1 - 2
1.1.2 Various Definitions of AI ............................................................................... 1 - 2
1.1.3 The Foundation of AI .................................................................................... 1 - 4
1.1.4 The Strong and Weak AI ............................................................................... 1 - 5
1.1.4.1 Strong AI ..................................................................................................... 1 - 5
1.1.4.2 Weak AI ....................................................................................................... 1 - 5

1.1.5 What AI can do Today ? ............................................................................... 1 - 6


1.1.5.1 Autonomous Planning and Scheduling ....................................................... 1 - 6
1.1.5.2 Game Playing ............................................................................................. 1 - 6

1.1.5.3 Autonomous Control .................................................................................. 1 - 6


1.1.5.4 Diagnosis ..................................................................................................... 1 - 6

1.1.5.5 Logistic Planning ......................................................................................... 1 - 6


1.1.5.6 Robotics ...................................................................................................... 1 - 6
1.1.5.7 Language Understanding and Problem Solving .......................................... 1 - 7

1.1.6 Human Vs Machine ...................................................................................... 1 - 7


1.1.6.1 Will Machine behave Exactly as Human ?................................................... 1 - 7

1.1.6.2 Comparisons between Human and Machines ............................................ 1 - 7

1.1.7 State of the Art ............................................................................................. 1 - 8


1.2 AI Problem....................................................................................................... 1 - 9
1.3 The Underlying Assumption .......................................................................... 1 - 10
1.4 What is an AI Technique ?............................................................................. 1 - 11
1.5 The Level of the Model ................................................................................. 1 - 11
1.6 Criteria for Success........................................................................................ 1 - 12

(vi)
1.7 History of Artificial Intelligence..................................................................... 1 - 13
1.8 AI Terms ........................................................................................................ 1 - 15
1.8.1 Agents and it's Environment....................................................................... 1 - 15
1.8.2 The AI Terminology ..................................................................................... 1 - 16
1.8.3 Architecture of Agent ................................................................................. 1 - 17
1.8.4 Schematic of AI's Agent Performing Action ................................................ 1 - 17
1.8.5 Role of An Agent Program .......................................................................... 1 - 18
1.8.6 Simple Example for Tabulation of a Agent ................................................. 1 - 18
1.8.7 The Weak and Strong Agent ....................................................................... 1 - 18
1.8.7.1 Weak Agent............................................................................................... 1 - 19
1.8.7.2 Strong Agent ............................................................................................. 1 - 19

1.8.8 Rational Behaviour and Omniscience ......................................................... 1 - 20


1.8.8.1 Rational Agent .......................................................................................... 1 - 20
1.8.8.2 The Good and the Bad Agent ................................................................... 1 - 21

1.8.8.3 Omniscience, Learning and Autonomy .................................................... 1 - 21


1.8.9 Agent and it's Environment ........................................................................ 1 - 22
1.8.9.1 Agent Description ..................................................................................... 1 - 22

1.9 The Environments ......................................................................................... 1 - 23


1.9.1 Nature of Environment ............................................................................... 1 - 23
1.9.2 Types of Task Environment......................................................................... 1 - 24
1.9.2.1 Fully Observable Vs Partially Observable .................................................. 1 - 24
1.9.2.2 Deterministic Vs Stochastic ....................................................................... 1 - 24

1.9.2.3 Episodic Vs Sequential .............................................................................. 1 - 25

1.9.2.4 Static Vs Dynamic ...................................................................................... 1 - 26

1.9.2.5 Discrete Vs Continuous ............................................................................. 1 - 26


1.9.2.6 Single Agent Vs Multiagent ....................................................................... 1 - 27

1.9.2.7 Complexity Comparison of Task Environment ......................................... 1 - 27

1.9.3 More Types of Task Environment ............................................................... 1 - 28


1.10 Different Types of Agents ............................................................................. 1 - 29
1.10.1 Intelligent Agent ......................................................................................... 1 - 29

(vii)
1.10.2 Different Forms of Agents : (Types of Agents) ........................................... 1 - 31
1.10.2.1 Agent Type 1 ............................................................................................. 1 - 31

1.10.2.2 Agent Type 2 ............................................................................................. 1 - 32

1.10.2.3 Agent Type 3 ............................................................................................. 1 - 33

1.10.2.4 Agent Type 4 ............................................................................................. 1 - 34

1.10.3 The Learning Agent ..................................................................................... 1 - 35


1.10.3.1 Components of Learning Agent ................................................................ 1 - 36
1.10.4 More Types of Agents ................................................................................. 1 - 37
1.11 Designing an Agent System ........................................................................... 1 - 37
1.11.1 The Steps in Designing an Agent................................................................. 1 - 38
1.11.2 Examples of Agent Types and Their PEAS Description
According to Their Uses .............................................................................. 1 - 38
1.11.3 The Detail Example of PEAS ........................................................................ 1 - 40
1.12 One Final Word ............................................................................................. 1 - 41
Review Questions .................................................................................................. 1 - 41
Multiple Choice Questions with Answers ............................................................. 1 - 42
Unit II
Chapter - 2 State Space Search (2 - 1) to (2 - 46)
2.1 Problem Defining and Solving Problem .......................................................... 2 - 2
2.1.1 What is Problem Solving ? ............................................................................ 2 - 2
2.1.2 Well Defined Problems ................................................................................. 2 - 2
2.1.3 Problem Formulation Types ......................................................................... 2 - 5
2.1.4 Solving the Problem...................................................................................... 2 - 6
2.1.5 Problem Solving Agents ................................................................................ 2 - 7
2.1.5.1 Approach of Problem Solving Agent .............................................................. 2 - 7

2.1.5.2 Steps in Problem Solving ................................................................................ 2 - 7

2.1.5.3 Algorithm ....................................................................................................... 2 - 9

2.1.5.4 For Example ................................................................................................... 2 - 9

2.2 State Space Search ........................................................................................ 2 - 10

(viii)
2.2.1 Construction of State Space ....................................................................... 2 - 10
2.2.2 Terminology used in Search Trees .............................................................. 2 - 10
2.2.3 Node Representation in a Search - Tree ..................................................... 2 - 12
2.2.4 The Node Searching and Expansion Algorithms ........................................ 2 - 12
2.2.4.1 Algorithm Tree Search ................................................................................. 2 - 12

2.2.4.2 Algorithm Expand Node ............................................................................... 2 - 13

2.2.5 Measuring Problem Solving Performance .................................................. 2 - 13


2.3 State Space Search Strategies ....................................................................... 2 - 14
2.3.1 Two Basic Types of Search Strategies ......................................................... 2 - 14
2.3.2 Uninformed Search Strategies .................................................................... 2 - 15
2.3.2.1 Breadth-First Search .................................................................................... 2 - 15
2.3.2.2 Uniform Cost Search .................................................................................... 2 - 17
2.3.2.3 Depth-First Search ....................................................................................... 2 - 18
2.3.2.4 DFS [Depth First Search] .............................................................................. 2 - 19
2.3.2.5 Depth-Limited Search (DLS) ......................................................................... 2 - 20
2.3.2.6 Iterative-Deepening Depth-First Search (IDDFS) ......................................... 2 - 22
2.3.2.7 Bidirectional Search ..................................................................................... 2 - 24

2.4 The Repeated States ..................................................................................... 2 - 25


2.4.1 Avoiding Repeated States ........................................................................... 2 - 25
2.4.2 Serious Problems Caused due to Repeated States ..................................... 2 - 25
2.4.3 Example of State Space that Generate an Exponentially
Larger Search Tree ...................................................................................... 2 - 26
2.4.4 Algorithm that can Avoid Repeated States
(Algorithms that Forget their History are Sure to Repeate the States.) ..... 2 - 27
2.5 Searching with Partial Information ............................................................... 2 - 28
2.5.1 Sensorless Problems (Conformant Problems) ............................................ 2 - 29
2.5.2 Contigency Problem.................................................................................... 2 - 30
2.5.3 Extreme Case of Contigency Problem ........................................................ 2 - 30
2.6 Issues in the Design of Search Problem ........................................................ 2 - 31
2.6.1 Issues in Engineering Design....................................................................... 2 - 31
2.6.1.1 Design Synthesis .......................................................................................... 2 - 31

(ix)
2.7 Example Problems......................................................................................... 2 - 32
2.7.1 Toy Problem................................................................................................ 2 - 32
2.7.2 Real World Problem.................................................................................... 2 - 33
2.7.3 Problem Formulation for Toy Problems ..................................................... 2 - 33
2.7.4 Real - World Problem Examples ................................................................. 2 - 37
Review Questions .................................................................................................. 2 - 41
Multiple Choice Questions with Answers ............................................................. 2 - 43

Chapter - 3 Heuristic Search (3 - 1) to (3 - 34)


3.1 Heuristic Search .............................................................................................. 3 - 2
3.1.1 Introduction to Informed Search .................................................................. 3 - 2
3.1.2 Generate-and-Test........................................................................................ 3 - 2
3.1.3 Best First Search Technique (BFS)................................................................. 3 - 2
3.1.4 Heuristic Function ......................................................................................... 3 - 5
3.1.5 Greedy Best First Search (GBFS) ................................................................... 3 - 5
3.1.6 How to Search Better ? ................................................................................. 3 - 6
3.1.7 Heuristic Functions and Their Nature ........................................................... 3 - 6
3.1.7.1 Accuracy of Heuristic Function ................................................................... 3 - 6
3.1.7.2 An Example of [Designing Heuristic Function] ............................................ 3 - 7

3.1.7.3 The Domination of Heuristic Function ........................................................ 3 - 7


3.1.7.4 Admissible Heuristic Functions ................................................................... 3 - 8

3.1.8 Learning Heuristic from Experience.............................................................. 3 - 8


3.2 Local Search .................................................................................................. 3 - 12
3.2.1 Local Search Algorithms.............................................................................. 3 - 12
3.2.2 Hill Climbing Search .................................................................................... 3 - 14
3.2.2.1 Algorithm for Hill Climbing........................................................................ 3 - 14

3.2.2.2 Problems with Hill Climbing ...................................................................... 3 - 14


3.2.2.3 Solving Problems Associated with Hill Climbing ....................................... 3 - 15

3.2.2.4 Example for Local Search .......................................................................... 3 - 16

3.2.2.5 Advantages of Hill Climbing ...................................................................... 3 - 16


3.2.2.6 Variations of Hill Climbing ......................................................................... 3 - 16

(x)
3.2.3 Simulated Annealing Search ....................................................................... 3 - 17
3.2.4 Local Beam Search ...................................................................................... 3 - 18
3.2.5 Stochastic Beam Search .............................................................................. 3 - 18
3.2.6 Genetic Algorithms ..................................................................................... 3 - 19
3.2.6.1 Term used in Genetic Algorithm ............................................................... 3 - 19

3.2.6.2 Working of a Genetic Algorithm ............................................................... 3 - 19

3.2.6.3 Example : 8 Queens Problem Fitness ........................................................ 3 - 20

3.2.6.4 Optimization using Genetic Algorithm ...................................................... 3 - 22

3.3 Local Search in Continuous Spaces ............................................................... 3 - 22


3.3.1 Search and Evaluation Theory .................................................................... 3 - 23
3.3.2 Problems Associated with Local Search...................................................... 3 - 24
3.3.3 Constrained Optimization Problem ............................................................ 3 - 24
3.4 Optimal Search .............................................................................................. 3 - 24
3.4.1 A* Search .................................................................................................... 3 - 24
3.4.2 Memory Bounded Heuristic Search ............................................................ 3 - 26
3.4.2.1 Recursive Best First Search (RBFS) ............................................................ 3 - 27
3.4.2.2 MA*........................................................................................................... 3 - 28

3.4.3 Problem Reduction with AO* Algorithm .................................................... 3 - 28


Review Questions .................................................................................................. 3 - 30
Multiple Choice Questions with Answers ............................................................. 3 - 30
Unit III
Chapter - 4 Adversarial Search and Games in AI (4 - 1) to (4 - 48)
4.1 What is Game ? ............................................................................................... 4 - 2
4.2 Applications of Game Theory.......................................................................... 4 - 2
4.3 Definition of Game .......................................................................................... 4 - 3
4.4 Game Theory ................................................................................................... 4 - 3
4.5 Role of Game Playing in AI .............................................................................. 4 - 4
4.6 Relevance of Game Theory and Game Playing ............................................... 4 - 5
4.7 Game Playing .................................................................................................. 4 - 5

(xi)
4.8 Types of Games ............................................................................................... 4 - 6
4.9 Formal Representation of a Game as a Problem ............................................ 4 - 7
4.9.1 A Game is Essentially a Kind of a Search Problem ! ....................................... 4 - 7
4.9.2 Game Playing Strategies ................................................................................ 4 - 8
4.9.3 The Game Tree .............................................................................................. 4 - 9
4.10 Major Components of Game Playing Program ............................................. 4 - 11
4.11 Mini-Max Algorithm ...................................................................................... 4 - 11
4.11.1 The Algorithm .............................................................................................. 4 - 11
4.11.2 Properties of Mini-Max................................................................................ 4 - 12
4.11.3 Problem Associated with Mini-Max............................................................. 4 - 12
4.11.4 Game Playing with Mini-Max-Tic-Tac-Toe
[Noughts and crosses] Example ................................................................... 4 - 12
4.11.5 Example to show how Mini-Max Algorithm Works ..................................... 4 - 13
4.11.6 The 'made-up' Games and Concept of 'ply' ................................................. 4 - 16
4.11.7 Mini-Max Algorithm for Playing Multiplayer Games ................................... 4 - 17
4.12 Alpha-Beta Pruning ....................................................................................... 4 - 18
4.12.1 Motivation for  -  Pruning........................................................................ 4 - 18
4.12.2 Steps in Alpha-Beta Pruning ........................................................................ 4 - 19
4.12.3 Alpha Cutoff ................................................................................................. 4 - 20
4.12.4 Beta-Cutoff .................................................................................................. 4 - 20
4.12.5 Algorithm of Alpha-Beta Pruning ................................................................. 4 - 20
4.12.6 Example of Alpha-Beta Pruning (Upto 3rd Ply)............................................ 4 - 21
4.12.7 Why is it Called  -  ? ................................................................................ 4 - 24
4.12.8 Heuristic Function that can be used in Cutting Off Search .......................... 4 - 25
4.12.8.1 Evaluation Functions .................................................................................. 4 - 25
4.12.8.2 Imperfect and Real-time Decisions ............................................................ 4 - 25
4.12.8.3 Cutting Off Search ...................................................................................... 4 - 25
4.12.8.4 Forward Pruning ........................................................................................ 4 - 27

4.13 Monte Carlo Tree Search .............................................................................. 4 - 28


4.14 Games with Chance ...................................................................................... 4 - 31
4.15 State of the Art Game Programs ................................................................... 4 - 33

(xii)
4.16 Stochastic Games .......................................................................................... 4 - 34
Solved Example ..................................................................................................... 4 - 40
Review Questions .................................................................................................. 4 - 43
Multiple Choice Questions with Answers ............................................................. 4 - 44

Chapter - 5 Constraint Satisfaction (5 - 1) to (5 - 30)


5.1 Constraint Satisfaction ................................................................................... 5 - 2
5.1.1 Constraint Satisfaction Problems - The Concept .......................................... 5 - 2
5.1.2 Formal Definition of Constraint Satisfaction Problems ............................... 5 - 2
5.1.3 Examples of CSP ............................................................................................ 5 - 3
5.1.3.1 Map Colouring Problem .............................................................................. 5 - 3
5.1.3.2 Other Examples of CSP ................................................................................ 5 - 4

5.1.4 Incremental Formulation for CSP ................................................................. 5 - 5


5.1.5 Searching for Goal State in CSP .................................................................... 5 - 5
5.1.6 Variations in CSPs ......................................................................................... 5 - 5
5.1.7 Constraints in CSPs ....................................................................................... 5 - 6
5.1.7.1 Properties of Constraints ............................................................................ 5 - 6
5.1.7.2 Types of Constraints in CSPs ....................................................................... 5 - 6

5.1.8 General Algorithm for Finding Solution in CSP ............................................. 5 - 9


5.2 N-Queen Problem and Scene Labeling Using CSP ........................................ 5 - 10
5.2.1 N-Queen Problem as CSP............................................................................ 5 - 10
5.2.2 Scene Labeling ............................................................................................ 5 - 13
5.2.3 Example ...................................................................................................... 5 - 17
5.3 Constraint Propagation ................................................................................. 5 - 20
5.3.1 Forward Checking (FC) ................................................................................ 5 - 20
5.3.2 Constraint Propagation Process ................................................................. 5 - 20
5.4 Higher Order and Directional Consistency.................................................... 5 - 22
5.5 Backtracking and Lookhead Strategies ......................................................... 5 - 25
5.5.1 Basic Steps in Backtracking Search ............................................................. 5 - 25
5.5.2 Backtracking Search Algorithm ................................................................... 5 - 25
5.5.3 Limitations of Backtracking......................................................................... 5 - 26

(xiii)
Review Questions .................................................................................................. 5 - 27
Multiple Choice Questions with Answers ............................................................. 5 - 27
Unit IV
Chapter - 6 Knowledge Representation Issues (6 - 1) to (6 - 24)
6.1 Representation and Mappings ........................................................................ 6 - 2
6.1.1 Introduction .................................................................................................. 6 - 2
6.1.2 Issues in Knowledge Representation ............................................................ 6 - 2
6.1.3 The Techniques of Representation and Mappings ....................................... 6 - 3
6.2 Approaches to Knowledge Representation .................................................... 6 - 6
6.2.1 Inferential Knowledge .................................................................................. 6 - 8
6.2.2 Procedural Knowledge .................................................................................. 6 - 8
6.2.2.1 Advantages of Procedural Knowledge ....................................................... 6 - 8
6.2.2.2 Disadvantages of Procedural Knowledge ................................................... 6 - 8

Review Questions .................................................................................................. 6 - 19


Multiple Choice Questions with Answers ............................................................. 6 - 24

Chapter - 7 Logical Agents and Knowledge Representation using


Propositional Logic (7 - 1) to (7 - 32)
7.1 Characteristic of Propositional Logic .............................................................. 7 - 2
7.2 Drawbacks of Propositional Logic ................................................................... 7 - 2
7.3 Syntax for Propositional Logic......................................................................... 7 - 3
7.3.1 Propositional Calculus Sentence................................................................... 7 - 3
7.3.2 Connectives .................................................................................................. 7 - 4
7.3.3 Grouping of Symbols in Propositional Logic ................................................. 7 - 6
7.3.4 Forming a Legal Sentence in Propositional Logic ......................................... 7 - 6
7.3.5 Formal Grammar for Propositional Logic ..................................................... 7 - 6
7.3.6 Inference in the Knowledge Base ................................................................. 7 - 7
7.4 Semantics for Propositional Logic ................................................................... 7 - 9
7.4.1 Interpretation of Propositions ...................................................................... 7 - 9
7.4.2 Computation of Truth Values ....................................................................... 7 - 9

(xiv)
7.4.3 Truth Table.................................................................................................. 7 - 10
7.4.4 Validity ........................................................................................................ 7 - 11
7.4.5 Satisfiability................................................................................................. 7 - 11
7.4.6 A Complete Example of Knowledge-based Agent ...................................... 7 - 12
7.5 Reasoning Patterns in Propositional Logic .................................................... 7 - 14
7.5.1 The Concept of Monotonicity ..................................................................... 7 - 15
7.5.2 Inference Rules ........................................................................................... 7 - 15
7.6 Forward and Backward Chaining .................................................................. 7 - 18
7.6.1 The Horn Clause .......................................................................................... 7 - 18
7.6.2 Forward Chaining Method .......................................................................... 7 - 18
7.6.3 The Backward Chaining Algorithm.............................................................. 7 - 20
7.7 Effective Propositional Inference .................................................................. 7 - 21
7.7.1 A Complete Backtracking Algorithm
[Davis Putnam Logmann-Loveland Algorithm-(DPLL)]................................ 7 - 21
7.8 Local Search Algorithms for Inferencing in Propositional Logic ................... 7 - 23
7.8.1 Local Search Algorithms Characteristics ..................................................... 7 - 23
7.8.2 Local Search Algorithm for Checking Satisfiability...................................... 7 - 23
7.8.3 Steps in WALKSAT Algorithm ...................................................................... 7 - 24
7.8.4 Hard Satisfiability Problems ........................................................................ 7 - 24
7.9 Knowledge based Agents .............................................................................. 7 - 25
7.9.1 Inference based Agent in Wumpus World - Agent based
on Propositional Logic................................................................................ 7 - 25
7.9.2 Circuit based Agent in Wumpus World ...................................................... 7 - 27
7.9.3 Comparison between Inference Based Agent (IBA)
and Circuit Based Agent (CBA) .................................................................... 7 - 28
Review Questions .................................................................................................. 7 - 29
Multiple Choice Questions with Answers ............................................................. 7 - 30

Chapter - 8 First Order Logic - Predicate Logic (8 - 1) to (8 - 32)


8.1 First Order Logic - [Predicate Logic] ............................................................... 8 - 2
8.1.1 Introduction to First Order Logic .................................................................. 8 - 2

(xv)
8.1.2 Properties of First Order Logic ...................................................................... 8 - 2
8.1.3 First Order Logic-Extension to Propositional Logic ....................................... 8 - 3
8.1.4 Variations of First Order Logic ...................................................................... 8 - 3
8.1.5 Characteristics of Logic ................................................................................. 8 - 3
8.1.6 Formal Languages and their Ontological
and Epistemological Commitments .............................................................. 8 - 4
8.1.7 Higher - Order Logic ...................................................................................... 8 - 4
8.1.8 Syntax for First Order Logic .......................................................................... 8 - 4
8.1.9 Sentence in First Order Logic ........................................................................ 8 - 7
8.1.10 Semantic of First Order Logic........................................................................ 8 - 8
8.1.11 Quantifiers .................................................................................................... 8 - 9
8.1.11.1 Universal Quantifier () ............................................................................ 8 - 9
8.1.11.2 Existential Quantifier () .......................................................................... 8 - 10

8.1.11.3 Truth Values of First Order Logic Expressions Containing Quantifiers...... 8 - 10

8.1.11.4 The Nested Quantifiers ............................................................................ 8 - 11


8.1.11.5 Relationship between  and  ............................................................... 8 - 11

8.1.11.6 Equality .................................................................................................... 8 - 12


8.1.11.7 Properties of Quantifiers.......................................................................... 8 - 12
8.1.11.8 The Examples Bank .................................................................................. 8 - 13

8.1.12 Using First Order Logic for Knowledge Base ............................................... 8 - 15


8.1.13 The Kinship Domain .................................................................................... 8 - 15
8.1.14 Number, Sets and Lists ............................................................................... 8 - 16
8.1.15 Synchronic and Diachronic Sentences ........................................................ 8 - 18
8.1.16 Synchronic Rules for Inferencing ................................................................ 8 - 18
8.1.16.1 Diagnostic Rules ....................................................................................... 8 - 18
8.1.16.2 Causal Rules ............................................................................................. 8 - 19

8.1.16.3 Model Based Reasoning Systems and Diagnostic Reasoning Systems ..... 8 - 19

8.2 The Wumpus World Represented using First Order Logic ........................... 8 - 20
8.2.1 Wumpus World Revisited ........................................................................... 8 - 20
8.2.2 Reasoning in Wumpus World using First Order Logic ................................ 8 - 20
8.3 Knowledge Engineering in First Order Logic ................................................. 8 - 21
(xvi)
8.3.1 We have Two Types of Knowledge Base .................................................... 8 - 21
8.3.2 Steps in Knowledgebase Engineering Process ............................................ 8 - 21
8.3.3 Knowledge Engineering in First Order Logic
for the Electronic Circuits Domain .............................................................. 8 - 23
Review Questions .................................................................................................. 8 - 25
Multiple Choice Questions with Answers ............................................................. 8 - 29
Unit V
Chapter - 9 Reasoning and Inferencing using
First Order Logic (9 - 1) to (9 - 68)
9.1 Inference in First Order Logic .......................................................................... 9 - 2
9.1.1 Inferencing in First Order Logic..................................................................... 9 - 2
9.1.2 Definition of Various Terms used in Inference Theory ................................ 9 - 2
9.1.3 Inference Rules ............................................................................................ 9 - 3
9.1.4 Reducing First Order Logic Inferences to Propositional Inferences ............. 9 - 5
9.1.5 Concept of Lifting.......................................................................................... 9 - 6
9.1.6 Unification .................................................................................................... 9 - 7
9.1.7 Storage and Retrieval of Data from Knowledge Base................................. 9 - 10
9.1.8 First Order Definite Clauses ........................................................................ 9 - 14
9.1.9 Inferencing Algorithm for First Order Logic ................................................ 9 - 14
9.1.9.1 Forward Chaining (Lifted Forward Chaining) ............................................ 9 - 14

9.1.9.2 Backward Chaining (Lifted Backward Chaining) ........................................ 9 - 20

9.1.9.3 Forward Chaining Vs Backward Chaining .................................................. 9 - 21

9.1.10 Resolution ................................................................................................... 9 - 22


9.1.11 Dealing with Equality ................................................................................... 9 - 40
9.1.12 Theorem Provers (Automated Reasoners) .................................................. 9 - 41
9.2 Monotonic and Non-Monotonic Reasoning ................................................. 9 - 42
9.2.1 Monotonic Reasoning ................................................................................. 9 - 42
9.2.2 Nonmonotonic Reasoning ........................................................................... 9 - 44
Review Questions .................................................................................................. 9 - 62
Multiple Choice Questions with Answers ............................................................. 9 - 65
(xvii)
Chapter 10 Knowledge Representation and Ontological Engineering
(10 - 1) to (10 - 32)
10.1 Knowledge Representation ........................................................................... 10 - 2
10.1.1 Ontological Engineering.............................................................................. 10 - 2
10.1.2 What is Knowledge Engineering ? .............................................................. 10 - 3
10.1.3 The Concept of Categories and Objects ..................................................... 10 - 4
10.1.3.1 Representation of Categories ................................................................... 10 - 4

10.1.3.2 Measurements .......................................................................................... 10 - 7


10.1.4 The Ontology of Situation Calculus............................................................. 10 - 9
10.1.4.1 Terms in Situation Calculus (Ontology of Situation Calculus) ................... 10 - 9

10.1.4.2 Describing Actions in Situation Calculus ................................................. 10 - 14

10.1.5 Time and Event Calculus ........................................................................... 10 - 15


10.1.5.1 Properties of Event Calculus ................................................................... 10 - 15
10.1.5.2 Generalized Events ................................................................................. 10 - 16
10.1.5.3 Intervals .................................................................................................. 10 - 17
10.1.5.4 Processes ................................................................................................ 10 - 18

10.1.6 Fluent Calculus ......................................................................................... 10 - 19


10.2 Mental Events and Mental Objects............................................................ 10 - 19
10.2.1 Theory of Beliefs ...................................................................................... 10 - 20
10.2.2 The Concept of Knowledge, Belief, Time, Actions and their
Association ............................................................................................... 10 - 21
10.3 Organization of Categories and their Reasoning Systems ......................... 10 - 22
10.3.1 Organizing Categories ............................................................................... 10 - 22
10.3.1.1 Semantic Networks ................................................................................ 10 - 23
10.3.1.2 Description Logic ..................................................................................... 10 - 24

10.3.2 Non-monotonic Reasoning ....................................................................... 10 - 25


10.3.2.1 Default Reasoning ................................................................................... 10 - 25
10.3.2.2 Circumscription ....................................................................................... 10 - 27
10.3.2.3 Truth Maintenance Systems ................................................................... 10 - 28

10.4 A Knowledge Engineering Example - Internet Shopping World ................ 10 - 29


Review Questions ................................................................................................ 10 - 30
Multiple Choice Questions with Answers ........................................................... 10 - 30

(xviii)
Unit VI
Chapter - 11 AI Planning (11 - 1) to (11 - 40)
11.1 Planning......................................................................................................... 11 - 2
11.1.1 Difficulties in Planning Problem................................................................... 11 - 2
11.1.2 The Comparison between Problem Solving and Planning ........................... 11 - 3
11.1.3 The Planning Problem.................................................................................. 11 - 3
11.1.4 Representation of Planning Problem........................................................... 11 - 3
11.1.5 Searching for Solution for Planning Problem............................................... 11 - 6
11.1.5.1 Forward State - Space Search (Progression Planner) ................................. 11 - 7

11.1.5.2 Backward State Space Search (Regression Planner) .................................. 11 - 8


11.1.5.3 Heuristic Function for State - Space Search ............................................... 11 - 9

11.2 Planning Languages - STRIPS ....................................................................... 11 - 10


11.3 Blocks World Problem in Robotics .............................................................. 11 - 17
11.4 Goal Stack Planning ..................................................................................... 11 - 19
11.5 Partial Order Planning ................................................................................. 11 - 23
11.5.1 Partial Order Planner ................................................................................. 11 - 23
11.5.2 Implementation of Partial Order Planner .................................................. 11 - 24
11.5.3 Search Problem Formulation for Partial Order Planner ............................ 11 - 26
11.5.4 A Partial Order Planning Example .............................................................. 11 - 26
11.5.5 A Solution Procedure by Partial Order Planning........................................ 11 - 27
11.5.6 Partial Order Planning with Unbound Variable ......................................... 11 - 29
11.5.7 Heuristics for Partial Order Planning ......................................................... 11 - 29
11.6 Plan Space and Searching in Planning......................................................... 11 - 30
11.6.1 What does Planning Involve ? ................................................................... 11 - 30
11.6.2 Search in Planning...................................................................................... 11 - 30
11.6.3 Components of a Planning System ............................................................ 11 - 32
11.7 Planning as Refinement Search (A Unified Framework for Planning) ........ 11 - 37
Review Questions ............................................................................................... 11 - 37
Multiple Choice Questions with Answers ........................................................... 11 - 37

(xix)
Chapter - 12 Programming in AI using Prolog (12 - 1) to (12 - 14)
12.1 Temporal Planning in AI - Time, Schedules, Resources ................................ 12 - 2
12.2 Analysis of Planning Approaches .................................................................. 12 - 4
12.3 AI - Architecture, Components, Future, Limits and Ethics ............................ 12 - 6
12.3.1 AI Architecture ........................................................................................... 12 - 6
12.3.2 AI Components ........................................................................................... 12 - 7
12.3.3 AI Future ..................................................................................................... 12 - 9
12.3.4 Limits and Risks in AI................................................................................. 12 - 10
12.3.5 AI and Ethical Concerns ............................................................................ 12 - 11
Review Questions ................................................................................................ 12 - 12
Multiple Choice Questions with Answers ........................................................... 12 - 12

Solved Model Question Papers (M - 1) to (M - 4)

(xx)

5 th
[Environment]
[Percepts]

[Sensor]

? thinks

[Actuator]

[Action]
AI
Design
Agent program Agent program
architecture
Implements
Agent function
Maps
Perception
Leads to
Action

Input An agent program Output


(Current percepts (Agent function) (Action made
from sensors) through actuators)
Optimal / right action / behaviour

Result into desired


sequence of states

Perceive sequence which


generator optimal
sequence actions
Agent coupled
with complex
environment
Environment known

Good agent

Rational behaviour

Environment unknown

Bad agent

Irrational behaviour
Sequence Expected
Rationality
of percept Depends performance
Maximizes
on

is not same as

Actual
Perfection performance
Maximizes
https://www.youtube.com/watch?
v=yHXatUO6h28

chess and card game

tick-tack-toe Ludo
part picking robo and chess
crossword puzzal vs car triving
maze vs footboll

Rising order of
Low High
complexity


Enviroment
(world with agents)

Percept

Knowledge through sensors


Belief
Interaction
Intelligent
agent
Goals
Obligation
Desires

through actuators
Action

World
without
agent

Intelligent agent

is

An entity

which perform?

1. Perception
2. Action
S
M
G
U
/
`S
N
G
U

https://www.youtube.com/watch?v=WNrymh1jzGk

Sensor
What the
world is like
now?

What action
Condition - action rule I should do
now?

Actuator

Environment
LIMITION
VERY LESS EFFFICENT
can stuck in loop




limition

Sensor
privious state State

How the world What the world


evolves? is like now?

What my action do?

What action I
Condition-action rule
should do now?
Actuators

Environment




Environment
Sensor
pervious State
How the world What the world
evolves? is like now?

What may action do?


What it will be like get result before
if I do action A? taking action

What action I
Goals
should do now?

Actuators

limition
not flixable -only move toword single goal
Environment

Sensor

What the
State world is like
now?

How the world evolves


What it will be
What may actions do like if I do
action A?

Utilitity How happy I will be


in such a state?

What action I
should do now?

Actuator
Performance
standard

Sensors
Critic

Feedback
Changes
Learning Performance
element element
Knowledge
Learning
Goals

Problem
generator
Actuators

Environment Sensors

https://www.youtube.com/watch?v=LAkscQo_Cak

Aurangabad

100

Mumbai

85
190 A. Nagar
120
Beed

Pune 90
Osmanabad
242
65
110
60 110
Satara 305
Phaltan Solapur Hyderabad

125 110 267

Vijapur Vijaywada
Kolhapur
160 190
125

Dharwad Ongala
Koppal
200 150
175 120
Guti 165
Chitradurg 155 Nellore

200 Kodappa
270
145
Banglore 250
Tirupati
150
Chennai
100 Vellore
105 160

Krushagiri 165

480

Puducherri
Madurai
c (x, a, y)

 3  10 14

3  10 14

3  10 14


Generate Act

Problem
solving Sequence of Successful
agent actions states
Problem

{ Set of goals }

Goal information

Performace measure

Problem and search


formulation

Action, states

Execution

Goal satisfied










Pune

Pune Node Satara Mumbai

Solapur A. Nagar

Node
Pune

Satara Mumbai

Solapur A. Nagar

Kolhapur
Pune

Phaltan

Leaf node
Fringe
Parent
Q node
Q
Action = Place
Q Queen 4
Q in cell ( 4, 3 )
State Depth = 4
Node
Path cost = 4

Leaf
node
8 Queen problem - some
state configuration

(b d 1 )
Level

2 3 d d+1
b + b + b + b + (b –b)
d+1
=O(b )

107

O (b d 1 )

O (b d 1 )


1 A

2 B C 3

4 5 6 7

D E F G

8 9 10 11

H I J K
O (b [C*/] ) bd

O (b C/)
O (b C/)

1 A
25
10
2 B C

5 5 9
18
3
D E F G

7 8
4
H I J K
O (b d )

O (b d  1)


O (b l )
O (b l )
1 A

2 B C 3

4 5 6 7
D E F G

8 9 10 11

H I J K
1 A

2 B C 5

3 4 6 7
D E F G

H I J K Unexpanded node

O (b d )

Limit = 0 1 A

Limit = 1 1 A

2 B C 3

Limit = 2 1 A

2 B C

3
D E F G
Start Goal

O (b d/2 )
O (b d/2 )

O (b d/2 )
O (b d/2 )
A

B B

C C C C

2d
2d
c)

4d
2 d2
O (b d )

2s


 22 (Two possibities)

RB
LB RB
LB

P P

LB RB LB RB
RB RB

LB LB

P P P P

RB
LB RB
LB

P P
8 8

64  63  ... 57  3  10 14
3  10 14

3 3

2 1 3 1 2 3

8 6 4 8 – 4

7 – 5 7 6 5

(a) Initial state (b) Goal state




You might also like