Page Numbers: Yes First Page: 1
Heading:
April 26, 1979 6:43 PM[IVY]<KRL>document>str-lev-mem-comp-change
Changing declarations mid-stream
Each record includes some kind of recognizable tag indicating the state of the declarations at time of compilation (e.g. an atom which is GENSYMMED anew every time potentially relevant declarations change). Compiled functions check to make sure that this tag matches the declarations at the time the function was compiled, and if not, the system recompiles the record or call (whichever is out of date) into the new form (using the old and new declarations) or failing this, falls back on intepretation. In addition, there is a translator which can take records compiled under one set of declarations and convert them to a new one (given, of course, the two sets of declarations).
The use of compiled records for changing values
In KRL-0, there was no mechanism for having changing descriptions. It was assumed that a description was time-independent, and that anything which depended on time had to be embedded in a contingency. This is conceptually clean, but implementationally disastrous. In KRL-1 we will have a notion of a slot being declared as a changing value, and a mechanism for Describe which allows the value to be updated, and the old descriptions to be thrown away. However, it is still much more conceptually clean to inist that any time-dependent fact be explicitly marked as so. By using the compiling notion, we can have our cake and eat it too. A slot of any unit can be declared as having a changing value (with more detailed specification of how it changes as well), and the field of the corresponding compiled record is declared as holding the current value. All simple stores and fetches are done to the compiled aspect, and over-writing of new values is just like it is in any language which stores into data records. The stuff appearing in the explicit aspect is pure, in that any time-dependent information is embedded in contingencies. Cases where only the current value is relevant are treated completely compiled, cases where explicit reasoning is to be done about time sequences are treated explicitly, and one can even imagine mixed cases in which the explicit aspect retains a partial record of what has gone on in the current value stored in the compiled aspect.