SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Knowledge
Representation,
Inference and
Reasoning
By - Er. Suraj Awal
Knowledge
- Knowledge is the individual’s understanding of a given subject that can be used to
solve the problems of a particular domain
- It is the part of the information that is extracted, analyzed and represented in a very
special way
- Knowledge representation is the process of expressing knowledge about the world in
a computer tractable form.
- A formal language which consists of formal symbols are used for knowledge
representation
Knowledge
- Fact is the truth about the real world
- The collection of facts from a domain provides the knowledge of that domain
- These facts should be represented and it can be done at two levels:
a) Knowledge level (Facts are described)
b) Symbol level (Mathematical representation of knowledge)
Types of Knowledge
1. Procedural Knowledge - Information that is processed
2. Declarative Knowledge - Information in the form of fact statements
3. Heuristic Knowledge - Informations used to make judgements
Logic
- Formal language that is used to express knowledge and ways of reasoning about the
world that is either true or false but not both at the same time.
- It is defined by:
1. Syntax (possible configuration that constitute sentences)
2. Semantic (interpretation of sentence about the world)
3. Proof theory (set of rules to inference new knowledge from the old one)
Propositional Logic
- Propositional logic is the logic that express knowledge at the
sentential level.
- Proposition is the declarative statement which can either be true or
false but not both at the same time.
- Provides mathematical model to reason about the logical expression
as true or false
- Atomic propositions are the statements constructed from constants
and propositional symbols
- Composite propositions are the statements constructed using valid
atomic propositions connected via connectives
Propositional Logic (Connectives)
1. AND
2. OR
3. NOT
4. Implies or If
.Then
5. Mutual Implication
Propositional Logic (Truth Table)
1. AND
P Q P and Q
F F F
F T F
T F F
T T T
Propositional Logic (Truth Table)
2. OR
P Q P or Q
F F F
F T T
T F T
T T T
Propositional Logic (Truth Table)
3. NOT
P Not P
F T
T F
Propositional Logic (Truth Table)
4. Implication
P Q P implies Q
F F T
F T T
T F F
T T T
Propositional Logic (Truth Table)
5. Mutual Implication
P Q P mutually implies Q
F F T
F T F
T F F
T T T
Propositional Logic (Well Defined Formula)
- A proposition is known as a well defined formula if:
1. A symbol is a sentence
2. If s is a sentence, then not s is a sentence
3. If s is a sentence, then (s) is a sentence
4. If s and T are sentences, then (s not T), (s or T), (s and T) and (s ⇔
T) are sentences
Tautology, Contradiction and Satisfiable
- Tautology is the notation in formal language which is always true
- Contradiction is the notation in formal language which is always
false
- If at least one sentence in the set is true, then it is satisfiable
Logical Equivalence
- If two propositions P and Q have same truth values in every possible
case, the propositions are called logically equivalent.
- If p, q and r are statements, then:
1. ˄ ( ˄ p ) Ξ p : Double Negation Rule
2. Ë„(p˅q) Ξ (Ë„p)^(Ë„q) : De-Morgan’s Law
3. Ë„(p^q) Ξ (Ë„p)˅(Ë„q) : De-Morgan’s Law
4. P^(q˅r) Ξ (p^q)˅(p^r) : distribution law
5. P˅(q^r) Ξ (p˅q)^(p˅r) : distribution law
Predicate Logic
- Predicate logic allows flexible knowledge representation
- In terms of objects, properties, relations and functions
- The symbols denote properties of an object or relation between
objects
- First Order Predicate Logic (FOPL) makes use of quantified variables
over objects.
Quantifiers
1. Universal Instantiation
∀ x : p(x) implies p(c) for all c
1. Universal Generalization
p(c) for all c implies ∀ x : p(x)
1. Existential Instantiation
∃ x : p(x) implies p(c) for some c
1. Existential Generalization
p(c) for some c implies ∃ x : p(x)
Skolemization Process
- It is a substitution process that eliminates existential quantifiers by
replacing them with some SKOLEM functions
- All the quantifiers should first be moved to the left side in proper
order
Skolemization Process (Algorithm)
1. If the leftmost quantifier in an expression is an existential quantifier,
we replace all occurrences of the variable it quantifies with an
arbitrary constant not appearing elsewhere in the expression and
delete the quantifier.
2. For each existential quantifier which is preceded by one or more
universal quantifiers, we replace all occurrences of the existentially
quantified variable by a function not appearing elsewhere in the
expression. The arguments of such function should match all the
variables appearing in each universal quantifier which preceed the
existential quantifier.
Skolemization Process (Example)
∃ x ∃ y ∀ u ∀ v ∃ z ∀ w ∃ s : P (x, y, v, z, w) ^ Q (s, u, x, z)
Solution,
∀ u ∀ v ∀ w : P (a, b, v, f(u, v), w) ^ Q (g(u, v, w), u, a, f(u, v))
Conjunctive Normal Form (CNF)
1. Eliminate => by using : (a => b) Ξ Ë„a ˅ b
2. Reduce scope of Ë„ to a single term using:
- ˄(˄a) Ξ a
- Ë„(a^b) Ξ Ë„a ˅ Ë„b
- ˄(a v b) Ξ ˄a ^ ˄b
- Ë„ ∀ x : p(x) Ξ ∃ x : Ë„p(x)
- Ë„ ∃ x : p(x) Ξ ∀ x : Ë„p(x)
1. Standardize variables so that each quantifiers binds a unique variable
- ∀ x : (p(x) v q(x)) Ξ ( ∀ x : p(x) v ∀ x : q(x) )
Conjunctive Normal Form (CNF)
4. Move all quantifiers to left without changing the relative order
5. Eliminate existential quantifiers by substituting a variable that produces
a desired value using skolemization process
6. Drop the prefix
7. Convert matrix into conjunction of disjoints:
(a^b)˅c Ξ (a˅c) ^ (b^c)
8. Create separate clause corresponding to each conjunct
9. Standardize apart the variables in the set of clauses
Horn Clause
- Horn clause is a clause with at most one positive literal
- A horn clause with exactly one positive literal is called definite
clause
- A horn clause with no positive literal is called goal clause
- A horn formula is a CNF whose all clauses are are horn clauses.
- Example : Ë„a v Ë„b v Ë„c v Ë„d v Ë„e v Ë„f v g
- It can be represented as : ( a ^ b ^ c ^ d ^ e ^ f ) ⇒ g
- Such representation are common in logic programming
Resolution Refutation Process
- Resolution is the process of that produces proof by refutation which
involves operating on the statements that have been converted to the
clause form.
- It proves a statement by attempting to show that the negation of a
statement produces a contradiction with the known statement.
Resolution Refutation Process (Algorithm)
1. Represent the facts using First Order Predicate Logic (FOPL)
2. Convert the predicates into clause form (Conjunctive Normal Form)
3. Repeat:
a) Select two clauses
b) Resolve them together
c) If resolvent is empty, contradiction occurs. Else, add it to set of
clauses.
Resolution Refutation Process (Example)
If X is on top of Y, Y supports X. If X is above Y and they are touching
each other, X is on top of Y. A cup is above a book. A cup is touching a
book. Show that supports(book, cup) is true.
Using Resolution Refutation process, prove the above knowledge
inference.
Resolution Refutation Process (Example)
Representation in FOPL:
1. ∀ x : ∀ y : top_of(X, Y) → supports(Y, X)
2. ∀ x : ∀ y : above(X, Y) ^ touch(X, Y) → top_of(X, Y)
3. above(cup, book)
4. touch(cup,book)
To prove : supports(book, cup)
Resolution Refutation Process (Example)
Conversion to Clause Form (CNF) :
1. Ë„ top_of(X1 , Y1) v supports(Y1 , X1)
2. Ë„ above(X2 , Y2) v Ë„ touch(X2 , Y2) v top_of(X2 , Y2)
3. above(cup, book)
4. touch(cup, book)
To prove : supports(book, cup)
Resolution Refutation Process (Example)
Resolution Refutation :
Assume, Ë„ supports(book, cup) is True.
Now,
Using assumption and clause form (1), putting book/Y1 and cup/X1 , we
get:
Ë„ top_of(cup, book) --------- (5)
Resolution Refutation Process (Example)
Using clause form (2) and knowledge (5), putting book/Y2 and cup/X2 ,
we get:
Ë„ above(cup, book) v Ë„ touch(cup, book) -------- (6)
Using knowledges (6) and (3), we get:
Ë„ touch(cup, book) --------- (7)
Resolution Refutation Process (Example)
Using knowledges (7) and (4), we get:
< Null >
Since contradiction occurs, our assumption is false.
Hence, supports(book, cup) is true.
Rule Based System
- Automatic problem solving tool that combines human expertise and
decision making
- Expressed as antecedent-consequent rules
- Solve problems by selecting relevant rules and combining the results
- Determine the best sequence of rules
- Modus Ponen : [ p ^ ( p → q ) ] → q
Forward Chaining
- Inference using repeated application of modus ponens
- Starts with available data
- Uses inference rules until a goal is reached
- Searches the rules until it finds one in which antecedent is true, then
concludes the consequent and adds new information to its data.
Backward Chaining
- Inference using repeated application of modus ponens
- Starts from the goals
- Uses inference rules until data is obtained
- Implements depth first search strategy
- Searches the rules until it finds one in which consequent is true, then
concludes the antecedent and adds new information to its data.
Rule Based System (Example)
Consider the rule base as:
1. If X croaks and eats flies, X is a frog.
2. If X chirps and sings, X is a Canary.
3. If X is a frog, then X is green.
4. If X is a Canary, then X is yellow.
Conclude color of Fritz, given he croaks and eats flies.
Rule Based System (Example)
Forward Chaining:
Fritz croaks and eats flies (Data)
Fritz is a frog
Fritz is green (Goal)
Rule Based System (Example)
Backward Chaining:
Color of Fritz (Goal)
Fritz is green
Fritz is yellow
Fritz is frog
Fritz is Canary
Entailment
- Relationship between current knowledge and new knowledge
inferred from current knowledge.
- Reflects that one fact follows from the others.
- Knowledge Base (KB) entails a sentence if and only if : the sentence
is true in all the world where KB is true.
Entailment (Example)
Consider Knowledge Base (KB) as:
A v B
Ë„ C v A
Consider a new sentence, S : A v B v C
Show that KB |- S ( KB entails S)
Entailment (Example)
A B C KB S
F F F F F
F F T F T
F T F T T
F T T F T
T F F T T
T F T T T
T T F T T
T T T T T
Entailment (Example)
From the truth table, whenever KB is true, S is also true. So, we can
say that KB entails S i.e. KB |- S.
Probability and Bayes Theorem
- Statistical theory of evidence, based on conditional probability
- Bayes theorem states that:
P(Hi | E) = P(E | Hi) * P(Hi)
ÎŁ(n=1 to k) P(E | Hn) * P(Hn)
Where,
P(Hi | E) = Prob. that Hi is true given evidence E
P(E | Hi) = Prob. that evidence E is observed given Hi is true
P(Hi) = Prob. that Hi is true in absence of evidence
K = number of hypotheses
Causal Network / Bayesian Network / Belief
Network
- Probabilistic graphical model that represents a set of random
variables and their conditional dependencies.
- Uses directed acyclic graph.
- Nodes represent the random variables
- Edges represent conditional dependencies
Causal Network / Bayesian Network / Belief
Network (Example)
Consider two events cause grass to be wet, either sprinkler is on or its
raining. Also, suppose when it rains, sprinkler is usually not turned on.
The conditional probability tables can be given as:
Sprinkler
Rain T F
F 0.4 0.6
T 0.01 0.99
Rain
T F
0.2 0.8
Grass Wet
Sprinkler Rain T F
F F 0.0 1.0
F T 0.8 0.2
T F 0.9 0.1
T T 0.99 0.01
Causal Network / Bayesian Network / Belief
Network (Example)
The situation can be modelled using Bayesian or Causal or Belief
network as shown in below graph:
Sprinkler Rain
Grass wet
Causal Network / Bayesian Network / Belief
Network (Example)
Q. Calculate the probability that it is raining, given the grass is wet?
P(R=T | G=T) = ÎŁ(S = {T, F})P(G=T, S, R=T) = 35.77%
(0.3577)
ÎŁ(S,R = {T, F})P(G=T, S, R)
Use the formula : P(G, S, R) = P(G|S, R) * P(S|R) * P(R)
The End !!!

Weitere Àhnliche Inhalte

Was ist angesagt?

Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
Vishal Singh
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
Rushdi Shams
 
Frames
FramesFrames
Frames
amitp26
 
First order logic
First order logicFirst order logic
First order logic
Rushdi Shams
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
Sajid Marwat
 

Was ist angesagt? (20)

Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligence
 
Reasoning in AI
Reasoning in AIReasoning in AI
Reasoning in AI
 
First order logic
First order logicFirst order logic
First order logic
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Frames
FramesFrames
Frames
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
 
Knnowledge representation and logic lec 11 to lec 15
Knnowledge representation and logic lec 11 to lec 15Knnowledge representation and logic lec 11 to lec 15
Knnowledge representation and logic lec 11 to lec 15
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Ch 6 final
Ch 6 finalCh 6 final
Ch 6 final
 
First order logic
First order logicFirst order logic
First order logic
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
AI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdfAI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdf
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Analytical learning
Analytical learningAnalytical learning
Analytical learning
 
Resolution method in AI.pptx
Resolution method in AI.pptxResolution method in AI.pptx
Resolution method in AI.pptx
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 

Ähnlich wie Knowledge Representation, Inference and Reasoning

Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logic
pendragon6626
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
PalGov
 
Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inference
asimnawaz54
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
Tianlu Wang
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
asimnawaz54
 

Ähnlich wie Knowledge Representation, Inference and Reasoning (20)

1. Logic and Proofs.ppt
1. Logic and Proofs.ppt1. Logic and Proofs.ppt
1. Logic and Proofs.ppt
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdf
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logic
 
AI R16 - UNIT-3.pdf
AI R16 - UNIT-3.pdfAI R16 - UNIT-3.pdf
AI R16 - UNIT-3.pdf
 
chapter9.ppt
chapter9.pptchapter9.ppt
chapter9.ppt
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
 
Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inference
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
 
The axiomatic power of Kolmogorov complexity
The axiomatic power of Kolmogorov complexity The axiomatic power of Kolmogorov complexity
The axiomatic power of Kolmogorov complexity
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
PROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In PrologPROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In Prolog
 
PROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In PrologPROLOG: Matching And Proof Search In Prolog
PROLOG: Matching And Proof Search In Prolog
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 

Mehr von Sagacious IT Solution

Mehr von Sagacious IT Solution (16)

List - Operations and Implementation
List - Operations and ImplementationList - Operations and Implementation
List - Operations and Implementation
 
Stack - Operations and Applications
Stack - Operations and ApplicationsStack - Operations and Applications
Stack - Operations and Applications
 
Introduction to Data Structure and Algorithm
Introduction to Data Structure and AlgorithmIntroduction to Data Structure and Algorithm
Introduction to Data Structure and Algorithm
 
Queue - Operations and Implementations
Queue - Operations and ImplementationsQueue - Operations and Implementations
Queue - Operations and Implementations
 
Neural Networks
Neural NetworksNeural Networks
Neural Networks
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning Algorithms
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Expert System
Expert SystemExpert System
Expert System
 
Game Playing Search Techniques - Examples
Game Playing Search Techniques - ExamplesGame Playing Search Techniques - Examples
Game Playing Search Techniques - Examples
 
Uninformed Search Examples
Uninformed Search ExamplesUninformed Search Examples
Uninformed Search Examples
 
Examples of Informed Search
Examples of Informed SearchExamples of Informed Search
Examples of Informed Search
 
Searching Algorithm
Searching AlgorithmSearching Algorithm
Searching Algorithm
 
Structured Knowledge Representation
Structured Knowledge RepresentationStructured Knowledge Representation
Structured Knowledge Representation
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Crypto Arithmetic Problem - Example
Crypto Arithmetic Problem - ExampleCrypto Arithmetic Problem - Example
Crypto Arithmetic Problem - Example
 
Introduction To Artificial Intelligence
Introduction To Artificial IntelligenceIntroduction To Artificial Intelligence
Introduction To Artificial Intelligence
 

KĂŒrzlich hochgeladen

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar â‰ŒđŸ” Delhi door step de...
Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar  â‰ŒđŸ” Delhi door step de...Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar  â‰ŒđŸ” Delhi door step de...
Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar â‰ŒđŸ” Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 

KĂŒrzlich hochgeladen (20)

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar â‰ŒđŸ” Delhi door step de...
Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar  â‰ŒđŸ” Delhi door step de...Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar  â‰ŒđŸ” Delhi door step de...
Call Now ≜ 9953056974 â‰ŒđŸ” Call Girls In New Ashok Nagar â‰ŒđŸ” Delhi door step de...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 

Knowledge Representation, Inference and Reasoning

  • 2. Knowledge - Knowledge is the individual’s understanding of a given subject that can be used to solve the problems of a particular domain - It is the part of the information that is extracted, analyzed and represented in a very special way - Knowledge representation is the process of expressing knowledge about the world in a computer tractable form. - A formal language which consists of formal symbols are used for knowledge representation
  • 3. Knowledge - Fact is the truth about the real world - The collection of facts from a domain provides the knowledge of that domain - These facts should be represented and it can be done at two levels: a) Knowledge level (Facts are described) b) Symbol level (Mathematical representation of knowledge)
  • 4. Types of Knowledge 1. Procedural Knowledge - Information that is processed 2. Declarative Knowledge - Information in the form of fact statements 3. Heuristic Knowledge - Informations used to make judgements
  • 5. Logic - Formal language that is used to express knowledge and ways of reasoning about the world that is either true or false but not both at the same time. - It is defined by: 1. Syntax (possible configuration that constitute sentences) 2. Semantic (interpretation of sentence about the world) 3. Proof theory (set of rules to inference new knowledge from the old one)
  • 6. Propositional Logic - Propositional logic is the logic that express knowledge at the sentential level. - Proposition is the declarative statement which can either be true or false but not both at the same time. - Provides mathematical model to reason about the logical expression as true or false - Atomic propositions are the statements constructed from constants and propositional symbols - Composite propositions are the statements constructed using valid atomic propositions connected via connectives
  • 7. Propositional Logic (Connectives) 1. AND 2. OR 3. NOT 4. Implies or If
