SlideShare a Scribd company logo
1 of 37
LOGIC IN AI
PROPOSITIONAL LOGIC, PREDICATE LOGIC
PRESENTED BY:
HASEEB UR RAHMAN
ARSLAN ALI
ZAIN QAMAR
WHAT IS KNOWLEDGE REPRESENTATION?
 Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things, which
is knowledge and as per their knowledge they perform various actions in the real world. But how
machines do all these things comes under knowledge representation and reasoning.
 Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which concerned
with AI agents thinking and how thinking contributes to intelligent behavior of agents.
 It is responsible for representing information about the real world so that a computer can understand
and can utilize this knowledge to solve the complex real world problems such as diagnosis a medical
condition or communicating with humans in natural language.
 It is also a way which describes how we can represent knowledge in artificial intelligence. Knowledge
representation is not just storing data into some database, but it also enables an intelligent machine to
learn from that knowledge and experiences so that it can behave intelligently like a human.
TECHNIQUES OF KNOWLEDGE REPRESENTATION:
 There are mainly four types of knowledge representation in
 Logical representation
 Semantic network representation
 Frame representation
 Production rules
LOGICAL REPRESENTATION:
 It is a language with some concrete rules, which deals with propositions and has no ambiguity in
representation.
 It consist of precisely defined:
 Syntax & semantics
 Each sentence can be translated into logics using syntax and semantics.
 Syntax: defines well formed sentence in the language
 Semantic: defines the truth meaning of of the sentence in the world.
PROPOSITIONAL LOGIC IN ARTIFICIAL INTELLIGENCE
 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.
THE BASIC IDEA OF PROPOSITIONAL LOGIC
 Proposition means sentences. Propositional logic applies the Boolean logic to convert our real-world
data into a format that is readable to the computer. For instance, if we say ‘It is hot and humid today’,
the machine won’t understand. But if we can create propositional logic for this sentence, then, we can
make the machine-read, and interpret our message.
 For example, ‘Earth is round’, the output for this proposition is TRUE. If we say, ‘Earth is square’, then
the output is FALSE. Propositional logic applies to those sentences where the output can only be either
TRUE or FALSE. But if we refer to the sentence like ‘Some children are lazy’ then here we have two
possible outputs. This preposition is TRUE for those children who are lazy, but it is FALSE for those
children who are not lazy. So, for such sentences/propositions where two or more outputs are
possible, propositional logic doesn’t apply.
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.
 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.
 How Propositional Logic in Artificial Intelligence Represents Data to Machine
 There are two types of prepositions, atomic and complex, that can be represented through propositional
logic. Atomic means a single preposition like ‘the sky is blue’, ‘hot days are humid’, water is liquid, etc
SYNTAX OF PROPOSITIONAL LOGIC:
 The syntax of propositional logic defines the allowable sentences for the knowledge representation.
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) “Haseeb is a doctor, and his clinic is in Faisalabad."
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:
 Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or
negative literal.
 Conjunction:
A sentence which has ∧ connective such as, P ∧ Q is called a conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
LOGICAL CONNECTIVES:
 Disjunction:
A sentence which has ∨ connective, such as P ∨ Q. is called disjunction, where P and Q are the propositions.
Example: "Rabail is a doctor or Engineer",
Here P= Rabail is Doctor. Q= Rabail is Doctor, so we can write it as P ∨ Q.
 Implication:
 A sentence such as P → Q, is called an implication. Implications are also known as if-then rules. It can be
represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
BICONDITIONAL:
A sentence such as P⇔ Q is a Biconditional sentence, example If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
FOLLOWING IS THE SUMMARIZED TABLE FOR PROPOSITIONAL LOGIC
CONNECTIVES:
 Propositional logic in Artificial intelligence
PROPOSITIONAL LOGIC EXAMPLE:
 A- It is hot.
 B- It is humidity.
 C- It is raining.
 Conditions: Propositional Logic
 It is humid then it is hot , = B A
 It is hot and humid then it is raining. = A^B ¬ C
Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Fourth Precedence Disjunction(OR)
Fifth Precedence Implication
Six Precedence Biconditional
Precedence of connectives:
Just like arithmetic operators, there is a precedence order
for propositional connectors or logical operators. This
order should be followed while evaluating a propositional
problem. Following is the list of the precedence order for
operators:
LIMITATIONS OF PROPOSITIONAL LOGIC:
 We can not represent propositions like All, some and none with propositions
 For example: All girls are intelligent
 some apples are sweet
 Has limited expressive power
 We can not represent statements in terms of their properties and relationship.
FIRST-ORDER LOGIC
In Propositional logic, we have seen that how to represent statements using propositional logic.
But unfortunately, in propositional logic, we can only represent the facts, which are either true or false.
Given Sentences:
• "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.
FOL
 First-order logic is another way of knowledge representation in artificial intelligence. It is an extension to
propositional logic.
 First-order logic is also known as Predicate logic or First-order predicate logic.
 first-order logic (like natural language) assumes the world contains
Objects: people, houses, numbers, colors, baseball games, wars, …
Relations: red, round, prime, brother of, bigger than, part of, comes between, …
Functions: father of, best friend, one more than, plus, …
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.
FOL PROVIDES
 Variable symbols
E.g., x, y, foo
 Connectives
Same as in PL: not (), and (), or (), implies (), if and only if (biconditional
)
 Quantifiers
Universal x or (Ax)
Existential x or (Ex)
FOL
• As a natural language, first-order logic also has two main parts:
• Syntax
• Semantics
ATOMIC SENTENCES:
• Atomic sentences are the most basic sentences of first-order logic.
• 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.
COMPLEX SENTENCES:
 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:
• A quantifier is a language element which generates quantification, and quantification specifies the
quantity of specimen in the universe of discourse.
• These are the symbols that permit to determine or identify the range and scope of the variable in the
logical expression. There are two types of quantifier:
• Universal Quantifier, (for all, everyone, everything)
• Existential quantifier, (for some, at least one).
UNIVERSAL QUANTIFIER:
 Universal quantifier is a symbol of logical representation, which specifies that the statement within its
range is true for everything or every instance of a particular thing.
 The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.
 In universal quantifier we use implication "→".
UNIVERSAL QUANTIFIER:
 If x is a variable, then ∀x is read as:
For all x
For each x
For every x.
 Example:
All man drink coffee.
∀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.
 In Existential quantifier we always use AND or Conjunction symbol (∧).
EXISTENTIAL QUANTIFIER:
 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:
Some boys are intelligent.
∃x: boys(x) ∧ intelligent(x)
 It will be read as: There are some x where x is a boy who is intelligent.
QUANTIFIERS IN FIRST-ORDER LOGIC:
 Points to remember:
The main connective for universal quantifier ∀ is implication →.
The main connective for existential quantifier ∃ is and ∧.
 Properties of Quantifiers:
In universal quantifier, ∀x∀y is similar to ∀y∀x.
In Existential quantifier, ∃x∃y is similar to ∃y∃x.
∃x∀y is not similar to ∀y∃x.
EXAMPLES:
1. All birds fly. predicate is "fly(bird).“, There are all birds who fly
∀x bird(x) →fly(x).
2. Every man respects his parent. predicate is "respect(x, y)," where x=man, and y=
parent.
∀x man(x) → respects (x, parent).
3. Some boys play cricket. predicate is "play(x, y)," where x= boys, and y=
game.
∃x boys(x) → play(x, cricket).
4. Not all students like both Mathematics and Science. predicate is "like(x, y)," where x= student, and
y= subject.
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
SEMANTIC NETWORK REPRESENTATION:
Semantic Network Representation:
Semantic networks are alternative of predicate logic for knowledge representation. In Semantic networks,
we can represent our knowledge in the form of graphical networks.This network consists of nodes
representing objects and arcs which describe the relationship between those objects.
1. Semantic networks do not have any standard definition for the link names.
2. These networks are not intelligent and depend on the creator of the system.
SEMANTIC NETWORK REPRESENTATION:
Semantic networks take more computational time at runtime as we need to traverse the complete network
tree to answer some questions.
Semantic networks try to model human-like memory but in practice, it is not possible to build such a vast
semantic network.
These types of representations are inadequate as they do not have any equivalent quantifier, e.g., for all,
for some, none, etc.
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. It consists of a collection of slots and slot values. These slots may
be of any type and sizes. Slots have names and values which are called facets.
WHAT IS PRODUCTION RULES ?
Production rules system consist of (condition, action) pairs which mean, "If condition then action". It has
mainly three parts:
● The set of production rules
● Working Memory
● The recognize-act-cycle

More Related Content

Similar to Knowledege Representation.pptx

AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
discrete structures and their introduction
discrete structures and their introductiondiscrete structures and their introduction
discrete structures and their introductionZenLooper
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfHrideshSapkota2
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Sabu Francis
 
Foundations of Knowledge Representation in Artificial Intelligence.pptx
Foundations of Knowledge Representation in Artificial Intelligence.pptxFoundations of Knowledge Representation in Artificial Intelligence.pptx
Foundations of Knowledge Representation in Artificial Intelligence.pptxkitsenthilkumarcse
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)surbhi jha
 
First Order Logic
First Order LogicFirst Order Logic
First Order LogicMianMubeen3
 
Prolog,Prolog Programming IN AI.pdf
Prolog,Prolog Programming IN AI.pdfProlog,Prolog Programming IN AI.pdf
Prolog,Prolog Programming IN AI.pdfCS With Logic
 
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
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logicDevaddd
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicTaymoor Nazmy
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfARMANVERMA7
 
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptxARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptxRuchitaMaaran
 

Similar to Knowledege Representation.pptx (20)

AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
lec3 AI.pptx
lec3  AI.pptxlec3  AI.pptx
lec3 AI.pptx
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
discrete structures and their introduction
discrete structures and their introductiondiscrete structures and their introduction
discrete structures and their introduction
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdf
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
 
AI Lesson 11
AI Lesson 11AI Lesson 11
AI Lesson 11
 
AI-09 Logic in AI
AI-09 Logic in AIAI-09 Logic in AI
AI-09 Logic in AI
 
Foundations of Knowledge Representation in Artificial Intelligence.pptx
Foundations of Knowledge Representation in Artificial Intelligence.pptxFoundations of Knowledge Representation in Artificial Intelligence.pptx
Foundations of Knowledge Representation in Artificial Intelligence.pptx
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
 
Prolog,Prolog Programming IN AI.pdf
Prolog,Prolog Programming IN AI.pdfProlog,Prolog Programming IN AI.pdf
Prolog,Prolog Programming IN AI.pdf
 
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
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logic
 
Module_4_2.pptx
Module_4_2.pptxModule_4_2.pptx
Module_4_2.pptx
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdf
 
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptxARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 

