The Changing World

 

I have argued that the purpose of logic is to help an agent survive and prosper in the world. Logic serves this task by providing the agent with a means for constructing symbolic representations of the world and for processing those representations to reason about the world. We have pictured this relationship between logic and the world like this:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


However, we have not yet considered the nature of this relationship in any detail. In particular, we have ignored any considerations about the way in which logical representations are related to the structure of the world. There are two parts to these considerations: what is the relationship between logic and static states of the world, and what is the relationship between logic and change. We shall consider these two issues now.

World structures

 

The relationship between logic and the world can be seen from two points of view. Seen from the perspective of the world, sentences of logic represent certain features of the world. Seen from the perspective of logic, the world gives meaning to sentences. This second viewpoint is also called “semantics”.

 

Although a real agent needs to worry only about the real world, it is convenient to consider other possible worlds, including artificial and imaginary worlds, like the world in the story of the fox and the crow. Both kinds of world, both real and possible, can be understood in similar terms, as world structures. A world structure is just a collection of individuals and relationships among them. Relationships are also called “facts”. In traditional logic, “world structures” are usually called “interpretations”, “models”, or sometimes “possible worlds”. For simplicity, properties of individuals are also regarded as relationships.

 

Traditional logic has a very simple semantics, in terms of whether or not sentences are true or false in a world structure. Sentences that are true are normally more useful to an agent than sentences that are false.

 

A world structure generally corresponds to a single, static state of the world. For example:

 

In the story of the fox and the crow, the fox, crow, cheese, tree, ground under the tree, and airspace between the crow and the ground can be regarded as individuals; and someone having something can be regarded as a relationship between two individuals. The sentence “The crow has the cheese.” is true in the world structure at the beginning of the story and false in the world structure at the end of the story.

 

An atomic sentence is true in a world structure if the relationship it expresses holds in the world structure, and otherwise it is false.

 

The simplest way to represent a world structure in logical terms is to represent it by the set of all atomic sentences that are true in the structure – in this example we might represent the world structure at the beginning of the story by the atomic sentences:

 

            The crow has the cheese.

            The crow is in the tree.

            The tree is above the air.

            The air is above the ground.

            The tree is above the ground.

            The fox is on the ground.

 

The difference between such atomic sentences and the world structure they represent is that in a world structure the individuals and the relationships between them have a kind of external existence that is independent of language. Atomic sentences, on the other hand, are merely symbolic expressions that stand for such external relationships. In particular, words and phrases like “the crow”, “the cheese”, “the tree”, etc. are names of individuals and “has”, “is in”, etc. are names of relations between individuals.

 

The attraction of logic as a way of representing the world lies mainly its ability to represent regularities in world structures by means of non-atomic sentences. For instance, in the example above:

 

            One object is above another object

            if the first object is above a third object

            and the third object is above the second.

 

The truth value of non-atomic sentences is defined in terms of the truth values of simpler sentences - for example, by means of such “meta-sentences” as:

 

            A sentence of the form “conclusion if conditions” is true

            if  conditions” is true and  “conclusion” is true 

            or “conditions” is not true.

 

            A sentence of the form “everything has property P” is true

            if  for every thing T in the world, “T has property P” is true.

Dynamic world structures

 

World structures in traditional logic are static, in the sense that they represent a single, static state of the world. One natural way to understand change is to view actions and other events as causing a change of state from one static world structure to another.         For example:

The crow has the cheese.

 

The crow is

in the tree.

 

The fox is on

the ground.

 

It is raining.

 

 

 

The crow has the cheese.

 

The crow is

in the tree.

 

The fox is on

the ground.

 

It is raining.

 

 

 

The crow has the cheese.

 

The crow is

in the tree.

 

The fox is on

the ground.

 

It is raining.

 

 

 
 


                                        

 

 

 


The fox praises     The fox praises                             The crow sings.

                              the crow.

 

 

 

 

 

 

 


                       

 

The cheese is on the ground.

 

The crow is

in the tree.

 

The fox is on

the ground.

 

It is raining.

 

 

 

The cheese is in the air.

 

The crow is

in the tree.

 

The fox is on

the ground.

 

It is raining.

 

 

 

 

 

 


                               The cheese                                       The fox picks

                               stops falling.                                     up the cheese.

 

 

 

 

 

 

 

 

This view of change is the basis of the semantics of modal logic. In modal logic, sentences are given a truth value relative to a static world structure embedded in a collection of world structures linked by state-transforming events. Syntactic expressions such as “in the past”, “in the future”, “after”, “since” and “until” are treated as modal operators, which are logical connectives, like “and”, “or”, “if”, “not” and “all”.  The truth value of sentences containing such modal operators is defined in terms of the truth values of simpler sentences - for example, by means of such meta-sentences as:

 

            A sentence of the form “in the future P” is true at a world structure S

            if there is a world structure S’

            that can be reached from S by a sequence of state-transforming events

            and the sentence “P” is true at S’.

 

For example, in modal logic, it is possible to express the sentence

 

                        “In the future the crow has the cheese.”

 

This sentence is true in the world structure at the beginning of the story and false in the world structure at the end of the story (assuming that the world ends after the fox picks up the cheese).

 

One objection to the modal logic approach is that its semantics defined in terms of the truth of sentences at a world structure in a collection of world structures linked by state-transforming events is too complicated. One alternative, which addresses this objection, is to simplify the semantics and increase the expressive power of the logical language by treating states of the world as individuals. To treat something as an individual, as though it exists, is to reify it; and the process itself is called reification.

 

The advantage of reification is that it makes talking about things a lot easier. The disadvantage is that it makes some people very upset. It’s alright to talk about material objects, like the fox, the crow and the cheese, as individuals. But it’s something else to talk about states of the world and other similarly abstract objects as though they too were ordinary individuals.

The situation calculus

 

The situation calculus[1], developed by McCarthy and Hayes in Artificial Intelligence, shares with modal logic the same view of change as transforming one state of the world into another, but it reifies states as individuals. As a consequence, world structures are dynamic, because they include state transitions as relationships between states.

 

For example, in the situation calculus, in the story of the fox and the crow, there is only one world structure and it contains, in addition to ordinary individuals, individuals that are global states. It is possible to express such sentences as:

 

               “The crow has the cheese in the state at the beginning of the story.”

 

               “The crow has the cheese in the state

               after the fox picks up the cheese,

               after the cheese stops falling,

               after the cheese starts falling,

               after the crow sings,

               after the fox praises the crow,

               after the state at the beginning of the story.”

 

The first of these two sentences is true and the second is false in the situation calculus world structure.

 

Reifying states of the world as individuals makes it possible to represent and reason about the effect of actions on states of affairs. If we also reify “facts”, then this representation can be formulated as two situation calculus axioms:

 

            A fact holds in the state of the world after an action,

            if the fact is initiated by the action

            and the action is possible in the state before the action.

 

            A fact holds in a state of the world after an action, 

            if the fact held in the state of the world before the action

            and the action is possible in the state before the action

            and the fact is not terminated by the action.

 

Our original version of the story of the fox and the crow can be reformulated in situation calculus terms (simplifying the first axiom by particularising it to this special case):

 

                        An animal has an object

                        in the state of the world after the animal picks up the object

if the animal is near the object

in the state of the world before the animal picks up the object

 

                                                                                                                        I am near the cheese

                        in the state of the world after the crow sings

if the crow has the cheese

in the state of the world before the crow sings

 

 

                        The crow sings

                        in the state of the world after I praise the crow.

 

In theory, an agent, such as the fox, could include such axioms among its beliefs, to plan its actions, infer their consequences, and infer the consequences of other agents’ actions. In practice, however, the use of the second axiom (called “the frame axiom”), to reason about facts that are not affected by actions, is computationally explosive. This problem, called “the frame problem”, is often taken to be an inherent problem with the use of logic to reason about change.

 

