Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

AI&MLm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 81

Please read this disclaimer before proceeding:

This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and delete
this document from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.
22IT401
ARTIFICIAL
INTELLIGENCE AND
MACHINE LEARNING

Department: Information Technology


Batch/Year: 2022-2026 / II
Created by: Dr.T.Mahalingam
: Dr.S.Selvakanmani
Date : 12-01-2024
Table of Contents
S.NO. CONTENTS SLIDE NO.

1 CONTENTS 5

2 COURSE OBJECTIVES 6

3 PRE REQUISITES (COURSE NAMES WITH CODE) 7

4 SYLLABUS (WITH SUBJECT CODE, NAME, LTPC DETAILS) 8

5 COURSE OUTCOMES (6) 12

6 CO- PO/PSO MAPPING 13

7 LECTURE PLAN –UNIT 1 15

8 ACTIVITY BASED LEARNING –UNIT 1 16


9 CROSSWORD PUZZLE 17
10 VIDEO LINK-QUIZ 18
11 TEST YOURSELF 19

12 LECTURE NOTES – UNIT 1 20

13 ASSIGNMENT 1- UNIT 1 68

14 PART A Q & A (WITH K LEVEL AND CO) 70

15 PART B Q s (WITH K LEVEL AND CO) 76

16 SUPPORTIVE ONLINE CERTIFICATION COURSES 77

REAL TIME APPLICATIONS IN DAY TO DAY LIFE AND TO


17 79
INDUSTRY

18 CONTENTS BEYOND THE SYLLABUS 80

19 ASSESSMENT SCHEDULE 82
83
20 PRESCRIBED TEXT BOOKS & REFERENCE BOOKS

21 MINI PROJECT SUGGESTIONS 84


2. COURSE OBJECTIVES

Understand the concept of agents, problem solving and


searching strategies.

Familiarize with Knowledge reasoning and representation


based AI systems and approaches.

Apply the aspect of Probabilistic approach to AI.

Understanding of concepts of machine learning approaches.

Recognize the concepts of Machine Learning and its


deterministic tools
3. PRE REQUISITES

PRE-REQUISITE CHART
22IT401- ARTIFICIAL INTELLIGENCE
AND MACHINE LEARNING

22MA401- Probability
and Statistics

22CS303- Design and


Analysis of Algorithms
4. 22IT401 ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING LTPC
OBJECTIVES 3 00 3
• Understand the concept of Artificial Intelligence

• Familiarize with Knowledge based AI systems and approaches

• Apply the aspect of Probabilistic approach to AI

• Identify the Neural Networks and NLP in designing AI models

• Recognize the concepts of Machine Learning and its deterministic tools

UNIT 1 PROBLEM SOLVING AND SEARCH STARTEGIES

Introduction: What Is Ai, The Foundations Of Artificial Intelligence, The History Of Artificial
Intelligence, The State Of The Art. Intelligent Agents: Agents And Environments, Good Behaviour:
The Concept Of Rationality, The Nature Of Environments, And The Structure Of Agents. Solving
Problems By Searching: Problem-Solving Agents, Uninformed Search Strategies, Informed
(Heuristic) Search Strategies, Heuristic Functions. Beyond Classical Search: Local Search
Algorithms and Optimization Problems, Searching With Nondeterministic Actions And Partial
Observations, Online Search Agents And Unknown Environments. Constraint Satisfaction
Problems: Definition, Constraint Propagation, Backtracking Search, Local Search, The Structure Of
Problems.

List of Exercise/Experiments

1. Implementation of uninformed search algorithm (BFS and DFS).

2. Implementation of Informed Search algorithm (A* and Hill Climbing Algorithm)

UNIT 2 KNOWLEDGE REPRESENTATION AND REASONING

Logical Agents: Knowledge-Based Agents, Propositional Logic, Propositional Theorem Proving,


Effective Propositional Model Checking, Agents Based on Propositional Logic. FirstOrder Logic:
Syntax and Semantics, Knowledge Engineering in FOL, Inference in First-Order Logic, Unification
and Lifting, Forward Chaining, Backward Chaining, Planning: Definition, Algorithms, Planning
Graphs, Hierarchical Planning, Multi-agent Planning. Knowledge Representation: Ontological
Engineering, Categories and Objects, Events, Mental Events and Mental Objects, Reasoning
Systems for Categories, Reasoning with Default Information, The Internet Shopping World.

List of Exercise/Experiments
1. Implementation of forward and backward chaining.
2. Implementation of unification algorithms.

8
4. 22IT401 ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING
LTPC
UNIT 3 LEARNING
3003
Learning from Examples: Forms of Learning, Supervised Learning, Learning Decision
Trees, Evaluating and Choosing the Best Hypothesis, The Theory of Learning, Regression
and Classification with Linear Models, Artificial Neural Networks. Applications: Human
computer interaction (HCI), Knowledge management technologies, AI for customer
relationship management, Expert systems, Data mining, text mining, and Web mining,
Other current topics.

List of Exercise/Experiments

1. Numpy Operations

2. NumPy arrays

3. NumPy Indexing and Selection

4. NumPy Exercise:

(i) Write code to create a 4x3 matrix with values ranging from 2 to 13.

(ii) Write code to replace the odd numbers by -1 in the following array.

(iii) Perform the following operations on an array of mobile phones prices 6999,
7500, 11999, 27899, 14999, 9999.

a) Create a 1d-array of mobile phones prices

b) Convert this array to float type

c) Append a new mobile having price of 13999 Rs. to this array

d) Reverse this array of mobile phones prices

e) Apply GST of 18% on mobile phones prices and update this array.

f) Sort the array in descending order of price

g) What is the average mobile phone price.

TOTAL : 45 PERIODS

9
4. 22IT401 ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING
LTPC
UNIT 4 FUNDAMENTALS OF MACHINE LEARNING
3003
Motivation for Machine Learning, Applications, Machine Learning, Learning associations,
Classification, Regression, The Origin of machine learning, Uses and abuses of machine
learning, Success cases, How do machines learn, Abstraction and knowledge
representation, Generalization, Factors to be considered, Assessing the success of
learning, Metrics for evaluation of classification method, Steps to apply machine learning
to data, Machine learning process, Input data and ML algorithm, Classification of machine
learning algorithms, General ML architecture, Group of algorithms, Reinforcement
learning, Supervised learning, Unsupervised learning, Semi-Supervised learning,
Algorithms, Ensemble learning, Matching data to an appropriate algorithm.

List of Exercise/Experiments

1. Build linear regression models to predict housing prices using python , using data set
available Google colabs.

2. Stock Ensemble-based Neural Network for Stock Market Prediction using Historical Stock
Data and Sentiment Analysis.

UNIT 5 MACHINE LEARNING AND TYPES

Supervised Learning, Regression, Linear regression, Multiple linear regression, A multiple


regression analysis, The analysis of variance for multiple regression, Examples for
multiple regression, Overfitting, Detecting overfit models: Cross validation, Cross
validation: The ideal procedure, Parameter estimation, Logistic regression, Decision trees:
Background, Decision trees, Decision trees for credit card promotion, An algorithm for
building decision trees, Attribute selection measure: Information gain, Entropy, Decision
Tree: Weekend example, Occam’s Razor, Converting a tree to rules, Unsupervised
learning, Semi Supervised learning, Clustering, K – means clustering, Automated
discovery, Reinforcement learning, Multi-Armed Bandit algorithms, Influence diagrams,
Risk modelling, Sensitivity analysis, Casual learning.

10
4. 22IT401 ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING
List of Exercise/Experiments
LTPC
Use Cases
3003
Case Study 1: Churn Analysis and Prediction (Survival Modelling)

Cox-proportional models

Churn Prediction

Case Study 2: Credit card Fraud Analysis

Imbalanced Data

Neural Network

Case study 3: Sentiment Analysis or Topic Mining from New York Times

Similarity measures (Cosine Similarity, Chi-Square, N Grams)

Part-of-Speech Tagging

Stemming and Chunking

Case Study 4: Sales Funnel Analysis

A/B testing

Campaign effectiveness, Web page layout effectiveness

Scoring and Ranking

Case Study 5: Recommendation Systems and Collaborative filtering

User based

Item Based

Singular value decomposition–based recommenders

Case Study 6: Customer Segmentation and Value

Segmentation Strategies

Lifetime Value

Case Study 7: Portfolio Risk Conformance

Risk Profiling

Portfolio Optimization

Case Study 8: Uber Alternative Routing

Graph Construction
11
Route Optimization
5.COURSE OUTCOME

Cognitive/
Affective Expected
Course
Course Outcome Statement Level of the Level of
Code
Course Attainment
Outcome
Course Outcome Statements in Cognitive Domain

Explain the problem solving and Understand


C211.1 70%
search strategies. K2
Demonstrate the techniques for
Apply
C211.2 knowledge representation and 70%
K3
reasoning.
Interpret various forms of learning, Apply
C211.3 artificial neural networks and its K3 70%
applications.

Experiment various machine Analyse


C211.4 70%
learning algorithms. K4

Employ AI and machine learning


Apply
C211.5 algorithms to solve real world 70%
K3
problems.

12
6.CO-PO/PSO MAPPING

Correlation Matrix of the Course Outcomes to


Programme Outcomes and Programme Specific
Outcomes Including Course Enrichment Activities

Programme Outcomes (POs), Programme Specific Outcomes (PSOs)


Course PO PO PO PO PO PO1 PO1 PO1 PSO PSO PSO
Outcomes PO3 PO4 PO5 PO9
1 2 6 7 8 0 1 2 1 2 3
(COs) K3/K
K3 K4 K5 K5 A2 A3 A3 A3 A3 A3 A2 K3 K3 K3
5
C211 K
2 1 1 1 3 3
.1 2
C211 K
3 2 1 1 3 3
.2 3
C211 K
3 2 1 1 3 2 3
.3 3
C211 K
.4 4
3 3 2 2 5 3 3

C211 K
3 2 1 1 3 2 3
.5 3
C211 2.8 2 1.2 1.2 3 0.8 3

13
UNIT II

KNOWLEDGE
REPRESENTATION AND
REASONING

14
LECTURE PLAN – UNIT II
UNIT I INTRODUCTION

Sl.
No
NO PROPOSED ACTUAL
OF LECTURE LECTURE PERTAINING TAXONOMY MODE OF
TOPIC
PERI CO(s) LEVEL DELIVERY
ODS
PERIOD PERIOD

1 PROPOSITION LOGIC
1 27.01.24 CO2 K2 MD1
-

FIRST ORDER
1 29.01.24 CO2 K2 MD1
2 PREDICATE LOGIC

INFERENCE,
FORWARD CHAINING
3 1 30.01.24 CO2 K2 MD1
-BACKWARD
CHAINING

RESOLUTION,
1 01.02.24 CO2 K3 MD1
4 UNIFICATION

PLANNING:
DEFINITION,
5 ALGORITHMS,
PLANNING GRAPHS, 1 02.02.24 CO2 K3 MD1
HIERARCHICAL
PLANNING, MULTI-
AGENT PLANNING
KNOWLEDGE
6 REPRESENTATION -
ONTOLOGICAL
2 03.02.24 CO2 K2 MD1
ENGINEERING -
CATEGORIES AND
OBJECTS
EVENTS - MENTAL
EVENTS AND
7 MENTAL OBJECTS -
1 06.02.24 CO2 K2 MD1
REASONING
SYSTEMS FOR
CATEGORIES
REASONING WITH
DEFAULT 1 08.02.24 CO2 K2 MD1
8 INFORMATION
LECTURE PLAN – UNIT II

ASSESSMENT COMPONENTS MODE OF DELEIVERY


AC 1. Unit Test MD 1. Oral presentation
AC 2. Assignment MD 2. Tutorial
AC 3. Course Seminar MD 3. Seminar
AC 4. Course Quiz MD 4 Hands On
AC 5. Case Study MD 5. Videos
AC 6. Record Work MD 6. Field Visit
AC 7. Lab / Mini Project
AC 8. Lab Model Exam
AC 9. Project Review

16
ACTIVITY BASED LEARNING – UNIT II

COMPLETE THE PUZZLES GIVEN BELOW

17
Lecture Notes
Proportional logic
Definition: A proposition is a statement that can be either
true or false; it must be one or the other, and it cannot be both

Propositional logic (PL) is the simplest form of logic where all


the statements are made by propositions. A proposition is a
declarative statement which is either true or false. It is a
technique of knowledge representation in logical and
mathematical form.
Example : a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
Following are some basic facts about propositional
logic:
Propositional logic is also called Boolean logic as it works on 0
and 1.
In propositional logic, we use symbolic variables to represent
the logic, and we can use any symbol for a representing a
proposition, such A, B, C, P, Q, R, etc.
Propositions can be either true or false, but it cannot be both.
Propositional logic consists of an object, relations or function,
and logical connectives.
These connectives are also called logical operators.
The propositions and connectives are the basic elements of
the propositional logic.
Connectives can be said as a logical operator which connects
two sentences.
A proposition formula which is always true is called tautology, and it
is also called a valid sentence.

A proposition formula which is always false is called Contradiction.

A proposition formula which has both true and false values is called

Statements which are questions, commands, or opinions are not


propositions such as "Where is Rohini", "How are you", "What is
your name", are not propositions.

There are two types of Propositions:

Atomic Propositions

Compound propositions

Atomic Proposition: Atomic propositions are the simple propositions. It


consists of a single proposition symbol. These are the sentences which must
be either true or false.

Example:

a) 2+2 is 4, it is an atomic proposition as it is a true fact.

b) "The Sun is cold" is also a proposition as it is a false fact.

Compound proposition: Compound propositions are constructed by


combining simpler or atomic propositions, using parenthesis and logical
connectives.

Example:

a) "It is raining today, and street is wet."

b) "Ankit is a doctor, and his clinic is in Mumbai."


Propositional Theorem Proving

A different approach to using logic to solve problems is to use


logical rules of inference to generate logical implications
in some cases, this can be less work than model-checking (i.e.
generating a truth table)
Logical Connectives:
Logical connectives are used to connect two simpler
propositions or representing a sentence logically. We can
create compound propositions with the help of logical
connectives. There are mainly five connectives, which are
given as follows:
Truth Table
Properties of Operators
• Commutativity:
• P∧ Q= Q ∧ P, or
• P ∨ Q = Q ∨ P.
• Associativity:
• (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
• Identity element:
• P ∧ True = P,
• P ∨ True= True.
• Distributive:
• P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
• P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
• DE Morgan's Law:
• ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
• ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
• Double-negation elimination:
• ¬ (¬P) = P.
Limitations of Propositional logic
• We cannot represent relations like ALL, some, or none with
propositional logic. Example:
• All the girls are intelligent.

• Some apples are sweet.

• Propositional logic has limited expressive power.

• In propositional logic, we cannot describe statements in terms


of their properties or logical relationships.
First-Order Logic in Artificial intelligence

Unfortunately, in propositional logic, we can only represent the facts, which


are either true or false.

PL is not sufficient to represent the complex sentences or natural language


statements.

The propositional logic has very limited expressive power.

Consider the following sentence, which we cannot represent using PL logic.

"Some humans are intelligent", or

"Sachin likes cricket."

To represent the above statements, PL logic is not sufficient, so we required


some more powerful logic, such as first-order logic.

• First-order logic is another way of knowledge representation in artificial


intelligence. It is an extension to propositional logic.

• FOL is sufficiently expressive to represent the natural language statements


in a concise way.

• First-order logic is also known as Predicate logic or First-order


predicate logic

• First-order logic (like natural language) does not only assume that the world
contains facts like propositional logic but also assumes the following things
in the world:

• As a natural language, first-order logic also has two main parts:

• Syntax

• Semantics
Syntax of First-Order logic:
The syntax of FOL determines which collection of symbols is a logical
expression in first-order logic. The basic syntactic elements of first-
order logic are symbols. We write statements in short-hand notation in
FOL.

Basic Elements of First-order logic:

Following are the basic elements of FOL syntax:

Constant 1, 2, A, John, Mumbai,


cat,....

Variables x, y, z, a, b,....

Predicates Brother, Father, >,....

Function sqrt, LeftLegOf, ....

Connectives ∧, ∨, ¬, ⇒, ⇔

Equality ==

Quantifier ∀, ∃

Definition with Examples


Atomic sentences:

• Atomic sentences are the most basic sentences of first-order logic.


These sentences are formed from a predicate symbol followed by a
parenthesis with a sequence of terms.

• We can represent atomic sentences as Predicate (term1, term2, ......,


term n).

Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).


Chinky is a cat: => cat (Chinky).
Complex Sentences:

Complex sentences are made by combining atomic sentences using


connectives.

First-order logic statements can be divided into two parts:

• Subject: Subject is the main part of the statement.

• Predicate: A predicate can be defined as a relation, which binds two


atoms together in a statement.

Consider the statement: "x is an integer.", it consists of two parts,


the first part x is the subject of the statement and second part "is an
integer," is known as a predicate.

Quantifiers in First-order logic:

1.Universal Quantifier, (for all, everyone, everything)

2.Existential quantifier, (for some, at least one).

The Universal quantifier is represented by a symbol ∀, which resembles


an inverted A.

Note: In universal quantifier we use implication "→".


If x is a variable, then ∀x is read as:
For all x
For each x
For every x.

Example:

All man drink coffee.

Let a variable x which refers to a cat so all x can be represented in


UOD as below:
∀x man(x) → drink (x, coffee).

It will be read as: There are all x where x is a man who drink coffee.
Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that
the statement within its scope is true for at least one instance of
something.

It is denoted by the logical operator ∃, which resembles as inverted E.


When it is used with a predicate variable then it is called as an
existential quantifier.

Note: In Existential quantifier we always use AND or Conjunction symbol


(∧).

If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will


be read as:

• There exists a 'x.'

• For some 'x.'

• For at least one 'x.'


Example:

It will be read as: There are some x where x is a boy who is intelligent.

Some Examples of FOL using quantifier:

1. All birds fly.


In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).
2. Every man respects his parent.
In this question, the predicate is "respect(x, y)," where x=man, and
y= parent.
Since there is every man so will use ∀, and it will be represented as
follows:
∀x man(x) → respects (x, parent).
Examples of FOL
3. Some boys play cricket.
In this question, the predicate is "play(x, y)," where x= boys, and y=
game. Since there are some boys so we will use ∃, and it will be
represented as:
∃x boys(x) → play(x, cricket).

4. Not all students like both Mathematics and Science.


In this question, the predicate is "like(x, y)," where x= student,
and y= subject.
Since there are not all students, so we will use ∀ with negation,
so following representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x,
Science)].

5. Only one student failed in Mathematics.


In this question, the predicate is "failed(x, y)," where x= student,
and y= subject.
Since there is only one student who failed in Mathematics, so we will
use following representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y)
[¬(x==y) ∧ student(y) → ¬failed (x, Mathematics)].
Using Predicate Logic / FOL some
examples
About Propositional logic:
FACTS:
Truth in the real world ie.,these are the things we want to
represent
Propositional Logic:
We explore a particular way of representing FACTS.

Way to represent the sort of world knowledge that AI system might


needs

Representing simple facts


It is raining
RAINING
It is sunny
SUNNY
It is windy
WINDY
If it is raining, then it is not sunny
RAINING → SUNNY

1. Socrates is a Man
We can write
SOCRATESMAN
2. Plato is a man
PLATOMAN
We can write conclusion as
MAN(SOCRATES)
MAN(PLATO)
Using Predicate Logic OR FOL
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Pompeians were either loyal to Caesar or hated him.
6. Every one is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
1. Marcus was a man.
man(Marcus)
2. Marcus was a Pompeian.
Pompeian(Marcus)
3. All Pompeians were Romans.
x: Pompeian(x) → Roman(x)
 = for all
4. Caesar was a ruler.
ruler(Caesar)
5. All Pompeians were either loyal to Caesar or hated him.
inclusive-or
x: Roman(x) → loyalto(x, Caesar)  hate(x, Caesar)
exclusive-or
x: Roman(x) → (loyalto(x, Caesar)  hate(x, Caesar)) 
(loyalto(x, Caesar)  hate(x, Caesar))
6. Every one is loyal to someone.
x: y: loyalto(x, y) y: x: loyalto(x, y)
 = there exists
7. People only try to assassinate rulers they are not loyal to.
x: y: person(x)  ruler(y)  tryassassinate(x, y)
→ loyalto(x, y)
8. Marcus tried to assassinate Caesar.
tryassassinate(Marcus, Caesar)

Was Marcus loyal to Caesar?


man(Marcus)
ruler(Caesar)
tryassassinate(Marcus, Caesar)
 x: man(x) → person(x)
loyalto(Marcus, Caesar)
Many English sentences are ambiguous.

There is often a choice of how to represent knowledge.

Obvious information may be necessary for reasoning

We may not know in advance which statements to deduce (P or


P).
Reasoning
1. Marcus was a Pompeian.
2. All Pompeians died when the volcano erupted in 79 A.D.
3. It is now 2008 A.D.

Is Marcus alive?
1. Marcus was a Pompeian.
Pompeian(Marcus)

2. All Pompeians died when the volcano erupted in 79 A.D.


erupted(volcano, 79)  x: Pompeian(x) → died(x, 79)

3. It is now 2008 A.D.


now = 2008

1. Marcus was a Pompeian.


Pompeian(Marcus)

2. All Pompeians died when the volcano erupted in 79 A.D.


erupted(volcano, 79)  x: Pompeian(x) → died(x, 79)

3. It is now 2008 A.D.


now = 2008
x: t1: t2: died(x, t1)  greater-than(t2, t1) → dead(x, t2)
The basic ideas

It is a procedure which gains its efficiency from facts.

KB |=   KB   |= false
The basic ideas

KB |=   KB   |= false

(  )  (   )  (  )
The basic ideas

KB |=   KB   |= false

(  )  (   )  (  )

sound and complete


1. Man(Marcus).

2. Pompeian(Marcus).

3. x: Pompeian(x) → Roman(x).

4. ruler(Caesar).

5. x: Roman(x) → loyalto(x, Caesar)  hate(x, Caesar).

6. x: y: loyalto(x, y).

7. x: y: person(x)  ruler(y)  tryassassinate(x, y)

→ loyalto(x, y).

8. tryassassinate(Marcus, Caesar).

Prove:

hate(Marcus, Caesar)

Question Answering

1. When did Marcus die?

2. Whom did Marcus hate?

3. Who tried to assassinate a ruler?

4. What happen in 79 A.D.?.

5. Did Marcus hate everyone?


Inference in FOL
We need intelligent computers which can create new logic from old
logic or by evidence.

So generating the conclusions from evidence and facts is


termed as Inference.

Inference rules:

Inference rules are applied to derive proofs in artificial intelligence.

The proof is a sequence of the conclusion that leads to the desired


goal.

some terminologies related to inference rules:

Implication: It is one of the logical connectives which can be


represented as P → Q. It is a Boolean expression.

Converse: The converse of implication, which means the right-


hand side proposition goes to the left-hand side and vice-versa. It
can be written as Q → P.

Contrapositive: The negation of converse is termed as


contrapositive, and it can be represented as ¬ Q → ¬ P.

Inverse: The negation of implication is called inverse. It can


be represented as ¬ P → ¬ Q.

Hence from the below truth table, we can prove that P → Q is


equivalent to ¬ Q → ¬ P, and Q→ P is equivalent to ¬ P → ¬ Q.
Types of Inference rules:

Modus Ponens:

This rule states that if P and P → Q is true, then we can infer


that Q will be true. It can be represented as:

Example:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be
true.

Modus Tollens:

The Modus Tollens rule state that if P→ Q is true and ¬ Q is true,


then ¬ P will also true. It can be represented as:

Examples:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P

Hypothetical Syllogism:

The Hypothetical Syllogism rule state that if P→R is true whenever


P→Q is true, and Q→R is true. It can be represented as the following
notation:
Example:

Statement-1: If you have my home key then you can unlock my


home. P→Q
Statement-2: If you can unlock my home then you can take my
money. Q→R
Conclusion: If you have my home key then you can take my
money. P→R

Modus Ponens:
This rule states that if P and P → Q is true, then we can infer
that Q will be true

Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then


¬ P will also true

Hypothetical Syllogism rule state if P→R is true whenever P→Q is true,


and Q→R is true
Knowledge Engineering in First-order logic

What is knowledge-engineering?

The process of constructing a knowledge-base in first-order logic is


called as knowledge- engineering.

In knowledge-engineering, someone who investigates a particular


domain, learns important concept of that domain, and generates a
formal representation of the objects, is known as knowledge
engineer.
Forward Chaining and Backward Chaining

• In a rule-based expert system, the domain knowledge is represented


by a set of IF-THEN production rules and data is represented by a set
of facts about the current situation.

• The inference engine compares each rule stored in the knowledge


base with facts contained in the database.

• When the IF (condition) part of the rule matches a fact, the rule is
fired and its THEN (action) part is executed.

• The matching of the rule IF parts to the facts produces inference


chains.

• The inference chain indicates how an expert system applies the rules
to reach a conclusion.

Inference engine cycles via a match -fire Procedure


CONT….

Rule 1: IF Y is true
AND D is true
THEN Z is true

Rule 2: IF X is true
AND B is true
AND E is true
THEN Y is true

Rule 3: IF A is true
THEN X is true
• Forward chaining is one of the two main methods of reasoning
when using inference rules.
• Forward chaining is a popular implementation strategy for expert
systems, business and production rule and systems..
• Forward chaining starts with the available data and uses inference
rules to extract more data until a goal is reached.
• An inference engine using forward chaining searches the inference
rules until it finds one where the If clause is known to be true.
• When such a rule is found, the engine can conclude, the Then
clause, resulting in the addition of new information to its data.
• Inference engines will iterate through this process until a goal is
reached.
FORWARD CHAINING

Backward Chaining

•Backward chaining (or backward reasoning) is an inference method that can


be described as working backward from the goal(s).
•It is used in automated theorem provers, proof assistants and other artificial
Intelligence applications.
•In game theory, its application to (simpler) subgames in order to find a
solution to the game is called backward induction.
•Backward chaining starts with a list of goals (or a hypothesis) and works
backwards from the consequent to the antecedent to see if there is data
available that will support any of these consequents.
•An inference engine using backward chaining would search the inference
rules until it finds one which has a consequent (Then clause) that matches a
desired goal.
Backward chaining or goal-driven inference works towards a final
state, and by looking at the working memory to see if goal already
there. If not look at the actions (THEN-parts) of rules that will
establish goal, and set up subgoals for achieving premises of the rules
(IF-part).

This continues until some rule can be applied, apply to achieve goal
state.

Advantage of backward chaining:


search is directed
Disadvantage of backward chaining:
goal has to be known

Now look at the example from above with backward chaining


The Unification Algorithm
In propositional logic, it is easy to determine that two literals
cannot both be true at the same time.
For example, man(John) and ¬ man(John) is a contradiction,
while man(John) and ¬ man(Spot) is not.
The basic idea of unification is very simple.
To attempt to unify two literals,
we first check if their initial predicate symbols are the
same. If so, we can proceed. Otherwise.
For Example:
tryassassinate (Marcus, Caesar)
hate(Marcus, Caesar)
cannot be unified, there is no way they can be unified
Suppose we want to unify the expressions
P(x, x)
P(y, z)
The two instances of P match fine
Next we compare x and y, and decide that if we substitute y for
x
We will write that substitution as y/x and now we can re
write as
P(y, y)
P(y, z)
Now we can attempt to unify arguments y and z, which
succeeds with the substitution z/y.
We get
P(z, z)
P(z, z)
The entire unification process has now succeeded.
We write the composition as
(z/y) (y/x)
Example:
Algorithm: Unify(L1, L2)
I. If L1 or L2 are both variables or constants, then:

(a) If L1 and L2 are identical, then return NIL.

(b) Else if L1 is a variable, then if L1 occurs in L2 then return


{FAIL}, else return (L2/L1).

(c) Else if L2 is a variable, then if L2 occurs in L1 then return


{FAIL} , else return (L1/L2).

(d) Else return {FAIL}.

2. If the initial predicate symbols in L1 and L2 are not identical,


then return {FAIL}.

3. If LI and L2 have a different number of arguments, then


return {FAIL}.

4. Set SUBST to NIL. (At the end of this procedure, SUBST will contain
all the substitutions used to unify L1 and L2.)

5. For i ← 1 to number of arguments in L1 :

(a) Call Unify with the ith argument of L1 and the ith argument of L2,
putting result in S.

(b) If S contains FAIL then return {FAIL}.

(c) If S is not equal to NIL then:

(i) Apply S to the remainder of both L1 and L2.

(ii) SUBST: = APPEND(S, SUBST).

6. Return SUBST.
RESOLUTION
Conversion to Clause form:
Suppose we know that all Romans who know Marcus either hate Caesar or think
that anyone who hates anyone is crazy. We could represent that in the following

∀x: [Roman(x) ∧ know(x, Marcus)] → [hate(x, Caesar) V (∀y : ∃z : hate


(y, z) → thinkcrazy(x, y))]
Conjunctive normal form as
¬ Roman(x) ∧ ¬ know(x, Marcus) V
hate(x, Caesar) V ¬ hate(y, z) V thinkcrazy(x, z)
Algorithm: Convert to Clause Form:
1. Eliminate →, using the fact that a → b is equivalent to ¬ a V b.
Performing this transformation on given above yields
Before:
∀x: [Roman(x) ∧ know(x, Marcus)] → [hate(x, Caesar) V (∀y : ∃z : hate (y, z) →
thinkcrazy(x, y))]

