Imagine you
are travelling on the
Emergencies
Press the alarm signal button
to alert the driver.
The driver will stop
if any part of the train is in a station.
If not, the train will continue to the next station,
where help can more easily be given.
There is a 50 pound penalty
for improper use.
The
The purpose of the Emergency Notice is to regulate the behaviour of passengers on the underground train in an
emergency. In this respect, it functions as a program, not to control the behaviour of a computer, but to control the behaviour of people.
To fulfill its purpose, the Notice needs to be unambiguous, so there is
no misunderstanding about its intended meaning; and it needs to be easy to
understand, so that readers can extract that meaning with as little effort as
possible. Like a computer program, it should also be efficient, so that it
achieves its purpose (to get help) as quickly as possible.
The computational nature of the emergency notice is most obvious in the
first sentence:
Press the alarm signal button
to alert the driver.
This has the form of a goal-reduction
procedure:
Reduce the goal of alerting the driver
to the sub-goal of pressing the alarm signal button.
In general, much of our human communication can be understood in such
computational terms, as one human attempting to program another, to elicit a
desired response. In this case, the Management of the Underground is attempting
to program passengers to behave effectively and efficiently in an emergency.
This computational view of human communication may be offensive at first
sight, because it suggests the view that people are merely machines. That is
not my intention.
I intend only to propose that thinking of people as computing agents can
sometimes help us to formulate our communications with them in more effective
and more efficient terms. More effective, because our “programs” will better
accomplish our intentions; and more efficient, because the recipient can
compile and execute the programs with less effort.
The Logic of the second and third
sentences of the Emergency Notice
But human communication can also be understood in logical terms.
Understood in this logical way, communications are collections of sentences
having an underlying logical form, which constitutes their meaning. To
understand an input natural language sentence, a reader or listener needs to
decipher its surface structure, extract its meaning and assimilate that meaning
into a collection of sentences in logical form, which includes both general
background knowledge and the presumed meanings of previously assimilated
sentences.
After constructing such a collection of meanings of the input natural
language sentences, the recipient is then ready to apply these meanings to
problems that arise in the environment. In this respect, natural language
sentences are like a computer program. The process of extracting the logical
meanings of the sentences is like compiling a program from external into
internal form, and the process of applying these meanings to problems in the environment
is like executing the resulting compiled program.
In the example of the emergency notice, the relationship between the
external form of the English sentences and their internal, logical form is most
obvious with the second and third sentences of the Notice, especially with
their use of such obviously logical terms as “if”, “any”, and “if not”.
It is tempting to argue that the Notice is easy to understand just
because the surface structure of its external form is so close to the internal
form of its intended meaning. In fact, the second and third sentences are more
ambiguous than they may appear at first sight. In particular, the second
sentence does not explicitly state what the driver will actually stop doing. It
is unlikely, for example, that:
The driver
will stop causing the emergency
if any part of the train is in a station.
Instead, it is almost certain that:
The driver will stop the train in a
station
If any part of the train is in the
station.
But even this interpretation does not fully capture the sentence’s
intended meaning. Understood in the context of the first sentence, the second
sentence has an additional implicit condition, namely that the driver has been
alerted to an emergency. Therefore, the intended meaning of the second sentence
is:
The driver will stop the train in a station
if
the driver is alerted to an emergency
and any part of the train is in the station.
Without the additional condition, the sentence literally means that the
driver will stop the train whenever the train is in a station, no matter
whether there is an emergency or not. To understand the sentence’s intended
meaning, a reader needs both general background knowledge about the way train
drivers can be expected to behave and specific knowledge of the context.
In the spirit of our interpretation of the second sentence, it is now
clear that the intended meaning of the third sentence is:
The driver will stop the train at
the next station
and help can be given there
better than between stations
if the driver is alerted to an emergency
and not any part of the train is
in a station.
In natural language, it is common to leave out conditions, such as “any part of the train is in the station”, that are
already present in the context. In formal logic, however, sentences stand on
their own two feet, without relying for support on the context around them.
Because sentences in formal logic do not rely on their context, you can
take a collection of sentences written in logical form, throw them up in the
air and then pick them up in any order. The resulting sequence of sentences has
the same meaning as the sentences you started with.
In theory, therefore, if this book were written in purely logical form,
you could read it backwards, forwards or in any other order, and it would have
the same meaning. In fact, much of the work in writing a book like this is in
trying to find a sequence for presenting the ideas so that they are as easy to
understand as possible,
The first
sentence of the Emergency Notice as a Logic Program
The first sentence of the Notice is written in the form of a procedure,
which hides its underlying logical form. In general, a goal-reduction procedure of the form:
Reduce goal to sub-goals
hides a logical implication:
Goal if sub-goals.
The goal-reduction behaviour of the procedure
can be obtained from the implication by backward reasoning:
To conclude that the goal can be
solved,
show that the sub-goals can be
solved.
Thus,
the first sentence of the Emergency Notice has the hidden logical form:
You alert the driver,
if you press the alarm signal
button.
The use of backward reasoning to turn implications into goal-reduction
procedures is called logic programming.
The implications themselves are called logic
programs. Logic programming became quite popular for a while in the 1980s,
and then largely fell into disuse. One of the goals of this book is to argue
that logic programming still has an important role to play, both inside and
outside of Computing.
Backward reasoning contrasts with forward
reasoning, which is probably more familiar. Given an implication of the
form:
If conditions then
conclusion.
and a collection of statements that match the conditions, forward
reasoning derives the conclusion as a logical consequence of the conditions.
Whether to use backward or forward reasoning and whether to use
procedural or logical forms of natural language are some of the main themes of
this book.
In natural language, implications are often hidden below the surface. For example, the last sentence of the Notice has the underlying logic form:
You may get a 50 pound penalty
if you press the alarm signal
button improperly.
Backwards reasoning turns this implication into a goal-reduction
procedure:
To get a 50 pound penalty,
press the alarm signal button
improperly.
It is very unlikely that passengers would want to get a 50 pound
penalty, and very unlikely, therefore, that passengers would use backward
reasoning to reduce such an unlikely goal to subgoals.
More likely, passengers would use forward reasoning instead, to derive that
using the alarm signal button improperly would have an undesirable consequence.
Thus, the sentence acts a constraint rather than as a generator of behaviour.
Since goal-reduction procedures restrict the use of implications to
backward reasoning, the procedural form of the sentence is not appropriate.
This explains why the sentence is written declaratively, rather than
procedurally.
In fact, only the first sentence of the Emergency Notice is written in
procedural form, and only this one sentence of the Notice functions as a normal
program, to evoke the behaviour desired of passengers
on the underground. Indeed, the fourth sentence can be viewed as a constraint,
to prevent undesired behaviour.
The second and third sentences, on the other hand, describe part of a
program to be executed by another agent, namely by the driver of the train. The
sentences are written declaratively and not procedurally precisely because they
are to be executed by another agent, and not by the agent observing the
emergency.
It is implicit that the purpose[1]
(or goal) of the Notice is to explain to passengers how to get help in an
emergency. That is why the third sentence includes the phrase
where help can more easily be given
which explains why the driver does not stop the train immediately when
it is not in a station.
The first sentence of the Notice could be rewritten as three sentences,
to make its purpose explicit:
If there is an emergency then get help.
You get help if you alert the driver.
You alert the driver if you press
the alarm signal button.
Here, just for a change, I have written the second and third sentences
as logic programs. Used to reason backwards, they behave as procedures:
To get help, alert the driver.
To alert the driver, press the alarm
signal button.
The first sentence also has the form of an implication. But its
conclusion is imperative (get help) rather than declarative (you will get
help). It is like a condition-action
rule, but more general, because its conclusion is a goal, rather than just
an action.
Implications with imperative conclusions (including condition-action
rules) can be used to “reason forward”, like logical implications. However,
they do not have all the same properties as logical implications with
declarative conclusions. Logical implications can be used to reason forwards or
backwards, but implications with imperative conclusions can only be used
forward. Declarative statements can be true or false. Imperative statements can
only be obeyed or not obeyed.
Condition-action rules have been used extensively by cognitive
psychologists as a computational model of the mind. Logic, on the other hand,
has in recent years fallen out of favour as a model
of human reasoning. One of the main purposes of this book is to investigate how
condition-action rules and logic can be reconciled and combined.
[1] The terms “goal” and
“purpose” are interchangeable. Other terms that sometimes have the same meaning
are “motivation”, “reason”, “interest”, “desire”, “objective” “mission”,
“target” etc.