# Philosophy, Computing, and Artificial Intelligence

PHI 319

*Computational Logic and Human Thinking*

Chapter 10 (150-159), Appendix A6 (301-317)
A6

## Abduction and Abductive Logic Programming

"Hypotheses in the form of facts... represent possible
underlying causes of observations; and the process of generating them is
known as *abduction*" (*Computational Logic and Human Thinking*, 151).
Abduction is defeasible reasoning from effects to causes.

In the case of symptoms and diseases, abduction is reasoning from the symptom (and a background theory) to the disease that explains the observation of the symptom.

Abduction is common in rational agents. Why? One reason is that explanations of observations may trigger maintenance goals that the observations themselves do not trigger.

### The Grass is Wet

Suppose that the agent makes the observation that *the
grass is wet*.
There are many possible explanations, but in this part of the
world (Tempe, Arizona) the most likely alternatives are
that it rained or that the sprinkler was on. How does
the agent reason to these explanations?

"[T]reating observations as goals extends the notion of goal,
beyond representing the world as the agent would like it to be in the future, to
explaining the world as the agent actually sees it. This is because the two kinds of
reasoning, finding actions to achieve a goal and finding hypotheses to explain an observation,
can both be viewed as special cases of the more abstract problem of finding
assumptions to deductively derive conclusions" (*Computational Logic and Human Thinking*, 152).
One way to find these explanations is by reasoning
backwards from the observation (treated as a goal) with
beliefs about causal connections represented in the logic program in the form

*effect if cause*

*effect if cause*

.

.

.

*effect if cause*

Suppose that the beliefs about the casual connections are

*the grass is wet if it
rained*.

*the grass is wet if the sprinkler was on*.

In this KB, there are "open" and "closed" predicates. The predicate *wet* is
"closed." It has a
definition (something is *wet* if *it rained* or *the sprinkler was on*).
The predicates *rained* and *was
on* are "open." They have no
definition because they do not occur in the heads of clauses.

"In abduction, we augment our beliefs with assumptions concerning instances of open predicates"
(*Computational Logic and Human Thinking*, 159).
Open predicates provide the possible hypotheses for abduction.

### Finding the Explanation

Backward reasoning from the observation that *the grass is wet* results in two possible
explanations: either *it rained* or *the
sprinkler was on*. The problem is to decide which is the best
explanation.

In general, this is difficult to do.

One way to help decide is to use forward reasoning. Forward reasoning can sometimes derive additional consequences that can be confirmed by past or future observations. The greater the number of such additional observations a hypothesis explains, the better the explanation.

The agent observes that
*the skylight is wet* and reasons forward from *it rained* to the *the skylight is wet*. The agent can conclude
*the grass is
wet* because *it rained*. The hypothesis *it rained*
explains two independent observations. The
hypothesis that *the sprinkler was on* explains only
one.

## Integrity Constraints

Another way to decide between possible explanations is in
terms of the consistency of the explanation with
observations. In the "grass is wet" example, there are two
possible explanations of *the grass is wet*. It might
be that *it rained* or that *the sprinkler was
on*. Suppose, however, that the agent observes that there
are clothes outside on the line and that the clothes are dry.
The hypothesis that *it rained* does not explain why
the clothes are dry. In fact, the hypothesis is inconsistent
with this observation. This inconsistency eliminates *it
rained* as an explanation.

One way to incorporate the consistency requirement is with the an *integrity
constraint*.

Integrity constraints work like prohibitions. In the "runaway trolley" example (in the last lecture), the agent reasons forward from the items in the plan to consequences to determine if any of these consequences trigger a prohibition. If they do, the agent abandons the plan because the prohibition makes it impossible both to accept the plan and to not do something wrong. In the "grass is wet" example, the agent reasons forwards from possible explanations to consequences of those explanations. If any of these consequences are inconsistent with what the agent knows, the agent abandons the explanation because the integrity constraint makes it impossible both to accept the explanation and maintain the integrity of his knowledge base.

Let the integrity constraint be

*if a thing is dry and the thing is
wet, then false*.

Now suppose the beliefs are

*the clothes outside are
dry*.

*the clothes outside are wet if it rained*.

Suppose the hypothesis is

*it rained*.

Forward reasoning yields

*the clothes outside are wet*

Forward reasoning with this consequence and the constraint yields

*if the clothes outside are dry,
then false*

More forward reasoning yields

*false*

This eliminates the hypothesis
that *it rained* as an explanation of the
observation that the *grass is wet*.

## On the Difficulty of Reasoning Backwards

"If P = NP, then the ability to *check* the solutions to puzzles efficiently would imply the ability to
*find* solutions efficiently. An analogy would be if anyone able to *appreciate* a great symphony
could also compose one themselves!" (Scott Aaronson,
"Why Philosophers Should Care About Computational Complexity").

**P** is the set of yes/no problems that can be
solved in polynomial time.
These problems are "tractable" because they can be solved
"quickly" as the size of the input increases.

**NP** is the set of yes/no problems such that
if the answer is "yes," the proof can be checked in polynomial time.

It is generally thought
that **P** ≠ **NP**,
but no one has proven that this is true. This is one of the Millennium Problems.

For an example of **P** vs **NP** in the context of logic, consider the problem of finding an
interpretation that makes a propositional formula true.
(If an interpretation exists, the formula is said to be
*satisfiable*. If no such interpretation exists, the
formula is said to be *unsatisfiable*.)
No one knows how to solve this problem in less
than exponential time, but if an interpretation is supplied,
it can be verified in polynomial time that this interpretation makes the formula true.

HORNSAT (Horn-satisfiability) is in **P**.
"In solving a problem ... sort, the grand thing is to be able to
reason backward. That is a very useful accomplishment, and a very easy one, but people do not
practise it much. In the everyday affairs of life it is more useful to reason forward,
and so the other comes to be neglected. There are fifty who can reason synthetically
for one who can reason analytically."

"I confess, Holmes, that I do not quite follow you."

"I hardly expected that you would, Watson. Let me see if I can make it clearer.
Most people, if you describe a train of events to them, will tell you what the result would be.
They can put those events together in their minds, and argue from them that something will come to pass.
There are few people, however, who, if you told them a result, would be able to evolve from
their own inner consciousness what the steps were which led up to that result. This power is what
I mean when I talk of reasoning backwards, or analytically"
(Arthur Conan Doyle,
*A Study in Scarlet*, 58).

"A primitive man wishes to cross a creek; but he cannot do so in the usual way because the water has risen
overnight. Thus, the crossing becomes the object of a problem; “crossing the creek’ is the x of this
primitive problem. The man may recall that he has crossed some other creek by walking along a fallen tree.
He looks around for a suitable fallen tree which becomes his new unknown, his y. He cannot find any suitable
tree but there are plenty of trees standing along he creek; he wishes that one of them would fall. Could he
make a tree fall across the creek? There is a great idea and there is a new unknown; by what means could he
tilt the tree over the creek?

This train of ideas ought to be called analysis if we accept the terminology of Pappus.
If the primitive man succeeds in finishing his analysis he may become the inventor of the bridge
and of the axe.
Pappus of Alexandria, Greek geometer, 4th century CE.
What will be the synthesis? Translation of ideas into actions. The finishing act of
the synthesis is walking along a tree across the creek
(George Pólya,
*How to Solve it*).

## What we have Accomplished in this Lecture

We considered abductive reasoning, its importance to rational agents, and how to incorporate this kind of reasoning in the logic programming/agent model.