Home Contents Index Previous Next

6.2 Coroutining

Coroutining deals with having Prolog goals scheduled for execution as soon as some conditions is fulfilled. In Prolog the most commonly used conditions is the instantiation (binding) of a variable. Scheduling a goal to execute immediately after a variable is bound allows may be used to avoid instantiation errors for some built-in predicates (e.g. arithmetic), do work lazy, prevent the binding of a variable to a particular value, etc. Using read/1). Spec is a file-specification for absolute_file_name/3. Terms is the resulting list of Prolog terms. Options is a list of options for absolute_file_name/3 and open/4. In addition, the option tail(Tail) is defined, forming a difference-list.

./usr/share/doc/swi-prolog-doc/Manual/xref.html0000644000000000000000000001406410462404100020301 0ustar rootroot SWI-Prolog 5.6.17 Reference Manual: Section 3.7


Home Contents Index Previous Next

3.7 Cross referencer

A cross-referencers is a tool examining the caller-callee relation between predicates and using this information to explicate dependency relations between source files, find calls to non-existing predicates and predicates for which no callers can be found. Cross-referencing is useful during program development, reorganisation, cleanup, porting and other program maintenance tasks. The dynamic nature of Prolog makes the task non-trivial. Goals can be created dynamically call/1 after construction of a goal term. Abtract interpretation can find some of such calls, but the ultimately they can come from external communication, making it completely impossible to predict the callee. In other words, the cross-referencer has only partial understanding of the program and its results are necessarily incomplete. Still, it provides valuable information to the developer.

SWI-Prolog's cross-referencer is split into two parts. The standard Prolog library library(prolog_xref) is an extensible library for in