What Explore mode does do is provide an interesting way to view the execution space of logic programs. With the first prototype, Explore's capabilities were sufficiently compelling to warrant further experimentation. Since then, additional search of both the World Wide Web and the literature has uncovered systems similar to Explore. In particular, TPM (Transparent Prolog Machine) is a sophisticated and mature system which seems to do what Explore does and more. Although Explore mode does have some unique features of its own, the existence of these systems has a bearing on the question of how additional enhancements to Explore should be made.
There are at least two avenues for further development of Explore. One is to create a full-fledged visual tracer for logic programs in general and/or Prolog in particular. This would involve, among other things, showing logic program execution in much greater detail, including unification, variable propagation, etc. Since the current program relies partly on Prolog to perform unification, this approach would require extensive overhaul of the existing code, even possibly a rewrite using a lower-level language such as C. In any event, the resulting program would only duplicate some features found in more powerful systems. Therefore, a second, more sensible approach may be to retain the overall structure of Explore, concentrate on its unique features and strengths, and make incremental enhancements where feasible. Desirable features and interesting ideas in other systems should be borrowed and incorporated into Explore mode, provided that the benefits far outweigh the costs. (The costs of an addition or modification will be considered in term of a) how difficult its implementation will be; and b) how much it will complicate the current system, thereby detracting from its clarity and simplicity.) With this in mind then, the next section proposes steps for improving Explore mode.
The second improvement relates to the way Explore performs redo. Recall that whenever a node P is redone, Explore automatically restores any node Q in the tree if Q was initially expanded after P. In other words, it prunes the current tree TQo rooted at Q and throws away the works done to expand Q. Typically, the user then has to re-expand Q, if only to get back to TQo. In some instance, it may be preferable to have a redo method that is less destructive, so to speak. This alternative redo would restore Q only if a) P and Q share one or more variables; and b) the shared variables are modified by the redo action. The motivation is to retain as much of the tree as possible, thereby minimizing having to re-expand the same nodes over and over. The caveat is that performing redo this way would not guarantee that all possible derivations can be obtained. What's more, providing yet another method of redo may prove too confusing to the user. Nevertheless, this may be an interesting idea worth pursuing.
Another potentially useful addition is a 'replay' facility that allows the user to retrace steps taken and to move forward. There are at least three ways to implement this feature. The first is to save a copy of the tree as the user performs operations on it. This essentially produces a snapshot of the tree though each step. When the user wishes to step backward, the program simply displays the previous tree, then the tree before that, and so forth. To go back to the beginning ('rewind'), the program displays the first recorded tree. Similarly, it displays the next tree in the sequence to step forward. The drawback of this method is that since only the graphical tree object is being saved, the program is merely replaying the execution in a VCR-like manner. No action -- expand, redo, etc. -- can be taken while in replay mode. To continue the execution, the user must first get out of replay mode by stepping forward to the end of the sequence; that is, the user must first return to the current point.
A second method remedies this flaw by saving all the data records associated with the nodes in the tree rather than just the graphical object. The recorded tree is not merely a static image but is actually 'live.' In essence, there is no difference between the recorded tree and the current tree: the user may perform any action with the former that can be done with the latter. Therefore, it is easy to step back to some previous point in the execution and choose a different branch to expand (for example).
Both these methods may potentially utilize a great deal of memory, especially for large trees. One way to reduce memory usage is to limit the number of steps that can be retraced. A more sophisticated approach, which constitutes the third method of implementing 'replay,' is to record only the action taken by the user. To step backward / forward, the program must then construct the previous / next tree by undoing / applying the recorded action to the current tree. This method would entail the least memory usage. Unfortunately, it may be unduly difficult to implement given the present program's structure.
Lastly, here are some additional miscellaneous improvements: