Artificial Intelligence: Technical
Artificial Intelligence: Technical
Artificial Intelligence: Technical
Artificial Intelligence
Anamitra Deshmukh-Nimbalkar
CTO & Chief Software Trainer, Mentor
(PGDBM, PGDPC, NET, SET, MCS)
® ®
TECHNICAL
PUBLICATIONS
SINCE 1993 An Up-Thrust for Knowledge
(i)
Artificial Intelligence
Subject Code : 310253
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 : sales@technicalpublications.org 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
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 :
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 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
(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
(vii)
1.10.2 Different Forms of Agents : (Types of Agents) ........................................... 1 - 31
1.10.2.1 Agent Type 1 ............................................................................................. 1 - 31
(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
(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
(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
(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
(xii)
4.16 Stochastic Games .......................................................................................... 4 - 34
Solved Example ..................................................................................................... 4 - 40
Review Questions .................................................................................................. 4 - 43
Multiple Choice Questions with Answers ............................................................. 4 - 44
(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
(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
(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.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
(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
(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
(xx)
5 th
[Environment]
[Percepts]
[Sensor]
? thinks
[Actuator]
[Action]
AI
Design
Agent program Agent program
architecture
Implements
Agent function
Maps
Perception
Leads to
Action
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
Rising order of
Low High
complexity
Enviroment
(world with agents)
Percept
through actuators
Action
World
without
agent
Intelligent agent
is
An entity
which perform?
1. Perception
2. Action
Sensor
What the
world is like
now?
What action
Condition - action rule I should do
now?
Actuator
Environment
Sensor
State
What action I
Condition-action rule
should do now?
Actuators
Environment
Environment
Sensor
State
What action I
Goals
should do now?
Actuators
Environment
Sensor
What the
State world is like
now?
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
Aurangabad
100
Mumbai
85
190 A. Nagar
120
Beed
Pune 90
Osmanabad
242
65
110
60 110
Satara 305
Phaltan Solapur Hyderabad
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
Action, states
Execution
Goal satisfied
Pune
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
Generator
Possible solution
Correct solution
Tester Stop
Incorrect solution
n1
' n 1'
O (b m )
h1
h 1 8 h 1
h2
h 1 and h 2
h 2 (n) h 1 (n) h2 h1
h2
h1
Objective
function
Global maximum
Current
state
State
space
Objective
function
Global maximum
Current
state
State
space
Plateau
87
P exp 8 E/ kT
8 log 2 8
2 4 7 4 8 5 5 2 24 32752411 32748552 32748152
31%
20
24415124 32752411 32752124 32252124
26%
(x 1 , y 1 ), (x 2 , y 2 ) (x 3 , y 3 )
f (x 1 , y 1 , x 2 , y 2 , x 3 , y 3 )
h (G2) h (G) 0
Goal : Acquire TV set
AND arc
Goal : Steal Goal : Earn Goal : Buy
TV set some money TV set
f
f
35 100
Mathematics
Mathematical
game
theory
AI :
Game theory
Game playing
Economics
Computer
science
MAX move
X X X
X X X
X X X
MIN move
X 0 X 0 X
0 ---
MAX move
X 0 X X 0 X 0
X X ---
MIN move
X 0 X X 0 X X 0 X
0 X 0 0 X X --- Terminal
0 X X 0 X 0 0
–1 0 +1 Utility
(b m )
0 0 X
X 0
X
0 0 X
X 0
X
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
0 0 X
X 0
MAX's move X
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
MIN move
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X 0 X 0 X X 0
0 X 0 X X X 0 X X X X X 0 X
0 0 X
X 0
MAX move X
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
MIN move
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X 0 X 0 0 X 0
0 X 0 X X X 0 X X X X X 0 X
MAX move
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X X 0 X 0 0 X X 0
0 X X X 0 X X X X 0 X X X X X X 0 X
0 0 X
X 0
MAX move X
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
MIN move
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X 0 X 0 0 X 0
0 X 0 X X X 0 X X X X X 0 X
MAX move 0 1 1 0 1 1
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X X 0 X 0 0 X X X
0 X X X 0 X X X X 0 X X X X X X 0 X
0 0 X
X 0
MAX move X
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
MIN move
0 1 1 0 1 1
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X 0 X 0 0 X 0
0 X 0 X X X 0 X X X X X 0 X
MAX move
(Back-up
0 1 1 0 1 1
max)
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X X 0 X 0 0 X X 0
0 X X X 0 X X X X 0 X X X X X X 0 X
0 0 X
X 0
MAX move X
(choose max) 1
0
0
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
MIN moves
(back-up
min) 0 1 1 0 1 1
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X 0 X 0 0 X 0
0 X 0 X X X 0 X X X X X 0 X
MAX move
(Back-up
0 1 1 0 1 1
max)
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X X 0 X 0 0 X X 0
0 X X X 0 X X X X 0 X X X X X X 0 X
0 0 X
Best move
X 0
MAX move X
(choose max) 1
0
0
0 0 X 0 0 X 0 0 X
X X 0 X 0 X 0
X X X X X
MIN move
(back-up
min) 0 1 1 0 1 1
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X 0 X 0 0 X 0
0 X 0 X X X 0 X X X X X 0 X
MAX move
(Back-up
0 1 1 0 1 1
max)
0 0 X 0 0 X 0 0 X 0 0 X 0 0 X 0 0 X
X X 0 X X 0 X 0 0 X X 0 X 0 0 X X 0
0 X X X 0 X X X X 0 X X X X X X 0 X
a 1, a 2 a3
a1 b1, b2 , b 3
MAX move
3 A
a1 a3
a2
3 B 2 C 2 D
b1 c1 c3 d1 d3 MIN
b3 move
b2 c2 d2
3 12 8 2 4 6 14 5 2
MAX A –3
a1 a3
a2
MIN B –3 C –4 D – 73
b1 b2 d1
c1 c2 c3 c4 d2 d3
MAX E F G H J K L M N
21 –3 12 70 –4 100 – 73 – 14 –8
e1 e 2 e 3 f1 g1 h1 h2 j1 j2 j3 j4 l1 l2 m1 n1 n2
MIN O P Q R S T U V W X Y Z A1 A2 A3 A4
23 28 21 –3 12 4 70 – 4 – 12 – 70 – 5 – 100 – 73 – 14 – 8 – 24
(V A , V B , V C )
A (1,2,6)
B (1,2,6) (1,5,2)
A
(1,2,6) (4,2,3) (6,1,2) (7,4,1) (5,1,1) (1,5,2) (7,7,1) (5,4,5)
( VA VB VC VA VB VC
VA VB VC
MAX move 3
MIN move 3
MAX move
3 12 8
MAX move 3
MIN move
3 2
MAX move X X
3 12 8 2
MAX move 3
MIN move
3 2 2
MAX move
X X
3 12 8 2 14 5 2
Choose max
15
No point in
Back-up min exploring
10 this branch
Choose max
Back-up min
20 No point in
exploring
Back-up max this branch
25
=
6 A =–6
= +6 = +2
6 B = – 2 C = 6
6 5 8 2 1
= Maximizer = Minimizer
(79) A
Maximizer's move
9 B C
Minimizer's move
D E F G
9 12 –5
Level 0 A
Maximizer's move
Level 1 8 B 5 C
Minimizer's move
Level 2 8 D 10 E 5 F G 11
Maximizer's move
Level 3 H I J K L M N O
6 8 10 9 3 5 11 7
B 8
Minimizer's move
8 D E 10
Maximizer's move
H I J K
6 8 10 9
MAX
MIN
..
..
..
MAX
MIN v
A
MAX move
6 B 1 C 2 D
6 E 8 F MIN move
G H I J
5 6 7 8
A 5
MAX move
B C D
5 1 2
(a)
A
MAX move
–2 B 1 C 2 D
MIN move
0 –2
E F
(b)
logN
Xi c
ni
ln
Repeat while time remains
Selection Expansion Simulation Backup
Tree Rollout
policy policy
MAX move
Probability
of a roll
[ Chance
level 1/6 1/6 1/6
nodes
for
( max ) ]
1 2 3 4 5 6
Value of
a roll
MIN move
[ Chance
level
nodes
for
( min ) ]
di di
di di
n
d i max s S (N, di )
i 1
n
d i min s S (N, di )
i 1
(b d n d )
x X
A1 An
a1 an
a1 an
ui S1 S2
A1 An
s'
n)
( , ... )
:
A
B C D
E F G H I J K
L M N O P Q R S T U V W X Y
(7) (6) (8) (5) (2) (3) (0) (– 2) (6) (2) (5) (8) (9) (2)
MIN
MAX
4 3 1 5 2 8 2
X 1 , X 2 , .... , X n
C 1 , C 2 , ... , C m
X1 D1
C1
Xi V i , X j V j , ...
B
A D
C E
North
(N)
North
West North
(NW) East
Middle (NE)
(M)
Middle Middle
West East
(MW) (ME)
South
(S)
South
East
(SE)
Q 1 , ... , Q 8
(d n )
V1, V2
V1 V2
Initial state :
No two letters
have the same
value.
E=2
N=3
R = 8 or 9
2 + D = Y or 2 + D = 10 + Y
C1=0 C1=1
2+D=Y 2 + D = 10 + Y
N + R = 10 + E D=8+Y
R=9 D = 8 or 9
S=8
D=8 D=9
Y=0 Y=1
Let S = 2
S(2) + S(2) = R(4)
Let D = 1
Let S = 1
S(1) + S(1) = R(2) S(2) + D(1) = E(3)
Now let S = 3
S(3) + S(3) = R(6)
Let D = 1
S(3) + D(1) = E(4)
Let O = 2
A + O(2) = G
Let A = 5
Let C = 9
C(9) + R(6) = A(5)
F1
L1
F2
L2
L3
F3
L4
F4
L5
L6
F5
T1
T2
A1
T3 A2
T4 A3
L (L-junction vertex)
T (T-junction vertex)
T F (Fork vertex)
A (Arrow vertex)
F (Convex Line)
(Concave line)
L
(Right / Up arrow line)
A
J
4 2
(a) (b)
(c)
DBFWC C C
Mp
Mp Mq
V2 V1 V1 V2
[V 1 V 2 ]
V1 V2
V1 V2
[V 1 V2
K th
(n 2 d 3 )
startB
{3..7}
{3..5}
dn
dn
Reasoning program
Internal
Facts representation
English
English generation
understanding
English
representation
No. black square
= 30
Isa
Cricket
Isa Isa
instance instance
bablee moni
Equal Equal
handed handed
BPL Indore
Handed
Person Right
isa
Adult Height
178
male
isa
Height 195
Equal to bats Baseball
handed player
isa isa batting 252
average
batting average batting average
106 Pitcher Fielder 262
instance instance
isa
Musician
isa isa
Avant Grade /
Jazz
Jazz
instance instance
bands bands
Input #1
Input #2
Output
Input #3
Input #4
a-
Market ma pla
de yer
-u -in
p-
o f
carries
Item Retailer
offered-in
is-
a-
for
supplies
m-
of
Creates
Various Brand
other
Manufacturer
attributes
fa
lls
-in
-a
is-a
Size
is-a
Category
is-a Color
Segment
is-a
has
Category
attribute
B 1, 1 P1, 2 B 1, 1 P1, 2
, , , ,
,
|
2n
2n
P Q P Q
4 Breeze PIT
Stench
Breeze
3 Stench PIT Breeze
Gold
2 Stench Breeze
START
1 2 3 4
1,4 2,4 3,4 4,4
A = Agent
B = Breeze
1,3 2,3 3,3 4,3
G = Glitter gold
OK = Soft square
1,2 2,2 3,2 4,2 P = Pit
S = Stench
OK
1,1 2,1 3,1 4,1 V = Visited
A W = Wumpus
OK OK
1,4 2,4 3,4 4,4
A = Agent
B = Breeze
1,3 2,3 3,3 4,3
G = Glitter gold
OK = Soft square
1,2 2,2 3,2 4,2 P = Pit
P?
S = Stench
OK
1,1 2,1 A 3,1 4,1 V = Visited
V B P? W = Wumpus
OK OK
[P Q, Q | P]
l 1 ... l k, m
l 1 ... l i 1 l i 1 ... l k
l li m
l 1 ... l k , m 1 ... m n
l 1 ... l i 1 l i 1 .. . l k m1 ... m j 1 m j 1 ... m n
li mj
l1 l2 , l2 l 3
l1 l 3
( ) ( )
B 1, 1 (P1, 2 P2, 1 )
(B 1, 1 (P1, 2 P2, 1 )) ((P1, 2 P2, 1 ) B 1, 1 )
( B 1, 1 P1, 2 P2, 1 ) ( (P1, 2 ) P2, 1 B 1, 1 )
|
L 1,1 L 1,1 B 1,1 B 1,1
Q
1
A
2
C
B
2
2
2
D
E
( D B C) (B A C)
( C B E) (E D B) (B E C)
Number of clauses
Number of symbols
250 10 15
R 1 P1,1
R2 W 1,1
R 3 R 18 B x,y (Px,y 1 Px,y 1 Px 1,y Px 1,y )
R 36 W 1,1 W 1,2
R 37 W 1,1 W 1,3
R 155
2 64
L 1,1 L 2,1
L 1,1 L 2,1
L 1,1(t) L 2,1(t 1)
(t) (t 1)
Alive t Scream t Alive t 1
Lt 1 ( Forward t 1 Bump t ))
(Lt1,1
1,1
1
(Lt1.2 (Facing Down t 1 Forward t 1 )) (Lt2,1
1 (Facing Left t 1 Forward t 1 ))
Breeze Forward
Stench TurnLeft
Glitter TurnRight
Bump Grab
Alive
Scream Shoot
L xy
t 1
Breeze Forward
Stench TurnLeft
Glitter L1,1 TurnRight
Bump Grab
L2,1
Scream FacingLeft Shoot
L1,2
FacingDown
B 4, 4
K (B 4, 4 ), K ( B 4, 4 )
t1 t2 t 3 tn
Crown
Onhead
Stepsister
Person Person
Princess
Stepsister
C D
RightLegShoe RightLegShoe
S1 S2 S1 S2
S1 S2 S1 S2
S1 S2 S1 S2
S1 S2 S1 S2
Dm
Dn
V
V
V
V
V
x P x P
P Q (P Q)
x P x P
(P Q) P Q
x P x P
P Q ( P Q)
x P x P
P Q ( P Q)
x y y x
x y y x
xy
yx
xy
yx
xy yx
xy
yx
xy
yx
x
x
x
x
x
y
x y
x
y
x y
x
x
Robotic arm
c b
Blocks Blocks
a d
Table
S((S(S(O)))
1
2
3
S1 S2 S1 S2
1 C1
X1
2 X2 1
3
A2
O1 2
A1
X1
X1
X1
t1 , t2 t1 t2 t1 t2
t1 t2 t1 t2 t2 t1
In
In
In
X1 X2
A1 A2
O1
X1 X2
C1 X1
X1 A2
C1 A1
2 O1
C1 X1
A1 O1
C1 A1
X2 C1
C1 X2
O1 C1
C1 A2
i1 i2 i 3 o 1 o 2
i1 C1 i2 C1
i3 c1 o1 C1 o2
r
Pi Pi
Pi Pi
S1 S2 S1 S2
S1 S2 S1 S2
S1 S2 S1 S2
S1 S2 S1 S2
Pi Pi
Pi Pi
pi
P1 P1
P2 P2
Car OK
Q
v S
SUBST ({ v / g }, S)
V, S
SUBST({V / k}, S)
E1 E2
1. Unify ((Parent X (Father X)(Mother Bill)), (Parents Bill (Father Bill)Y))
)
Unify First Elements
and Apply
Substitutions to Rest
)
Return {Bill/X}
4. Unify (X, Bill) 5. Unify (((Father Bill)(Mother Bill)),
((Father Bill)Y))
1. Unify (Parents X (Father X)(Mother Bill)), (Parents Bill (Father Bill)Y))
return { }
Return {bill/X}
4. Unify (X, Bill) 5. Unify (((Father Bill)(Mother Bill)),
((Father Bill)Y))
Return { }
6. Unify ((father bill),(father bill)) 11. Unify (((Mother Bill)),(Y))
TEACHES (Radhakrishnan,Dipu)
TEACHES (x, y)
2n
Pn
i Pn Pi Pn
Pi Pn
q
q
q
q
M1
M1
M1
Facts inferred
on the second Criminal (West)
iteration
Facts inferred
on the first Weapon (M1) Sells (West,M1,Nono) Hostile (Nono)
iteration
Initial fact American (West) Missile (M1) Owns (Nono, M1) Enemy (Nono, America)
NT
WA Q
SA NSW
T
Pi Pi
k 1
Pi
M1
1 2
1 2 2 1
q
P1 Pn
q P1 Pn
Step 1 Criminal (West) x | West, y|M1, z|Nono
7 [y|M1] 11 { } 12 { } 14 { }
l 1, 1 l 1, K l n, 1 l n, K
2. Eliminate
G1
d d
(K y ) Ky (e y ) ey
dy dy
l 1 , V... V l k , m 1 V.... V m n
SUBST ( , l 1 , V... . V l i 1 V, l i 1 V... V l k V m , V... V mj 1 V mj 1 V... V mn )
li mj
|
American (x) Weapon (y) Sells(x,y,z)
Hostile(z) Criminal(x)
Criminal (West)
American (West)
Missile (M1)
Missile (M1)
Missile (M1) Owns (Nono, M1)
Hostile (Nono)
Enemy(x, America)
Hostile (x)
Hostile (Nono)
Kills(Curiosity, Tuna)
Animal (Tuna) Loves(y,x) Animal (z) Kills(x,z) Kills(Jack, Tuna) Loves(x,f(x)) Loves(G(x),x)
Animal (x) V
Loves (Jack, x)
x1
x4
Pass (x1, History) Win(x1, Lottery) Happy(x)
= {x4 = Nimu}
Pass (x, History) Happy(x)
{x = x3, y2 = History}
Happy(x) Lucky(x3)
Lucky (Nimu)
{x3 = Nimu}
Happy(x) Happy (Nimu)
= {x = Nimu}
False
{}
{}
{}
{x|Me}
= {y|Mani, z|fish}
=
= {x|Mani}
Contradiction
Cat (Tuna) Cat(x) Animal(x) Kills (Jack, Tuna) Kills(John, Tuna)
Kills(John, Tuna)
Animal (Tuna) Loves(y,x) Animal (z) Kills(x,z) Kills(Jack, Tuna) Loves(x,f(x)) Loves(G(x),x)
Animal (x) V
Loves (Jack, x)
Assume S is unsatisfiable,
and in clausal form
Herbrand’s theorem
[If a set S of clauses is
unsatisfiable, then there
exists a finite subset of
Hs (S) that is also
unsatisfiable]
Lifting lemma
Ci C i 1
C0 S Cn C0
B0 C1 C1 B1 C2
Cn
C0 B0
C0 C1
B1 C1 B1 C2
A1 AK
Ai
x1 x1
x2 x2 x2
x3 x3
x4 y1 x4 y 1 x4 y 1
hate(Marcus, Caesar) 5
Marcus/x2
3 Roman(Marcus) loyalto(Marcus, Caesar)
Marcus/x1
Pompein(Marcus) loyalto(Marcus, Caesar) 2
7 loyalto(Marcus, Caesar)
Marcus/x4 ,Caesar/y1
7 man(Marcus) ruler(Caesar) tryassassinate(Marcus, Caesar)
tryassassinate(Marcus, Caesar) 8
x2
x1
7 th
X4 y1
4 th
X Y , A [T]
Unify (x, s)
SUBST ( , A [y])...)
P(o) x (P(x) P(x 1))
x P (x)
t 1 t 2 t1 t2 t1 t2
t 1 t 2 t1 t2 t1 t2
Side1 Side 2
Side 1 Side 2
y2
x2
y1
x1
y1 y2
x1 x2
c1 c2 c1 c2
c1 c2
c1 c2 c2 c1
s1 s2
z
s1 s2
s1 s2
s1
s2
x1 x1
Roman(Marcus) (ii)
Marcus/x1
(i) Pompein(Marcus)
Easygame(x)
Likes (Mani,Game(x))
V Likes (Mani,Game(x))
(Negation
and Step 1)
Indoorgame (x)
Easygame (x) V Easygame (x)
Step 3
Indoorgame
Indoorgame (x) (Tabletennis)
Step 4
x = Table Tennis
Dog(D) Dog(y) Owns(x,y) Animallover(x)
(Step1a and
Step 2)
{y/D}
{x/Jack} Step1.b
Animallover(Jack) 7
{y/Tuna} Step 3
V
Animallover(Jack) Animallover(x) Kills(x,Tuna) False
{x/Jack}
Step 7
Kills(Curiosity, Tuna)
(Step 4 and False
Negation)
Kills(Jack, Tuna)
False
Kills(Curiosity, Tuna)
Kills(Curiosity, Tuna) V Kills(Jack, Tuna)
(Negation and
Step 4)
~Animallover(x) V ~ Animal(y)
Kills(Jack, Tuna)
V ~Kills(x,y)
{x/Jack,
y/Tuna} Step 3
{D/Tuna}
Step 1.a
Own(Jack, D) ~Owns(Jack,Tuna)
V ~ Animal(Tuna)
{D/Tuna}
Step 1-b
{x/Tuna} Step 6
Step 5
{ }
4th
4th
3rd
3rd
4th 3rd
Anything
Humans
BB7
L1
q1 q2 q1
q2 q1 q2
q1 q2 q1 q2
q1 q2
S0
D0
PIT
PIT
PIT
PIT PIT
S0
S0
S0
S0 G1 S0
S0
S0 G1
x1 xm y1 yn
x1 xm y1 y m x1 y1 xm ym
G1
(a A 1 V a A 2 ... )
Actions making Fi true
A1
A 2 , Fi
A 3 , Fi
A 4 , Fi
S0
G1
G1
G1 G1 So
G1 So
t2
t2
t2 t2 t2
t2 t1 t1 t1
(t 1 t 2 )
i
Meet (i, j) j
Before (i, j) i
j
After (j, i)
During (i, j) i
j
i
Overlap (i, j)
j
Overlap (j, i)
e1 e2
e1 e2
e1 e2
Has a part
Bird Wings
is_a
Has colour
Parrot Green
is_a s Rukumni
ve
Lo
Owns
Mithu Krishna
Sis
ter
of Subhadra
x x WildAnimals
Legs
WildAnimals 4
Subset of
Tiger
A: B
C
(x)
E (x)
(x)
x1 xm (x)
(x) (x)
10 40
At (P1, B)
Fly(P1, A, B) At (P2, B)
At (P1, A)
At (P2, A)
Fly(P2, A, B) At (P1, B)
At (P2, B)
At (P1, A)
At (P2, B) Fly(P1, A, B)
At (P1, B)
At (P2, B)
At (P1, B) Fly(P2, A, B)
At (P2, A)
X
Y X Y
Z Y
X Y Z
A
B
C
A B C
A
B
A
B
A
B
1
UNSTACK (A,B)
2 PUTDOWN (A)
B C D
Start :
ON(B,A)^ONTABLE(A)^
ONTABLE(C)^ONTABLE(D)
^ARMEMPTY
C B
A D
Goal : ON(C,A)^ON(B,D)^
ONTABLE(A)^ONTABLE(D)
Partial order plan
Start
Left Right
sock sock
P
P
Right SockOn
Left SockOn
Right ShoeOn
Left ShoeOn
P
P
At (Spare,Trunk) Remove(Spare,Trunk)
At (Spare, Trunk) Remove (Spare, Trunk)
S0 S1
A, S 1 B, S 1
i
i
T.E. (Computer) Semester - VI (As Per 2019 Pattern)
A AO
T.E. (Computer) Semester - VI (As Per 2019 Pattern)
1
2
2
A
eats(Mani, Fish) Cat(y) likes(y,z) eats (y,z)
= {y|Mani, z|fish}
=
= {x|Mani}
Contradiction