#8. The procedure queue. The procedure queue is one more facility for planning actions designed for the situation when source data for a task have no explicit structure that would allow to select principal objects (or elementary situations) and to run some procedures related to those objects as well as to provide data for them. This is the case, e.g., in natural language understanding when what one originally has is only linear sequence of words while their syntactic and semantic relationships are still to be found. A similar probllem will probably arise in understanding pictures specified as sets of pixels or of small features.

In a natural language text to each word one can attach a specific procedure. Such procedures will in some cases seek access to words connected to the given word by a given relationship (such relationships are not specified in advance), in other cases those procedures will scan the text for words that can be connected to the given word by certain relationships. It is necessary to organize interaction between procedures contributed by different words. Their interaction with respect to data is supported by the common net, while the interaction with respect to control flow is established by the procedure queue.

Two operations are provided for the procedure queue, enqueueing and running the queue. An item to be enqueued may be a function from a package or a separate procedure; no parameter is specified here. Additionally a rank is specified for the new queue element, a positive integer. The queue is run in the order of ascending ranks. The procedure requesting the queue to be run specifies a parameter value that will be passed to every procedure in the queue. Thus, various runs of the queue can produce various effects, depending on the parameter. When the queue is being run, a successfully completed procedure leaves the queue, while a procedure ending in a failure stays in the queue which proceeds further to the next queue item. When a queue run is complete the maximum violation status of all successful procedures is returned as the result.

Restoration done at failure processing includes restoring the previous state of the queue, i.e., inserting items that had been deleted and removing those inserted later.

Interaction between procedures in the queue does not amount to relative ordering by ranks. A procedure selected from the queue may require another run of the queue (in a recursive fashion) and provide its own parameter. The internal run is started from the beginning of the queue, i.e., it uses its own queue pointer distinct from that of the external queue run.

All enqueued procedures must follow the same conventions concerning their parameter. Thus a procedure requesting a queue run can specify selective execution of queue procedures related to some specific data without knowing the internal structure of those procedures. To achieve this, the common conventions on parameter use must have a proviso that the procedure receiving an "inappropriate" parameter (i.e., called out of necessary context) immediately fails and thus remains in the queue; if the parameter is "appropriate" the procedure continues normally.

The requirement of unified parameter convention for all queue procedures is sometimes difficult to fulfill. Probably, future implementations will provide many queues, each with its own convention, and also will have operations for dequeueing items and purging queues.