
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:
open_source(+File, -Stream) is semidet[multifile]clause_property(ClauseRef, file(File)), prolog_clause:open_source(File, Stream)
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)
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: