
prolog_clause.pl -- Get detailed source-information about a clauseThis module started life as part of the GUI tracer. As it is generally useful for debugging purposes it has moved to the general Prolog library.
The tracer library library(trace/clause) adds caching and dealing with
dynamic predicates using listing to XPCE objects to this. Note that
clause_info/4 as below can be slow.
clause_info(+ClauseRef, -File, -TermPos, -VarOffsets) is semidet
clause_info(+ClauseRef, -File, -TermPos, -VarOffsets, +Options) is semidet
Note that positions are character positions, i.e., not
bytes. Line endings count as a single character, regardless of
whether the actual ending is \n or =|\r\n|_.
Defined options are:
unify_term(+T1, +T2)
NOTE: Called directly from library(trace/clause) for the GUI
tracer.
open_source(+File, -Stream) is semidet[multifile]clause_property(ClauseRef, file(File)), prolog_clause:open_source(File, Stream)
make_varnames(+ReadClause, +DecompiledClause, +Offsets, +Names, -Term) is detvarnames(...) where each argument contains the name
of the variable at that offset. If the read Clause is a DCG rule,
name the two last arguments <DCG_list> and <DCG_tail>
This predicate calles the multifile predicate make_varnames_hook/5 with the same arguments to allow for user extensions. Extending this predicate is needed if a compiler adds additional arguments to the clause head that must be made visible in the GUI tracer.
unify_goal(+Read, +Decompiled, +Module, +TermPosRead, -TermPosDecompiled) is semidet[multifile]
initialization_layout(+SourceLocation, ?InitGoal, -ReadGoal, -TermPos) is semidet
predicate_name(:Head, -PredName:string) is det
clause_name(+Ref, -Name)The following predicates are exported, but not or incorrectly documented.
clause_info(Arg1, Arg2, Arg3, Arg4, Arg5)