After Eliminate
∀x: ¬ [Roman(x) ∧ know(x, Marcus)] V[hate(x, Caesar) V (∀y : ¬(∃z :
hate(y, z)) V thinkcrazy(x, y))]
2. Reduce the scope of each ¬ to a single term, using the fact that
¬ (¬ p) = p,
deMorgan's laws [which say that ¬ (a ∧ b) = ¬ a V ¬ b → 1
and ¬ (a V b) = ¬ a ∧ ¬ b ] → 2
and the standard correspondences between quantifiers. ∃x: Existential
quantification
[¬ ∀x: P(x) = ∃x: ¬ P(x) -> 3
and ¬ ∃x: P(x) = ∀ x: ¬P(x)] -> 4
Performing this transformation on from step 1 yields
Before:
∀x: ¬ [Roman(x) ∧ know(x, Marcus)] V[hate(x, Caesar) V (∀y : ¬(∃z : hate(y, z)) V
thinkcrazy(x, y))]
After:
∀x: [¬ Roman(x) V ¬ know(x, Marcus)] V[hate(x, Caesar) V (∀y: ∀z: ¬
hate(y, z) V thinkcrazy(x, y))]
3. Standardize variables so that each quantifier binds a unique variable. Since
variables are just dummy names, this process cannot affect the truth value of
the wff. For example, the formula
∀x: P(x) V ∀x: Q(x) would be converted to
∀x: P(x) V ∀y: Q(y)
This step is in preparation for the next.
4. Move all quantifiers to the left of the formula without changing their
relative order
Before:
∀x: [¬ Roman(x) V ¬ know(x, Marcus)] V[hate(x, Caesar) V (∀y: ∀z: ¬ hate(y, z) V
thinkcrazy(x, y))]
After:
∀x: ∀y: ∀z : [¬ Roman(x) V ¬ know(x, Marcus)] V
[hate(x, Caesar) V (¬ hale(y, z) V thinkcrazy(x, y))]
5. Eliminate existential quantifiers. ∃y : President(y)
can be transformed into the formula
President(S1)
But for above example it is not required
6. Drop the prefix
Before:
∀x: ∀y: ∀z : [¬ Roman(x) V ¬ know(x, Marcus)] V
[hate(x, Caesar) V (¬ hale(y, z) V thinkcrazy(x, y))]
After :
[¬ Roman(x) V ¬ know(x, Marcus)] V[hate(x, Caesar) V (¬ hate(y, z) V
thinkcrazy(x, y))]
7. Convert the matrix into a conjunction of disjuncts. In the case or our
example, since there are no and’s, it is only necessary to exploit the associative
property of or [ i.e., ( a ∧ b ) ∨ c ≡ ( a ∨ c ) ∧ ( b ∨ c ). and simply remove the
parentheses, giving
Before:
[¬ Roman(x) V ¬ know(x, Marcus)] V[hate(x, Caesar) V (¬ hate(y, z) V thinkcrazy(x, y))]
After:
¬ Roman(x) V ¬ know(x, Marcus) V hate(x, Caesar) V ¬ hate(y, z) V
thinkcrazy(x, y)
The Basis of Resolution
The resolution procedure is a simple iterative process.
At each step, two parent clauses, are compared (resolved), yielding
a new clause
The new clause represents ways that the two parent clauses interact
with each other
For Example:
winter V summer
¬ winter V cold
we can deduce
summer V cold

Summary of Conversion to Clause Form

1. Eliminate →.
2. Reduce the scope of each  to a single term.
3. Standardize variables so that each quantifier binds a unique variable.
4. Move all quantifiers to the left without changing their relative order.
5. Eliminate  (Skolemization).
6. Drop .
7. Convert the formula into a conjunction of disjuncts.
8. Create a separate clause corresponding to each conjunct.
9. Standardize apart the variables in the set of obtained clauses.
KNOWLEDGE REPRESENTATION

❑ Ontological Engineering

❑ Categories and Objects

❑ Events

❑ Mental Events and Mental Objects

❑ Reasoning System for Categories

ONTOLOGICAL ENGINEERING

Ontologies are constructed using knowledge representation languages and


logics. An ontology consists of a set of concepts, axioms, and relationships
that describe a domain of interest .
• Create more general and flexible representations.

• Concepts like actions, time, physical object and beliefs

• Define general framework of concepts

• Upper ontology

• Limitations of logic representation

• Red, green and yellow tomatoes: exceptions and uncertain


• Representing a general-purpose ontology is a difficult task called ontology
engineering
• Existing GP ontologies have been created in different ways: By
team of trained ontologists

By importing concepts from database(s)

By extracting information from text documents

By inviting anybody to enter commonsense knowledge

• Ontological engineering has only been partially successful, and few large AI
systems are based on GP ontologies (use special purpose ontologies)
Each link indicates that the lower concept is a specialization of the upper one.
Specializations are not necessarily disjoint; a human is both an animal and an
agent, for example.

Categories and Objects


• Two choices for representation:
• Predicate
• Basketball(b)
• Object
• Basketballs
• Member(b, Basketballs)
• Subset(Basketballs, Balls)
Categories - Organizing
• Inheritance:
• All instances of the category Food are edible
– Fruit is a subclass of Food
– Apples is a subclass of Fruit
• Therefore, Apples are edible

• The Class/Subclass relationships among Food, Fruit and Apples is a


taxonomy
Categories - Partitioning

•Disjoint: The categories have no members in common


• Disjoint(s)⇔(∀ c1,c2 c1 ∈ s ∧ c2 ∈ s ∧ c1 ≠ c2 ⇒
Intersection(c1,c2) ={})
• Example:
Disjoint({animals, vegetables})

Exhaustive Decomposition: Every member of the category is included in at


least one of the subcategories
• E.D.(s,c) ⇔ (∀ i i ∈ c ⇒ ∃ c2 c2 ∈ s ∧ i ∈ c2)
• Example:
ExhaustiveDecomposition( {Americans, Canadian, Mexicans},
NorthAmericans).

Partition: Disjoint exhaustive decomposition


•Partition(s,c) ⇔ Disjoint(s) ∧ E.D.(s,c)
•Example: Partition({Males,Females},Persons).

Partition: Disjoint exhaustive decomposition


•Partition(s,c) ⇔ Disjoint(s) ∧ E.D.(s,c)
•Example: Partition({Males,Females},Persons).
•Is ({Americans,Canadian, Mexicans},NorthAmericans)

a partition?
•No! There might be dual citizenships.

Categories can be defined by providing necessary and sufficient conditions


for membership
• ∀ x Bachelor(x) ⇔ Male(x) ∧ Adult(x) ∧ Unmarried(x)
Natural kinds
• Many categories have no clear-cut definitions (chair, bush, book).

• Tomatoes: sometimes green, red, yellow, black, mostly round.

• One solution: category Typical(Tomatoes)


• ∀x x ∈ Typical(Tomatoes) ⇒ Red(x) ∧ Spherical(x)
• We can write down useful facts about categories without providing
exact definitions

Physical composition

• One object may be part of another:


• PartOf(Seoul,Southkoarea)

• PartOf(Southkorea,EastAsia)
• PartOf(EastAsia,Asia)
• The PartOf predicate is transitive (and reflexive), so we can infer that
PartOf(Seoul,Asia)

• More generally:
• ∀ x PartOf(x,x)

• ∀ x,y,z PartOf(x,y) ∧ PartOf(y,z) ⇒ PartOf(x,z)

• Often characterized by structural relations among parts.


• E.g. Biped(a) ⇒
Measurements

•Objects have height, mass, cost, ....

Values that we assign to these are measures

•Combine Unit functions with a number:


• Length(L1) = Inches(1.5) = Centimeters(3.81).

•Conversion between units:


• ∀ i Centimeters(2.54 x i)=Inches(i).

•Some measures have no scale:

Beauty, Difficulty, etc.


• Most important aspect of measures: they are orderable.

• Don't care about the actual numbers.

(An apple can have deliciousness .9 or .1.)


•Measures can be used to describe objects as follows:
• Diameter(Basketball 12) = Inches(9.5) .
• ListPrice(Basketball 12) = $(19) .
• d ∈ Days ⇒ Duration(d) = Hours(24) .
Events
• Facts were treated as true independent of time
• Events: need to describe what is true, when something is happening
• For instance: Flying event
• E ∈ Flying's
• Flyer(E, Shankar)
• Origin(E, SanFrancisco)
• Destination(E, Baltimore)
• We will consider two kinds of time intervals: moments and extended intervals. The
distinction is that only moments have zero duration:

• Partition({Moments, ExtendedIntervals}, Intervals) i ∈ Moments ⇔ Duration(i) =


Seconds(0) .
• The function Duration gives the difference between the end time and the start time.
• Interval(i) ⇒ Duration(i) = (Time(End(i)) - Time(Begin(i))) .
• Time(Begin(AD1900)) = Seconds(0) .
• Time(Begin(AD2001)) = Seconds(3187324800) .
• Time(End(AD2001)) = Seconds(3218860800) .
• Duration(AD2001) = Seconds(31536000) .

• Two intervals Meet if the end time of the first equals the star time of the second. The
complete set of
interval relations logically below:
• Meet(i, j) ⇔ End(i) = Begin(j)
• Before(i, j) ⇔ End(i) < Begin(j)
• After(j, i) ⇔ Before(i, j)
• During(i, j) ⇔ Begin(j) < Begin(i) < End(i) < End(j)
• Overlap(i, j) ⇔ Begin(i) < Begin(j) < End(i) < End(j)
• Begins(i, j) ⇔ Begin(i) = Begin(j)
• Finishes(i, j) ⇔ End(i) = End(j)
• Equals(i, j) ⇔ Begin(i) = Begin(j) ∧ End(i) = End(j)
Graphically

•Physical objects can be viewed as generalized events, in the sense


that a physical object is a chunk of space–time.
•George Washington was president throughout 1790
•T (Equals (President(USA), George Washington), AD1790)

A schematic view of the object President(USA) for the


first 15 years of its existence.
Mental events and objects
• So far, KB agents can have beliefs and deduce new beliefs

• What about knowledge about beliefs? What about knowledge about


the inference process?

• Requires a model of the mental objects in someone’s head and the


processes that manipulate these objects.

• Relationships between agents and mental objects: believes, knows,


wants,
• Believes(Lois,Flies(Superman)) with Flies(Superman) being a
function . . . a candidate for a mental object (reification).

• Agent can now reason about the beliefs of agents.


• Modal logic solves some tricky issues with the interplay of
quantifiers and knowledge.
• particular someone who Bond knows is a spy
∃ x Kbond Spy(x) ,

• Bond just knows that there is at least one spy


• Kbond∃ x Spy(x)

Alice asks “what is the square root of 1764” and Bob replies “I don’t know.”
If Alice
insists “think harder,” Bob should realize that with some more thought, this
question can in fact be answered. On the other hand, if the question were
“Is your mother sitting down right now?” then Bob should realize that
thinking harder is unlikely to help. Knowledge about the knowledge of other
agents is also important; Bob should realize that his mother knows whether
she is sitting or not, and that asking her would be a way to find out.
Reasoning System for Categories
Semantic Networks
• Logic vs. semantic networks

• Many variations
• All represent individual objects, categories of objects and
relationships among objects.

• persons have two legs—that is


• ∀ x x ∈ Persons ⇒ Legs(x, 2)

Allows for inheritance reasoning


• Female persons inherit all properties from person.

• Cfr. OO programming.

Inference of inverse links

• SisterOf vs. HasSister

Mammals

Subsetof
HasMother

Legs
Persons
Male
Female Subsetof Subsetof
Persons
Persons

Sisterof Legs
Mar y Lee
Reasoning System for Categories
Description logics

Are designed to describe definitions and properties about


categories

• A formalization of semantic networks

• Bachelor = And(Unmarried,Adult,Male)

▪ Principal inference task is

• Subsumption: checking if one category is the subset of


another by comparing their definitions

• Classification: checking whether an object belongs to a


category.

• Consistency: whether the category membership

criteria are logically satisfiable.

describe the set of men with at least three sons who are all
unemployed and married to doctors, and at most two daughters who
are all professors in physics or math departments
Reasoning in Artificial Intelligence
What do you mean by the term Reasoning
Reasoning is an act of deriving a conclusion from certain premises using
a given methodology
Reasoning is a process of thinking; logically arguing; drawing inferen.
When a system is required to do something, that it has not been explicitly
told how to do, it must reason. It must figure out what it needs to know from
what it already knows.

Many types of reasoning have been identified and recognized, but many
questions regarding their logical and computational properties still remained
under controversy.

Popular methods of Reasoning include: Abduction, Induction, model- based,


explanation and confirmation. All of them are intimately related to problems of
belief revision and theory development, knowledge assimilation, discovery and
learning.
When a system is required to do something, that it has not been explicitly
told how to do, it must reason. It must figure out what it needs to know from
what it already knows.

Example: Fact-1 : Robins are birds, Fact-2 : All birds have wings.

Then we can ask: DO ROBINS HAVE WINGS?

Reasoning is an act of deriving a conclusion from certain premises


using a given methodology.

Any knowledge system must reason, if it is required to do something which


has not being told explicitly.

For reasoning system must find out, what it needs to know from what it
already knows.

Hence to answer the above question- some reasoning must go.


Human reasoning capabilities

 Broadly it is being divided into three areas:

 Mathematical Reasoning- axioms, definitions, theorems, proofs

 Logical Reasoning- deductive, inductive, abductive

 Non-logical Reasoning- linguistic, language

 Above three mentioned are in every human being, but the ability
level depends on education, genetics and environment.

 Intelligent Quotient (IQ)= mathematical + logical reasoning,


whereas, Emotional Quotient mostly depends on non-logical
reasoning capabilities.

 Logical Reasoning is our major concern in AI.

Logical Reasoning :

Logic is a language of reasoning. It is a collection of rules called


logic arguments, we use when doing logical reasoning.

Logical Reasoning is a process of drawing conclusions from


premises using rule of inference.

 The study of is divided into two: formal and informal logic.

 The formal logic is sometimes called symbolic logic.

Symbolic logic is the study of symbolic abstraction (construct) that


capture the formal features of logical inference by a formal system.

Formal system consists of two components, a formal language and a


set of inference rules. The formal system has axioms.

Axiom is a sentence that is always true within the system.

Sentences are derived using the system’s axioms and rules of


derivation are called theorems.
Formal Vs Informal Logic

Formal Logic

The formal logic is the study of inference with purely formal


content,
i.e. where content is made explicit. Eg:
Propositional logic and Predicate Logic.

Here the logical arguments are set of rules for manipulating


symbols. The rules are of two types:

 Syntax rules: how to build meaningful expressions.

 Inference rules: how to obtain true formulas from other true


formulas.

Logic also need semantics, which says how to assign meaning to


expressions.

Informal Logic

The informal logic is study of natural language arguments.

The analysis of argument structures in ordinary language is part


of informal logic

The focus lies in distinguishing good arguments (valid) and bad


arguments (invalid).
Uncertainty in Reasoning

The world is an uncertain places; often the knowledge is imperfect


which causes uncertainty. Therefore reasoning must be able to operate
under uncertainty.

 AI systems must have ability to reason under conditions of


uncertainty.

 Incompleteness knowledge compensate for lack of knowledge.

 Inconsistencies knowledge Resolve ambiguities and


contradictions

 Changing knowledge update the knowledgebase over time.

Methods of reasoning:

To a certain extend this will depend on the chosen knowledge


representation. Although a good knowledge representation scheme
has to allow easy, natural, and plausible reasoning.

 Three types of logical reasoning:

 Deduction

 Induction

 Abduction

Deductive Reasoning :

Deductive Reasoning is a process in which general premises are


used to obtain a specific inference. Reasoning moves from a general
principle to a specific conclusion.
 Example: Premise : I wash my car when the weather is good on weekends.

 Premise: Today is Sunday and the weather is hot

 Conclusion: Therefore, I will wash my car today.

 To use deductive reasoning the problem must generally be formatted in this


way. Once the format has been achieved , the conclusion must be valid if
the premises are true. The whole idea is to develop new knowledge from
previously given knowledge.

 One of the basic rules of inference of deductive logic is the modus ponens
rule.
 A formal English statement of this rule is : If X is true and if X being true
implies Y is true then Y is true. (X∧(X→Y)→Y

 Example: All cats are felines. Bosty is a cat. I can deduce that Bosty is a
feline

Abduction Reasoning :
 Abduction is a form of deductive logic which provides only a ‘plausible
inference’.

For instance:

If I read Smoking causes lung cancer and Frank died of lung cancer
, I may infer that Frank was a smoker. Again this may or may not be
true. Using statistics and probability theory , abduction may yield the most
probable inference among many possible inferences.

Abduction is heuristic in the sense that it provides a plausible conclusion


consistent with available information, but one which may in fact be wrong.
To illustrate how abduction works, consider following logical system
consisting of a general rule and a specific proposition:
1)All successful , entrepreneurial industrialists are rich persons. 2)John is a
rich person.

If this was only information available, a plausible inference would be that
John was a successful , entrepreneurial industrialist. This conclusion
could also be false since there are other roads to riches such as inheritance ,
the lottery...If we had a table of the income distribution of wealthy persons
along with their personal histories, we could refine our abduction inference
with the probability of the inference being true .

Inductive Reasoning :
A principle of reasoning to a conclusion about all members of a class from
examination of only a few members of the class; broadly, reasoning from the
particular to the general.

For example :

In 1998, The best model of Turkey is from İzmir In 1999, The best model of
Turkey is from İzmir In 2000, The best model of Turkey is from İzmir I would
logically infer that all the girls from İzmir is beautiful.

This may or may not be true. But it provides a useful generalization.

Another example :

Falcon can fly. Canary can fly. Gull can fly.

Conclusion: Birds can fly.

The outcome of the inductive reasoning process will frequently contain some
measure of uncertainty because including all possible facts in the premises is
usually impossible. Deductive or inductive approaches are used in logic, rule-
based systems, and frames.
Other types of Reasoning

Analogical Reasoning
Monotonic Reasoning [Preferred in Certainty]-
Monotonic reasoning is static, in other words the truth of the
statement doesn’t change when any new information is added.

Non-Monotonic Reasoning [Preferred in


uncertainty]- In real life we frequently deal with non-monotonic
reasoning. In these situations the truth of a statement can change
when a new information is added

Reasoning with LOGIC:


Modus Ponens

Modus Tollens

Model –based Reasoning :

In artificial intelligence, model-based reasoning refers to an


inference method used in expert systems based on a model of the
physical world.

Case-based Reasoning: (CBR), broadly construed, is the


process of solving new problems based on the solutions of similar
past problems.
Rule-based Reasoning :

 A particular type of reasoning which uses "if-then-else" rule


statements.

 As mentioned above, rules are simply patterns and an inference


engine searches for patterns in the rules that match patterns in the
data.

 IF robbery is TRUE AND suspect witness identification is TRUE AND


suspect physical evidence is TRUE AND suspect lacks alibi is TRUE
THEN probable cause is TRUE ELSE round up usual suspects

Blackboard Systems:
 A blackboard system is an artificial intelligence application based
on the blackboard architectural model, where a common
knowledge base, the "blackboard", is iteratively updated by a
diverse group of specialist knowledge sources, starting with a
problem specification and ending with a solution.

Truth Maintenance systems.


 Necessary when changes in the fact-base lead to inconsistency /
incorrectness among the facts non-monotonic reasoning

A Truth Maintenance System tries to adjust the Knowledge Base or Fact


Base upon changes to keep it consistent and correct.

A TMS uses dependencies among facts to keep track of conclusions and


allow revision / retraction of facts and conclusions.
ASSIGNMENT – UNIT II

Assignment Questions – Very Easy


Q. ASSIGNMENT QUESTIONS Marks Knowledge CO
No. level
1. Explain the concept of a knowledge-based 5 K2 CO3
agent.

2. provide examples to demonstrate how 5 K2 CO3


propositions, logical connectives, and truth
values are used.

Assignment Questions - Easy

Q. ASSIGNMENT QUESTIONS Marks Knowledge CO


No. level
1. Discuss the significance of effective 5 K3 CO3
propositional model checking in the context of
knowledge-based agents.
2. Explain the role of variables, constants, 5 K2 CO3
predicates, and quantifiers in constructing first-
order logic statements. Include examples to
illustrate your points.

Assignment Questions - Medium

Q. ASSIGNMENT QUESTIONS Marks Knowledge CO


No. level
1. Describe the process of inference in first-order 5 K3 CO3
logic.

2. Explain the concept of unification in first- 5 K3 CO3


order logic.

66
ASSIGNMENT – UNIT II
Assignment Questions - Hard
Q. ASSIGNMENT QUESTIONS Marks Knowledge CO
No. level
1. Provide a detailed example to illustrate how 5 K4 CO3
forward chaining can solve a specific problem.

2. provide a real-world scenario where backward 5 K5 CO3


chaining would be a more suitable approach.

Assignment Questions – Very Hard

Q. ASSIGNMENT QUESTIONS Marks Knowledge CO


No. level
1. Provide an example of a real-world application 5 K5 CO3
that requires multi-agent planning.

2. Discuss how categories, objects, and events 5 K5 CO3


are represented in an online shopping system.

Course Outcomes:
CO2: Working knowledge on tools and frameworks.

*Allotment of Marks

Correctness of the Presentation Timely Submission Total (Marks)


Content

10 - 5 15
PART A- UNIT-2
1. Define First order Logic?
First-order logic is another way of knowledge representation in
artificial intelligence. It is an extension to propositional logic.
FOL is sufficiently expressive to represent the natural language
statements in a concise way.
First-order logic is also known as Predicate logic or First-
order predicate logic. First-order logic is a powerful language
that develops information about the objects in a more easy way
and can also express the relationship between those objects.

2. What is Predicate Logic?


A predicate is an expression of one or more variables determined on
some specific domain. A predicate with variables can be made a
proposition by either authorizing a value to the variable or by
quantifying the variable..
The following are some examples of predicates.
Consider E(x, y) denote "x = y"
Consider X(a, b, c) denote "a + b + c = 0"
Consider M(x, y) denote "x is married to y."

3. Define Propositional Logic?


Propositional logic (PL) is the simplest form of logic where all
the statements are made by propositions. A proposition is a declarative
statement which is either true or false. It is a technique of knowledge
representation in logical and mathematical form.
4. What is Unification algorithms?
Unification is a process of making two different logical atomic
expressions identical by finding a substitution. Unification depends on the
substitution process.
It takes two literals as input and makes them identical using
substitution.
For example, man(John) and ¬ man(John) is a contradiction, while man(John)
and ¬ man(Spot) is not.
PART A- UNIT-2
5. List any 3 rules to perform Unification algorithms?
Predicate symbol must be same, atoms or expression with
different predicate symbol can never be unified.
Number of Arguments in both expressions must be identical.
Unification will fail if there are two similar variables present in
the same expression.
6. Convert the following statement into proportional Logic: All
Pompeians are Romans.
1. x: Pompeian(x) → Roman(x)
7. Convert the following statement into proportional Logic: All
Romans are either loyal to Caesar or hated him.
x: Roman(x) → loyalto(x, Caesar)  hate(x, Caesar)
8. Convert the following statement into proportional Logic:
Everyone is loyal to someone.
x: y: loyalto(x, y)
9. Define Ontology?
An ontology is a set of concepts and categories in a subject
area or domain that possesses the properties and relations between
them. Ontological Modeling can help the cognitive AI or machine
learning model by broadening its' scope. They can include any data
type or variation and set each diver data to a specific task.
10. What is Ontological Engineering?
Itis a field which studies the methods and methodologies for
building ontologies, which are formal representations of a set of
concepts within a domain and the relationships between those
concepts. In a broader sense, this field also includes a knowledge
construction of the domain using formal ontology representations
such as OWL/RDF.
PART A- UNIT-2
.
11. What do you mean by a term REASONING?
Reasoning is an act of deriving a conclusion from certain premises
using a given methodology.

 Reasoning is a process of thinking; logically arguing; drawing


inference.

 Popular methods of Reasoning include: Abduction, Induction, model-


based, explanation and confirmation. All of them are intimately
related to problems of belief revision and theory development,
knowledge assimilation, discovery and learning.

12. Difference between formal and Informal logical?


Formal Logic

The formal logic is the study of inference with purely formal content,
i.e. where content is made explicit. Eg:
Propositional logic and Predicate Logic.

Here the logical arguments are set of rules for manipulating symbols. The
rules are of two types:

 Syntax rules: how to build meaningful expressions.

 Inference rules: how to obtain true formulas from other true formulas.

Logic also need semantics, which says how to assign meaning to


expressions.

13. List the types for logical reasoning?


Formal Logic and informal logic

14.What is deductive reasoning


Deductive Reasoning is a process in which general premises are used to
obtain a specific inference. Reasoning moves from a general principle to a
specifi conclusion.
 Example: Premise : I wash my car when the weather is good on weekends.
 Premise: Today is Sunday and the weather is hot
 Conclusion: Therefore, I will wash my car today.