Arguably, it is not logic that is the source of the problem, but the situation calculus view of change, which it shares with modal logic and which is too global. Every action, no matter how isolated, is regarded as changing the entire state of the world. Even worse than that, to reason about the state of the world after a sequence of actions, it is necessary to know all the other actions that take place throughout the entire world in the meanwhile.

 

Thus to reason about the state of the world after the fox praises the crow, the crow sings, the cheese falls and the fox picks up the cheese, it is necessary to know and reason about everything that has happened everywhere else in the world between the beginning and the end of the story. This kind of thinking is not so difficult in the imaginary world of the fox and the crow, but it is clearly impossible for a real agent living in the real world.

An event-oriented approach to change

 

One alternative is to abandon the view that actions transform global states of the world and replace it with the view that actions and other events can occur simultaneously in different parts of the world, independently and without affecting other parts of the world. In this alternative approach, the focus is on the occurrence of events and on the effect of events on local states of affairs.

 

Events include both ordinary actions, which are performed by agents, and other events, like the cheese landing on the ground, which can be understood metaphorically as actions that are performed by inanimate objects.

 

For simplicity, we can assume that events occur instantaneously. For this purpose, an event that has duration can be decomposed into an instantaneous event that starts it, followed by a state of continuous change, followed by an instantaneous event that ends it.  Thus the cheese falling to the ground can be decomposed into the instantaneous event in which the cheese starts to fall, which initiates the state during which the cheese is actually falling, which is terminated by the instantaneous event in which the cheese lands.

 

Events initiate and terminate relationships among individuals. These relationships, together with the periods for which they hold, can be regarded as local states of affairs. We can picture such a local state and the events that initiate and terminate it like this:

 

 

 

In the story of the fox and the crow, we can picture the effect of events on the state of the cheese like this:

 

 

A simplified calculus of events

 

Although we can represent world structures by atomic sentences, logic allows us to represent them more compactly by means of non-atomic sentences. In particular, we can derive information about local states of affairs from information about the occurrence of events, by means of the following event calculus axiom[2]:      

 

            A fact holds at a point in time,

            if an event happened earlier

            and the event initiated the fact

            and there is no other event

                   that happened after the initiating event and before the time point and

                   that terminated the fact.

 

Because this axiom uses information about the occurrence of events to “calculate” information about local states of affairs, we call it the “event calculus”.

 

The event calculus can be used, like the situation calculus, by an agent to plan its actions, infer their consequences, and infer the consequences of other agents’ actions. Because it requires only localised knowledge of the affect of events, it is potentially more practical than the situation calculus.

 

To apply the event calculus in practice, it needs to be augmented with other axioms that define initiation, termination and temporal order. In the case of the changing location of the cheese in the story of the fox and the crow, we need information about the events that affect that location – for example:

 

The cheese falls at time 3.

The cheese lands at time 5.

            The fox picks up the cheese at time 8.

 

 We need to know what local states of affairs such events initiate and terminate:

 

The falling of an object initiates the fact that the object is in the air.

The landing of an object initiates the fact that the object is on the ground.

The picking up of an object by an agent initiates the fact the agent has the object.

 

We also need some explanation for the fact that the crow has the cheese at the beginning of the story. This can be given, for example, by assuming an additional event, such as:

 

            The crow picks up the cheese at time 0.

 

Finally, we need to be able to determine temporal relationships between time points and events. Because, in this example, we conveniently used numbers to name time points, we can do this with simple arithmetic. However, because the event calculus axiom is vague about time, we can use any system for measuring time, as long as we can then determine when one event occurs before another and when a time point is after an event. Whether we use numbers, dates and/or clock time is not important.

Keeping Track of Time

 

What is important is to keep track of time, to make sure that you do what you need to do before it is too late. So, if you are hungry, then you need to get food and eat it before you collapse from lack of strength. If a car is rushing towards you, then you need to run out of the way before you get run over. If you have a 9:00 appointment at work, then you need to get out of bed, wash, eat, dress, journey to work, and arrive before 9:00.

 

To get everything done in time, you need some kind of internal clock, both to timestamp externally observed events and to compare the current time with the deadlines of any internally derived future actions. This creates yet more work for the agent cycle:

 

 

To cycle,

observe the world, record any observations,

together with the time of their observation,

think,

decide what actions to perform, choosing only actions

that have not exceeded their deadline,

act,cycle again.

 

Consider, for example, the problem of the fox when she becomes hungry. When her body signals that she is hungry, she needs to estimate how long she can go without eating and derive the goals of getting food and eating it before it is too late. One way for her to do this is to use a maintenance goal, with an explicit representation of time:

 

                        If I am hungry at time Thungry

                        and I will collapse at a later time Tcollapse  if I don’t eat

                        then I have food at a time Tfood

                        and I eat the food at the time Tfood

                        and Tfood is after Thungry  but before Tcollapse.

 

She also needs to be able to deal with any attack from the local hunt:

 

                        If the hunters attack me at time Tattack

                        and they will catch me at a later time Tcatch  if I don’t run away

                        then I run away from the hunters at a time Trun

                        and Trun is after Tattack  but before Tcatch.

 

Suppose, the fox is both hungry and under attack by the hunt at the same time. Then the fox needs to do a quick mental calculation, to estimate both how much time she has to find food and how much time she has to run away. She needs to judge the probability and utilities of the two different actions, and schedule them to maximise their overall expected utility. If the fox has done her calculations well and is lucky with the way subsequent events unfold, then she will have enough time both to satisfy her hunger and to escape from attack. If not, then either she will die of starvation or she will die from the hunt.

 

A critic might object, however, that this kind of reasoning is an unrealistic, normative ideal, which is better suited to a robot than to an intelligent biological being. An ordinary person, in particular, would simply give higher priority to escaping from attack than to satisfying its hunger. A person’s maintenance goals would be “rules of thumb” that might look more like this:

 

                        If I am hungry at time Thungry

                        then I have food at a time Tfood

                        and I eat the food at the time Tfood

                        and Tfood is as soon as possible after Thungry.

 

 

                        If someone attacks me at time Tattack

                        then I run away from the attackers at a time Trun

                        and Trun is immediately after Tattack .

 

Thus assuming that you are a person who is hungry and attacked at the same time, say time 1 arbitrarily, your goals would look like this:

 

                        I have food at a time Tfood

                        I eat the food at the time Tfood

                        I run away from the hunters at a time Trun

                        and Trun is immediately after time 1 .

                        and Tfood is as soon as possible after 1 .

 

It would then be an easy matter for you to determine not only that Trun should be before Tfood but that Trun should be the next moment in time.

 

It would be the same if you were attacked after you became hungry, but before you have succeeded in obtaining food. You would run away immediately, and resume looking for food only after (and if) you have escaped from attack.

 

Rules of thumb give a quick and easy result, which is not always optimal. If you were running away from attack and you noticed a piece of cheese on the ground, a normative calculation might determine that you have enough time both to pick up the cheese and to continue running and escape from attack. But rules of thumb, which are designed to deal with the most commonly occurring cases, are less likely to recognise this possibility.

 

The relationship between normative calculation and rules of thumb is the same as the relationship between deliberate and intuitive thinking that we discussed in the chapter about levels of consciousness.

Conclusion

 

The world is a difficult place, which never stands still. By the time you’ve thought about one problem, it throws up another one that is even more urgent. It trips you up and it keeps you on your toes.

 

We do our best to get on top of it, by forming mental representations of the world. But it doesn’t make it easy. It wipes out its past and conceals its future, revealing only the way it is here and now.

 

In the struggle to survive and prosper, we use our memory of past observations, to generate hypothetical beliefs, to explain the past and predict the future. We compare these predictions with reality and revise our beliefs if necessary. This process of hypothesis formation and belief revision takes place in addition to the agent cycle, as times when the world slows down long enough to take stock. It is one of the many issues that we have yet to discuss in greater detail later in the book.

 

 

 



[1] A situation is just another name for global state.

[2] It is convenient to adopt the convention that a fact holds after the event that initiates it, but at the time of the event that terminates it.