.Then 5. Mutual Implication
  • 8. Propositional Logic (Truth Table) 1. AND P Q P and Q F F F F T F T F F T T T
  • 9. Propositional Logic (Truth Table) 2. OR P Q P or Q F F F F T T T F T T T T
  • 10. Propositional Logic (Truth Table) 3. NOT P Not P F T T F
  • 11. Propositional Logic (Truth Table) 4. Implication P Q P implies Q F F T F T T T F F T T T
  • 12. Propositional Logic (Truth Table) 5. Mutual Implication P Q P mutually implies Q F F T F T F T F F T T T
  • 13. Propositional Logic (Well Defined Formula) - A proposition is known as a well defined formula if: 1. A symbol is a sentence 2. If s is a sentence, then not s is a sentence 3. If s is a sentence, then (s) is a sentence 4. If s and T are sentences, then (s not T), (s or T), (s and T) and (s ⇔ T) are sentences
  • 14. Tautology, Contradiction and Satisfiable - Tautology is the notation in formal language which is always true - Contradiction is the notation in formal language which is always false - If at least one sentence in the set is true, then it is satisfiable
  • 15. Logical Equivalence - If two propositions P and Q have same truth values in every possible case, the propositions are called logically equivalent. - If p, q and r are statements, then: 1. Ë„ ( Ë„ p ) Ξ p : Double Negation Rule 2. Ë„(p˅q) Ξ (Ë„p)^(Ë„q) : De-Morgan’s Law 3. Ë„(p^q) Ξ (Ë„p)˅(Ë„q) : De-Morgan’s Law 4. P^(q˅r) Ξ (p^q)˅(p^r) : distribution law 5. P˅(q^r) Ξ (p˅q)^(p˅r) : distribution law
  • 16. Predicate Logic - Predicate logic allows flexible knowledge representation - In terms of objects, properties, relations and functions - The symbols denote properties of an object or relation between objects - First Order Predicate Logic (FOPL) makes use of quantified variables over objects.
  • 17. Quantifiers 1. Universal Instantiation ∀ x : p(x) implies p(c) for all c 1. Universal Generalization p(c) for all c implies ∀ x : p(x) 1. Existential Instantiation ∃ x : p(x) implies p(c) for some c 1. Existential Generalization p(c) for some c implies ∃ x : p(x)
  • 18. Skolemization Process - It is a substitution process that eliminates existential quantifiers by replacing them with some SKOLEM functions - All the quantifiers should first be moved to the left side in proper order
  • 19. Skolemization Process (Algorithm) 1. If the leftmost quantifier in an expression is an existential quantifier, we replace all occurrences of the variable it quantifies with an arbitrary constant not appearing elsewhere in the expression and delete the quantifier. 2. For each existential quantifier which is preceded by one or more universal quantifiers, we replace all occurrences of the existentially quantified variable by a function not appearing elsewhere in the expression. The arguments of such function should match all the variables appearing in each universal quantifier which preceed the existential quantifier.
  • 20. Skolemization Process (Example) ∃ x ∃ y ∀ u ∀ v ∃ z ∀ w ∃ s : P (x, y, v, z, w) ^ Q (s, u, x, z) Solution, ∀ u ∀ v ∀ w : P (a, b, v, f(u, v), w) ^ Q (g(u, v, w), u, a, f(u, v))
  • 21. Conjunctive Normal Form (CNF) 1. Eliminate => by using : (a => b) Ξ Ë„a ˅ b 2. Reduce scope of Ë„ to a single term using: - Ë„(Ë„a) Ξ a - Ë„(a^b) Ξ Ë„a ˅ Ë„b - Ë„(a v b) Ξ Ë„a ^ Ë„b - Ë„ ∀ x : p(x) Ξ ∃ x : Ë„p(x) - Ë„ ∃ x : p(x) Ξ ∀ x : Ë„p(x) 1. Standardize variables so that each quantifiers binds a unique variable - ∀ x : (p(x) v q(x)) Ξ ( ∀ x : p(x) v ∀ x : q(x) )
  • 22. Conjunctive Normal Form (CNF) 4. Move all quantifiers to left without changing the relative order 5. Eliminate existential quantifiers by substituting a variable that produces a desired value using skolemization process 6. Drop the prefix 7. Convert matrix into conjunction of disjoints: (a^b)˅c Ξ (a˅c) ^ (b^c) 8. Create separate clause corresponding to each conjunct 9. Standardize apart the variables in the set of clauses
  • 23. Horn Clause - Horn clause is a clause with at most one positive literal - A horn clause with exactly one positive literal is called definite clause - A horn clause with no positive literal is called goal clause - A horn formula is a CNF whose all clauses are are horn clauses. - Example : Ë„a v Ë„b v Ë„c v Ë„d v Ë„e v Ë„f v g - It can be represented as : ( a ^ b ^ c ^ d ^ e ^ f ) ⇒ g - Such representation are common in logic programming
  • 24. Resolution Refutation Process - Resolution is the process of that produces proof by refutation which involves operating on the statements that have been converted to the clause form. - It proves a statement by attempting to show that the negation of a statement produces a contradiction with the known statement.
  • 25. Resolution Refutation Process (Algorithm) 1. Represent the facts using First Order Predicate Logic (FOPL) 2. Convert the predicates into clause form (Conjunctive Normal Form) 3. Repeat: a) Select two clauses b) Resolve them together c) If resolvent is empty, contradiction occurs. Else, add it to set of clauses.
  • 26. Resolution Refutation Process (Example) If X is on top of Y, Y supports X. If X is above Y and they are touching each other, X is on top of Y. A cup is above a book. A cup is touching a book. Show that supports(book, cup) is true. Using Resolution Refutation process, prove the above knowledge inference.
  • 27. Resolution Refutation Process (Example) Representation in FOPL: 1. ∀ x : ∀ y : top_of(X, Y) → supports(Y, X) 2. ∀ x : ∀ y : above(X, Y) ^ touch(X, Y) → top_of(X, Y) 3. above(cup, book) 4. touch(cup,book) To prove : supports(book, cup)
  • 28. Resolution Refutation Process (Example) Conversion to Clause Form (CNF) : 1. Ë„ top_of(X1 , Y1) v supports(Y1 , X1) 2. Ë„ above(X2 , Y2) v Ë„ touch(X2 , Y2) v top_of(X2 , Y2) 3. above(cup, book) 4. touch(cup, book) To prove : supports(book, cup)
  • 29. Resolution Refutation Process (Example) Resolution Refutation : Assume, Ë„ supports(book, cup) is True. Now, Using assumption and clause form (1), putting book/Y1 and cup/X1 , we get: Ë„ top_of(cup, book) --------- (5)
  • 30. Resolution Refutation Process (Example) Using clause form (2) and knowledge (5), putting book/Y2 and cup/X2 , we get: Ë„ above(cup, book) v Ë„ touch(cup, book) -------- (6) Using knowledges (6) and (3), we get: Ë„ touch(cup, book) --------- (7)
  • 31. Resolution Refutation Process (Example) Using knowledges (7) and (4), we get: < Null > Since contradiction occurs, our assumption is false. Hence, supports(book, cup) is true.
  • 32. Rule Based System - Automatic problem solving tool that combines human expertise and decision making - Expressed as antecedent-consequent rules - Solve problems by selecting relevant rules and combining the results - Determine the best sequence of rules - Modus Ponen : [ p ^ ( p → q ) ] → q
  • 33. Forward Chaining - Inference using repeated application of modus ponens - Starts with available data - Uses inference rules until a goal is reached - Searches the rules until it finds one in which antecedent is true, then concludes the consequent and adds new information to its data.
  • 34. Backward Chaining - Inference using repeated application of modus ponens - Starts from the goals - Uses inference rules until data is obtained - Implements depth first search strategy - Searches the rules until it finds one in which consequent is true, then concludes the antecedent and adds new information to its data.
  • 35. Rule Based System (Example) Consider the rule base as: 1. If X croaks and eats flies, X is a frog. 2. If X chirps and sings, X is a Canary. 3. If X is a frog, then X is green. 4. If X is a Canary, then X is yellow. Conclude color of Fritz, given he croaks and eats flies.
  • 36. Rule Based System (Example) Forward Chaining: Fritz croaks and eats flies (Data) Fritz is a frog Fritz is green (Goal)
  • 37. Rule Based System (Example) Backward Chaining: Color of Fritz (Goal) Fritz is green Fritz is yellow Fritz is frog Fritz is Canary
  • 38. Entailment - Relationship between current knowledge and new knowledge inferred from current knowledge. - Reflects that one fact follows from the others. - Knowledge Base (KB) entails a sentence if and only if : the sentence is true in all the world where KB is true.
  • 39. Entailment (Example) Consider Knowledge Base (KB) as: A v B Ë„ C v A Consider a new sentence, S : A v B v C Show that KB |- S ( KB entails S)
  • 40. Entailment (Example) A B C KB S F F F F F F F T F T F T F T T F T T F T T F F T T T F T T T T T F T T T T T T T
  • 41. Entailment (Example) From the truth table, whenever KB is true, S is also true. So, we can say that KB entails S i.e. KB |- S.
  • 42. Probability and Bayes Theorem - Statistical theory of evidence, based on conditional probability - Bayes theorem states that: P(Hi | E) = P(E | Hi) * P(Hi) ÎŁ(n=1 to k) P(E | Hn) * P(Hn) Where, P(Hi | E) = Prob. that Hi is true given evidence E P(E | Hi) = Prob. that evidence E is observed given Hi is true P(Hi) = Prob. that Hi is true in absence of evidence K = number of hypotheses
  • 43. Causal Network / Bayesian Network / Belief Network - Probabilistic graphical model that represents a set of random variables and their conditional dependencies. - Uses directed acyclic graph. - Nodes represent the random variables - Edges represent conditional dependencies
  • 44. Causal Network / Bayesian Network / Belief Network (Example) Consider two events cause grass to be wet, either sprinkler is on or its raining. Also, suppose when it rains, sprinkler is usually not turned on. The conditional probability tables can be given as: Sprinkler Rain T F F 0.4 0.6 T 0.01 0.99 Rain T F 0.2 0.8 Grass Wet Sprinkler Rain T F F F 0.0 1.0 F T 0.8 0.2 T F 0.9 0.1 T T 0.99 0.01
  • 45. Causal Network / Bayesian Network / Belief Network (Example) The situation can be modelled using Bayesian or Causal or Belief network as shown in below graph: Sprinkler Rain Grass wet
  • 46. Causal Network / Bayesian Network / Belief Network (Example) Q. Calculate the probability that it is raining, given the grass is wet? P(R=T | G=T) = ÎŁ(S = {T, F})P(G=T, S, R=T) = 35.77% (0.3577) ÎŁ(S,R = {T, F})P(G=T, S, R) Use the formula : P(G, S, R) = P(G|S, R) * P(S|R) * P(R)