Format of Head Port Messages

The message shown at a Head port is slightly different than the messages at other ports. Rather than optionally showing something unusual about the predicate (dynamic in the above example), the Head port shows you which clause of the predicate is being, and which, if any, will be tried next. For example, a Head port might be printed as follows:

        (23) 0 Head [2->4]: mymodule:foo(hello,there,_123) ?
     

Here the [2->4] means that clause 2 for predicate mymodule:foo/3 is about to be tried. If this clause's head should fail to unify, or if a goal in the body of the clause fails, clause 4 will be tried next. Clause 3 will be skipped, due to indexing (see bas-eff-ind). If clause 2 were the last clause to be tried, it would be shown as [2]. And in the case where clause 2 is being tried, and all the following clauses are indexable, but none can match the goal, the debugger will show [2->fail], suggesting that a choice point is being left, even though no more solutions will be possible (see bas-eff-ind for an explanation of indexable clauses, and how indexing works).