Re: using gxref on a single module

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 02/04/2014 08:38 PM, Abdallah, Samer wrote:
> Hello all,
> I'm trying to use gxref to understand the structure of a single module
> (actually, the GULP4 feature structure translator I mentioned in an
> earlier post about feature structure unification) and the information it 
> is displaying doesn't match what I would expect: 
> 
> Two predicates that
> are defined and called internally withing the module are showing up
> as "Not Called" in the "File Info" window of the gxref GUI. Is there some
> reason why that would be the case? They are called normally, not via
> a meta-predicate.

Dunno.

> In addition, there are two predicates which *are* only
> called via meta-predicates (one of which is bagof/3) which also show
> up as "Not Called". Since the system does a meta-predicate analysis
> on load now, isn't the information necessary to detect such 'static'
> calls via meta-predicates available now?

It should ...

> Finally, it would seem to be useful to get a dependency graph between
> predicates in a module - is there any tool which can do this?
> In the meantime, I am drawing the graph with pen and paper...

gxref us based on library(prolog_xref), which performs analysis based
on the source file.  This is always a bit limited as one can do pretty
wild things in SWI-Prolog while loading code.  The alternative is
library(prolog_codewalk), which analyses the _loaded_ code, and this
is not subject to hard to track code rewriting.  The documentation
[1] contains an example that generates a call-graph.

Next, there is the pack graphml, which writes GraphML files.  Then
you have tools like Gephi to draw wonderful graphs :-)  If you go that
way, please send the picture :-)

	Cheers --- Jan

[1] http://www.swi-prolog.org/pldoc/doc/swi/library/prolog_codewalk.pl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.