The wait annotation is used to allow goal delaying during the evaluation of a grammar. The idea is to wait until enough information is available before trying to choose between the branches of an alt. The grammar writer indicates which information is requested before the evaluation of an alt can start using the wait annotation and a sequence of path expressions which point to the features which must be instantiated with the requested information.
When enough information is already present, the alt is evaluated as usual. When there is missing information (some of the features are not yet instantiated), the alt is frozen (delayed). Frozen alts are stored on an agenda, which keeps track of the decisions which remain to be made in the future. At regular intervals (in FUF, whenever a new choice point is met), the agenda is checked, and if enough information has been gathered since the time a decision has been frozen, the decision is thawed, and evaluated immediately. After the evaluation of the thawed alt, control proceeds where it was interrupted.
In addition, at the end of the unification stage, the determination stage checks if any decision is still on the agenda. Such a situation is reached if not enough information could be gathered anyway to allow the evaluation of the frozen alts. In this case, the frozen alts of the agenda are ``forced'' and evaluated, even though some of the requested information is missing.
Finally, there is one more configuration of control decisions which
concerns the goal delaying behavior of FUF: as explained on page
, wait annotations have priority over ignore
annotations to insure that ignore annotations are only considered when
enough information is available for them to make sense. When thawing a
frozen alt from the agenda, after enough information has been gathered, the
ignore annotations are immediately checked. If they do match, then the
whole frozen alt is immediately ignored.
Corresponding to each of these configurations, the trace system emits the following messages. In every case, a unique agenda identifier (integer number) is assigned to each frozen alt:
|