SlideShare una empresa de Scribd logo
1 de 103
1
International Islamic University Chittagong
January 22, 2024
Tashin Hossain
Department of Computer Science and Engineering
Lecture#7
Agents that Reason Logically
And Propositional Logic
Adjunct Lecturer
Course Information
2
Course Materials:
1. Stuart Russell, Peter Norvig: “Artificial Intelligence A
Modern Approach”, 3rd Edition.
2. Other specific materials and lecture slides
Course Information
3
Segment Contents
03
Game playing: Introduction, Perfect Decisions, Imperfect
Decisions, Alpha-Beta Pruning.
Constraints satisfaction problem: Travelling salesman problem,
graph coloring etc.
04
Propositional and First-Order logic: Knowledge
Representation, Reasoning and Logic; Propositional Logic:
Syntax, Semantics, Validity and Inference, Rules of Inference for
Propositional logic; First-Order Logic: Syntax and Semantics,
Using first-order logic.
Inference in first order logic: Inference Rules Involving
Quantifiers, Example Proof, Generalized Modus Ponens, Forward
and Backward Chaining, Completeness, Resolution.
Course Information
4
Segment Contents
05
Probabilistic Reasoning: Probability and Bayes’ Theorem,
Certainty Factors and Rule-Based Systems, Bayesian Networks,
Fuzzy Logic; Ds theory, ER
Some Expert Systems: Representation and Using Domain
Knowledge, Expert System Shells, Explanation, And Knowledge
Acquisition.
06
Learning: Introduction to Learning, Inductive Learning, Learning
Decision Trees, Neural Net Learning;
07
Natural language processing: Introduction, Syntactic
Processing, Semantic Analysis, Discourse and Pragmatic
Processing.
5
Agents that Reason
Logically
Knowledge and Reasoning
6
 From the previous lectures it has been shown that an agent that
has goals and searches for solutions to the goals can do better
than one that just reacts to its environment (simple reflex agent)
 We focused mainly on the question of how to carry out the search
(using different search strategies), leaving aside the question of
general methods for describing states and actions
Knowledge and Reasoning
7
 It is necessary to powering the agents with the capacity for general
logical reasoning
 A logical, knowledge-based agent begins with some knowledge of the
world and of its own actions
 It uses logical reasoning to maintain a description of the world as new
precepts arrive and to deduce a course of action that will achieve its goals
 In this lecture we introduce the basic design for a knowledge-
based agent, followed by a simple logical language for expressing
knowledge, and show how it can be used to draw conclusions
about the world and to decide what to do
A Knowledge Based Agent
8
 A knowledge-based agent consists of a knowledge base
(KB) and an inference engine (IE)
 A knowledge-base is a set of representations of what one
knows about the world (objects and classes of objects, the
fact about objects, relationships among objects, etc.)
 Each individual representation is called a sentence
 The sentences are expressed in a knowledge representation
language
A Knowledge Based Agent
9
 Examples of sentences
– The moon is made of green cheese  Fact
– If A is true then B is true  Rule
– A is false
– All humans are mortal
– Confucius is a human
 The Inference engine derives new sentences from the input
and KB
 The inference mechanism depends on representation in KB
A Knowledge Based Agent
10
The agent operates as follows:
1. It receives percepts from environment
2. It computes what action it should perform (by IE and KB)
3. It performs the chosen action (some actions are simply
inserting inferred new facts into KB).
Expert System
11
KB can be Viewed at Different Levels
12
 Knowledge Level
– The most abstract level
– describe agent by saying what it knows
– Example: A taxi agent might know that the Golden Gate Bridge
connects San Francisco with the Marin County
 Logical Level
– The level at which the knowledge is encoded into sentences
– Example: Links(GoldenGateBridge, SanFrancisco, Marin-County)
 Implementation Level
– The physical representation of the sentences in the logical level
– Example: “Links (GoldenGateBridge, SanFrancisco, MarinCounty)”
13
Propositional Logic
What is Proposition?
14
 A proposition is a statement that can be either true or
false; it must be one or the other, and it cannot be both
 The sun rises in the east
 Today is a very hot day
Knowledge and Intelligence
15
 Does knowledge has any role in demonstrating
intelligent behavior?
Logic is a Formal Language
16
 Propositional Logic
 Rahima is intelligent - proposition
 Rahima is hardworking – proposition
 If Rahima is intelligent and Rahima is hardworking
Then Rahima scores high marks -proposition
Elements of PL
17
 Rahima is intelligent => intelligent ( Rahima)
 Rahima is hardworking
Objects and Relations or functions
Elements
Towards the Syntax
18
 Intelligent (Rahima) == Rahima is intelligent
 Hardworking (Rahima) == Rahima is hardworking
Towards more syntax
19
o Let P stand for intelligent (Rahima) 
o Let Q stand for Hardworking (Rahima)  F
o What does P ˄ Q (P and Q) mean ? 
o What does P ˅ Q (P and Q) mean ? 
o P ˄ Q, P ˅ Q are compound propositions
Syntactic Elements of PL
20
o A set of propositional symbols (P, Q, R etc.)
o each of which can be True or False
o Set of logical operators :˄, ˅, Not, implies
o often parenthesis() is used for grouping
o There are two special symbols
o TRUE (T) and FALSE (F) – these are logical constants
How to form propositional sentence?
21
– Each symbol (a proposition or a constant) is a sentence
– If P is a sentence and Q is a sentence, Then
– (p) is a sentence
– P ˄ Q is a sentence
– P or Q is a sentence
– not P is a sentence
– P implies Q is a sentence
– Nothing else is a sentence
– Sentences are called world form formulae (wff)
Examples of WFFs
22
P , Q  True
– P and Q  True
– (P or Q) implies R  If the roads get wet, then it rains
– (P and Q) or R implies S
– Not (P or Q)
– Not (P or Q) implies R and S
Implication
23
 P implies Q P  Q
 If P is true then Q is true
 If it rains then the roads are wet
 Sufficient condition
 If the roads are wet then it rains ???
Equivalence
24
 P bidirectional Q
 Triangle
If two sides (A,B) of an triangle are equal (P), then
Opposite angles are equal (Q)
If opposite angles of a triangle are equal (Q), then two
sides of an triangle are equal (P)
What does a wff mean -Semantics
25
 Interpretation in a world
 When we interpret a sentence in a world we assign
meaning to it and it evaluates to either True or False
The Child can write
Nursery
Class 2
F
T
World
Semantics
Semantic of compound sentence
26
P: Likes ( Rahima, Sanjida)
Q: Knows (Tania, Farzana)
World: Rahima and Sanjida are friends and
Tania and Farzana known to each other
P= T, Q=T
P and Q =T
P and Not Q = F
Validity of a sentence
27
If a propositional sentence is true under all possible
interpretation, it is VALID
• Tautology
• Satisfiability
• Inconsistent
P v ¬ P = T
Question:
Validity of a sentence
28
• Tautology  Compound Proposition is always True
• Satisfiability  A compound sentence is satisfiable if there is at least
one true result in its Truth table
• Valid: A compound proposition is valid when it is a tautology
• Invalid: A compound proposition is invalid when it is either a
contradiction or contingency
Validity of a sentence
29
Inconsistency in propositional logic refers to a situation
where a set of propositions or statements leads to a
contradiction, meaning that it's impossible for all the
statements in the set to be simultaneously true
Let's consider a simple example:
Statement A: It is raining.
Statement B: It is not raining.
Quiz
30
Express the following English sentence in the
language of PL
– It rains in July  rains ( July)
– The book is not costly  not costly (book)
– If it rains today and one does not carry umbrella, then
he will be drenched
Rains(today) ^ not carry( umbrella)  drenched(he)
Quiz
31
If P is true and Q is true then are the followings true or
false
– P → Q
– (¬P∨Q) → Q
– (¬P^Q) → P
– P ∨ ¬P
32
Inference in PL
Objectives
33
• Infer the truth value of a proposition
• Reason towards new facts, given a set of propositions
• Prove a proposition given a set of propositional facts
Procedure to derive Truth Value
34
P Q P^Q PvQ
F F F F
F T F T
T F F T
T T T T
P v Q will be True when any of them is True
P ^ Q will be True when both of them are True
Procedure to derive Truth Value
35
P Q P  Q
F F T
F T T
T F F
T T T
If you won’t reach the station on time, then you won’t be able to catch
the train  T
If P is True, then Q is True, since P is a sufficient condition so that Q is
True
De Morgan’s Law
36
1. ¬ ( P ^ Q ) = ¬P v ¬ Q
2. ¬ ( P v Q ) = ¬P ^ ¬ Q
Prove the De morgan’s law using Truth
table
Reasoning
37
• P: It is the month of July
• Q: It rains
• R: P→Q
• If it is the month of July then it rains
• It is the month of July
• Conclude: It rains
Reasoning
38
P→Q
P
----------
Q ( it rains)
This type of reasoning is called deductive reasoning
Reasoning –Modus Ponens
39
• Modus Ponens is very much a valid inference
rule prove
P  Q ¬P v Q
Prove:
 (¬P v Q) ^ P
 (¬P v P) v Q
 T v Q
 Q
Valid inference rule
40
• Thus Irrespective of meaning modus ponens allow us to
infer the truth of Q
• Modus Ponens is a inference rule that allow us to
deduce the truth of a consequent depending on the truth
of an antecedents
Satisfiability
41
Satisfiability
42
Entailment
43
Entailment
44
Entailment
45
Set of Sentences,
S
S1
Interpretation
True
True
If the interpretation satisfies the sentence S1, that is True, then we can say
that S1 entails from S.
Entailment
46
47
Clauses: A Special Form
48
Converting a compound proposition to
the clausal form
49
Converting a compound proposition to
the clausal form
50
Converting a compound proposition to
the clausal form
51
Example: Consider the Sentence
¬ ( A  B) v (C  A)
1. Eliminate the Implication Sign
¬ (¬A v B) v (¬ C v A)
2. Eliminate the double negation and reduce scope of “not”
signs
(A ^ ¬ B) v (¬C v A)
3. Convert to conjunctive normal form by using distributive and
associative law
(A ^ ¬ B) v (¬C v A) => Distributive Law: A(B+C) = AB + AC
 ( A v ¬C v A) ^ (¬B v ¬C v A)
 ( A v ¬C) ^ (¬B v ¬C v A)
4. Get the set of clauses
 ( A v ¬C)
 (¬B v ¬C v A)
Resolution – A technique of inference
52
Resolution – A technique of inference
53
(X v S1) AND (¬X v S2)
X v S1 ¬X v S2
S1 v S2
An Example
54
Convert the Sentences into PL
55
Convert the Sentences into Clausal Form
56
Proof by Refutation
57
Procedure of Resolution
58
Quiz
59
60
First Order Logic
Objectives
61
Objectives
62
Limitations of PL
63
Limitations of PL
64
Limitations of PL
65
The Problem of Infinite Model
66
FOL/Predicate Logic
67
What added in FOL?
68
Terms
69
Terms: Constants and Variables
70
Terms: Functions
71
Functions: Example
72
Functions with Variable Arguments
73
Predicates
74
Types of Predicates
75
Formulation of Predicates
76
Predicate Examples
77
Quantifiers
78
Universal Quantifiers
79
Universal Quantifiers
80
Quiz Problem Revisited
81
Existential Quantifier
82
Duality of Quantifiers
83
Sentences
84
Exercise
85
86
Reasoning in FOL
Example of Sentences
87
Example of Sentences
88
Example of Sentences
89
Alternative Representation
90
FOL with Equality
91
Exercise Revisited
92
Exercise Revisited
93
Inference Rules
94
Inference Rules
95
Reasoning in FOL
96
Representation in FOL
97
Inferencing
98
Inferencing (contd.)
99
Horn Sentences
100
Horn Sentences
101
Horn Sentences
102
Continue…
Next Lecture
103

Más contenido relacionado

Similar a Knowledge base artificial intelligence.pdf

Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptxRavind8
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdfsmarwaneid
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDr. Khaled Bakro
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptNandiniSR2
 
Discrete_Mathmatics Projects report.docx
Discrete_Mathmatics Projects report.docxDiscrete_Mathmatics Projects report.docx
Discrete_Mathmatics Projects report.docxSwapnajitSahoo1
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSCSSN
 
Notes discrete math
Notes discrete mathNotes discrete math
Notes discrete mathliyana31
 
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...Ashish Duggal
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
Lecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematicsLecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematicssaiful26baiust
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 
chapter 1 (part 2)
chapter 1 (part 2)chapter 1 (part 2)
chapter 1 (part 2)Raechel Lim
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculusRajendran
 

Similar a Knowledge base artificial intelligence.pdf (20)

Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
 
Pnp
PnpPnp
Pnp
 
Discrete_Mathmatics Projects report.docx
Discrete_Mathmatics Projects report.docxDiscrete_Mathmatics Projects report.docx
Discrete_Mathmatics Projects report.docx
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision Making
 
Chapter1p1.pdf
Chapter1p1.pdfChapter1p1.pdf
Chapter1p1.pdf
 
Notes discrete math
Notes discrete mathNotes discrete math
Notes discrete math
 
Prpositional2
Prpositional2Prpositional2
Prpositional2
 
Lecture 01.ppt
Lecture 01.pptLecture 01.ppt
Lecture 01.ppt
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Lecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematicsLecture notes in_discrete_mathematics
Lecture notes in_discrete_mathematics
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
chapter 1 (part 2)
chapter 1 (part 2)chapter 1 (part 2)
chapter 1 (part 2)
 
DISMATH_Part1
DISMATH_Part1DISMATH_Part1
DISMATH_Part1
 
AI R16 - UNIT-3.pdf
AI R16 - UNIT-3.pdfAI R16 - UNIT-3.pdf
AI R16 - UNIT-3.pdf
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 

Último

Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...Nitin Sonavane
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Lovely Professional University
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxKarpagam Institute of Teechnology
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxMustafa Ahmed
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualBalamuruganV28
 
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...jiyav969
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfragupathi90
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.MdManikurRahman
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemSampad Kar
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsMathias Magdowski
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AISheetal Jain
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfMadan Karki
 
1893-part-1-2016 for Earthquake load design
1893-part-1-2016 for Earthquake load design1893-part-1-2016 for Earthquake load design
1893-part-1-2016 for Earthquake load designAshishSingh1301
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...IJECEIAES
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxCHAIRMAN M
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfEr.Sonali Nasikkar
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024EMMANUELLEFRANCEHELI
 

Último (20)

Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
Vip ℂall Girls Karkardooma Phone No 9999965857 High Profile ℂall Girl Delhi N...
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
1893-part-1-2016 for Earthquake load design
1893-part-1-2016 for Earthquake load design1893-part-1-2016 for Earthquake load design
1893-part-1-2016 for Earthquake load design
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 

Knowledge base artificial intelligence.pdf

  • 1. 1 International Islamic University Chittagong January 22, 2024 Tashin Hossain Department of Computer Science and Engineering Lecture#7 Agents that Reason Logically And Propositional Logic Adjunct Lecturer
  • 2. Course Information 2 Course Materials: 1. Stuart Russell, Peter Norvig: “Artificial Intelligence A Modern Approach”, 3rd Edition. 2. Other specific materials and lecture slides
  • 3. Course Information 3 Segment Contents 03 Game playing: Introduction, Perfect Decisions, Imperfect Decisions, Alpha-Beta Pruning. Constraints satisfaction problem: Travelling salesman problem, graph coloring etc. 04 Propositional and First-Order logic: Knowledge Representation, Reasoning and Logic; Propositional Logic: Syntax, Semantics, Validity and Inference, Rules of Inference for Propositional logic; First-Order Logic: Syntax and Semantics, Using first-order logic. Inference in first order logic: Inference Rules Involving Quantifiers, Example Proof, Generalized Modus Ponens, Forward and Backward Chaining, Completeness, Resolution.
  • 4. Course Information 4 Segment Contents 05 Probabilistic Reasoning: Probability and Bayes’ Theorem, Certainty Factors and Rule-Based Systems, Bayesian Networks, Fuzzy Logic; Ds theory, ER Some Expert Systems: Representation and Using Domain Knowledge, Expert System Shells, Explanation, And Knowledge Acquisition. 06 Learning: Introduction to Learning, Inductive Learning, Learning Decision Trees, Neural Net Learning; 07 Natural language processing: Introduction, Syntactic Processing, Semantic Analysis, Discourse and Pragmatic Processing.
  • 6. Knowledge and Reasoning 6  From the previous lectures it has been shown that an agent that has goals and searches for solutions to the goals can do better than one that just reacts to its environment (simple reflex agent)  We focused mainly on the question of how to carry out the search (using different search strategies), leaving aside the question of general methods for describing states and actions
  • 7. Knowledge and Reasoning 7  It is necessary to powering the agents with the capacity for general logical reasoning  A logical, knowledge-based agent begins with some knowledge of the world and of its own actions  It uses logical reasoning to maintain a description of the world as new precepts arrive and to deduce a course of action that will achieve its goals  In this lecture we introduce the basic design for a knowledge- based agent, followed by a simple logical language for expressing knowledge, and show how it can be used to draw conclusions about the world and to decide what to do
  • 8. A Knowledge Based Agent 8  A knowledge-based agent consists of a knowledge base (KB) and an inference engine (IE)  A knowledge-base is a set of representations of what one knows about the world (objects and classes of objects, the fact about objects, relationships among objects, etc.)  Each individual representation is called a sentence  The sentences are expressed in a knowledge representation language
  • 9. A Knowledge Based Agent 9  Examples of sentences – The moon is made of green cheese  Fact – If A is true then B is true  Rule – A is false – All humans are mortal – Confucius is a human  The Inference engine derives new sentences from the input and KB  The inference mechanism depends on representation in KB
  • 10. A Knowledge Based Agent 10 The agent operates as follows: 1. It receives percepts from environment 2. It computes what action it should perform (by IE and KB) 3. It performs the chosen action (some actions are simply inserting inferred new facts into KB).
  • 12. KB can be Viewed at Different Levels 12  Knowledge Level – The most abstract level – describe agent by saying what it knows – Example: A taxi agent might know that the Golden Gate Bridge connects San Francisco with the Marin County  Logical Level – The level at which the knowledge is encoded into sentences – Example: Links(GoldenGateBridge, SanFrancisco, Marin-County)  Implementation Level – The physical representation of the sentences in the logical level – Example: “Links (GoldenGateBridge, SanFrancisco, MarinCounty)”
  • 14. What is Proposition? 14  A proposition is a statement that can be either true or false; it must be one or the other, and it cannot be both  The sun rises in the east  Today is a very hot day
  • 15. Knowledge and Intelligence 15  Does knowledge has any role in demonstrating intelligent behavior?
  • 16. Logic is a Formal Language 16  Propositional Logic  Rahima is intelligent - proposition  Rahima is hardworking – proposition  If Rahima is intelligent and Rahima is hardworking Then Rahima scores high marks -proposition
  • 17. Elements of PL 17  Rahima is intelligent => intelligent ( Rahima)  Rahima is hardworking Objects and Relations or functions Elements
  • 18. Towards the Syntax 18  Intelligent (Rahima) == Rahima is intelligent  Hardworking (Rahima) == Rahima is hardworking
  • 19. Towards more syntax 19 o Let P stand for intelligent (Rahima)  o Let Q stand for Hardworking (Rahima)  F o What does P ˄ Q (P and Q) mean ?  o What does P ˅ Q (P and Q) mean ?  o P ˄ Q, P ˅ Q are compound propositions
  • 20. Syntactic Elements of PL 20 o A set of propositional symbols (P, Q, R etc.) o each of which can be True or False o Set of logical operators :˄, ˅, Not, implies o often parenthesis() is used for grouping o There are two special symbols o TRUE (T) and FALSE (F) – these are logical constants
  • 21. How to form propositional sentence? 21 – Each symbol (a proposition or a constant) is a sentence – If P is a sentence and Q is a sentence, Then – (p) is a sentence – P ˄ Q is a sentence – P or Q is a sentence – not P is a sentence – P implies Q is a sentence – Nothing else is a sentence – Sentences are called world form formulae (wff)
  • 22. Examples of WFFs 22 P , Q  True – P and Q  True – (P or Q) implies R  If the roads get wet, then it rains – (P and Q) or R implies S – Not (P or Q) – Not (P or Q) implies R and S
  • 23. Implication 23  P implies Q P  Q  If P is true then Q is true  If it rains then the roads are wet  Sufficient condition  If the roads are wet then it rains ???
  • 24. Equivalence 24  P bidirectional Q  Triangle If two sides (A,B) of an triangle are equal (P), then Opposite angles are equal (Q) If opposite angles of a triangle are equal (Q), then two sides of an triangle are equal (P)
  • 25. What does a wff mean -Semantics 25  Interpretation in a world  When we interpret a sentence in a world we assign meaning to it and it evaluates to either True or False The Child can write Nursery Class 2 F T World Semantics
  • 26. Semantic of compound sentence 26 P: Likes ( Rahima, Sanjida) Q: Knows (Tania, Farzana) World: Rahima and Sanjida are friends and Tania and Farzana known to each other P= T, Q=T P and Q =T P and Not Q = F
  • 27. Validity of a sentence 27 If a propositional sentence is true under all possible interpretation, it is VALID • Tautology • Satisfiability • Inconsistent P v ¬ P = T Question:
  • 28. Validity of a sentence 28 • Tautology  Compound Proposition is always True • Satisfiability  A compound sentence is satisfiable if there is at least one true result in its Truth table • Valid: A compound proposition is valid when it is a tautology • Invalid: A compound proposition is invalid when it is either a contradiction or contingency
  • 29. Validity of a sentence 29 Inconsistency in propositional logic refers to a situation where a set of propositions or statements leads to a contradiction, meaning that it's impossible for all the statements in the set to be simultaneously true Let's consider a simple example: Statement A: It is raining. Statement B: It is not raining.
  • 30. Quiz 30 Express the following English sentence in the language of PL – It rains in July  rains ( July) – The book is not costly  not costly (book) – If it rains today and one does not carry umbrella, then he will be drenched Rains(today) ^ not carry( umbrella)  drenched(he)
  • 31. Quiz 31 If P is true and Q is true then are the followings true or false – P → Q – (¬P∨Q) → Q – (¬P^Q) → P – P ∨ ¬P
  • 33. Objectives 33 • Infer the truth value of a proposition • Reason towards new facts, given a set of propositions • Prove a proposition given a set of propositional facts
  • 34. Procedure to derive Truth Value 34 P Q P^Q PvQ F F F F F T F T T F F T T T T T P v Q will be True when any of them is True P ^ Q will be True when both of them are True
  • 35. Procedure to derive Truth Value 35 P Q P  Q F F T F T T T F F T T T If you won’t reach the station on time, then you won’t be able to catch the train  T If P is True, then Q is True, since P is a sufficient condition so that Q is True
  • 36. De Morgan’s Law 36 1. ¬ ( P ^ Q ) = ¬P v ¬ Q 2. ¬ ( P v Q ) = ¬P ^ ¬ Q Prove the De morgan’s law using Truth table
  • 37. Reasoning 37 • P: It is the month of July • Q: It rains • R: P→Q • If it is the month of July then it rains • It is the month of July • Conclude: It rains
  • 38. Reasoning 38 P→Q P ---------- Q ( it rains) This type of reasoning is called deductive reasoning
  • 39. Reasoning –Modus Ponens 39 • Modus Ponens is very much a valid inference rule prove P  Q ¬P v Q Prove:  (¬P v Q) ^ P  (¬P v P) v Q  T v Q  Q
  • 40. Valid inference rule 40 • Thus Irrespective of meaning modus ponens allow us to infer the truth of Q • Modus Ponens is a inference rule that allow us to deduce the truth of a consequent depending on the truth of an antecedents
  • 45. Entailment 45 Set of Sentences, S S1 Interpretation True True If the interpretation satisfies the sentence S1, that is True, then we can say that S1 entails from S.
  • 47. 47
  • 49. Converting a compound proposition to the clausal form 49
  • 50. Converting a compound proposition to the clausal form 50
  • 51. Converting a compound proposition to the clausal form 51 Example: Consider the Sentence ¬ ( A  B) v (C  A) 1. Eliminate the Implication Sign ¬ (¬A v B) v (¬ C v A) 2. Eliminate the double negation and reduce scope of “not” signs (A ^ ¬ B) v (¬C v A) 3. Convert to conjunctive normal form by using distributive and associative law (A ^ ¬ B) v (¬C v A) => Distributive Law: A(B+C) = AB + AC  ( A v ¬C v A) ^ (¬B v ¬C v A)  ( A v ¬C) ^ (¬B v ¬C v A) 4. Get the set of clauses  ( A v ¬C)  (¬B v ¬C v A)
  • 52. Resolution – A technique of inference 52
  • 53. Resolution – A technique of inference 53 (X v S1) AND (¬X v S2) X v S1 ¬X v S2 S1 v S2
  • 55. Convert the Sentences into PL 55
  • 56. Convert the Sentences into Clausal Form 56
  • 66. The Problem of Infinite Model 66
  • 68. What added in FOL? 68
  • 70. Terms: Constants and Variables 70
  • 73. Functions with Variable Arguments 73