Knowledege Representation.pptx

  • 1. LOGIC IN AI PROPOSITIONAL LOGIC, PREDICATE LOGIC PRESENTED BY: HASEEB UR RAHMAN ARSLAN ALI ZAIN QAMAR
  • 2. WHAT IS KNOWLEDGE REPRESENTATION?  Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things, which is knowledge and as per their knowledge they perform various actions in the real world. But how machines do all these things comes under knowledge representation and reasoning.  Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which concerned with AI agents thinking and how thinking contributes to intelligent behavior of agents.  It is responsible for representing information about the real world so that a computer can understand and can utilize this knowledge to solve the complex real world problems such as diagnosis a medical condition or communicating with humans in natural language.  It is also a way which describes how we can represent knowledge in artificial intelligence. Knowledge representation is not just storing data into some database, but it also enables an intelligent machine to learn from that knowledge and experiences so that it can behave intelligently like a human.
  • 3. TECHNIQUES OF KNOWLEDGE REPRESENTATION:  There are mainly four types of knowledge representation in  Logical representation  Semantic network representation  Frame representation  Production rules
  • 4. LOGICAL REPRESENTATION:  It is a language with some concrete rules, which deals with propositions and has no ambiguity in representation.  It consist of precisely defined:  Syntax & semantics  Each sentence can be translated into logics using syntax and semantics.  Syntax: defines well formed sentence in the language  Semantic: defines the truth meaning of of the sentence in the world.
  • 5. PROPOSITIONAL LOGIC IN ARTIFICIAL INTELLIGENCE  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.
  • 6. THE BASIC IDEA OF PROPOSITIONAL LOGIC  Proposition means sentences. Propositional logic applies the Boolean logic to convert our real-world data into a format that is readable to the computer. For instance, if we say ‘It is hot and humid today’, the machine won’t understand. But if we can create propositional logic for this sentence, then, we can make the machine-read, and interpret our message.  For example, ‘Earth is round’, the output for this proposition is TRUE. If we say, ‘Earth is square’, then the output is FALSE. Propositional logic applies to those sentences where the output can only be either TRUE or FALSE. But if we refer to the sentence like ‘Some children are lazy’ then here we have two possible outputs. This preposition is TRUE for those children who are lazy, but it is FALSE for those children who are not lazy. So, for such sentences/propositions where two or more outputs are possible, propositional logic doesn’t apply.
  • 7. 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.
  • 8.  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.  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.  How Propositional Logic in Artificial Intelligence Represents Data to Machine  There are two types of prepositions, atomic and complex, that can be represented through propositional logic. Atomic means a single preposition like ‘the sky is blue’, ‘hot days are humid’, water is liquid, etc
  • 9. SYNTAX OF PROPOSITIONAL LOGIC:  The syntax of propositional logic defines the allowable sentences for the knowledge representation. 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.
  • 10.  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) “Haseeb is a doctor, and his clinic is in Faisalabad."
  • 11. 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:  Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative literal.  Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a conjunction. Example: Rohan is intelligent and hardworking. It can be written as, P= Rohan is intelligent, Q= Rohan is hardworking. → P∧ Q.
  • 12. LOGICAL CONNECTIVES:  Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction, where P and Q are the propositions. Example: "Rabail is a doctor or Engineer", Here P= Rabail is Doctor. Q= Rabail is Doctor, so we can write it as P ∨ Q.  Implication:  A sentence such as P → Q, is called an implication. Implications are also known as if-then rules. It can be represented as If it is raining, then the street is wet. Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
  • 13. BICONDITIONAL: A sentence such as P⇔ Q is a Biconditional sentence, example If I am breathing, then I am alive P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
  • 14. FOLLOWING IS THE SUMMARIZED TABLE FOR PROPOSITIONAL LOGIC CONNECTIVES:  Propositional logic in Artificial intelligence
  • 15. PROPOSITIONAL LOGIC EXAMPLE:  A- It is hot.  B- It is humidity.  C- It is raining.  Conditions: Propositional Logic  It is humid then it is hot , = B A  It is hot and humid then it is raining. = A^B ¬ C
  • 16. Precedence Operators First Precedence Parenthesis Second Precedence Negation Third Precedence Conjunction(AND) Fourth Precedence Disjunction(OR) Fifth Precedence Implication Six Precedence Biconditional Precedence of connectives: Just like arithmetic operators, there is a precedence order for propositional connectors or logical operators. This order should be followed while evaluating a propositional problem. Following is the list of the precedence order for operators:
  • 17. LIMITATIONS OF PROPOSITIONAL LOGIC:  We can not represent propositions like All, some and none with propositions  For example: All girls are intelligent  some apples are sweet  Has limited expressive power  We can not represent statements in terms of their properties and relationship.
  • 18. FIRST-ORDER LOGIC In Propositional logic, we have seen that how to represent statements using propositional logic. But unfortunately, in propositional logic, we can only represent the facts, which are either true or false. Given Sentences: • "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.
  • 19. FOL  First-order logic is another way of knowledge representation in artificial intelligence. It is an extension to propositional logic.  First-order logic is also known as Predicate logic or First-order predicate logic.  first-order logic (like natural language) assumes the world contains Objects: people, houses, numbers, colors, baseball games, wars, … Relations: red, round, prime, brother of, bigger than, part of, comes between, … Functions: father of, best friend, one more than, plus, …
  • 20. 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.
  • 21. FOL PROVIDES  Variable symbols E.g., x, y, foo  Connectives Same as in PL: not (), and (), or (), implies (), if and only if (biconditional )  Quantifiers Universal x or (Ax) Existential x or (Ex)
  • 22. FOL • As a natural language, first-order logic also has two main parts: • Syntax • Semantics
  • 23. ATOMIC SENTENCES: • Atomic sentences are the most basic sentences of first-order logic. • 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).
  • 24. 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.
  • 25. COMPLEX SENTENCES:  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.
  • 26. QUANTIFIERS IN FIRST-ORDER LOGIC: • A quantifier is a language element which generates quantification, and quantification specifies the quantity of specimen in the universe of discourse. • These are the symbols that permit to determine or identify the range and scope of the variable in the logical expression. There are two types of quantifier: • Universal Quantifier, (for all, everyone, everything) • Existential quantifier, (for some, at least one).
  • 27. UNIVERSAL QUANTIFIER:  Universal quantifier is a symbol of logical representation, which specifies that the statement within its range is true for everything or every instance of a particular thing.  The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.  In universal quantifier we use implication "→".
  • 28. UNIVERSAL QUANTIFIER:  If x is a variable, then ∀x is read as: For all x For each x For every x.  Example: All man drink coffee. ∀x man(x) → drink (x, coffee).  It will be read as: There are all x where x is a man who drink coffee.
  • 29. 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.  In Existential quantifier we always use AND or Conjunction symbol (∧).
  • 30. EXISTENTIAL QUANTIFIER:  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: Some boys are intelligent. ∃x: boys(x) ∧ intelligent(x)  It will be read as: There are some x where x is a boy who is intelligent.
  • 31. QUANTIFIERS IN FIRST-ORDER LOGIC:  Points to remember: The main connective for universal quantifier ∀ is implication →. The main connective for existential quantifier ∃ is and ∧.
  • 32.  Properties of Quantifiers: In universal quantifier, ∀x∀y is similar to ∀y∀x. In Existential quantifier, ∃x∃y is similar to ∃y∃x. ∃x∀y is not similar to ∀y∃x.
  • 33. EXAMPLES: 1. All birds fly. predicate is "fly(bird).“, There are all birds who fly ∀x bird(x) →fly(x). 2. Every man respects his parent. predicate is "respect(x, y)," where x=man, and y= parent. ∀x man(x) → respects (x, parent). 3. Some boys play cricket. predicate is "play(x, y)," where x= boys, and y= game. ∃x boys(x) → play(x, cricket). 4. Not all students like both Mathematics and Science. predicate is "like(x, y)," where x= student, and y= subject. ¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
  • 34. SEMANTIC NETWORK REPRESENTATION: Semantic Network Representation: Semantic networks are alternative of predicate logic for knowledge representation. In Semantic networks, we can represent our knowledge in the form of graphical networks.This network consists of nodes representing objects and arcs which describe the relationship between those objects. 1. Semantic networks do not have any standard definition for the link names. 2. These networks are not intelligent and depend on the creator of the system.
  • 35. SEMANTIC NETWORK REPRESENTATION: Semantic networks take more computational time at runtime as we need to traverse the complete network tree to answer some questions. Semantic networks try to model human-like memory but in practice, it is not possible to build such a vast semantic network. These types of representations are inadequate as they do not have any equivalent quantifier, e.g., for all, for some, none, etc.
  • 36. 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. It consists of a collection of slots and slot values. These slots may be of any type and sizes. Slots have names and values which are called facets.
  • 37. WHAT IS PRODUCTION RULES ? Production rules system consist of (condition, action) pairs which mean, "If condition then action". It has mainly three parts: ● The set of production rules ● Working Memory ● The recognize-act-cycle