You are on page 1of 472

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 : 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

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
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
Sensor
What the
world is like
now?

What action
Condition - action rule I should do
now?

Actuator

Environment



Sensor
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
State

How the world What the world


evolves? is like now?

What may action do?


What it will be like
if I do action A?

What action I
Goals
should do now?

Actuators
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

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
COTS

(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/) cost/cost per action

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

If goal is not found increase limit by 1, everytime else


dont increase.

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


ISGPS

 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





Generator
Possible solution
Correct solution
Tester Stop

Incorrect solution
open : unused that are in fringe, closed :
used
n1

' n 1'
O (b m )

1  b * (b*) 2  ...  (b*) d


3 22  3.1  10 10

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

Shoulder "Flat" local maximum

Current
state

State
space
Objective
function

Global maximum

Shoulder Local maximum

'Flat' local maxima

Current
state
State
space
Plateau
87

P  exp 8  E/ kT



8  log 2 8
2 4 7 4 8 5 5 2 24 32752411 32748552 32748152
31%

3 2 7 5 2 4 1 1 23 24748552 24752411 24752411


29%

20
24415124 32752411 32752124 32252124
26%

3 2 5 4 3 2 1 3 11 24415124 24415411 24415417


14%
Fitness Selection pairs cross-over Mutation
17 th



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

C (1,2,6) X (6,1,2) (1,5,2) (5,4,5)

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 B=


6 D 8 E 2 F G
=–6 =–8 = 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.

The sum of M=1 SE ND


the digits S = 8 or 9 +
MO R E
must be as O=0
shown. N=E+1 MON E Y
C2 = 1
N+R>8
E9

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)

Let D = 3 Let A = 5 Let A = 6


S(1) + D(3) = E(4) O + A(5) = G O + A(6) = G

Let O = 0 Let O = 5 (Now, O can O > 8 therefore O = 9


O(0) + A = G O(5) + A = G take values O(9) + A(6) = G(5)
6,7,8,9 which
Let A = 5 Let A = 6 gives value of
G as 1,2,3,4 Carry(1) + R(4) + O(9) = N(4)
O(0) + A (5) = G = 5
respectively.
O(5) + A(6) = G(1) But these digit Hence contradiction
Contradiction values are already because R = 4 and N = 4
assigned to other
Contradiction letters. It means
that value of
O should be greater
than 9 which is
not possible.)
It is a failure.

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

A(5) + O(2) = G(7)

R(6) + O(2) = N(8)

Let C = 9
C(9) + R(6) = A(5)

carry = 0 carry = 0 carry = 0 carry = 0


C(9) R(6) O(2) S(3) S(3)
R(2) O(2) A(5) D(1) S(3)
D(1) A(5) N(8) G(7) E(4) R(6)

 
 

  

  

 


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

(Left / Down arrow line)



J

4 2


 


 

(a) (b)

(c)

DBFWC C C

DBFWC DBFWC DBW DBW W W


DB DB D
FW W
C
DB
FW DB B
C W
{O 1 , O 2 , ... , O n }

Oi {f1 , f2 , ... , fm(i) }


Os {g 1 , g 2 , ... , g m(s) }
Mp : Os  Oi

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}

start startA startD finish


{0} {0..2} {7..9} {9..11}
startC

{3..5}
dn
dn

Reasoning program
Internal
Facts representation
English
English generation

understanding

English
representation
No. black square
= 30

No. white square


= 32

Cover fields on the board Partial covering


Player

Isa

Cricket

Isa Isa

L. batsman L.H. batsman

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

Chicago team Three-Finger Pee-Wee- team Brooklyn


cubs Brown Reese dodgers
age
Adult male 35

isa

Musician

isa isa

Avant Grade /
Jazz
Jazz

instance instance

Miles Davis John Zom

bands bands

Miles Davis Group Naked City


Miles Davis Quintet Massada
Input Hidden Output
layer layer layer

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

1 Breeze PIT 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

   

1,4 2,4 3,4 4,4


A = Agent
B = Breeze
1,3 2,3 3,3 4,3
G = Glitter gold
W!
OK = Soft square
1,2 A 2,2 3,2 4,2 P = Pit
S S = Stench
OK OK
1,1 2,1 B 3,1 4,1 V = Visited
V V 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 )
 

  
      
      

( 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 )  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 19  R 34 B x,y  (Px,y  1  Px,y  1  Px 1,y  Px 1,y )

R 35 W 1,1  W 1,2  .... W 4,4

 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

Lt1, 1 < > Lt1, 11  ( Forward t  1  Bump t ))

 (Lt1, 21  (Facing Down t  1  Forward t  1 ))

 (Lt2, 11  (Facing Left t  1  Forward 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

xy 
yx 

xy 
yx 

xy yx

xy

yx
xy

yx

x
 x 
x
  x

Step Sister (Drizella , Cindrella)


Predicate Constant Constant
Term Term
Atomic sentence

 [( Length ( Leftshoeof (Cindrella) , Length(Leftshoeof (Drizella)))]


Predicate Function FunctionOF Constant
Term
Atomic sentence
Sibling (Cindrella , Drizella)  Sibling(Drizella, Cindrella)
Predicate Term Term Atomic sentence
Atomic sentence
Complex sentence

x (StudiesIn (x, India)  Smart (x))


Variable Sentences

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

P1 , P2 , ..... Pn , (P1  P2 .... Pn  q)


SUBST( , q)
pi

   

 
 


S1 S2 S1  S2
S1 S2 S1  S2
S1 S2 S1  S2
S1 S2 S1  S2
   

  

 

Pi Pi
 Pi  Pi

P1 , P2 , ..... Pn , (P1  P2 .... Pn  q)


SUBST( , q)

pi

P1 P1
P2 P2


Engine Starts   Flat Tire  Car OK


P Q

 Car OK
Q

 (Engine Starts   Flat Tire)  


P

 

 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 { }

2. Unify (Parents, Parents) 3. Unify ((X(Father X)(Mother Bill)),


(Bill(Father Bill)Y))

1. Unify ((Parents X (Father X)(Mother Bill)), (Parents Bill (Father Bill)Y))

)Unify First Elements


and Apply
Substitutions to Rest
)
Return { }

2. Unify (Parents, Parents) 3. Unify (X(Father X)(Mother Bill)),


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

)Unify First Elements


and Apply
Substitutions to Rest
) Return {(Mother Bill) / Y,
Bill/X}

return { }

2. Unify (Parents, Parents) 3. Unify (X(Father X)(Mother Bill)),


(Bill(Father Bill)Y))

) Unify First Elements


and Apply
Substitutions to Rest
) Return {Mother Bill/ Y}

Return {bill/X}
4. Unify (X, Bill) 5. Unify (((Father Bill)(Mother Bill)),
((Father Bill)Y))

) Unify First Elements


and Apply
Substitutions toRest
) Return {Mother Bill/ Y}

Return { }
6. Unify ((father bill),(father bill)) 11. Unify (((Mother Bill)),(Y))

) Unify first elements


and apply
substitutions to rest
) return { }
) Unify First Elements
and Apply
Substitutions to Rest
) Return { }

return { } Return {(Mother


Bill /Y)}
7. Unify (Father, Father) 8. Unify ((Bill),(Bill)) 12. Unify ((Mother Bill),Y)
13. Unify ((),())

Return { } ) Unify First Elements


and Apply
Substitutions to Rest
) Return { }

9. Unify (Bill, Bill) 10. Unify ((),())


TEACHES (x, y)

TEACHES (x, Dipu) TEACHES (Radhakrishnan, y)

TEACHES (Radhakrishnan,Dipu)

TEACHES (x, y)

TEACHES (x, Dipu) TEACHES (x, x) TEACHES (Radhakrishnan, y)

TEACHES (Dipu, Dipu)

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

2.1 2.2 2.3


Step 2 American (West) Weapon (y) Sells (West, M1, z) 2.4 Hostile (Nono)
{} [z | Nono]
2.6
2.5 8
9 10 13
Missile(y) Missile(M1) Owns (Nono, M1) Enemy (Nono, American)

7 [y|M1] 11 { } 12 { } 14 { }
l 1, 1 l 1, K   l n, 1 l n, K

   

    

    
  
   

1. (x)(P(x))  ((y)(P(y)  P(F(x,y))) (y)(Q(x,y)  P(y)))(like A  B  C)

2. Eliminate 

