SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Predicate Logic (FOL)
• In propositional logic, we can only represent
the facts, which are either true or false.
• PL is not sufficient to represent the complex
sentences or natural language statements.
• The propositional logic has very limited
expressive power. Ex:
1. "Some humans are intelligent"
2. "Sachin likes cricket”
First-Order logic
• First-order logic is another way of knowledge
representation in artificial intelligence. It is an
extension to propositional logic.
• FOL is sufficiently expressive to represent the
natural language statements in a concise way.
• First-order logic is also known as Predicate logic
or First-order predicate logic.
• It is a powerful language that develops
information about the objects in a easy way and
express the relationship between those objects.
• First-order logic does not only assume that the
world contains facts like propositional logic
but also assumes the following things in the
world:
– Objects, which are things with individual identities
– Properties of objects that distinguish them from
other objects
– Relations that hold among sets of objects
– Functions, which are a subset of relations where
there is only one “value” for any given “input”
• Examples:
– Objects: Students, lectures, companies, cars ...
– Relations: Brother-of, bigger-than, outside, part-of,
has-color, occurs-after, owns, visits, precedes, ...
– Properties: blue, oval, even, large, ...
– Functions: father-of, best-friend, second-half, one-
more-than ...
• As a natural language, first-order logic also has
two main parts:
• Syntax
• Semantics
User provides
• Constant symbols, which represent individuals in the
world
– Mary
– 3
– Green
• Function symbols, which map individuals to individuals
– father-of(Mary) = John
– color-of(Sky) = Blue
• Predicate symbols, which map individuals to truth values
– greater(5,3)
– green(Grass)
– color(Grass, Green)
– Valmiki wrote Ramayan [wrote(Valmiki, Ramayan)]
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)
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.
• 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.
Universal Quantifier ( ):
• Universal quantifier, which specifies that the
statement within its range is true for everything
or every instance of a particular thing.
• If x is a variable, then ∀x is read as:
• For all x
• For each x
• For every x.
Example
• All man drink coffee.
• Let a variable x which refers to a cat so all x can be
represented in UOD as below:
• ∀x man(x) → drink (x, coffee).
Existential Quantifier:
• Existential quantifiers, which express that the
statement within its scope is true for at least one
instance of something.
• 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)
Properties of Quantifiers
• The main connective for universal quantifier ∀ is
implication →.
• The main connective for existential quantifier ∃ is
and ∧.
• In universal quantifier, ∀x∀y is similar to ∀y∀x.
Ex: (x)(y)P(x,y) ↔ (y)(x) P(x,y)
• In Existential quantifier, ∃x∃y is similar to ∃y∃x.
Ex: (x)(y)P(x,y) ↔ (y)(x) P(x,y)
• ∃x∀y is not similar to ∀y∃x.
Sentences are built from terms and atoms
• A term (denoting a real-world individual) is a constant symbol, a
variable symbol, or an n-place function of n terms.
x and f(x1, ..., xn) are terms, where each xi is a term.
A term with no variables is a ground term
• An atomic sentence (which has value true or false) is an n-place
predicate of n terms
• A complex sentence is formed from atomic sentences connected by
the logical connectives:
P, PQ, PQ, PQ, PQ where P and Q are sentences
• A quantified sentence adds quantifiers  and 
• A well-formed formula (wff) is a sentence containing no “free”
variables. That is, all variables are “bound” by universal or existential
quantifiers.
(x)P(x,y) has x bound as a universally quantified variable, but y is
free.
Quantifiers
• Universal quantification
– (x)P(x) means that P holds for all values of x in the
domain associated with that variable
– E.g., (x) dolphin(x)  mammal(x)
• Existential quantification
– ( x)P(x) means that P holds for some value of x in the
domain associated with that variable
– E.g., ( x) mammal(x)  lays-eggs(x)
– Permits one to make a statement about some object
without naming it
Quantifiers
• Universal quantifiers are often used with
“implies” to form “rules”:
(x) student(x)  smart(x) means “All students are
smart”
• Universal quantification is rarely used to make
blanket statements about every individual in the
world:
(x)student(x)smart(x) means “Everyone in the world
is a student and is smart”
• Existential quantifiers are usually used with “and”
to specify a list of properties about an individual:
(x) student(x)  smart(x) means “There is a student
who is smart”
• A common mistake is to represent this English
sentence as the FOL sentence:
(x) student(x)  smart(x)
– But what happens when there is a person who is not a
student?
Quantifier Scope
• Switching the order of universal quantifiers does
not change the meaning:
– (x)(y)P(x,y) ↔ (y)(x) P(x,y)
• Similarly, you can switch the order of existential
quantifiers:
– (x)(y)P(x,y) ↔ (y)(x) P(x,y)
• Switching the order of universals and existentials
does change meaning:
– Everyone likes someone: (x)(y) likes(x,y)
– Someone is liked by everyone: (y)(x) likes(x,y)
Connections between All and Exists
We can relate sentences involving  and 
using De Morgan’s laws:
(x) P(x) ↔ (x) P(x)
(x) P ↔ (x) P(x)
(x) P(x) ↔  (x) P(x)
(x) P(x) ↔ (x) P(x)
Quantified inference rules
• Universal instantiation
– x P(x)  P(A)
• Universal generalization
– P(A)  P(B) …  x P(x)
• Existential instantiation
– x P(x) P(F)  skolem constant F
• Existential generalization
– P(A)  x P(x)
Universal instantiation
(a.k.a. universal elimination)
• If (x) P(x) is true, then P(C) is true, where C is
any constant in the domain of x
• Example:
(x) eats(Ziggy, x)  eats(Ziggy, IceCream)
• The variable symbol can be replaced by any
ground term, i.e., any constant symbol or
function symbol applied to ground terms only
Existential instantiation
(a.k.a. existential elimination)
• From (x) P(x) infer P(c)
• Example:
– (x) eats(Ziggy, x)  eats(Ziggy, Stuff)
• Note that the variable is replaced by a brand-new
constant not occurring in this or any other sentence in
the KB
• Also known as skolemization; constant is a skolem
constant
• In other words, we don’t want to accidentally draw
other inferences about it by introducing the constant
• Convenient to use this to reason about the unknown
object, rather than constantly manipulating the
existential quantifier
Existential generalization
(a.k.a. existential introduction)
• If P(c) is true, then (x) P(x) is inferred.
• Example
eats(Ziggy, IceCream)  (x) eats(Ziggy, x)
• All instances of the given constant symbol are
replaced by the new variable symbol
• Note that the variable symbol cannot already
exist anywhere in the expression
Translating English to FOL
Every gardener likes the sun.
x gardener(x)  likes(x,Sun)
You can fool some of the people all of the time.
x t person(x) time(t)  can-fool(x,t)
You can fool all of the people some of the time.
x t (person(x)  time(t) can-fool(x,t))
x (person(x)  t (time(t) can-fool(x,t)))
All purple mushrooms are poisonous.
x (mushroom(x)  purple(x))  poisonous(x)
No purple mushroom is poisonous.
x purple(x)  mushroom(x)  poisonous(x)
x (mushroom(x)  purple(x))  poisonous(x)
There are exactly two purple mushrooms.
x y mushroom(x)  purple(x)  mushroom(y)  purple(y) ^ (x=y)  z
(mushroom(z)  purple(z))  ((x=z)  (y=z))
Clinton is not tall.
tall(Clinton)
X is above Y iff X is on directly on top of Y or there is a pile of one or more other
objects directly on top of one another starting with X and ending with Y.
x y above(x,y) ↔ (on(x,y)  z (on(x,z)  above(z,y)))
Equivalent
Equivalent
Practice
1. All birds fly.
2. Every man respects his parent.
3. Some boys play cricket.
4. Not all students like both Mathematics and
Science.
5. Only one student failed in Mathematics.
1. ∀x bird(x) →fly(x).
2. ∀x man(x) → respects (x, parent).
3. ∃x boys(x) → play(x, cricket).
4. ¬∀ (x) [ student(x) → like(x, Mathematics) ∧
like(x, Science)].
5. ∃(x) [ student(x) → failed (x, Mathematics)
∧∀ (y) [¬(x==y) ∧ student(y) → ¬failed (y,
Mathematics)].
Free and Bound Variables
• The quantifiers interact with variables which appear in a suitable
way. There are two types of variables in First-order logic which
are given below:
• Free Variable: A variable is said to be a free variable in a formula
if it occurs outside the scope of the quantifier.
Example: ∀x ∃(y)[P (x, y, z)], where z is a free variable.
• Bound Variable: A variable is said to be a bound variable in a
formula if it occurs within the scope of the quantifier.
Example: ∀x [A (x) B( y)], here x and y are the bound variables.
•
Predicate Symbol:
Valmiki wrote Ramayan
wrote(valmiki,ramayan)
Constant Symbol: Represent the objects.
Ex; Rama,sita,car,elephant etc.,
Variable symbol: These symbols are permitted
to have indefinite values about the entity
Ex: x likes y
likes(x,y)
Function symbol: These symbols are used to
represent special type of relationship or
mapping.
John’s father is married to John’s mother.
Married(father(john),mother(john))
Exercise
1. John likes Cricket OR football
2. John lives in a house and the color of the house is
green.
3. If car belongs to john then it is green.
4. John did not write Ramayana.
5. All elephants are gray.
6. Some courses in CSE are easy
• Likes(John, Cricket) V likes(John, football)
• Lives(john, house) Ʌ colour (house, green)
• Belongs(car, john) → colour (car, green)
• ¬Write(john, ramayana)
• All elephants are gray
X:elephant(x) →colour(x, gray)
• Some courses in CSE are easy
ƎX: Course(x) Ʌ easy(x, CSE)
• Venkatesh only likes easy courses.
• Science courses are not easy.
• All the courses in the arts department are
easy.
• B.Sc is a science course
• Venkatesh only likes easy courses
X:easycourse(x) →likes(venkatesh,X)
• Science courses are not easy
x:science_course(x) →¬easy_course(x)
• All the courses in the arts department are
easy
x:course(x)Ʌarts(x) → easy(x)
• B.Sc is a science course
science_course(B.Sc)
• Mani only likes easy games.
• Boxing is hard.
• All the indoor games are easy.
• Table Tennis is an indoor game.
• Q: Is mani likes table tennis.
• Mani only likes easy games
X:easy_games(x) → likes(mani,game(x))
• Boxing is hard
Hard(boxing)
• All the indoor games are easy.
x: indoorgame(x) → easygames(x)
• Table Tennis is an indoor game.
Indoorgame(Table Tennis)
• Karate fighters are very strong.
• Mani is a karate fighter.
• Mani broke some body-part of every other
karate fighter.
• Mani broke the leg of the karate fighter who
broke the jaw of raja.
• Raja is a boxer
• Boxers are not as strong as karate fighters.
• Karate fighters are very strong
X:very_strong(karate_fighter(x))
• Mani is a karate fighter
Karate_fighter(mani)
• Mani broke some body-part of every other
karate fighter
Ǝx: y:Body_part(x)
Ʌkarate_fighter(y)Ʌbroke(mani,y(x))
• Mani broke the leg of the karate fighter who
broke the jaw of raja.
broke(mani,karate_fighter(leg))Ʌbroke(karate
_fighter, (jaw(Raja))
• Raja is a boxer
boxer(raja)
• Boxers are not as strong as karate fighters
x: y:¬strong_as(boxer(x),karate_fighter(y))
• Vishnu likes all kinds of fruits
• Mani is a good student
• All good students have high grades
• All students with high grades are bright
• Narayanan likes seeing English movies.
1.Marcus was a man.
Man(marcus)
2. Marcus was a Pompeian.
Pompeian(marcus)
3. All Pompeians were Romans.
X: pompeian(x) →roman(x)
4. Caesar was a ruler.
ruler(caesar)
5. All Romans were either loyal to Caesar or hated
him.
X:roman(x) →loyalto(x,caesar)Vhate(x,caesar)
6. Everyone is loyal to someone.
X:ƎY:loyalto(x,y)
7. People only try to assassinate rulers they are not loyal
to.
x: y: person(x) Ʌruler(y) Ʌtryassassinate(x,y)
→¬loyalto(x,y)
8. Marcus tried to assassinate Caesar.
tryassassinate(marcus,caesar)
9. All men are people.
X:man(x) → person(x)
Q: Was Marcus loyal to Caesar?
A: loyalto(Marcus,Caesar)
• Marcus was a man.
Man(marcus)
• Marcus was a Pompeian.
pompeian(marcus)
• Marcus was bourn in 40 A.D.
born(marcus,40)
• All men are moral.
x: man(x) → mortal(x)
• All Pompeians died when the volcano erupted in
79 A.D
[ X:pompeian(x) → died(x,79)]
Ʌerupted(volcano,79)
• No mortal lives longer than 150 years
X: t1: t2:mortal(x)Ʌborn(x,t1) Ʌgt(t2-t1,150)
→Dead(x,t2)
• Now=1991
• Alive means not died.
X: t:[alive(x,t) → ¬dead(x,t)] Ʌ[¬ dead(x,t) →
alive(x,t)]
• If someone dies, then he is dead at all later
times.
X: t1 : t2:died(x,t1) Ʌgt(t2,t1) → dead(x,t2)

Weitere ähnliche Inhalte

Was ist angesagt?

Methods and constructors
Methods and constructorsMethods and constructors
Methods and constructors
Ravi_Kant_Sahu
 

Was ist angesagt? (20)

Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
 
Artificial Intelligence - Reasoning in Uncertain Situations
Artificial Intelligence - Reasoning in Uncertain SituationsArtificial Intelligence - Reasoning in Uncertain Situations
Artificial Intelligence - Reasoning in Uncertain Situations
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
 
Parse Tree
Parse TreeParse Tree
Parse Tree
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
 
Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and Reasoning
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
UNIT-IV
UNIT-IVUNIT-IV
UNIT-IV
 
Fuzzy sets
Fuzzy sets Fuzzy sets
Fuzzy sets
 
Np hard
Np hardNp hard
Np hard
 
Uncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial IntelligenceUncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial Intelligence
 
Problem Formulation
Problem FormulationProblem Formulation
Problem Formulation
 
Theory of automata and formal language lab manual
Theory of automata and formal language lab manualTheory of automata and formal language lab manual
Theory of automata and formal language lab manual
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 
Methods and constructors
Methods and constructorsMethods and constructors
Methods and constructors
 
Implementation of lexical analyser
Implementation of lexical analyserImplementation of lexical analyser
Implementation of lexical analyser
 
Assemblies
AssembliesAssemblies
Assemblies
 
Frames
FramesFrames
Frames
 
Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)
 

Ähnlich wie Module_5_1.pptx

dfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.ppt
dfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.pptdfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.ppt
dfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.ppt
NobitaNobi489694
 
Knowledge Representation and Reasoning.pptx
Knowledge Representation and Reasoning.pptxKnowledge Representation and Reasoning.pptx
Knowledge Representation and Reasoning.pptx
MohanKumarP34
 

Ähnlich wie Module_5_1.pptx (20)

Basic Knowledge Representation in First Order Logic.ppt
Basic Knowledge Representation in First Order Logic.pptBasic Knowledge Representation in First Order Logic.ppt
Basic Knowledge Representation in First Order Logic.ppt
 
dfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.ppt
dfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.pptdfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.ppt
dfgsdfdsgdfgfdgdrgdfgffdhyrthfgnhgjhgdfs.ppt
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
 
PredicateLogic (1).ppt
PredicateLogic (1).pptPredicateLogic (1).ppt
PredicateLogic (1).ppt
 
PredicateLogic.pptx
PredicateLogic.pptxPredicateLogic.pptx
PredicateLogic.pptx
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
X02PredCalculus.ppt
X02PredCalculus.pptX02PredCalculus.ppt
X02PredCalculus.ppt
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
Lec 3.pdf
Lec 3.pdfLec 3.pdf
Lec 3.pdf
 
FOLBUKCFAIZ.pptx
FOLBUKCFAIZ.pptxFOLBUKCFAIZ.pptx
FOLBUKCFAIZ.pptx
 
Knowledge Representation and Reasoning.pptx
Knowledge Representation and Reasoning.pptxKnowledge Representation and Reasoning.pptx
Knowledge Representation and Reasoning.pptx
 
First order logic
First order logicFirst order logic
First order logic
 
3 fol examples v2
3 fol examples v23 fol examples v2
3 fol examples v2
 
Per3 logika
Per3 logikaPer3 logika
Per3 logika
 
Formal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and QuantifiersFormal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and Quantifiers
 
Quantifiers and its Types
Quantifiers and its TypesQuantifiers and its Types
Quantifiers and its Types
 
Quantification
QuantificationQuantification
Quantification
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
 

Mehr von DrKalaavathiBuvanesh (6)

Text Book-2--linear-algebra.pdf
Text Book-2--linear-algebra.pdfText Book-2--linear-algebra.pdf
Text Book-2--linear-algebra.pdf
 
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdfSAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
 
Module_4_2.pptx
Module_4_2.pptxModule_4_2.pptx
Module_4_2.pptx
 
Module_3_1.pptx
Module_3_1.pptxModule_3_1.pptx
Module_3_1.pptx
 
IEEE_Wireless.pdf
IEEE_Wireless.pdfIEEE_Wireless.pdf
IEEE_Wireless.pdf
 
IEEEWired.pdf
IEEEWired.pdfIEEEWired.pdf
IEEEWired.pdf
 

Kürzlich hochgeladen

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Kürzlich hochgeladen (20)

Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
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
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 

Module_5_1.pptx

  • 2. • In propositional logic, we can only represent the facts, which are either true or false. • PL is not sufficient to represent the complex sentences or natural language statements. • The propositional logic has very limited expressive power. Ex: 1. "Some humans are intelligent" 2. "Sachin likes cricket”
  • 3. First-Order logic • First-order logic is another way of knowledge representation in artificial intelligence. It is an extension to propositional logic. • FOL is sufficiently expressive to represent the natural language statements in a concise way. • First-order logic is also known as Predicate logic or First-order predicate logic. • It is a powerful language that develops information about the objects in a easy way and express the relationship between those objects.
  • 4. • First-order logic does not only assume that the world contains facts like propositional logic but also assumes the following things in the world: – Objects, which are things with individual identities – Properties of objects that distinguish them from other objects – Relations that hold among sets of objects – Functions, which are a subset of relations where there is only one “value” for any given “input”
  • 5. • Examples: – Objects: Students, lectures, companies, cars ... – Relations: Brother-of, bigger-than, outside, part-of, has-color, occurs-after, owns, visits, precedes, ... – Properties: blue, oval, even, large, ... – Functions: father-of, best-friend, second-half, one- more-than ... • As a natural language, first-order logic also has two main parts: • Syntax • Semantics
  • 6. User provides • Constant symbols, which represent individuals in the world – Mary – 3 – Green • Function symbols, which map individuals to individuals – father-of(Mary) = John – color-of(Sky) = Blue • Predicate symbols, which map individuals to truth values – greater(5,3) – green(Grass) – color(Grass, Green) – Valmiki wrote Ramayan [wrote(Valmiki, Ramayan)]
  • 7. 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)
  • 8. 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).
  • 9. 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.
  • 10. • 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.
  • 11. Universal Quantifier ( ): • Universal quantifier, which specifies that the statement within its range is true for everything or every instance of a particular thing. • If x is a variable, then ∀x is read as: • For all x • For each x • For every x.
  • 12. Example • All man drink coffee. • Let a variable x which refers to a cat so all x can be represented in UOD as below: • ∀x man(x) → drink (x, coffee).
  • 13. Existential Quantifier: • Existential quantifiers, which express that the statement within its scope is true for at least one instance of something. • 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.'
  • 14. Example • Some boys are intelligent. • ∃x: boys(x) ∧ intelligent(x)
  • 15. Properties of Quantifiers • The main connective for universal quantifier ∀ is implication →. • The main connective for existential quantifier ∃ is and ∧. • In universal quantifier, ∀x∀y is similar to ∀y∀x. Ex: (x)(y)P(x,y) ↔ (y)(x) P(x,y) • In Existential quantifier, ∃x∃y is similar to ∃y∃x. Ex: (x)(y)P(x,y) ↔ (y)(x) P(x,y) • ∃x∀y is not similar to ∀y∃x.
  • 16. Sentences are built from terms and atoms • A term (denoting a real-world individual) is a constant symbol, a variable symbol, or an n-place function of n terms. x and f(x1, ..., xn) are terms, where each xi is a term. A term with no variables is a ground term • An atomic sentence (which has value true or false) is an n-place predicate of n terms • A complex sentence is formed from atomic sentences connected by the logical connectives: P, PQ, PQ, PQ, PQ where P and Q are sentences • A quantified sentence adds quantifiers  and  • A well-formed formula (wff) is a sentence containing no “free” variables. That is, all variables are “bound” by universal or existential quantifiers. (x)P(x,y) has x bound as a universally quantified variable, but y is free.
  • 17. Quantifiers • Universal quantification – (x)P(x) means that P holds for all values of x in the domain associated with that variable – E.g., (x) dolphin(x)  mammal(x) • Existential quantification – ( x)P(x) means that P holds for some value of x in the domain associated with that variable – E.g., ( x) mammal(x)  lays-eggs(x) – Permits one to make a statement about some object without naming it
  • 18. Quantifiers • Universal quantifiers are often used with “implies” to form “rules”: (x) student(x)  smart(x) means “All students are smart” • Universal quantification is rarely used to make blanket statements about every individual in the world: (x)student(x)smart(x) means “Everyone in the world is a student and is smart”
  • 19. • Existential quantifiers are usually used with “and” to specify a list of properties about an individual: (x) student(x)  smart(x) means “There is a student who is smart” • A common mistake is to represent this English sentence as the FOL sentence: (x) student(x)  smart(x) – But what happens when there is a person who is not a student?
  • 20. Quantifier Scope • Switching the order of universal quantifiers does not change the meaning: – (x)(y)P(x,y) ↔ (y)(x) P(x,y) • Similarly, you can switch the order of existential quantifiers: – (x)(y)P(x,y) ↔ (y)(x) P(x,y) • Switching the order of universals and existentials does change meaning: – Everyone likes someone: (x)(y) likes(x,y) – Someone is liked by everyone: (y)(x) likes(x,y)
  • 21. Connections between All and Exists We can relate sentences involving  and  using De Morgan’s laws: (x) P(x) ↔ (x) P(x) (x) P ↔ (x) P(x) (x) P(x) ↔  (x) P(x) (x) P(x) ↔ (x) P(x)
  • 22. Quantified inference rules • Universal instantiation – x P(x)  P(A) • Universal generalization – P(A)  P(B) …  x P(x) • Existential instantiation – x P(x) P(F)  skolem constant F • Existential generalization – P(A)  x P(x)
  • 23. Universal instantiation (a.k.a. universal elimination) • If (x) P(x) is true, then P(C) is true, where C is any constant in the domain of x • Example: (x) eats(Ziggy, x)  eats(Ziggy, IceCream) • The variable symbol can be replaced by any ground term, i.e., any constant symbol or function symbol applied to ground terms only
  • 24. Existential instantiation (a.k.a. existential elimination) • From (x) P(x) infer P(c) • Example: – (x) eats(Ziggy, x)  eats(Ziggy, Stuff) • Note that the variable is replaced by a brand-new constant not occurring in this or any other sentence in the KB • Also known as skolemization; constant is a skolem constant • In other words, we don’t want to accidentally draw other inferences about it by introducing the constant • Convenient to use this to reason about the unknown object, rather than constantly manipulating the existential quantifier
  • 25. Existential generalization (a.k.a. existential introduction) • If P(c) is true, then (x) P(x) is inferred. • Example eats(Ziggy, IceCream)  (x) eats(Ziggy, x) • All instances of the given constant symbol are replaced by the new variable symbol • Note that the variable symbol cannot already exist anywhere in the expression
  • 26. Translating English to FOL Every gardener likes the sun. x gardener(x)  likes(x,Sun) You can fool some of the people all of the time. x t person(x) time(t)  can-fool(x,t) You can fool all of the people some of the time. x t (person(x)  time(t) can-fool(x,t)) x (person(x)  t (time(t) can-fool(x,t))) All purple mushrooms are poisonous. x (mushroom(x)  purple(x))  poisonous(x) No purple mushroom is poisonous. x purple(x)  mushroom(x)  poisonous(x) x (mushroom(x)  purple(x))  poisonous(x) There are exactly two purple mushrooms. x y mushroom(x)  purple(x)  mushroom(y)  purple(y) ^ (x=y)  z (mushroom(z)  purple(z))  ((x=z)  (y=z)) Clinton is not tall. tall(Clinton) X is above Y iff X is on directly on top of Y or there is a pile of one or more other objects directly on top of one another starting with X and ending with Y. x y above(x,y) ↔ (on(x,y)  z (on(x,z)  above(z,y))) Equivalent Equivalent
  • 27. Practice 1. All birds fly. 2. Every man respects his parent. 3. Some boys play cricket. 4. Not all students like both Mathematics and Science. 5. Only one student failed in Mathematics.
  • 28. 1. ∀x bird(x) →fly(x). 2. ∀x man(x) → respects (x, parent). 3. ∃x boys(x) → play(x, cricket). 4. ¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)]. 5. ∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧ student(y) → ¬failed (y, Mathematics)].
  • 29. Free and Bound Variables • The quantifiers interact with variables which appear in a suitable way. There are two types of variables in First-order logic which are given below: • Free Variable: A variable is said to be a free variable in a formula if it occurs outside the scope of the quantifier. Example: ∀x ∃(y)[P (x, y, z)], where z is a free variable. • Bound Variable: A variable is said to be a bound variable in a formula if it occurs within the scope of the quantifier. Example: ∀x [A (x) B( y)], here x and y are the bound variables. •
  • 30. Predicate Symbol: Valmiki wrote Ramayan wrote(valmiki,ramayan) Constant Symbol: Represent the objects. Ex; Rama,sita,car,elephant etc., Variable symbol: These symbols are permitted to have indefinite values about the entity
  • 31. Ex: x likes y likes(x,y) Function symbol: These symbols are used to represent special type of relationship or mapping. John’s father is married to John’s mother. Married(father(john),mother(john))
  • 32. Exercise 1. John likes Cricket OR football 2. John lives in a house and the color of the house is green. 3. If car belongs to john then it is green. 4. John did not write Ramayana. 5. All elephants are gray. 6. Some courses in CSE are easy
  • 33. • Likes(John, Cricket) V likes(John, football) • Lives(john, house) Ʌ colour (house, green) • Belongs(car, john) → colour (car, green) • ¬Write(john, ramayana) • All elephants are gray X:elephant(x) →colour(x, gray) • Some courses in CSE are easy ƎX: Course(x) Ʌ easy(x, CSE)
  • 34. • Venkatesh only likes easy courses. • Science courses are not easy. • All the courses in the arts department are easy. • B.Sc is a science course
  • 35. • Venkatesh only likes easy courses X:easycourse(x) →likes(venkatesh,X) • Science courses are not easy x:science_course(x) →¬easy_course(x) • All the courses in the arts department are easy x:course(x)Ʌarts(x) → easy(x)
  • 36. • B.Sc is a science course science_course(B.Sc)
  • 37. • Mani only likes easy games. • Boxing is hard. • All the indoor games are easy. • Table Tennis is an indoor game. • Q: Is mani likes table tennis.
  • 38. • Mani only likes easy games X:easy_games(x) → likes(mani,game(x)) • Boxing is hard Hard(boxing) • All the indoor games are easy. x: indoorgame(x) → easygames(x) • Table Tennis is an indoor game. Indoorgame(Table Tennis)
  • 39. • Karate fighters are very strong. • Mani is a karate fighter. • Mani broke some body-part of every other karate fighter. • Mani broke the leg of the karate fighter who broke the jaw of raja. • Raja is a boxer • Boxers are not as strong as karate fighters.
  • 40. • Karate fighters are very strong X:very_strong(karate_fighter(x)) • Mani is a karate fighter Karate_fighter(mani) • Mani broke some body-part of every other karate fighter Ǝx: y:Body_part(x) Ʌkarate_fighter(y)Ʌbroke(mani,y(x))
  • 41. • Mani broke the leg of the karate fighter who broke the jaw of raja. broke(mani,karate_fighter(leg))Ʌbroke(karate _fighter, (jaw(Raja)) • Raja is a boxer boxer(raja) • Boxers are not as strong as karate fighters x: y:¬strong_as(boxer(x),karate_fighter(y))
  • 42. • Vishnu likes all kinds of fruits • Mani is a good student • All good students have high grades • All students with high grades are bright • Narayanan likes seeing English movies.
  • 43. 1.Marcus was a man. Man(marcus) 2. Marcus was a Pompeian. Pompeian(marcus) 3. All Pompeians were Romans. X: pompeian(x) →roman(x) 4. Caesar was a ruler. ruler(caesar) 5. All Romans were either loyal to Caesar or hated him.
  • 44. X:roman(x) →loyalto(x,caesar)Vhate(x,caesar) 6. Everyone is loyal to someone. X:ƎY:loyalto(x,y) 7. People only try to assassinate rulers they are not loyal to. x: y: person(x) Ʌruler(y) Ʌtryassassinate(x,y) →¬loyalto(x,y) 8. Marcus tried to assassinate Caesar. tryassassinate(marcus,caesar) 9. All men are people. X:man(x) → person(x)
  • 45. Q: Was Marcus loyal to Caesar? A: loyalto(Marcus,Caesar)
  • 46. • Marcus was a man. Man(marcus) • Marcus was a Pompeian. pompeian(marcus) • Marcus was bourn in 40 A.D. born(marcus,40) • All men are moral. x: man(x) → mortal(x) • All Pompeians died when the volcano erupted in 79 A.D
  • 47. [ X:pompeian(x) → died(x,79)] Ʌerupted(volcano,79) • No mortal lives longer than 150 years X: t1: t2:mortal(x)Ʌborn(x,t1) Ʌgt(t2-t1,150) →Dead(x,t2) • Now=1991 • Alive means not died.
  • 48. X: t:[alive(x,t) → ¬dead(x,t)] Ʌ[¬ dead(x,t) → alive(x,t)] • If someone dies, then he is dead at all later times. X: t1 : t2:died(x,t1) Ʌgt(t2,t1) → dead(x,t2)