2
Most read
3
Most read
4
Most read
Propositional Logic and
predicate logic
Big Ideas
• Logic is a great knowledge representation
language for many AI problems
• Propositional logic is the simple
foundation and fine for some AI problems
• First order logic (FOL) is much more
expressive as a KR language and more
commonly used in AI
• There are many variations: horn logic,
higher order logic, three-valued logic,
probabilistic logics, etc.
Propositional logic (PL)
• Simple language for showing key ideas and definitions
• User defines set of propositional symbols, like P and Q
• User defines semantics of each propositional symbol:
– P means “It is hot”, Q means “It is humid”, etc.
• A sentence (well formed formula) is defined as
follows:
– A symbol is a sentence
– If S is a sentence, then S is a sentence
– If S is a sentence, then (S) is a sentence
– If S and T are sentences, then (S  T), (S  T), (S  T), and (S
↔ T) are sentences
– A sentence results from a finite number of applications of the
rules
Propositional logic
• Logical constants: true, false
• Propositional symbols: P, Q,... (atomic sentences)
• Wrapping parentheses: ( … )
• Sentences are combined by connectives:
 and [conjunction]
 or [disjunction]
implies [implication / conditional]
 is equivalent[biconditional]
 not [negation]
• Literal: atomic sentence or negated atomic sentence
P,  P
Examples of PL sentences
• (P  Q)  R
“If it is hot and humid, then it is raining”
• Q  P
“If it is humid, then it is hot”
• Q
“It is humid.”
• We’re free to choose better symbols, btw:
Ho = “It is hot”
Hu = “It is humid”
R = “It is raining”
Some terms
• The meaning or semantics of a sentence
determines its interpretation
• Given the truth values of all symbols in a
sentence, it can be “evaluated” to determine
its truth value (True or False)
• A model for a KB is a possible world – an
assignment of truth values to propositional
symbols that makes each sentence in the KB
True
Truth tables
Truth tables for the five logical connectives
Example of a truth table used for a complex sentence
• Truth tables are used to define logical connectives
• and to determine when a complex sentence is true
given the values of the symbols in it
On the implies connective:
P  Q
• Note that  is a logical connective
• So PQ is a logical sentence and has a
truth value, i.e., is either true or false
• If we add this sentence to the KB, it can be
used by an inference rule, Modes Ponens, to
derive/infer/prove Q if P is also in the KB
• Given a KB where P=True and Q=True, we
can also derive/infer/prove that PQ is
True
Propositional Logic can’t say
• If X is married to Y, then Y is married to X.
• If X is west of Y, and Y is west of Z, then X
is west of Z.
• And a million other simple things.
• Fix:
– extend representation: add predicates
– Extend operator(resolution): add unification
Syntax
• See text for formal rules.
• All of propositional + quantifiers, predicates,
functions, and constants.
• Variables can take on values of constants or terms.
• Term = reference to object
• Variables not allowed to be predicates.
– E.G. What is the relationship between Bill and Hillary?
• Text Notation: variables lower case, constants upper
• Prolog Notation: variables are upper case, etc
Semantics
• Validity = true in every model and every
interpretation.
• Interpretation = mapping of constants,
predicates, functions into objects, relations,
and functions.
Advance Artificial
Intelligence
12
Predicate Calculus
So it is a better idea to use predicates instead of
propositions.
This leads us to predicate calculus.
Predicate calculus has symbols called
• object constants,
• relation constants, and
• function constants
These symbols will be used to refer to objects in the world
and to propositions about the word.
Advance Artificial
Intelligence
13
Quantification
Introducing the universal quantifier  and the existential
quantifier  facilitates the translation of world knowledge
into predicate calculus.
Examples:
Paul beats up all professors who fail him.
x(Professor(x)  Fails(x, Paul)  BeatsUp(Paul, x))
There is at least one intelligent UMB professor.
x(UMBProf(x)  Intelligent(x))
Representing World in FOL
• All kings are persons.
 goes to?
