| OCR Text |
Show 66 Time stamps must be monotonically increasing on each node: that is. time stamp values must never be reset when backtracking. To understand why this ts so, note that one process may search two branches originating at the same choice point. as in Figure 16d. If P1 restores the time along with other values when it backtracks. it can confuse the bindings made during the execution of the first choice with those of the second choice. This problem is avoided by never resetting the time. Further time stamp values are always calculated from the highest time. 4.2.4 Optimizations In addition to the important opttmJzation of combining binding spans. several others are possible. Traversing the linked list can still be expected to require an unreasonable amount of time. One way to lessen this cost is to "short-circuit" the search. When a variable disambiguation terminates at a value cell which is the result of traversing a binding list, the original reference can be changed to point directly to the correct value cell. Further references to the same variable will be direct, so that disambiguation will terminate quickly. An example of short-circuiting is shown in Figure 17. The original reference is to value cell A. Disambiguating the variable may require examining all of the value cells on the the binding list to determine that the variable is unbound. The new binding is stored in value cell B. Further references to the variable along this search path are directly to B, el1minating repeated searching from A. A second way of reducing the time for the list traversal depends on monotonicity of both the time stamp values of value cells on each local binding list and of binding spans from each process in the ancestor stack. When comparing the value cell time stamp with binding spans from a particular process, if the lower bound of the span is greater than the time stamp, no remaining spans from this process can possibly include the time stamp. In this case, the remaining time spans do not need to be examined, and the search proceeds to the next value cell. A third way of reducing the dereferencing time is by reducing the total number of value cells in the binding list. The length of a binding list is potentially un- |