review : quantifiers a key to predicate logic we have been ignoring is the inclusion of quantifiers...

20
REVIEW : Quantifiers • A key to predicate logic we have been ignoring is the inclusion of quantifiers • You should recall from discrete that you can also write statements such as x fast(x) implies horse(x) y fast(y) implies valuable(y)

Upload: julius-elliott

Post on 18-Jan-2016

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

REVIEW : Quantifiers

• A key to predicate logic we have been ignoring is the inclusion of quantifiers

• You should recall from discrete that you can also write statements such as – x  fast(x) implies horse(x)– y  fast(y) implies valuable(y)

Page 2: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Rules of Inference

• Modus Ponens p ^ (p -> q) -> q

• In other words, if you have an implication rule in the knowledge base AND the left hand side of the implication rule (the antecedent) then you can infer the right hand side of the rule (the consequent)

Page 3: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Rules of Inference

• Modus Tolens q’ ^ (p -> q) -> p’

• In other words, if you have an implication rule in the knowledge base AND the negation of the consequent than you can imply the negation of the antecedent

Page 4: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

CAUTION

• Do not try to use either p’ ^ (p -> q) -> q’

(If today is not my birthday than I can infer that I won’t get presents??? Not true!)

q ^ (p -> q) -> p

(If I get presents today it must be my birthday)

Page 5: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Consider the following

Using rules of inference, what can you add to this knowledge base?

For each new fact, document how it was infered.

Page 6: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

HW#4 Assigned today

• Short paper pencil activity converting English to Predicate Logic and then using Modus Ponens and inference to prove a claim (fact).

• Due on Monday.

Page 7: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

• The “name” of a symbol does not matter in reasoning with the symbol.

• Only the semantics attached to the name matter.

Page 8: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

is the Universal quantifier.  It means "for all"

x P(x)  is true in a model m iff P is true with x being each possible object in the world.

• Roughly speaking, it is the equivalent of the conjunction of instantiations of PP(a) ^ P(b) ^ P(c) ....

Page 9: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

• Typically, -> is the main connective with x   At(x,UNI)  ->  Smart(x)       – [Everyone at UNI is smart]

• Common mistake is to use ^ as the connective with x   At(x,UNI)  ^  Smart(x)      – [Everyone is at UNI and everyone is smart]

Page 10: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

is the Existential quantifier.  It means "there exists"

x P  is true in a model m iff P is true with x being one possible object in the world.

• Roughly speaking, is equivalent of the disjunction of instantiations of PP(a) V P(b) V P(c) ....

Page 11: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

• Typically, ^ is the main connective with x   At(x,Iowa)  ^  Smart(x)       – [Someone at Iowa is smart]

• Common mistake is to use -> as the connective with x   At(x,Iowa)  ->  Smart(x)     – [This is true if there is anyone not at Iowa]

Page 12: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

x y is the same as y x x  y is the same as  y x x  y is not the same as y x

x  y Loves (x,y)    • ["There is a person who loves everyone in the world"]

y x  Loves (x,y)  • ["Everyone in the world is loved by at least one

person"

Page 13: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Some things to keep in mind

• Quantifier duality: each can be expressed using the other

x  Likes(x,IceCream)

¬ ( x  ¬Likes(x,IceCream))

x  Likes(x,Broccoli)        

¬ ( x   ¬Likes(x,Broccoli))

Page 14: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Try writing the following:

• Brothers are Siblings

• Sibling is reflexive

• One’s mother is one’s female parent

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

Page 15: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Try writing the following

Page 16: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

One more outburst like that and you’ll be in contempt of court

• Straightforward Answer:haveOutburst(You) and inContempt(You)

• Consequence:inContempt(You) must be true!

• Intended Meaning:haveOutburst(You) implies inContempt(You)

Page 17: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

The Walking Dead is on TV tonight if you’re interested

• Straightforward Answer: interested( You, The Walking Dead ) implies onTubeTonight( The Walking Dead )

• Consequence:What if I am not interested?

• Intended Meaning:onTubeTonight( The Walking Dead ) ^

(interested( You, The Walking Dead ) implies canWatchTonight( You,The Walking Dead ) )

Page 18: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Either the Steelers win the Super Bowl, or I’m out $10.00.

• Straightforward Answer:win( Steelers, SuperBowl(2014) ) or  lose(JBS, $10)

• Consequence:What if the Steelers win?  Where is the causality?

• Intended Meaning:Prevent( win(Steelers, SuperBowl(2014) ) , lose(JBS, $10) )

Page 19: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Maybe I’ll come to your party, and maybe I won’t

• Straightforward Answer:

(maybe( comeTo( JBS, YourParty ) ) ) or

(maybe( not comeTo( JBS, YourParty ) ) )• Consequence:

That’s a tautology

We need an operator that deals with possibility...

• Intended Meaning:Undecided comeTo(JBS,YourParty)

Page 20: REVIEW : Quantifiers A key to predicate logic we have been ignoring is the inclusion of quantifiers You should recall from discrete that you can also write

Well, I like Bob and I don’t like Bob.

• Straightforward Answer:

like(JBS,Bob) ^ not like(JBS,Bob)

• Consequence:That’s a contradiction

We need to represent states explicitly.

• Intended Meaning: way1, way2 like(JBS, Bob, way1) ^ like(JBS,Bob,way2)