next up previous
Next: Specifying and Verifying Elephant Up: Elephant 2000: A Programming Previous: Abstract Objects

Implementation

We contemplate that Elephant 2000 will have two kinds of implementation, interpreted and compiled.

The interpreted implementation has a single simple data structure--a history list of events. Inputs will certainly be included as events. In principle, this is all that is required. However, including actions by the program in the history enables the interpreter to avoid repeating certain computations. These actions are both external and internal.

The interpreter then examines inputs as they come in and according to the rules decides what to do with each one. The version of Elephant 2000 presently contemplated only provides for certain requests, etc. and assumes they arrive in some order. The necessary synchronization is performed by the runtime system outside of the program itself, and so is the rejection of inputs that don't match any program statement.

Matching event patterns to the history of events is done explicitly each time an input is interpreted. The actions that are logged are those that are part of the Elephant 2000 language. The simple form of matching done by Prolog may be adequate for this purpose.

The interpreter will therefore be somewhat slow, but for many purposes it will be adequate.

An Elephant 2000 compiler will translate programs into an ordinary programming language, e.g. Common Lisp or C. It would put data structures in the object program that would permit reference to these structures in order to decide what to do and would update the structures according to the action taken. In a full translation, there would be no explicit history in the object program.



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