extensions to fol. when the form of the statements provides useful information rule-based systems...

41
Extensions to FOL

Upload: camron-beasley

Post on 17-Dec-2015

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Extensions to FOL

Page 2: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Extensions to FOL•When the form of the statements provides useful information

•Rule-based systems

•Frame systems

•When FOL isn’t enough

•Default reasoning and circumscription

•Reasoning with uncertainty

•Degrees of membership (fuzzy logic)

•Reasoning about belief

Page 3: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

What Does Really Mean?

HasChildren Mother A B definition of B

Raining Wet A B A causes B

Fever Infection A B A is a symptom of BB causes A

LikeBig GetHummer A B whenever A occurs,B usually does too

So how should we reason with these very different things?

Page 4: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Rule-Based SystemsThe logic:

a b is equivalent to: a b

So, given: fever infection fever infection fever

Conclude: infection

Given: fever infection fever infection infection

Conclude: fever

But are these two inferences equally useful?

Page 5: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

An Example for a Design Task: XCON (1982)

From XCON (1982):If: the most current active context is distributing

massbus devices, and there is a single-port disk drive that has not been

assigned to a massbus, and there are no unassigned dual-port disk drives, and the number of devices that each massbus should support is known, and there is a massbus that has been assigned at least one disk drive that should support additional disk drives, and the type of cable needed to connect the disk drive to the previous

device on the massbus is knownThen: assign the disk drive to the massbus.

Page 6: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

An Example for a Diagnosis Task: Mycin (1975)

If: (1) the stain of the ogranism is gram-positive, and (2) the morphology of the organism is coccus, and (3) the growth conformation of the organism is clumps

Then: there is suggestive evidence (0.7) that the identity of the organism is staphylococcus.

Page 7: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Simple Examples Today

eXpertise2Go: http://www.expertise2go.com/

AcquiredIntelligence: http://www.aiinc.ca/demos/

(whales, graduate school)

DecisionScript: http://www.vanguardsw.com/decisionscript/Examples.htm

Page 8: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Implementation of Rule-Based Systems

•Prolog: The KB: reply(sampcor) :- a, b

A query: ?- reply(X)

Use backward chaining to answer the question.

•Expert system shells: Typically combine methods

If (1) the suggested technique category is correlation and regression analysis, and (2) one of the values of the desired correlation/regression result is a measure of the degree to which 2 variables move together Then the suggested analysis approach is to calculate a sample correlation coefficient

If a b reply(sampcor)

Page 9: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Expert System Shells

Some rules are best used in forward chaining mode. For example, data collection and reasoning from symptoms.

Other rules (e.g., how to achieve goals) are best used in backward chaining mode.

All these rules may also want to exploit other kinds of knowledge, like default information associated with classes of objects:

Page 10: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Inheritance, Again

birds canfly T

ISA ISA

robins ostriches canfly F Instance-of Instance-of

Tweety Richy

Scooter is a bird. Can Scooter fly?

Page 11: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Inheritance

Objects inherit from their parents:•Scooter inherits from Bird the facts that:

•its birthmode is eggs, and•it has two wings

Should Scooter inherit from Bird the fact that it can fly?

Page 12: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Default Reasoning

•The importance of default reasoning

•Default reasoning is nonmonotonic.

•Techniques for default reasoning

•Inheritance

•The closed world assumption

•Circumscription

•Maintaining consistency in nonmonotonic reasoning systems

Page 13: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Default Reasoning - Examples

Inheritance from superclasses:x bird(x) canfly(x) UNLESS ostrich(x)

The “normal” case:x bird(x) canfly(x) UNLESS (broken-wing(x)

sick(x) in(oil-slick, x))

The closed world assumption:can cats fly?

Abduction:infection fever Given fever, can we

conclude infection?

Page 14: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Default Reasoning in Nonmonotonic

Inference in FOL systems is monotonic:

The addition of any new assertion that is consistent with the KB will never cause a formula that was previously true to become false.

Default reasoning may be nonmonotonic:Birds can fly.Tweety is a bird. Tweety can fly.

But what if we now learn:

Tweety is an ostrich. orTweety has a broken wing.

Page 15: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Implementing Inheritance

birds canfly T

ISA ISA

robins ostriches canfly F Instance-of Instance-of

Tweety Richy

If we implement inheritance procedurally, we don’t have to write the UNLESS clauses. We assume Tweety isn’t an ostrich.

Page 16: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

The Closed World Assumption

The CWA: Any ground atomic sentences that are not asserted to be true in the KB can be assumed to be false.

We make the closed world assumption for two reasons:•We have to. In any complex domain, there may be a huge number of possible facts and there isn’t time to mention each of them explicitly:

•A database of classes mentions the ones that are offered.•An inventory database mentions all the objects on hand.•An airline scheduling system assumes that it will be told if the power is out or the terminal has burned down or is held by terrorists or there is a storm.

•It is consistent with felicitous human communication.

Page 17: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Implementing the CWA: Negation as Failure

A common way to implement the CWA: Interpret failure to prove p as a proof of p.

Example:

hasonhand(x) uses(x) mustorder(x)

How do we prove hasonhand(x)?

Page 18: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Circumscription

x bird(x) canfly(x) UNLESS (broken-wing(x) sick(x) in(oil-slick, x))

Is different from:x bird(x) broken-wing(x) sick(x) in(oil-slick, x)

canfly(x)Or:x bird(x) adult(x) withmother(x)