(x)(P(x)  ((x)(P(y)  P(F(x,y))) (y)(Q(x,y)P(y)))

        
        

(x)(P(x) ((y)(P(y) (P(y)P(F(x,y))) (z)(Q(x,z)P(z))))

5. Eliminate existential quantification.

(Skolemization) [The detail procedure is explained next]


(x)(P(x)  ((y)(P(y)  P(F(x,y))) (Q(x, g(x) )  P(g(x) )))

     

        
        

  
 
 

  
 
 
   

  

  

  

  
 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)

 American (West)   Weapon (y)


  Sells (West,y,z)   Hostile (y)

 Missile (x)  Weapon (x)

 Weapon(y)   Sells (West,y,z)


  Hostile (z)

Missile (M1)

 Missile (y)   Sells(West,y,z)


  Hostile (z)

 Missile (x)   Owns (Nono,x)


 Sells (West, x, Nono)
 Sells (West, M1, z)
 Hostile (z)

Missile (M1)
 Missile (M1)   Owns (Nono, M1)
 Hostile (Nono)

Owns (Nono, M1)

 Owns (Nono, M1)   Hostile (Nono)

 Enemy(x, America)
 Hostile (x)
 Hostile (Nono)

Enemy (Nono, America)

 Enemy (Nono, America)

    
     

 

 

 


 
   
 

Cat (Tuna)  Cat(x)  Animal(x) Kills (Jack, Tuna)  Kills(Curiosity, Tuna)

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

 Loves(y,x)   Kills(x, Tuna)  Animal(F(Jack))  Animal (F(x)) 


Loves (G(Jack), Jack) Loves (G(x), x)

 Loves(y, Jack) Loves(G(Jack), Jack)


 

 

  

 

   
    
 
  

   
    
 
  
 
  
    
 
 

  
 

 

   x1
 
 

 x4 


 Pass (x1, History)   Win(x1, Lottery)  Happy(x)

 Lucky(x4)  Win(x4, Lottery)


 {x1 = x4}

 Pass (x, History)  Happy(x)   Lucky(x4) Lucky (Nimu)

 = {x4 = Nimu}
 Pass (x, History)  Happy(x)

 Lucky(x3) V Pass(x3, y2)

 {x = x3, y2 = History}
Happy(x)   Lucky(x3)

Lucky (Nimu)

 {x3 = Nimu}
Happy(x)  Happy (Nimu)

 = {x = Nimu}

False

 PhD(x)  HQ(x)  HQ(x)  Rich(x)

{}

 PHD(x)  Rich(x) PhD(x)  ES(x)

{}

Rich(x)  ES(x)  ES(x)  Rich(x)

{}

Want to prove Rich(x)  Rich(Me)

{x|Me}
 

 
 

 
  

 eats(Mani, Fish)  Cat(y)   likes(y,z)  eats (y,z)

 = {y|Mani, z|fish}

 Cat(Mani)   likes(Mani, fish) Cat (Mani)

=

 Cat(x)  likes(X, Fish)  Likes(Mani, fish)

 = {x|Mani}

 Cat (Mani) Cat (Mani)

Contradiction

Negation of goal :  eats (Mani, fish)


    

     

 

 

 


 
   
 

 
 
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)

 Loves(y,x)   Kills(x, Tuna)  Animal(F(Jack))  Animal (F(x)) 


Loves (G(Jack), Jack) Loves (G(x), x)

 Loves(y, Jack) Loves(G(Jack), Jack)


Any set of sentences S is representable
in clausal form

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]

Some set S' of ground instances is


unsatisfiable
Ground resolution theorem
[A completeness theorem
for resolution in propositional
logic]

Resolution can find a contradiction in S'

Lifting lemma

There is a resolution proof for the


contradiction in S'
 
 

 

  




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)

ruler(Caesar) tryassassinate(Marcus, Caesar) 4

tryassassinate(Marcus, Caesar) 8
x2
 

  x1

7 th
  
X4 y1

 
4 th



 
  

 

X  Y , A [T]
Unify (x, s)  
SUBST ( , A [y])...)

isPriminister (Manmohan_ Singh)


isPriminister (M_ Singh)


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}

Owns(x,D) Animallover(x) Own(Jack, D)

{x/Jack} Step1.b

Animallover(Jack) 7

Cat(Tuna) Cat(x) Animal(x)


(Step 5 and Step 6)
{x/Tuna}
V
Animallover
V (x) Animal(y)
Animal(Tuna)
Kills (x,y) False

{y/Tuna} Step 3

V
Animallover(Jack) Animallover(x) Kills(x,Tuna) False

{x/Jack}
Step 7

Kills(Jack, Tuna) False Kills(Jack, Tuna) V Kills


(Curosity,Tuna)

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

~Dog(y) V ~ Owns (x,y) ~Animallover(Jack) V ~ Animal(Tuna)


V Animallover (x)
{x/Jack, y/Tuna}
Step 2
~Dog(Tuna) V ~ Owns
(Jack, Tuna) V ~ Animal (Tuna) Dog(D)

{D/Tuna}
Step 1.a

Own(Jack, D) ~Owns(Jack,Tuna)
V ~ Animal(Tuna)
{D/Tuna}
Step 1-b

~ Animal (Tuna) ~Cat(x) V Animal(x)

{x/Tuna} Step 6

~ Cat (Tuna) Cat (Tuna)

Step 5
{ }

      
 
    
      
 








4th
4th
3rd
3rd
4th 3rd

 
Anything

Abstract objects Generalized events

Set Numbers Reprentational Interval Places Physical Processes


objects objects

Sentences Measurements Moments Things Stuff

Categories Times Weights Animals Agents Solid Liquid Gas

Humans
BB7

 

    


     

 
  

   

L1
q1   q2   q1 
q2  q1 q2
q1   q2   q1 q2 
q1 q2

   
S0

D0
PIT
PIT

PIT
PIT PIT

PIT Result (Turn Right),


Result (Forward, S0)
Gold PIT PIT
Turn (Right)

Result (Forward, S0)


PIT
Forward
S0

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

V (Fi (s)  a  A 3  a  A 4 ...)


Actions making fi False



 
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

bird (x) : files (x)


flies (x)
 (x) : E  (x)
 (x)

 (x)
E  (x)
(x)
x1 xm  (x)
(x) (x)

Indian (x)  adult (x) : y bike(y)  owns (x, y)


y bike (y)  owns (x, y)

  
 
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

Start State Goal state



  
 









 

 

Z Y

X Y Z
 



 


  

   


  

 

 

 


A

B
C
A B C
A

B
A

B
A

B
1
UNSTACK (A,B)

2 PUTDOWN (A)

3 Global database at this point


A B ONTABLE(B)^CLEAR(A)^CLEAR(B)^ONTABLE(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

Left sock on Right sock on


Left Right
shoe shoe

Left shoe on , Right shoe on


Finish

 

P
 
P
  

Start Start Start Start Start Start

Right Right Left Left Right Left


sock sock sock sock sock sock

Left Left Right Right Right Left


sock sock sock sock shoe shoe

Right Left Right Left Left Right


shoe shoe shoe shoe sock sock

Left Right Left Right Left Right


shoe shoe shoe shoe shoe shoe

Finish Finish Finish Finish Finish Finish



Right SockOn
    
Left SockOn


Right ShoeOn
    
Left ShoeOn



P
  

 

P
 
 

 
 



 

 
 
 

At (Spare,Trunk) Remove(Spare,Trunk)

Start Put on(Spare, Axle) Finish

At(Spare, Trunk) At(Spare, Ground) At(Spare, Axle)


At(Flat, Axle)  At(Flat, Axle)


At (Spare, Trunk) Remove (Spare, Trunk)

Start Put on(Spare, Axle) Finish


At (Spare, Trunk) At (Spare, Ground) At (Spare, Axle)
At (Flat, Axle)  At (Flat, Axle)

Leave overnight  At (Flat, Axle)


 At (Flat, Ground)
 At (Spare, Axle)
 At (Spare, Ground)
 At (Spare, Trunk)


At (Spare, Trunk) Remove (Spare, Trunk)

Start Put on(Spare, Axle) Finish


At (Spare, Trunk) At (Spare, Ground) At (Spare, Axle)
At (Flat, Axle)  At (Flat, Axle)

At (Flat, Axle) Remove (Flat, Axle)


S0
A, B, S 0 
B, S 0 
A, S 0

 

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}

 Cat(Mani)   likes(Mani, fish) Cat (Mani)

=

 Cat(x)  likes(X, Fish)  Likes(Mani, fish)

 = {x|Mani}

 Cat (Mani) Cat (Mani)

Contradiction

Negation of goal :  eats (Mani, fish)


9 789355 850140
Made in India

You might also like