SlideShare a Scribd company logo
1 of 23
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

Similar to predicateLogic.ppt

Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)SURBHI SAROHA
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicArchanaT32
 
chapter2 Know.representation.pptx
chapter2 Know.representation.pptxchapter2 Know.representation.pptx
chapter2 Know.representation.pptxwendifrawtadesse1
 
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
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prologsaru40
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxPriyalMayurManvar
 
Ch2 (8).pptx
Ch2 (8).pptxCh2 (8).pptx
Ch2 (8).pptxDeyaHani
 
1. Introduction to math logic.pptx
1. Introduction to math logic.pptx1. Introduction to math logic.pptx
1. Introduction to math logic.pptxssuserabc12e
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prologbaran19901990
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfHrideshSapkota2
 

Similar to predicateLogic.ppt (20)

Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional Logic
 
AI Lesson 11
AI Lesson 11AI Lesson 11
AI Lesson 11
 
chapter2 Know.representation.pptx
chapter2 Know.representation.pptxchapter2 Know.representation.pptx
chapter2 Know.representation.pptx
 
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)
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prolog
 
Logic
LogicLogic
Logic
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
 
Dependency-Based Word Embeddings
Dependency-Based Word EmbeddingsDependency-Based Word Embeddings
Dependency-Based Word Embeddings
 
AI-09 Logic in AI
AI-09 Logic in AIAI-09 Logic in AI
AI-09 Logic in AI
 
Ch2 (8).pptx
Ch2 (8).pptxCh2 (8).pptx
Ch2 (8).pptx
 
1. Introduction to math logic.pptx
1. Introduction to math logic.pptx1. Introduction to math logic.pptx
1. Introduction to math logic.pptx
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
Logic (1)
Logic (1)Logic (1)
Logic (1)
 
Logic
LogicLogic
Logic
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
1019Lec1.ppt
1019Lec1.ppt1019Lec1.ppt
1019Lec1.ppt
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdf
 

Recently uploaded

Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
“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
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
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
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 

Recently uploaded (20)

9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
“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...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
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
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 

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,