next up previous
Next: The Structure of Elephant Up: Elephant 2000: A Programming Previous: Speech Acts and Abstract

Referring to the past

Algolic programs refer to the past via variables, arrays and other data structures. Elephant 2000 programs can refer to the past directly. In one respect,this is not such a great difference, because the program can be regarded as having a single virtual history list or ``journal''. It is then a virtual side-effect of actions to record the action in the history list. Calling the history list virtual means that it may not actually take that form in a compiled program which may use conventional arrays and not record information that is sure not to be referred to. However, we propose to provide ways of referring to the past that are semantically more like the ways people refer to the past in natural languages than just having an index variable into a list

We consider the past as a history, a function of time that gives the events and states that have occurred. Referring to the past involves using some function of this history. Here are some examples.

  1. The simplest function of the past is the value of some parameter at a given time, say the account balance of a certain person on January 5, 1991. References to the past are rarely this simple.
  2. Next we may consider the time of a certain event, say the time when a person was born.
  3. Slightly more complex is the first or last time a certain event occurred or a certain parameter had a certain value, say the most recent time a certain person was overdrawn at his bank.
  4. More generally, we may consider the unique time or the first or last time a certain proposition was true.
  5. Still more generally, we will be interested in time-valued functions of the whole past, e.g. an average time.
  6. Whether a person has an airplane reservation for a certain flight is determined by whether one has been made for him and not subsequently cancelled.
  7. An interpreter for a programming language with subroutines might avoid explicit mention of a stack by saying that a program returns from a subroutine to the statement following the entry that corresponds to the current execution of the return statement. It must also say that when the return occurs the variables have the values they had before the subroutine was entered. It isn't obvious that avoiding explicit mention of a stack would be a good idea, but it might have the advantage that a compiler would have more flexibility in how it chose to remember the necessary information than if an explicit data structure were specified.
  8. The wages of an hourly worker for a week is obtained by adding up the lengths of the intervals during which he was on the job, each multiplied by the pay rate for that time, e.g. more for working on the graveyard shift. We shall see that this is ontologically more complex than the previous examples, because it requires sets of intervals as objects and not just individual times.

    For the purposes of the Elephant language we shall devise a set of ways of expressing these functions of the past that are general enough to obviate the need for many references to data structures and are still computationally feasible.


next up previous
Next: The Structure of Elephant Up: Elephant 2000: A Programming Previous: Speech Acts and Abstract

John McCarthy
Fri Nov 6 21:37:30 PST 1998