• for all x, King(x) & Person(x).
• for all x, King(x) => Person(x).
Representing World in FOL
• All kings are persons.
• for all x, King(x) => Person(x). OK.
• for all x, King(x) & Person(x). Not OK.
– this says every object is a king and a person.
• In Prolog: person(X) :- king(X).
• Everyone Likes icecream.
• for all x, Likes(x, icecream).
Negating Quantifiers
• ~ there exist x, P(x)
• ~ for all x, P(x)
For all x, Likes(x,Icecream)
No one likes liver.
For all x, not Likes(x,Liver)
• For all x, ~P(x)
• There exists x, ~P(x)
• There does not exist an x,
not Likes(x,Icecream)
• Not there exists x,
Iikes(x,Liver).
More Translations
• Everyone loves
someone.
• There is someone that
everyone loves.
• Everyone loves their
father.
• See text.
• For all x, there is a y(x)
such that Loves(x,y(x)).
• There is an M such that
for all x, Loves(x,M).
• M is skolem constant
• For all x,
Loves(x,Father(x)).
• Father(x) is skolem
function.
Occurs Checking
• When unifying a variable against a complex
term, the complex term should not contain
the same variable, else non-match.
• Prolog doesn’t check this.
• Ex. f(X,X) and f(Y,g(Y)) should not unify.
Modeling with Definite Clauses:
at most one positive literal
1. It is a crime for an american to sell weapons to a
hostile country.
1’. American(x)&Weapons(y)&Hostile(z) &
Sell(x,y,z) => Criminal (x).
2. The country Nono has some missiles.
There exists x Owns(Nono,x)&Missile(x).
2’. Missile(M1). … Skolem Constant introduction
2’’. Owns(Nono,M1).
Resolution gives forward chaining
• Enemy(x,America)
=>Hostile(x)
• Enemy(Nono,America)
• |- Hostile(Nono)
• Not Enemy(x,America)
or Hostile(x)
• Enemy(Nono,America)
• Resolve by {x/Nono}
• To Hostile(Nono)
FOL -> Conjuctive Normal Form
• Similar to process for propositional logic, but
• Use negations rules for quantifiers
• Standarize variables apart
• Universal quantification is implicit.
• Skolemization: introduction of constants and
functions to remove existential quantifiers.
Time
• Before (x,y) implies After(y,x)
• After(x,y) imples Before(y,x)
• Before(x,y) and Before(y,z) implies
Before(x,z) etc.
• When are you done?
• What about during?
Space and more
• In(x,y) and In(y,z) implies in(x,z).
• Infront, behind, etc
• Frame problem: you turn, some predicates
change and some don’t.
• etc.
And lots more: heat, wind, hitting, physical
objects versus thoughts, knowing,

More Related Content

PPT
Propositional and first order logic - AI
PPTX
lec3 AI.pptx
PPT
10a.ppt
PPTX
Basic Knowledge Representation and Reasonong
PPT
Logic.ppt
PPT
Propositional and first-order logic different chapters
PPT
Propositional and first-order logic different chapters
PDF
Logic programming (1)
Propositional and first order logic - AI
lec3 AI.pptx
10a.ppt
Basic Knowledge Representation and Reasonong
Logic.ppt
Propositional and first-order logic different chapters
Propositional and first-order logic different chapters
Logic programming (1)

Similar to predicateLogic.ppt (20)

PPT
Logical Programming Paradigm for programming Languages.
PPT
AI-Unit4.ppt
PPTX
Module_4_2.pptx
PPTX
Module4_AI 4th semester engineering.pptx
PDF
AI NOTES ppt 4.pdf
PPTX
Chapter 1.4.pptx Chapter 1.4.pptx DISCREATE MATH
PPTX
Introduction to mathematical analysis
PPTX
Propositional logic(part 2)
PPTX
Logic in Predicate and Propositional Logic
PPTX
Knowledge & logic in Artificial Intelligence.pptx
PPTX
Natural language processing: word senses and relations
PDF
Knowledge Representation, Prepositional Logic, Representation and Mapping
PDF
Chapter 4 - Knowledge Representation and Reasoning (1).pdf
PDF
AI Lesson 11
PPTX
chapter2 Know.representation.pptx
PPTX
Foundations of Knowledge Representation in Artificial Intelligence.pptx
PPTX
First order predicate logic(fopl)
PPT
Predicate logic_2(Artificial Intelligence)
PPTX
DISCRETE MATHEMATICS for IT students.pptx
PPT
Chaps 1-3-ai-prolog
Logical Programming Paradigm for programming Languages.
AI-Unit4.ppt
Module_4_2.pptx
Module4_AI 4th semester engineering.pptx
AI NOTES ppt 4.pdf
Chapter 1.4.pptx Chapter 1.4.pptx DISCREATE MATH
Introduction to mathematical analysis
Propositional logic(part 2)
Logic in Predicate and Propositional Logic
Knowledge & logic in Artificial Intelligence.pptx
Natural language processing: word senses and relations
Knowledge Representation, Prepositional Logic, Representation and Mapping
Chapter 4 - Knowledge Representation and Reasoning (1).pdf
AI Lesson 11
chapter2 Know.representation.pptx
Foundations of Knowledge Representation in Artificial Intelligence.pptx
First order predicate logic(fopl)
Predicate logic_2(Artificial Intelligence)
DISCRETE MATHEMATICS for IT students.pptx
Chaps 1-3-ai-prolog
Ad

Recently uploaded (20)

PDF
FYJC - Chemistry textbook - standard 11.
PPTX
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
PPTX
FILIPINO 8 Q2 WEEK 1(DAY 1).power point presentation
PPTX
GW4 BioMed Candidate Support Webinar 2025
PPTX
UCSP Section A - Human Cultural Variations,Social Differences,social ChangeCo...
DOCX
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
PDF
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
PDF
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
PPTX
Environmental Sciences and Sustainability Chapter 2
PDF
Laparoscopic Imaging Systems at World Laparoscopy Hospital
PDF
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
PDF
IS1343_2012...........................pdf
PPTX
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
PPTX
Entrepreneurship Management and Finance - Module 1 - PPT
PDF
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
PDF
New_Round_Up_6_SB.pdf download for free, easy to learn
PDF
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
PDF
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
PPTX
Neurological complocations of systemic disease
FYJC - Chemistry textbook - standard 11.
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
FILIPINO 8 Q2 WEEK 1(DAY 1).power point presentation
GW4 BioMed Candidate Support Webinar 2025
UCSP Section A - Human Cultural Variations,Social Differences,social ChangeCo...
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
Environmental Sciences and Sustainability Chapter 2
Laparoscopic Imaging Systems at World Laparoscopy Hospital
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
IS1343_2012...........................pdf
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
Entrepreneurship Management and Finance - Module 1 - PPT
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
New_Round_Up_6_SB.pdf download for free, easy to learn
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
Neurological complocations of systemic disease
Ad

predicateLogic.ppt

  • 2. Big Ideas • Logic is a great knowledge representation language for many AI problems • Propositional logic is the simple foundation and fine for some AI problems • First order logic (FOL) is much more expressive as a KR language and more commonly used in AI • There are many variations: horn logic, higher order logic, three-valued logic, probabilistic logics, etc.
  • 3. Propositional logic (PL) • Simple language for showing key ideas and definitions • User defines set of propositional symbols, like P and Q • User defines semantics of each propositional symbol: – P means “It is hot”, Q means “It is humid”, etc. • A sentence (well formed formula) is defined as follows: – A symbol is a sentence – If S is a sentence, then S is a sentence – If S is a sentence, then (S) is a sentence – If S and T are sentences, then (S  T), (S  T), (S  T), and (S ↔ T) are sentences – A sentence results from a finite number of applications of the rules
  • 4. Propositional logic • Logical constants: true, false • Propositional symbols: P, Q,... (atomic sentences) • Wrapping parentheses: ( … ) • Sentences are combined by connectives:  and [conjunction]  or [disjunction] implies [implication / conditional]  is equivalent[biconditional]  not [negation] • Literal: atomic sentence or negated atomic sentence P,  P
  • 5. Examples of PL sentences • (P  Q)  R “If it is hot and humid, then it is raining” • Q  P “If it is humid, then it is hot” • Q “It is humid.” • We’re free to choose better symbols, btw: Ho = “It is hot” Hu = “It is humid” R = “It is raining”
  • 6. Some terms • The meaning or semantics of a sentence determines its interpretation • Given the truth values of all symbols in a sentence, it can be “evaluated” to determine its truth value (True or False) • A model for a KB is a possible world – an assignment of truth values to propositional symbols that makes each sentence in the KB True
  • 7. Truth tables Truth tables for the five logical connectives Example of a truth table used for a complex sentence • Truth tables are used to define logical connectives • and to determine when a complex sentence is true given the values of the symbols in it
  • 8. On the implies connective: P  Q • Note that  is a logical connective • So PQ is a logical sentence and has a truth value, i.e., is either true or false • If we add this sentence to the KB, it can be used by an inference rule, Modes Ponens, to derive/infer/prove Q if P is also in the KB • Given a KB where P=True and Q=True, we can also derive/infer/prove that PQ is True
  • 9. Propositional Logic can’t say • If X is married to Y, then Y is married to X. • If X is west of Y, and Y is west of Z, then X is west of Z. • And a million other simple things. • Fix: – extend representation: add predicates – Extend operator(resolution): add unification
  • 10. Syntax • See text for formal rules. • All of propositional + quantifiers, predicates, functions, and constants. • Variables can take on values of constants or terms. • Term = reference to object • Variables not allowed to be predicates. – E.G. What is the relationship between Bill and Hillary? • Text Notation: variables lower case, constants upper • Prolog Notation: variables are upper case, etc
  • 11. Semantics • Validity = true in every model and every interpretation. • Interpretation = mapping of constants, predicates, functions into objects, relations, and functions.
  • 12. Advance Artificial Intelligence 12 Predicate Calculus So it is a better idea to use predicates instead of propositions. This leads us to predicate calculus. Predicate calculus has symbols called • object constants, • relation constants, and • function constants These symbols will be used to refer to objects in the world and to propositions about the word.
  • 13. Advance Artificial Intelligence 13 Quantification Introducing the universal quantifier  and the existential quantifier  facilitates the translation of world knowledge into predicate calculus. Examples: Paul beats up all professors who fail him. x(Professor(x)  Fails(x, Paul)  BeatsUp(Paul, x)) There is at least one intelligent UMB professor. x(UMBProf(x)  Intelligent(x))
  • 14. Representing World in FOL • All kings are persons.  goes to? • for all x, King(x) & Person(x). • for all x, King(x) => Person(x).
  • 15. Representing World in FOL • All kings are persons. • for all x, King(x) => Person(x). OK. • for all x, King(x) & Person(x). Not OK. – this says every object is a king and a person. • In Prolog: person(X) :- king(X). • Everyone Likes icecream. • for all x, Likes(x, icecream).
  • 16. Negating Quantifiers • ~ there exist x, P(x) • ~ for all x, P(x) For all x, Likes(x,Icecream) No one likes liver. For all x, not Likes(x,Liver) • For all x, ~P(x) • There exists x, ~P(x) • There does not exist an x, not Likes(x,Icecream) • Not there exists x, Iikes(x,Liver).
  • 17. More Translations • Everyone loves someone. • There is someone that everyone loves. • Everyone loves their father. • See text. • For all x, there is a y(x) such that Loves(x,y(x)). • There is an M such that for all x, Loves(x,M). • M is skolem constant • For all x, Loves(x,Father(x)). • Father(x) is skolem function.
  • 18. Occurs Checking • When unifying a variable against a complex term, the complex term should not contain the same variable, else non-match. • Prolog doesn’t check this. • Ex. f(X,X) and f(Y,g(Y)) should not unify.
  • 19. Modeling with Definite Clauses: at most one positive literal 1. It is a crime for an american to sell weapons to a hostile country. 1’. American(x)&Weapons(y)&Hostile(z) & Sell(x,y,z) => Criminal (x). 2. The country Nono has some missiles. There exists x Owns(Nono,x)&Missile(x). 2’. Missile(M1). … Skolem Constant introduction 2’’. Owns(Nono,M1).
  • 20. Resolution gives forward chaining • Enemy(x,America) =>Hostile(x) • Enemy(Nono,America) • |- Hostile(Nono) • Not Enemy(x,America) or Hostile(x) • Enemy(Nono,America) • Resolve by {x/Nono} • To Hostile(Nono)
  • 21. FOL -> Conjuctive Normal Form • Similar to process for propositional logic, but • Use negations rules for quantifiers • Standarize variables apart • Universal quantification is implicit. • Skolemization: introduction of constants and functions to remove existential quantifiers.
  • 22. Time • Before (x,y) implies After(y,x) • After(x,y) imples Before(y,x) • Before(x,y) and Before(y,z) implies Before(x,z) etc. • When are you done? • What about during?
  • 23. Space and more • In(x,y) and In(y,z) implies in(x,z). • Infront, behind, etc • Frame problem: you turn, some predicates change and some don’t. • etc. And lots more: heat, wind, hitting, physical objects versus thoughts, knowing,