Next: mpg-ref-greater_than, Previous: mpg-ref-goal_expansion, Up: mpg-bpr [Contents][Index]
goal_source_info/3
goal_source_info(+AGoal, -Goal, -SourceInfo)
Decompose the AGoal annotated goal into a Goal proper and the SourceInfo descriptor term, indicating the source position of the goal.
callable, must be nonvar
callable
term
Annotated goals occur in most of error message terms, and
carry information on the Goal causing the error and its source
position. The SourceInfo term, retrieved by
goal_source_info/3
will be one of the following:
[]
The goal has no source information associated with it.
fileref(File,Line)
The goal occurs in file File, line Line.
clauseref(File,MFunc,ClauseNo,CallNo,Line)
The goal occurs in file File, within predicate
MFunc, clause number ClauseNo, call number
CallNo and virtual line number Line. Here, MFunc is of
form Module:Name/Arity
, calls are numbered
textually and the virtual line number shows the position of the
goal within the listing of the predicate MFunc, as
produced by listing/1
. Such a term is returned for
goals occurring in interpreted predicates, which do
not have “real” line number information, e.g. because they were
entered from the terminal, or created dynamically.
instantiation_error
Goal is uninstantiated
type_error
Goal is not a callable