One way to implement this is to create the predicate Abnormal:

x bird(x) canfly(x) UNLESS Abnormal(x)(broken-wing(x) sick(x) in(oil-slick, x)) Abnormal(x)

Page 19: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Circumscription

Then we circumscribe Abnormal, i.e., we prefer models in which Abnormal is true of the smallest possible number of individuals consistent with the rest of the KB.

But what happens if we are told just:bird(Tweety) and then we conclude canfly(Tweety)

Then we are told:broken-wing(Tweety)

How do we undo the conclusion canfly(Tweety)?

Page 20: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Abbott, Babbitt, and Cabot

Page 21: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Truth Maintenance Systems

The basic idea: Associate with each assertion one or more justifications. Believe any assertion with at least one valid justification.

Each justification is composed of two parts:•An IN-list•An OUT-list

We will define the operation of a TMS that operates as a service to a separate reasoning system. The TMS doesn’t make choices. It is just a bookkeeper.

Page 22: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

The Structure of a Justification

Page 23: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Before Alibis

Page 24: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Abbott’s Situation, with Alibi

Page 25: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Babbitt’s Situation

Page 26: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Cabot’s Situation

Page 27: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

The Big Picture

Page 28: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

New Facts Come In

Page 29: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Deciding How to Resolve the Conflict

Page 30: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Abduction

Examples:

infection fever measles spotsraining wetsidewalks

If given:

fever, can we conclude infection?spots, can we conclude measles?wetsidewalks, can we conclude raining?

Page 31: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Uncertainty and Fuzziness

•Degrees of truthJohn is tall.John is very tall.

•Probability of truthJohn is in Austin (p = .6)Coin is heads (p = .5)

•Certainty of beliefJohn is in Austin (c = .2) a wild guessCoin is heads (c = 1) sure it’s 50/50

Page 32: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

When Must We Deal with Uncertainty?•Diagnosis:

Observe: spots, fever, headache. What’s wrong with the patient?Observe: clothes are wrinkled and hot. What’s wrong with the dryer?

•Interpretation:

•Speech understanding•Language understanding•Image understanding•Data interpretation

•Planning:

If I turn the steering wheel, where will the car go?

Page 33: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Probabilistic Reasoning

P(strep) = x (the probability that a random person has strep right now)

P(staph) = y (similar)

Suppose that we can use the same drug in either case, so we want to know

P(strep staph) =

Page 34: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Probabilistic Reasoning

P(strep) = x (the probability that a random person has strep right now)

P(staph) = y (similar)

Suppose that we can use the same drug in either case, so we want to know

P(strep staph) = P(strep) + P(staph) - P(strep staph)

Page 35: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Probabilistic ReasoningSuppose There are Three Factors

P(a b c) = P(a) + P(b) + P(c) - P(a b) - P(a c) - P(b c)+P(a b c)

P(a b c) = P(a b c)- P(a) - P(b) - P(c) + P(a b) + P(a c) + P(b c)

Page 36: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Conditional Probability

P(measles spots) = P(measles | spots) P(spots) definitionP(measles spots) = P(spots | measles) P(measles)

P(measles | spots) = P(measles spots) definition P(spots)

P(measles | spots) = P(spots | measles) P(measles) Bayes Rule

P(spots)

Page 37: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Examples from Diagnosis and Interpretation

P(measles | spots) = P(spots | measles) P(measles) P(spots)

P(word x | sound y) = P(sound y | word x) P(word x) P(sound y)

Word = Argmax(P(sound y | word x) P(word x)) x

Page 38: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Naïve Bayes ClassifierWhat if Multiple Observations Are Available? P(measles | spots fever)

= P(spots fever | measles) P(measles) P(spots fever)

Assume spots and fever are independent:

= P(spots fever | measles) P(measles) P(spots fever)

= P(spots|measles) P(fever | measles) P(measles) P(spots) P(fever)

Disease = Argmax(P(spots|x) P(fever |x) P(x) ) x

Page 39: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Not Quite So Naïve Bayes ClassifierComparing chicken pox (pox) to measles:

P(measles | spots fever)

= P(spots fever | measles) P(measles) P(spots fever)

Assume spots and fever are independent given measles or pox and measles and pox are independent:

= P(spots|measles) P(fever | measles) P(measles) P(spots fever)

= P(spots|measles) P(fever | measles) P(measles) P(spots|measles)*P(fever|measles)*P(measles) + P(spots|pox)* P(fever|pox)*P(pox)

Disease = Argmax(P(spots|x) P(fever |x) P(x) ) x

Page 40: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Learning Naïve Bayes Classification

An important aspect of naïve Bayes classification is that a classifier can be learned.

Where do numbers like p(spots | measles) come from?

Answer:

patient diagnosis fever cough spots sore throat sneezes achy

1 Measles Yes Yes Yes No No Yes

2 Measles Yes No Yes No No Yes

3 Measles Yes No No No No No

4 Chickenpox Yes No Yes Yes No No

5 Chickenpox Yes No Yes No No No

Page 41: Extensions to FOL. When the form of the statements provides useful information Rule-based systems Frame systems When FOL isn’t enough Default reasoning

Various ad hoc Approaches

Unfortunately, it often happens that we don’t have all the joint probabilities required to compute true probabilities for our conclusions. So a variety of approximate methods are used.

http://www.expertise2go.com/webesie/tutorials/Inference/Confidence1.htm