PART A- UNIT-2
15.Define Knowledge Representation
Knowledge representation and reasoning is the field of artificial
intelligence dedicated torepresenting information about the world in a
form that a computer system can use to solvecomplex tasks such as
diagnosing a medical condition or having a dialog in a natural language
16. What are the different kinds of knowledge that can be presented in
AI?
Objects – Events – Performance – Facts – Meta-Knowledge – Knowledge-
base
17. List out 5 different types of knowledge
Declarative Knowledge.
Procedural Knowledge.
Meta Knowledge.
Heuristic Knowledge.
Structural Knowledge.
18. Define meta knowledge.
In the field of AI, the knowledge of pre-defined knowledge is known as
meta knowledge. A study of planning, tagging and learning are some of
the examples of meta knowledge. This model tends to change with time
and utilize a different specification.
19. Define Heuristic Knowledge.
Heuristic knowledge is representing knowledge of some experts in a filed
or subject. Heuristic knowledge is rules of thumb based on previous
experiences, awareness of approaches, and which are good to work but
not guaranteed.
20. List down the steps in cycle of knowledge representation in AI.
Perception
Learning
Knowledge Representation & Reasoning
Planning
Execution
PART A- UNIT-2
21. List out some issues in knowledge representation.
Relationship among attribute
Existence ISA hierarchy
Single value attributes
Choosing granularity
22. What are the rules if inference
Modus Penous
Modus Tollens
Universal specification
Chain Rule
23. What is semantic network?
A semantic network is a knowledge structure that depicts how
concepts are related to one another and illustrates how they
interconnect. Semantic networks use artificial intelligence
(AI)programming to mine data, connect concepts and call attention
to relationships.
24. What is frame representation
A frame is a record like structure which consists of a collection of
attributes and its values to describe an entity in the world. Frames
are the AI data structure which divides knowledge into substructures
by representing stereotypes situations.
25. List out the advantages and disadvantages of semantic network
representation
Advantages: – Semantic networks are a natural representation of
knowledge. – Also, it conveys meaning in a transparent manner. –
These networks are simple and easy to understand.
Disadvantages: – Semantic networks take more computational time
at runtime. – Also, these are inadequate as they do not have any
equivalent quantifiers. – These networks are not intelligent and
depend on the creator of the system.
PART B- UNIT-2
1. Explain Resolution in details?

2. Explain Unification Algorithm with example?

3. Convert the following into proportional logic:

1. Marcus was a man.

2. Marcus was a Pompeian.

3. All Pompeians were Romans.

4. Caesar was a ruler.

5. All Pompeians were either loyal to Caesar or hated him.

6. Every one is loyal to someone.

7. People only try to assassinate rulers they are not loyal to.

8. Marcus tried to assassinate Caesar.

4. What is ONTOLOGICAL ENGINEERING Explain CATEGORIES AND OBJECTS in


details?

5. Explain in detail about MENTAL EVENTS AND MENTAL OBJECTS?


SUPPORTIVE ONLINE COURSES – UNIT II

https://onlinecourses.nptel.ac.in/noc21_cs42/preview
An Introduction to Artificial Intelligence
By Prof. Mausam | IIT Delhi

https://www.coursera.org/learn/computational-thinking-problem-
solving

https://www.coursera.org/learn/artificial-intelligence-education-
for-teachers

https://www.coursera.org/specializations/ai-healthcare

https://www.coursera.org/learn/predictive-modeling-machine-
learning
https://www.drdobbs.com/parallel/the-practical-application-of-
prolog/184405220

74
VIDEO LINKS

https://onlinecourses.nptel.ac.in/noc21_cs42/preview
An Introduction to Artificial Intelligence
By Prof. Mausam | IIT Delhi

https://www.coursera.org/learn/computational-thinking-problem-
solving

https://www.coursera.org/learn/artificial-intelligence-education-
for-teachers

https://www.coursera.org/specializations/ai-healthcare

https://www.coursera.org/learn/predictive-modeling-machine-
learning
https://www.drdobbs.com/parallel/the-practical-application-of-
prolog/184405220

75
REAL TIME APPLICATION- UNIT II

Prolog is successful is as environmental systems that predict the weather,


analyze water supplies, and so on. The MM4 Weather Modeling System,
developed at Penn State University and the National Center for Atmospheric
Research in (Boulder Colo.), gives relatively detailed, short term forecast of
meteorological conditions if the continental United States. It is used
particularly to model pollutant dispersion (for instance, acid rain deposition).
The original program, which contained 16,000 lines of FORTRAN code, was
harnessed with Strand88, and 10-fold speedups have been obtained with 15
parallel processors.

Prolog expert systems has been developed at the U.K.'s University of


Surrey, and several are targeted for the water industry. One of these
systems WIESSE, which was built as part of the WIESC Alvey Project,
provides an expert system development environment. WIESSE has been
used to develop two expert systems: WADNES and SERPES. WADNES
provides support for emergences that can occur in a water distribution
system by using a model of the distribution network to suggest methods of
re-supplying water—informing appropriate bodies and managing remedial
resources. WADNES creates input data files for large commercial FORTRAN
simulation program, runs the simulation, and interprets the output through
intelligent processing. While these applications were developed as
demonstrator systems, they are generating considerable interest throughout
the U.K.'s private water companies.

76
CONTENT BEYOND SYLLABUS – UNIT I

1. BALLGAMES
Prolog is being used for fielded heavyweight applications, and benefits can
result from using the language. But Prolog is a far more interesting
language than, say, C++—and it is starting to finds its way into our homes.

The Fantasy Basketball system has been used for two years to produce the
weekly standings for the Bay Area Fantasy Basketball League of Palo Alto,
Calif. Fantasy (or Rotisserie) Basketball leagues are a growing hobby
among avid basketball fans, consisting of fictitious teams who are in the
NBA and featuring competitions between teams based on the game
statistics of their NBA players.

77
ASSESSMENT SCHEDULE

Tentative schedule for the Assessment During 2023-


2024 EVEN semester

Name of the
S.NO Start Date End Date Portion
Assessment

1 UNIT TEST 1 2.2.24 9.2.24 UNIT 1

2 IAT 1 12.2.24 17.2.24 UNIT 1 & 2

3 UNIT TEST 2 11.3.24 16.3.24 UNIT 3

4 IAT 2 1.4.24 6.4.24 UNIT 3 & 4

5 MODEL 20.4.24 30.4.24 ALL 5 UNITS

78
PRESCRIBED TEXT BOOKS AND REFERENCE BOOKS

1. Introduction to Artificial Intelligence and Machine Learning (IBM ICE


Publications).

2. Stuart Russell, Peter Norvig, “Artificial Intelligence: A Modern


Approach”, Third Edition, Pearson Education I Prentice Hall of India,
2010.

3. Elaine Rich and Kevin Knight, “Artificial Intelligence”, Third Edition,


Tata McGraw-Hill, 2010.

REFERENCES:

1. Patrick H. Winston. "Artificial Intelligence", Third edition, Pearson


Edition, 2006.

2. Dan W.Patterson, “Introduction to Artificial Intelligence and Expert


Systems”, PHI, 2006.

3. Nils J. Nilsson, “Artificial Intelligence: A new Synthesis”, Harcourt


Asia Pvt. Ltd., 2000.

79
Mini Projects
Very Easy: Propositional Logic Topic:
Create a program that evaluates the truth value
of a given propositional logic expression

Easy: First Order Logic Topic:


Implement a simple knowledge base system
using first-order logic to represent relationships
between objects.

Medium: Propositional Theorem Proving Topic:


Develop a program that performs propositional
theorem proving using resolution for a set of
given logical expressions.

Hard: Planning Topic:


Design a planning algorithm to generate a
sequence of actions for a robot to navigate
through a maze with various obstacles.

Very Hard: Knowledge Representation Topic:


Build a knowledge representation system for a
virtual world, such as an Internet Shopping
World, using ontological engineering and first-
order logic. Implement reasoning mechanisms
for handling complex scenarios involving
categories, objects, and events.
Thank you

Disclaimer:

This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document through
email in error, please notify the system manager. This document contains proprietary
information and is intended only to the respective group / learning community as
intended. If you are not the addressee you should not disseminate, distribute or
copy through e-mail. Please notify the sender immediately by e-mail if you have
received this document by mistake and delete this document from your system. If
you are not the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this information is
strictly prohibited.

81

You might also like