Message Handling

The interaction between YAP and the user relies on YAP's ability to portray messages.

These messages range from prompts to error information. All message processing is performed through the builtin print_message//22, in two steps:

  • The message is processed into a list of commands

  • The commands in the list are sent to the format//33 builtin in sequence.

The first argument to print_message//22 specifies the importance of the message. The options are:

  • error error handling

  • warning compilation and run-time warnings,

  • informational generic informational messages

  • help help messages (not currently implemented in YAP)

  • query query used in query processing (not currently implemented in YAP)

  • silent,M,Na,Ar,File, FilePos]], [nl, nl]. messages that do not produce output but that can be intercepted by hooks.

The next table shows the main predicates and hooks associated to message handling in YAP:

An error record comsists of An ISO compatible descriptor of the format

error(error_kind(Culprit,..), In)

In YAP, the info field describes:

  • what() more detauls on the event

  • input_stream, may be one of;

  • loop_stream

  • file()

  • non e

  • prolog_source(_) a record containing file, line, predicate, and clause that activated the goal, or a list therof. YAP tries to search for the user code generatinng the error.

c_source(0), a record containing the line of C-code thhat caused the event. This is reported under systm debugging mode, or if this is user code.