0% found this document useful (0 votes)
49 views35 pages

First-Order Logic - w9

The document provides an overview of first order logic including: - Universal and existential quantification symbols - Examples of translating sentences to first order logic - Inference rules for first order logic including universal elimination, existential elimination, and existential introduction - The process of unification to combine terms and find substitutions - Examples of proofs in first order logic - The sound generalized modus ponens rule of inference - Converting sentences to Horn form for efficient inference

Uploaded by

Mudathir Ayomide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views35 pages

First-Order Logic - w9

The document provides an overview of first order logic including: - Universal and existential quantification symbols - Examples of translating sentences to first order logic - Inference rules for first order logic including universal elimination, existential elimination, and existential introduction - The process of unification to combine terms and find substitutions - Examples of proofs in first order logic - The sound generalized modus ponens rule of inference - Converting sentences to Horn form for efficient inference

Uploaded by

Mudathir Ayomide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 35

First Order Logic

Universal quantification (for all): 


 <variables> <sentence>

• “Every one in the cs561 class is smart”:


 x In(cs561, x)  Smart(x)

  P corresponds to the conjunction of instantiations


of P
In(cs561, Manos)  Smart(Manos) 
In(cs561, Dan)  Smart(Dan) 

In(cs561, Clinton)  Smart(Clinton)
Existential quantification (there exists): 

  is a natural connective to use with 

• Common mistake: to use  in conjunction with 

e.g:  x In(cs561, x)  Smart(x)


is true if there is anyone that is not in cs561!
(remember, false  true is valid).
Properties of quantifiers

Not all by one


person but
each one at
least by one

Proof?
Example sentences
• Brothers are siblings

• Sibling is transitive

• One’s mother is one’s sibling’s mother

• A first cousin is a child of a parent’s sibling

.
Example sentences
• Brothers are siblings

 x, y Brother(x, y)  Sibling(x, y)

• Sibling is transitive

 x, y, z Sibling(x, y)  Sibling(y, z)  Sibling(x, z)

• One’s mother is one’s sibling’s mother

 m, c, d Mother(m, c)  Sibling(c, d)  Mother(m, d)

• A first cousin is a child of a parent’s sibling

 c, d FirstCousin(c, d)   p, ps Parent(p, d)  Sibling(p, ps)  Parent(ps, c)


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)
Translating English to FOL
• You can fool all of the people some of the time.
 x  t (person(x) ^ time(t) =>
can-fool(x,t)

• All purple mushrooms are poisonous.


 x (mushroom(x) ^ purple(x)) =>
poisonous(x)
Translating English to FOL…

• No purple mushroom is poisonous.

¬( x) purple(x) ^ mushroom(x) ^ poisonous(x)

or, equivalently,

( x) (mushroom(x) ^ purple(x)) =>


¬poisonous(x)
Examples
• A sibling is another child of one’s parent
 x,y Sibling(x, y)  ¬(x=y)  p Parent(p, x)  Parent(p, y)

• A set is a subset of another iff all of the first set’s members re members of the
second set

 s1,s2 Subset(s1, s2)  (x Member (x, s1) =>Member (x,s2 )

• Two sets are equal iff each is a subset of the other

 s1,s2 (s1= s2)  (Subset (s1, s2)  Subset (s2,s1 )


Translating English to FOL…

• All purple mushrooms are poisonous.


 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) v (y=z))

• Deb is not tall.

¬tall(Deb)
Translating English to FOL…

• X is above Y if X is on directly on top of Y or else


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) v


( z) (on(x,z) ^ above(z,y)))
Equality

Spot has at least two sisters

x,y Sister(Spot,x) ^ Sister(Spot,y) ^ ¬ (x=y)


Wumpus world example
Wumpus world, FOL Knowledge
Base
Deducing hidden properties
Remember:
propositional
logic
• Ground term: A term that does not contain a
variable.
– A constant symbol
– A function applies to some ground term

• {x/a}: substitution/binding list


Proofs
Proofs
The three new inference rules for FOL (compared to propositional logic) are:

• Universal Elimination (UE):


for any sentence , variable x and ground term ,
x  e.g., from x Likes(x, Candy) and {x/Joe}
{x/} we can infer Likes(Joe, Candy)

• Existential Elimination (EE):


for any sentence , variable x and constant symbol k not in KB,
x  e.g., from x Kill(x, Victim) we can infer
{x/k} Kill(Murderer, Victim), if Murderer new symbol

• Existential Introduction (EI):


for any sentence , variable x not in  and ground term g in ,
 e.g., from Likes(Joe, Candy) we can infer
x {g/x} x Likes(x, Candy)
Example Proof
Example Proof
Example Proof
Example Proof

4&5
Search with primitive example
rules
Unification

Goal of unification: finding σ


Unification

{y/John, x/OJ}
More Unification Examples

VARIABLE term

1 – unify(P(a,X), P(a,b)) σ = {X/b}


2 – unify(P(a,X), P(Y,b)) σ = {Y/a, X/b}
3 – unify(P(a,X), P(Y,f(a)) σ = {Y/a, X/f(a)}
4 – unify(P(a,X), P(X,b)) σ = failure

Note: If P(a,X) and P(X,b) are independent, then we


can replace X with Y and get the unification to
work.
Generalized Modus Ponens
(GMP)
Soundness of GMP
Properties of GMP
• Why is GMP and efficient inference rule?

- It takes bigger steps, combining several small inferences into one

- It takes sensible steps: uses eliminations that are guaranteed


to help (rather than random UEs)

- It uses a precompilation step which converts the KB to canonical


form (Horn sentences)

Remember: sentence in Horn from is a conjunction of Horn clauses


(clauses with at most one positive literal), e.g.,
(A  B)  (B  C  D), that is (B  A)  ((C  D)  B)
Horn form
• We convert sentences to Horn form as they are entered
into the KB
• Using Existential Elimination and And Elimination

• e.g., x Owns(Nono, x)  Missile(x) becomes

Owns(Nono, M)
Missile(M)

(with M a new symbol that was not already in the KB)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy